1 #include "AliITSURecoSens.h"
2 #include "AliITSUGeomTGeo.h"
3 #include "AliITSsegmentation.h"
4 #include "AliExternalTrackParam.h"
5 #include "AliITSUAux.h"
8 using namespace AliITSUAux;
11 ClassImp(AliITSURecoSens)
13 //______________________________________________________
14 AliITSURecoSens::AliITSURecoSens(Int_t id)
28 //______________________________________________________
29 AliITSURecoSens::AliITSURecoSens(const AliITSURecoSens &source)
31 ,fNClusters(source.fNClusters)
32 ,fFirstClusterId(source.fFirstClusterId)
34 ,fPhiTF(source.fPhiTF)
35 ,fPhiMin(source.fPhiMin)
36 ,fPhiMax(source.fPhiMax)
43 //______________________________________________________
44 AliITSURecoSens& AliITSURecoSens::operator=(const AliITSURecoSens &source)
47 if (&source==this) return *this;
48 TObject::operator=(source);
49 fNClusters = source.fNClusters;
50 fFirstClusterId = source.fFirstClusterId;
52 fPhiTF = source.fPhiTF;
53 fPhiMin = source.fPhiMin;
54 fPhiMax = source.fPhiMax;
61 //______________________________________________________
62 void AliITSURecoSens::SetBoundaries(double phiMn,double phiMx, double zMn, double zMx)
71 //______________________________________________________
72 void AliITSURecoSens::Print(Option_t*) const
75 printf("Sensor%4d xTF=%+.3e phiTF=%+.3e | Phi:[%5.3f:%5.3f] Z:[%+7.3f:%+7.3f]\n",
76 GetID(),GetXTF(),GetPhiTF(), fPhiMin,fPhiMax, fZMin,fZMax);
79 //______________________________________________________
80 void AliITSURecoSens::ResetClusters()
82 // discard old clusters
87 //______________________________________________________
88 void AliITSURecoSens::ProcessClusters(Int_t)
90 // create structures for fast finding
95 //______________________________________________________________________________
96 Int_t AliITSURecoSens::Compare(const TObject* obj) const
98 // compare sensor positions
99 AliITSURecoSens* copy = (AliITSURecoSens*)obj;
100 double phi = MeanPhiSmall(fPhiMin,fPhiMax);
101 double phiC = MeanPhiSmall(copy->fPhiMin,copy->fPhiMax);
102 double span = DeltaPhiSmall(fPhiMin,fPhiMax)/2;
103 double dPhi = DeltaPhiSmall(phi,phiC);
105 // special case to well define 1st raw (closest to 0 from above): wrap around 0/2pi
106 if (dPhi>span) return phi<phiC ? -1 : 1;
108 double phiT = phi+span;
110 // if (phiT<phiC && OKforPhiMin(phiT,phiC)) return -1;
111 if (OKforPhiMin(phiT,phiC)) return -1;
114 //if (phiT>phiC && OKforPhiMax( phiT,phiC)) return 1;
115 if (OKforPhiMax( phiT,phiC)) return 1;
117 // sane phi range, check Z
118 double dz = (fZMax-fZMin)/2;
119 if (fZMax+dz < copy->fZMax) return -1;
120 if (fZMin-dz > copy->fZMin) return 1;
121 AliError(Form("Same chip compared? %d %d",GetID(),copy->GetID()));
128 //______________________________________________________________________________
129 Int_t AliITSURecoSens::CheckCoverage(double phi, double z) const
131 // check if the sensor contains the impact point phi, z
132 // if not, tell in which direction to move.
133 // kLeft, kRight are for smaller/larger angles, kUp,kDown for larger/smaller Z
136 if (z<fZMin) res |= kDown;
137 else if (z>fZMax) res |= kUp;
139 if (!OKforPhiMin(fPhiMin,phi)) res |= kLeft;
140 else if (!OKforPhiMax(fPhiMax,phi)) res |= kRight;