1 #include <gearimpl/TPCModuleImpl.h>
2 #include <gearimpl/RectangularPadRowLayout.h>
3 #include <gearimpl/FixedPadSizeDiskLayout.h>
4 #include <gearimpl/FixedPadAngleDiskLayout.h>
5 #include <gear/PadRowLayout2D.h>
14 cout <<
"#--------------------------------" << endl;
15 for (
int row = 0; row < layout->
getNRows() ; row++)
17 const std::vector< int > & padsInRow = layout->
getPadsInRow (row);
19 for (
unsigned int i=0; i < padsInRow.size() ; i++)
24 int padIndex = layout->
getNearestPad( padCenter[0] , padCenter[1] );
26 cout << padCenter[0] <<
"\t" << padCenter[1] <<
"\t"
27 << padsInRow[i] <<
"\t" << padIndex << endl;
47 cout << endl <<
"# pad centre: "<< padZeroCentre[0] <<
"\t" << padZeroCentre[1]<< endl<<endl;
50 cout <<
"# r\t phi\t d" << endl;
51 for (
double phi = -M_PI*0.2; phi < M_PI*0.2; phi +=M_PI*0.005 )
55 cout << r <<
"\t"<< phi<<
"\t"<< circularPadPlane->
getNearestPad(r, phi)<< endl;
58 for (
double r = 10.; r < 100.; r+=1.)
60 double phi = M_PI*0.2;
62 cout << r <<
"\t"<< phi<<
"\t"<< circularPadPlane->
getNearestPad(r, phi)<< endl;
65 for (
double phi = M_PI*0.2; phi > -M_PI*0.2; phi -=M_PI*0.005 )
69 cout << r <<
"\t"<< phi<<
"\t"<< circularPadPlane->
getNearestPad(r, phi)<< endl;
72 for (
double r = 100.; r > 10.; r-=1.)
74 double phi = -M_PI*0.2;
76 cout << r <<
"\t"<< phi<<
"\t"<< circularPadPlane->
getNearestPad(r, phi)<< endl;
80 delete circularPadPlane;
virtual int getNearestPad(double c0, double c1) const
The index of the pad nearest to the given point in 2d coordinates (r, phi).
virtual Vector2D getPadCenter(int padIndex) const
The center of the pad in 2d coordinates (r,phi).
Abstract description of a planar subdetector with pads (cells) that are positioned in rows (circular ...
Implementation of PadRowLayout2D for a disk with fixed angled keystone pads.
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).
virtual Vector2D getPadCenter(int padIndex) const =0
The center of the pad in 2d coordinates, (x,y) or (r,phi).