1 #include <gearimpl/TPCModuleImpl.h>
2 #include <gearimpl/RectangularPadRowLayout.h>
3 #include <gearimpl/FixedPadSizeDiskLayout.h>
4 #include <gearimpl/GearMgrImpl.h>
5 #include <gearimpl/TPCParametersImpl.h>
6 #include <gear/PadRowLayout2D.h>
7 #include <gearxml/XMLHandlerMgr.h>
8 #include <gearxml/TPCParametersXML.h>
9 #include <gearxml/tinyxml.h>
10 #include <gearxml/GearXML.h>
20 cout <<
"#--------------------------------" << endl;
21 for (
int row = 0; row < layout->
getNRows() ; row++)
23 const std::vector< int > & padsInRow = layout->
getPadsInRow (row);
25 for (
unsigned int i=0; i < padsInRow.size() ; i++)
29 cout << padCenter[0] <<
"\t" << padCenter[1] << endl;
36 void dumpPlaneExtent(
TPCModule const * module)
45 case PadRowLayout2D::POLAR :
47 y_phi_step = M_PI/180.;
50 case PadRowLayout2D::CARTESIAN :
80 double local_y_phi_step;
84 case PadRowLayout2D::POLAR :
86 local_y_phi_step = M_PI/180.;
89 case PadRowLayout2D::CARTESIAN :
91 local_y_phi_step = 1.;
101 cout <<
"0\t 0\t"<<globalCoords[0] <<
"\t"<< globalCoords[1] <<endl;
107 cout <<
"0\t 0\t"<<globalCoords[0] <<
"\t"<< globalCoords[1] <<endl;
114 cout <<
"0\t 0\t"<<globalCoords[0] <<
"\t"<< globalCoords[1] <<endl;
120 cout <<
"0\t 0\t"<<globalCoords[0] <<
"\t"<< globalCoords[1] <<endl;
124 int main(
int argc,
char* argv[])
128 cout <<
"Tool to dump coordinates of the local plane extend, the module extent and the pad centres." << endl;
129 cout <<
"usage: testPlaneExtent gearfile.xml" << endl;
138 const std::vector<TPCModule *> & moduleVec = mTPC.
getModules();
140 for (std::vector<TPCModule *>::const_iterator moduleIter = moduleVec.begin();
141 moduleIter < moduleVec.end(); moduleIter++)
143 dumpPlaneExtent(*moduleIter);
144 dumpCoordinates(*moduleIter);
147 delete xmlmgr;
delete mgr;
virtual const TPCParameters & getTPCParameters() const =0
Get the TPCParameters.
Abstract description of a planar subdetector with pads (cells) that are positioned in rows (circular ...
Proposal for an abstract interface that defines the geometry properties of a TPC like detector needed...
GearMgr * createGearMgr()
Creates an instance of GearMgr from the data given in the XML file.
Base exception class for GEAR - all other exceptions extend this.
Implementation of GEAR using XML.
virtual Vector2D localToGlobal(double c0, double c1) const =0
Returns the global coordinates for a point in local coordinates.
virtual const std::vector< TPCModule * > & getModules() const =0
Returns vector of all modules in this TPC (endplate).
virtual const PadRowLayout2D & getLocalPadLayout() const =0
Returns a reference to the instance of the underlaying pad layout.
virtual int getCoordinateType() const =0
The type of the row layouts coordinate system: PadRowLayout2D.CARTESIAN or PadRowLayout2D.POLAR.
virtual int getNRows() const =0
The number of rows.
virtual int getTPCCoordinateType() const =0
Returns the TPCs coordinate type.
Abstract interface for a manager class that returns the Gear classes for the relevant subdetectors...
virtual const std::vector< double > & getPlaneExtent() const =0
Inherited from PadRowLayout2D.
virtual const std::vector< int > & getPadsInRow(int rowNumber) const =0
Indices of all pads in row rowNumber (row indices start from 0 at the bottom (CARTESIAN) or at the ce...
virtual const std::vector< double > & getPlaneExtent() const =0
Extent of the sensitive plane - [xmin,xmax,ymin,ymax] CARTESIAN or [rmin,rmax,phimin,phimax] POLAR.
A wrapper Class for PadRowLayout2D which converts between the actual pad layouts local coodinate syst...
virtual Vector2D getPadCenter(int padIndex) const =0
The center of the pad in 2d coordinates, (x,y) or (r,phi).