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>
17 cout <<
"#--------------------------------" << endl;
18 for (
int row = 0; row < layout->
getNRows() ; row++)
20 const std::vector< int > & padsInRow = layout->
getPadsInRow (row);
21 for (
unsigned int i=0; i < (padsInRow.size() < 10 ? padsInRow.size() : 10 ); i++)
26 int padIndex = layout->
getNearestPad( padCenter[0] , padCenter[1] );
28 cout << padCenter[0] <<
"\t" << padCenter[1] <<
"\t"
29 << padsInRow[i] <<
"\t" << padIndex << endl;
38 rectangularPadPlane->
addRow(3, 10, 2., 5.);
44 rectangularModule1->
setIntVal(
"myIntForForTheModule",43);
47 rectangularModule1->setAngle(M_PI/4);
63 circularModule1->setAngle(M_PI/4);
69 circularModule2->setAngle(M_PI/4);
75 modularTPCRectangular->
addModule(rectangularModule1);
77 modularTPCRectangular->
addModule(circularModule1);
82 modularTPCCircular->
addModule(circularModule2);
84 modularTPCRectangular->
setIntVal(
"myIntForTheTPC",42);
91 cout << modularTPCElement<<endl;
92 cout << modularTPCXML->
toXML(*modularTPCCircular )<<endl;
94 delete modularTPCCircular;
delete modularTPCRectangular;
delete modularTPCXML;
delete myGearMgr;
void setOffset(double x_r, double y_phi)
Set the offset of the local pad plane wrt.
Abstract description of a planar subdetector with pads (cells) that are positioned in rows (circular ...
Implementation of PadRowLayout2D for a disk with fixed sized keystone pads.
Manager class that returns the Gear classes for the relevant subdetectors.
Abstract XML handler for TPCParameters.
virtual void addRow(int nRow, int nPad, double padWidth, double padHeight, double rowHeight=0.0, double leftOffset=0.0, double rightOffset=0.0)
Add nRow rows with the given parameters.
virtual int getNRows() const =0
The number of rows.
The element is a container class.
virtual void setIntVal(const std::string &key, int val)
Set Integer value for key.
A Container for TPCModules which describe the geometry properties of a given TPC. ...
virtual void addModule(TPCModule *TPCModule)
Adds a Module to the vector of modules, or throws an exception.
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).
Implementation of PadRowLayout2D for a rectangular row based layout where all pads in a given row are...
virtual TiXmlElement toXML(const GearParameters &modularTPC) const
Creates an XML node for the given TPCParameters.
A wrapper Class for PadRowLayout2D, allowing which converts between local and global coordinate syste...
virtual Vector2D getPadCenter(int padIndex) const =0
The center of the pad in 2d coordinates, (x,y) or (r,phi).