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;
34 void dumpPlaneExtent(
TPCModule const * module)
42 double local_y_phi_step;
46 case PadRowLayout2D::POLAR :
48 local_y_phi_step = M_PI/180.;
51 case PadRowLayout2D::CARTESIAN :
53 local_y_phi_step = 1.;
63 cout <<
"0\t 0\t 0\t 0\t"<<globalCoords[0] <<
"\t"<< globalCoords[1] <<endl;
69 cout <<
"0\t 0\t 0\t 0\t"<<globalCoords[0] <<
"\t"<< globalCoords[1] <<endl;
76 cout <<
"0\t 0\t 0\t 0\t"<<globalCoords[0] <<
"\t"<< globalCoords[1] <<endl;
82 cout <<
"0\t 0\t 0\t 0\t"<<globalCoords[0] <<
"\t"<< globalCoords[1] <<endl;
89 for (
double x = -100; x < 100; x+=2)
92 cout << x<<
"\t"<<100<<
"\t 0\t 0"<<endl;
94 cout <<
"0\t 0\t"<< x<<
"\t"<<100<<endl;
97 cout << x<<
"\t"<<-100<<
"\t 0\t 0"<<endl;
99 cout <<
"0\t 0\t"<< x<<
"\t"<<-100<<endl;
102 for (
double y = -100; y < 100; y+=2)
105 cout << 100<<
"\t"<<y<<
"\t 0\t 0"<<endl;
107 cout <<
"0\t 0\t"<< 100<<
"\t"<<y<<endl;
110 cout << -100<<
"\t"<<y<<
"\t 0\t 0"<<endl;
112 cout <<
"0\t 0\t"<< -100<<
"\t"<<y<<endl;
116 int main(
int argc,
char* argv[] )
120 cout <<
"Tool to test the isInsideModule function of TPCModule."<< endl;
121 cout <<
"usage: testDistanceToModue gearfile.xml" << endl;
130 const std::vector<TPCModule *> & moduleVec = mTPC.
getModules();
132 for (std::vector<TPCModule *>::const_iterator moduleIter = moduleVec.begin();
133 moduleIter < moduleVec.end(); moduleIter++)
136 dumpPlaneExtent(*moduleIter);
138 dumpBox(*moduleIter);
141 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 bool isInsideModule(double c0, double c1) const =0
True if global coordinate (c0,c1) is within this modules area of amplification/interest.
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.
Abstract interface for a manager class that returns the Gear classes for the relevant subdetectors...
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).