1 #include <gearimpl/TPCModuleImpl.h>
2 #include <gearimpl/RectangularPadRowLayout.h>
3 #include <gearimpl/FixedPadSizeDiskLayout.h>
4 #include <gearimpl/FixedPadAngleDiskLayout.h>
5 #include <gearimpl/VersatileDiskRowLayout.h>
6 #include <gear/PadRowLayout2D.h>
15 cout <<
"#--------------------------------" << endl;
16 for (
int row = 0; row < layout->
getNRows() ; row++)
18 const std::vector< int > & padsInRow = layout->
getPadsInRow (row);
20 for (
unsigned int i=0; i < padsInRow.size() ; i++)
25 int padIndex = layout->
getNearestPad( padCenter[0] , padCenter[1] );
27 cout << padCenter[0] <<
"\t" << padCenter[1] <<
"\t"
28 << padsInRow[i] <<
"\t" << padIndex << endl;
36 circularPadPlane->
addRow( 10 ,
40 circularPadPlane->
addRow( 10 ,
44 circularPadPlane->
addRow( 10 ,
49 dumpCoordinates( circularPadPlane );
55 cout << endl <<
"# pad centre: "<< padZeroCentre[0] <<
"\t" << padZeroCentre[1]<< endl<<endl;
58 cout <<
"# r\t phi\t d" << endl;
59 for (
double phi = -M_PI*0.2; phi < M_PI*0.2; phi +=M_PI*0.005 )
63 cout << r <<
"\t"<< phi<<
"\t"<< circularPadPlane->
getNearestPad(r, phi)<< endl;
66 for (
double r = 10.; r < 100.; r+=1.)
68 double phi = M_PI*0.2;
70 cout << r <<
"\t"<< phi<<
"\t"<< circularPadPlane->
getNearestPad(r, phi)<< endl;
73 for (
double phi = M_PI*0.2; phi > -M_PI*0.2; phi -=M_PI*0.005 )
77 cout << r <<
"\t"<< phi<<
"\t"<< circularPadPlane->
getNearestPad(r, phi)<< endl;
80 for (
double r = 100.; r > 10.; r-=1.)
82 double phi = -M_PI*0.2;
84 cout << r <<
"\t"<< phi<<
"\t"<< circularPadPlane->
getNearestPad(r, phi)<< endl;
88 delete circularPadPlane;
Abstract description of a planar subdetector with pads (cells) that are positioned in rows (circular ...
virtual int getNearestPad(double c0, double c1) const
The index of the pad nearest to the given point in 2d coordinates (x,y,) or (r,phi).
virtual void addRow(int nPads, double padPitch, double rowHeight, double offset=0., double padWidth=0., double padHeight=0., int repeat=1)
Add 'repeat' rows with the given parameters.
virtual Vector2D getPadCenter(int padIndex) const
The center of the pad in 2d coordinates, (x,y) or (r,phi).
virtual int getNRows() const =0
The number of rows.
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 wedge shaped module.
virtual Vector2D getPadCenter(int padIndex) const =0
The center of the pad in 2d coordinates, (x,y) or (r,phi).