78 for (UInt_t isector = 0; isector <
fNumSectors; ++isector)
92 for (UInt_t ipad = 0; ipad < numpads; ++ipad)
114 for (UInt_t ipad = 0; ipad < numpads; ++ipad)
132 for (UInt_t irow = 0; irow < nrowscenter; ++irow)
135 UInt_t numpads = 2*TMath::Floor( TMath::Sqrt(rcenter*rcenter - yloc*yloc)/
fCenterPadWidth );
139 for (UInt_t ipad = 0; ipad < numpads; ++ipad)
154 for (UInt_t ipix = 0; ipix < numpixside; ++ipix)
165 <<
" pixels and each sector has " 182 std::cout <<
"gar::ChannelMapStandardAlg::CheckPositions -- checking positions" <<
std::endl;
185 float xyz[3] = {0, 0, 0};
187 for (UInt_t ichan = 0; ichan < numchans; ++ichan)
195 if (chancheck != ichan)
197 std::cout <<
"gar::ChannelMapStandardAlg::CheckPositions mismatch, input chan, xyz, output chan " << ichan <<
" " 198 << xyz[0] <<
" " << xyz[1] <<
" " << xyz[2] <<
" " << chancheck <<
std::endl;
222 std::cout <<
"gar::ChannelMapStandardAlg::CheckPositions -- done checking positions" <<
std::endl;
237 unsigned int nearestchannel;
239 return nearestchannel;
252 float phi = TMath::ATan2(xyz[1],xyz[2]);
253 if (phi<0) phi += 2.0*TMath::Pi();
255 UInt_t isector = TMath::Floor(phisc);
260 float crot = TMath::Cos(rotang);
261 float srot = TMath::Sin(rotang);
262 float zrot = xyz[2]*crot + xyz[1]*srot;
263 float yrot = - xyz[2]*srot + xyz[1]*crot;
325 if (irow >= totpadrows)
333 int ichanrowoff = TMath::Floor(yrot/padwidthloc) +
fNumPadsPerRow.at(irow)/2;
334 if (ichanrowoff < 0 || (UInt_t) ichanrowoff >=
fNumPadsPerRow.at(irow))
362 UInt_t irow = TMath::Floor(tvar);
374 UInt_t ivar = TMath::Floor(tvar);
400 nearestchannel = TMath::Max(TMath::Min(ichan, (UInt_t)
fPixelCenters.size() - 1), (UInt_t) 0);
412 TVector3 xvec(xyz[0],xyz[1],xyz[2]);
413 float xyztest[3] = {0,0,0};
414 TVector3 xvectestm(0,0,0);
416 TVector3 xvectestp(0,0,0);
419 TVector3 zerovec(0,0,0);
426 TVector3 xvecchan(xyztest[0],xyztest[1],xyztest[2]);
428 cwn.push_back(centerchanwithpos);
434 xvectestm.SetXYZ(xyztest[0],xyztest[1],xyztest[2]);
435 if ( (xvecchan-xvectestm).Mag() < 5.0 )
443 xvectestp.SetXYZ(xyztest[0],xyztest[1],xyztest[2]);
444 if ( (xvecchan-xvectestp).Mag() < 5.0 )
451 TVector3 dvec(0,0,0);
454 dvec = xvectestm - xvecchan;
458 dvec = xvectestp - xvecchan;
468 float dvm = dvec.Mag();
472 <<
"Pad neighbor has same coordinates as pad, geometry problem " << chan;
476 cwn.at(0).padrowdir = dvec;
479 cwn.at(1).padrowdir = dvec;
483 cwn.at(2).padrowdir = dvec;
487 TVector3 ndp(0,-dvec.Z(),dvec.Y());
488 float mag = ndp.Mag();
491 TVector3 nextrowhyp = xvecchan + ndp;
493 unsigned int nextrowchan;
494 float nextrowhyparray[3] = {0,0,0};
495 nextrowhyp.GetXYZ(nextrowhyparray);
500 TVector3 nrv(nextrowhyparray[0],nextrowhyparray[1],nextrowhyparray[2]);
506 TVector3 xvt(xyztest[0],xyztest[1],xyztest[2]);
507 if ( (xvecchan-xvt).Mag() < 5.0 )
514 TVector3 xvtp(xyztest[0],xyztest[1],xyztest[2]);
515 if ( (xvecchan-xvtp).Mag() < 5.0 )
523 nextrowhyp = xvecchan - ndp;
524 nextrowhyp.GetXYZ(nextrowhyparray);
529 TVector3 nrv(nextrowhyparray[0],nextrowhyparray[1],nextrowhyparray[2]);
536 TVector3 xvt(xyztest[0],xyztest[1],xyztest[2]);
537 if ( (xvecchan-xvt).Mag() < 5.0 )
544 TVector3 xvtp(xyztest[0],xyztest[1],xyztest[2]);
545 if ( (xvecchan-xvtp).Mag() < 5.0 )
std::vector< gar::geo::ChanWithPos > ChanWithNeighbors
float fPadWidthOROC
Pad width in the OROC (assumed same for both sections)
void Initialize(GeometryCore &geo) override
UInt_t fNumChansPerSector
Number of TPC pad channels per sector.
UInt_t fNumPadRowsOROCO
Number of large-pitch pad rows in the outer ROC.
std::vector< UInt_t > fCenterNumPadsPerRow
pads per row for the center hole filler
unsigned int NearestChannel(float const *xyz) const override
float fPhiSectorWidth
width of a sector in phi (in radians)
void ChannelToPosition(unsigned int chan, float *xyz) const override
int TPCNumDriftVols() const
Returns number of TPC drift volumes.
Float_t GetOuterPadWidth() const
Float_t GetInnerPadLength() const
float fPadHeightOROCI
Pad height in the outer ROC inner part (cm)
float fPadHeightOROCO
Pad height in the outer ROC outer part (cm)
Float_t GetOuter1PadLength() const
void Uninitialize() override
float TPCXCent() const
Returns the X location of the center of the TPC in cm.
float fIROCOuterRadius
Radius from the beam in cm along the midline of the sector to the outer IROC row outer edge...
Description of geometry of one entire detector.
static AliTPCROC * Instance()
UInt_t GetNRowLow() const
AliTPCROC * fROC
TPC Readout geometry from ALICE software stack.
std::vector< UInt_t > fFirstPadInRow
indexed by "global" pad row number for a single sector
std::vector< UInt_t > fCenterFirstPadInRow
first pad in row for center hole filler
Float_t GetOuterRadiusUp() const
float fXPlaneLoc
Location of pixel plane in X (only positive. Assume other one is at -X)
float fOROCInnerRadius
Radius from the beam in cm along the midline of the sector to the inner OROC row inner edge...
float fPadWidthIROC
Pad width in the inner ROC (cm)
float fOROCPadHeightChangeRadius
Radius from the beam in cm along the midline of the sector to the OROC pad height change...
XYZPos fTPCCenter
Location of the center of the TPC.
float fIROCInnerRadius
Radius from the beam in cm along the midline of the sector to the inner IROC row inner edge...
enum gar::geo::ROCType_ ROCType
float TPCZCent() const
Returns the Z location of the center of the TPC in cm.
float fCenterPadWidth
Width of square pads in center hole filler.
UInt_t fNumPadRowsIROC
Number of pad rows in the inner ROC – 64 (TDR) or 63 (ALICE code)
float fOROCOuterRadius
Radius from the beam in cm along the midline of the sector to the outer OROC row outer edge...
UInt_t fNumSectors
Number of sectors – should be 18.
void CheckPositions()
Method to check consistency of NearestChannel and ChannelToPosition.
float fPadHeightIROC
Pad height in the inner ROC (cm)
std::vector< UInt_t > fNumPadsPerRow
indexed by "global" pad row number for a single sector
Float_t GetOuterRadiusLow() const
General GArSoft Utilities.
std::vector< XYZPos > fPixelCenters
pixel centers (in cm) – for the entire detector
UInt_t fNumChansCenter
Number of channels in center hole filler.
UInt_t GetNRowUp2() const
UInt_t GetNPads(UInt_t sector, UInt_t row) const
float TPCYCent() const
Returns the Y location of the center of the TPC in cm.
float fSectorOffsetAngleDeg
Angle to rotate to the middle of the first sector – should be 10 degrees.
ChannelMapStandardAlg(fhicl::ParameterSet const &p)
void NearestChannelInfo(float const *xyz, gar::geo::ChanWithNeighbors &cwn) const override
Float_t GetInnerPadWidth() const
Float_t GetOuter2PadLength() const
float TPCLength() const
Returns the length of the TPC (x direction)
const gar::geo::GeometryCore * fGeo
UInt_t GetNRowUp1() const
UInt_t fGapChannelNumber
channel number GetNearestChannel returns when xyz is in a gap
Float_t GetInnerRadiusUp() const
LArSoft geometry interface.
unsigned int Nchannels() const override
Float_t GetInnerRadiusLow() const
void NearestChannelWithROCType(float const *xyz, gar::geo::ROCType &roctype, unsigned int &nearestchannel) const
UInt_t fNumPadRowsOROCI
Number of small-pitch pad rows in the outer ROC.
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
void GetPositionGlobal(UInt_t sector, UInt_t row, UInt_t pad, Float_t *pos)