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>
18 cout <<
"#--------------------------------" << endl;
19 for (
int row = 0; row < layout->
getNRows() ; row++)
21 const std::vector< int > & padsInRow = layout->
getPadsInRow (row);
22 for (
unsigned int i=0; i < (padsInRow.size() < 10 ? padsInRow.size() : 10 ); i++)
27 int padIndex = layout->
getNearestPad( padCenter[0] , padCenter[1] );
29 cout << padCenter[0] <<
"\t" << padCenter[1] <<
"\t"
30 << padsInRow[i] <<
"\t" << padIndex << endl;
35 int main(
int argc,
char* argv[])
40 cout <<
"usage: " << argv[0] <<
" gearfile.xml" << endl;
50 const std::vector<TPCModule *> & moduleVec = mTPC.
getModules();
54 cout <<
"vector size is "<< moduleVec.size() << endl;
61 cout << modularTPCXML->
toXML(mTPC )<<endl;
69 delete xmlmgr;
delete mgr;
delete modularTPCXML;
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.
Abstract XML handler for TPCParameters.
Implementation of GEAR using XML.
virtual const std::vector< TPCModule * > & getModules() const =0
Returns vector of all modules in this TPC (endplate).
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 int getNearestPad(double c0, double c1) const =0
The index of the pad nearest to the given point in 2d coordinates (x,y,) or (r,phi).
virtual double getMaxDriftLength() const =0
The maximum drift length in the TPC in mm.
virtual TiXmlElement toXML(const GearParameters &modularTPC) const
Creates an XML node for the given TPCParameters.
virtual Vector2D getPadCenter(int padIndex) const =0
The center of the pad in 2d coordinates, (x,y) or (r,phi).