]>
Commit | Line | Data |
---|---|---|
e4f2f73d | 1 | #ifndef ALITRDSEEDV1_H |
2 | #define ALITRDSEEDV1_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
e44586fb | 4 | * See cxx source for full Copyright notice */ |
e4f2f73d | 5 | |
829e9a79 | 6 | /* $Id: AliTRDseedV1.h 60233 2013-01-10 09:04:08Z abercuci $ */ |
e4f2f73d | 7 | |
8 | //////////////////////////////////////////////////////////////////////////// | |
9 | // // | |
ee8fb199 | 10 | // \class AliTRDseedV1 |
11 | // \brief The TRD offline tracklet | |
12 | // \author Alexandru Bercuci | |
e4f2f73d | 13 | // // |
14 | //////////////////////////////////////////////////////////////////////////// | |
15 | ||
3e778975 | 16 | #ifndef ALITRDTRACKLETBASE_H |
17 | #include "AliTRDtrackletBase.h" | |
e3cf3d02 | 18 | #endif |
19 | ||
20 | #ifndef ROOT_TMath | |
21 | #include "TMath.h" | |
e4f2f73d | 22 | #endif |
23 | ||
ae4e8b84 | 24 | #ifndef ALITRDGEOMETRY_H |
25 | #include "AliTRDgeometry.h" | |
26 | #endif | |
27 | ||
0906e73e | 28 | #ifndef ALIPID_H |
29 | #include "AliPID.h" | |
30 | #endif | |
31 | ||
e4f2f73d | 32 | |
f29f13a6 | 33 | #ifndef ALITRDCLUSTER_H |
34 | #include "AliTRDcluster.h" | |
35 | #endif | |
36 | ||
d07eec70 | 37 | |
e4f2f73d | 38 | class TTreeSRedirector; |
f301a656 | 39 | class TLinearFitter; |
829e9a79 | 40 | class TGeoHMatrix; |
e4f2f73d | 41 | class AliRieman; |
42 | ||
4ecadb52 | 43 | class AliTRDReconstructor; |
eb38ed55 | 44 | class AliTRDtrackingChamber; |
f3d3af1b | 45 | class AliTRDtrackV1; |
eb2b4f91 | 46 | class AliTRDpadPlane; |
3e778975 | 47 | class AliTRDseedV1 : public AliTRDtrackletBase |
48 | { | |
4ecadb52 | 49 | friend class AliHLTTRDTracklet; // wrapper for HLT |
3044dfe5 | 50 | |
e3cf3d02 | 51 | public: |
52 | enum ETRDtrackletBuffers { | |
980d5a2a | 53 | kNbits = 6 // bits to store number of clusters |
54 | ,kMask = 0x3f // bit mask | |
55 | ,kNtb = 31 // max clusters/pad row | |
8d2bec9e | 56 | ,kNclusters = 2*kNtb // max number of clusters/tracklet |
1f97f376 | 57 | ,kNdEdxSlices= 8 // dEdx slices allocated in reconstruction |
e44586fb | 58 | }; |
e3cf3d02 | 59 | |
2e2915e7 | 60 | // bits from 0-13 are reserved by ROOT (see TObject.h) |
e3cf3d02 | 61 | enum ETRDtrackletStatus { |
f29f13a6 | 62 | kOwner = BIT(14) // owner of its clusters |
63 | ,kRowCross = BIT(15) // pad row cross tracklet | |
1f97f376 | 64 | ,kChmbGood = BIT(16) // status of the detector from calibration view point |
e20bef2b | 65 | ,kCalib = BIT(17) // calibrated tracklet |
66 | ,kKink = BIT(18) // kink prolongation tracklet | |
1fd9389f | 67 | ,kStandAlone = BIT(19) // tracklet build during stand alone track finding |
2eb10c34 | 68 | ,kPrimary = BIT(20) // tracklet from a primary track candidate |
e44586fb | 69 | }; |
2eb10c34 | 70 | |
71 | enum ETRDtrackletError { // up to 8 bits | |
72 | kAttachClFound = 0 // not enough clusters found | |
73 | ,kAttachRowGap = 1 // found gap attached rows | |
74 | ,kAttachRow = 2 // found 3 rows | |
75 | ,kAttachMultipleCl= 3// multiple clusters attached to time bin | |
76 | ,kAttachClAttach= 4 // not enough clusters attached | |
77 | ,kFitCl = 5 // not enough clusters for fit | |
78 | ,kFitFailedY = 6 // fit failed in XY plane failed | |
79 | ,kFitFailedZ = 7 // fit in the QZ plane failed | |
7c3eecb8 | 80 | }; |
e44586fb | 81 | |
ae4e8b84 | 82 | AliTRDseedV1(Int_t det = -1); |
e44586fb | 83 | ~AliTRDseedV1(); |
84 | AliTRDseedV1(const AliTRDseedV1 &ref); | |
85 | AliTRDseedV1& operator=(const AliTRDseedV1 &ref); | |
ddfbc51a | 86 | |
9dcc64cc | 87 | Bool_t AttachClusters(AliTRDtrackingChamber *const chamber, Bool_t tilt = kFALSE, Bool_t ChgPlus=kTRUE, Int_t ev=-1); |
203967fc | 88 | void Bootstrap(const AliTRDReconstructor *rec); |
e3cf3d02 | 89 | void Calibrate(); |
203967fc | 90 | void CookdEdx(Int_t nslices); |
e3cf3d02 | 91 | void CookLabels(); |
3e778975 | 92 | Bool_t CookPID(); |
829e9a79 | 93 | Bool_t Fit(UChar_t opt=0); // OBSOLETE |
94 | Bool_t FitRobust(AliTRDpadPlane *pp, Int_t opt=0); | |
95 | Double_t EstimatedCrossPoint(AliTRDpadPlane *pp); | |
33ab3872 | 96 | Bool_t Init(const AliTRDtrackV1 *track); |
4ecadb52 | 97 | void Init(const AliRieman *fit); |
203967fc | 98 | Bool_t IsEqual(const TObject *inTracklet) const; |
e3cf3d02 | 99 | Bool_t IsCalibrated() const { return TestBit(kCalib);} |
803dc399 | 100 | Bool_t IsChmbGood() const { return TestBit(kChmbGood);} |
e44586fb | 101 | Bool_t IsOwner() const { return TestBit(kOwner);} |
f29f13a6 | 102 | Bool_t IsKink() const { return TestBit(kKink);} |
2eb10c34 | 103 | Bool_t IsPrimary() const { return TestBit(kPrimary);} |
2eb10c34 | 104 | Bool_t HasError(ETRDtrackletError err) const |
105 | { return TESTBIT(fErrorMsg, err);} | |
3e778975 | 106 | Bool_t IsOK() const { return GetN() > 4 && GetNUsed() < 4;} |
e44586fb | 107 | Bool_t IsRowCross() const { return TestBit(kRowCross);} |
f29f13a6 | 108 | Bool_t IsUsable(Int_t i) const { return fClusters[i] && !fClusters[i]->IsUsed();} |
109 | Bool_t IsStandAlone() const { return TestBit(kStandAlone);} | |
e44586fb | 110 | |
2eb10c34 | 111 | Float_t GetAnodeWireOffset(Float_t zt); |
68f9b6bd | 112 | Float_t GetC(Int_t typ=0) const { return fC[typ]; } |
9dcc64cc | 113 | Float_t GetCharge(Bool_t useOutliers=kFALSE) const; |
e3cf3d02 | 114 | Float_t GetChi2() const { return fChi2; } |
115 | inline Float_t GetChi2Z() const; | |
116 | inline Float_t GetChi2Y() const; | |
f29f13a6 | 117 | inline Float_t GetChi2Phi() const; |
e44586fb | 118 | void GetCovAt(Double_t x, Double_t *cov) const; |
d937ad7a | 119 | void GetCovXY(Double_t *cov) const { memcpy(cov, &fCov[0], 3*sizeof(Double_t));} |
16cca13f | 120 | void GetCovRef(Double_t *cov) const { memcpy(cov, &fRefCov, 7*sizeof(Double_t));} |
66765e8e | 121 | static Int_t GetCovSqrt(const Double_t * const c, Double_t *d); |
4d6aee34 | 122 | static Double_t GetCovInv(const Double_t * const c, Double_t *d); |
7c3eecb8 | 123 | UChar_t GetErrorMsg() const { return fErrorMsg;} |
203967fc | 124 | Float_t GetdX() const { return fdX;} |
4d6aee34 | 125 | const Float_t* GetdEdx() const { return &fdEdx[0];} |
a0bb5615 | 126 | Float_t GetQperTB(Int_t tb) const; |
9dcc64cc | 127 | Float_t GetdQdl() const; |
4d6aee34 | 128 | Float_t GetdQdl(Int_t ic, Float_t *dx=NULL) const; |
2eb10c34 | 129 | Float_t GetdYdX() const { return fYfit[1];} |
130 | Float_t GetdZdX() const { return fZfit[1];} | |
3e778975 | 131 | Int_t GetdY() const { return Int_t(GetY()/0.014);} |
203967fc | 132 | Int_t GetDetector() const { return fDet;} |
15a4c6d0 | 133 | Int_t GetChargeGaps(Float_t sz[kNtb], Float_t pos[kNtb], Int_t ntb[kNtb]) const; |
e3cf3d02 | 134 | void GetCalibParam(Float_t &exb, Float_t &vd, Float_t &t0, Float_t &s2, Float_t &dl, Float_t &dt) const { |
135 | exb = fExB; vd = fVD; t0 = fT0; s2 = fS2PRF; dl = fDiffL; dt = fDiffT;} | |
4d6aee34 | 136 | AliTRDcluster* GetClusters(Int_t i) const { return i<0 || i>=kNclusters ? NULL: fClusters[i];} |
8d2bec9e | 137 | Int_t GetIndexes(Int_t i) const{ return i<0 || i>=kNclusters ? -1 : fIndexes[i];} |
e3cf3d02 | 138 | Int_t GetLabels(Int_t i) const { return fLabels[i];} |
829e9a79 | 139 | Float_t GetLocalZ() const { return fZfit[0] - fZfit[1] * fX;} |
140 | Float_t GetLocalY() const { return fYfit[0] - fYfit[1] * fX;} | |
4d6aee34 | 141 | Float_t GetMomentum(Float_t *err = NULL) const; |
980d5a2a | 142 | Int_t GetN() const { return (Int_t)fN&kMask;} |
3e778975 | 143 | Int_t GetN2() const { return GetN();} |
980d5a2a | 144 | Int_t GetNUsed() const { return Int_t((fN>>kNbits)&kMask);} |
145 | Int_t GetNShared() const { return Int_t(((fN>>kNbits)>>kNbits)&kMask);} | |
5c5d503a | 146 | Int_t GetTBoccupancy() const; |
147 | Int_t GetTBcross() const; | |
e44586fb | 148 | Float_t GetQuality(Bool_t kZcorr) const; |
dd8059a8 | 149 | Float_t GetPadLength() const { return fPad[0];} |
150 | Float_t GetPadWidth() const { return fPad[1];} | |
ae4e8b84 | 151 | Int_t GetPlane() const { return AliTRDgeometry::GetLayer(fDet); } |
152 | ||
3e778975 | 153 | Float_t* GetProbability(Bool_t force=kFALSE); |
b25a5e9e | 154 | Float_t GetPt() const { return fPt; } |
3e778975 | 155 | inline Double_t GetPID(Int_t is=-1) const; |
81b50104 | 156 | Float_t GetS2Y() const { return fCov[0];} |
e3cf3d02 | 157 | Float_t GetS2Z() const { return fS2Z;} |
81b50104 | 158 | Double_t GetS2DYDX(Float_t) const { return fCov[2];} |
159 | inline Double_t GetS2DZDX(Float_t) const; | |
e3cf3d02 | 160 | Float_t GetSigmaY() const { return fS2Y > 0. ? TMath::Sqrt(fS2Y) : 0.2;} |
161 | Float_t GetSnp() const { return fYref[1]/TMath::Sqrt(1+fYref[1]*fYref[1]);} | |
1fd9389f | 162 | Float_t GetTgl() const { return fZref[1]/TMath::Sqrt(1+fYref[1]*fYref[1]);} |
dd8059a8 | 163 | Float_t GetTilt() const { return fPad[2];} |
3e778975 | 164 | UInt_t GetTrackletWord() const { return 0;} |
b72f4eaf | 165 | UShort_t GetVolumeId() const; |
e3cf3d02 | 166 | Float_t GetX0() const { return fX0;} |
167 | Float_t GetX() const { return fX0 - fX;} | |
81b50104 | 168 | Float_t GetXcross() const { return fS2Y;} |
829e9a79 | 169 | Float_t GetY() const { return TMath::Abs(fY)<1.e-15?GetLocalY():fY;/*fYfit[0] - fYfit[1] * fX;*/} |
170 | Double_t GetYat(Double_t x) const { return fY/*fit[0]*/ - fYfit[1] * (fX0-x);} | |
1fd9389f | 171 | Float_t GetYfit(Int_t id) const { return fYfit[id];} |
172 | Float_t GetYref(Int_t id) const { return fYref[id];} | |
829e9a79 | 173 | Float_t GetYref() const { return fYref[0] - fYref[1] *fX;} |
174 | Float_t GetZ() const { return TMath::Abs(fZ)<1.e-15?GetLocalZ():fZ;/*fZfit[0] - fZfit[1] * fX;*/} | |
175 | Double_t GetZat(Double_t x) const { return fZ/*fit[0]*/ - fZfit[1] * (fX0-x);} | |
1fd9389f | 176 | Float_t GetZfit(Int_t id) const { return fZfit[id];} |
177 | Float_t GetZref(Int_t id) const { return fZref[id];} | |
829e9a79 | 178 | Float_t GetZref() const { return fZref[0] - fZref[1] *fX;} |
1fd9389f | 179 | Int_t GetYbin() const { return Int_t(GetY()/0.016);} |
180 | Int_t GetZbin() const { return Int_t(GetZ()/fPad[0]);} | |
e3cf3d02 | 181 | |
ae4e8b84 | 182 | inline AliTRDcluster* NextCluster(); |
71ea19a3 | 183 | inline AliTRDcluster* PrevCluster(); |
e44586fb | 184 | void Print(Option_t *o = "") const; |
71ea19a3 | 185 | inline void ResetClusterIter(Bool_t forward = kTRUE); |
980d5a2a | 186 | void Reset(Option_t *opt=""); |
ae4e8b84 | 187 | |
68f9b6bd | 188 | void SetC(Float_t c, Int_t typ=0) { fC[typ] = c;} |
803dc399 | 189 | void SetChmbGood(Bool_t k = kTRUE){ SetBit(kChmbGood, k);} |
1fd9389f | 190 | void SetChi2(Float_t chi2) { fChi2 = chi2;} |
16cca13f | 191 | inline void SetCovRef(const Double_t *cov); |
2eb10c34 | 192 | void SetErrorMsg(ETRDtrackletError err) { SETBIT(fErrorMsg, err);} |
e3cf3d02 | 193 | void SetIndexes(Int_t i, Int_t idx) { fIndexes[i] = idx; } |
194 | void SetLabels(Int_t *lbls) { memcpy(fLabels, lbls, 3*sizeof(Int_t)); } | |
e20bef2b | 195 | void SetKink(Bool_t k = kTRUE){ SetBit(kKink, k);} |
2eb10c34 | 196 | void SetPrimary(Bool_t k = kTRUE){ SetBit(kPrimary, k);} |
f29f13a6 | 197 | void SetStandAlone(Bool_t st) { SetBit(kStandAlone, st); } |
b25a5e9e | 198 | void SetPt(Double_t pt) { fPt = pt;} |
29b87567 | 199 | void SetOwner(); |
4ecadb52 | 200 | void SetPadPlane(AliTRDpadPlane * const p); |
dd8059a8 | 201 | void SetPadLength(Float_t l) { fPad[0] = l;} |
202 | void SetPadWidth(Float_t w) { fPad[1] = w;} | |
cbe97468 | 203 | void SetTilt(Float_t tilt) { fPad[2] = tilt; } |
203967fc | 204 | void SetDetector(Int_t d) { fDet = d; } |
bee2b41e | 205 | void SetDX(Float_t inDX) { fdX = inDX;} |
4d6aee34 | 206 | void SetReconstructor(const AliTRDReconstructor *rec) {fkReconstructor = rec;} |
e3cf3d02 | 207 | void SetX0(Float_t x0) { fX0 = x0; } |
81b50104 | 208 | void SetXYZ(TGeoHMatrix *mDet); |
829e9a79 | 209 | void SetYref(Int_t i, Float_t y) { if(i==0||i==1) fYref[i] = y;} |
210 | void SetZref(Int_t i, Float_t z) { if(i==0||i==1) fZref[i] = z;} | |
f29f13a6 | 211 | // void SetUsabilityMap(Long_t um) { fUsable = um; } |
16cca13f | 212 | void Update(const AliTRDtrackV1* trk); |
e3cf3d02 | 213 | void UpdateUsed(); |
214 | void UseClusters(); | |
e4f2f73d | 215 | |
d937ad7a | 216 | protected: |
829e9a79 | 217 | void Copy(TObject &ref) const; |
e4f2f73d | 218 | |
e44586fb | 219 | private: |
3e778975 | 220 | inline void SetN(Int_t n); |
221 | inline void SetNUsed(Int_t n); | |
222 | inline void SetNShared(Int_t n); | |
4ecadb52 | 223 | inline void Swap(Int_t &n1, Int_t &n2) const; |
224 | inline void Swap(Double_t &d1, Double_t &d2) const; | |
3e778975 | 225 | |
4d6aee34 | 226 | const AliTRDReconstructor *fkReconstructor;//! local reconstructor |
e3cf3d02 | 227 | AliTRDcluster **fClusterIter; //! clusters iterator |
8d2bec9e | 228 | Int_t fIndexes[kNclusters]; //! Indexes |
0323ef61 | 229 | Float_t fExB; // tg(a_L) @ tracklet location |
230 | Float_t fVD; // drift velocity @ tracklet location | |
231 | Float_t fT0; // time 0 @ tracklet location | |
232 | Float_t fS2PRF; // sigma^2 PRF for xd->0 and phi=a_L | |
233 | Float_t fDiffL; // longitudinal diffusion coefficient | |
234 | Float_t fDiffT; // transversal diffusion coefficient | |
71ea19a3 | 235 | Char_t fClusterIdx; //! clusters iterator |
7c3eecb8 | 236 | UChar_t fErrorMsg; // processing error |
6ad5e6b2 | 237 | UInt_t fN; // number of clusters attached/used/shared |
e3cf3d02 | 238 | Short_t fDet; // TRD detector |
8d2bec9e | 239 | AliTRDcluster *fClusters[kNclusters]; // Clusters |
2eb10c34 | 240 | Float_t fPad[4]; // local pad definition : length/width/tilt/anode wire offset |
1fd9389f | 241 | Float_t fYref[2]; // Reference y, dydx |
242 | Float_t fZref[2]; // Reference z, dz/dx | |
829e9a79 | 243 | Float_t fYfit[2]; // Fit :: chamber local y, dy/dx |
244 | Float_t fZfit[2]; // Fit :: chamber local z, dz/dx | |
16cca13f | 245 | Float_t fPt; // Pt estimate @ tracklet [GeV/c] |
e44586fb | 246 | Float_t fdX; // length of time bin |
829e9a79 | 247 | Float_t fX0; // anode wire position in TrackingCoordinates (alignment included) |
248 | Float_t fX; // local radial offset from anode wire where tracklet position is estimated | |
249 | Float_t fY; // r-phi position of the tracklet in TrackingCoordinates (alignment included) | |
250 | Float_t fZ; // z position of the tracklet in TrackingCoordinates (alignment included) | |
81b50104 | 251 | Float_t fS2Y; // estimated radial cross point (chmb. coord.) in case of RC tracklets |
e3cf3d02 | 252 | Float_t fS2Z; // estimated resolution in the z direction |
68f9b6bd | 253 | Float_t fC[2]; // Curvature for standalone [0] rieman [1] vertex constrained |
e3cf3d02 | 254 | Float_t fChi2; // Global chi2 |
1f97f376 | 255 | Float_t fdEdx[kNdEdxSlices]; // dE/dx measurements for tracklet |
1fd9389f | 256 | Float_t fProb[AliPID::kSPECIES]; // PID probabilities |
e3cf3d02 | 257 | Int_t fLabels[3]; // most frequent MC labels and total number of different labels |
16cca13f | 258 | Double_t fRefCov[7]; // covariance matrix of the track in the yz plane + the rest of the diagonal elements |
d937ad7a | 259 | Double_t fCov[3]; // covariance matrix of the tracklet in the xy plane |
e4f2f73d | 260 | |
829e9a79 | 261 | ClassDef(AliTRDseedV1, 13) // The offline TRD tracklet |
e4f2f73d | 262 | }; |
263 | ||
264 | //____________________________________________________________ | |
e3cf3d02 | 265 | inline Float_t AliTRDseedV1::GetChi2Z() const |
e4f2f73d | 266 | { |
e3cf3d02 | 267 | Double_t dz = fZref[0]-fZfit[0]; dz*=dz; |
268 | Double_t cov[3]; GetCovAt(fX, cov); | |
269 | Double_t s2 = fRefCov[2]+cov[2]; | |
270 | return s2 > 0. ? dz/s2 : 0.; | |
e4f2f73d | 271 | } |
272 | ||
273 | //____________________________________________________________ | |
e3cf3d02 | 274 | inline Float_t AliTRDseedV1::GetChi2Y() const |
e4f2f73d | 275 | { |
e3cf3d02 | 276 | Double_t dy = fYref[0]-fYfit[0]; dy*=dy; |
277 | Double_t cov[3]; GetCovAt(fX, cov); | |
278 | Double_t s2 = fRefCov[0]+cov[0]; | |
279 | return s2 > 0. ? dy/s2 : 0.; | |
e4f2f73d | 280 | } |
281 | ||
f29f13a6 | 282 | //____________________________________________________________ |
283 | inline Float_t AliTRDseedV1::GetChi2Phi() const | |
284 | { | |
285 | Double_t dphi = fYref[1]-fYfit[1]; dphi*=dphi; | |
286 | Double_t cov[3]; GetCovAt(fX, cov); | |
287 | Double_t s2 = fRefCov[2]+cov[2]; | |
288 | return s2 > 0. ? dphi/s2 : 0.; | |
289 | } | |
290 | ||
16cca13f | 291 | |
292 | ||
3e778975 | 293 | //____________________________________________________________ |
294 | inline Double_t AliTRDseedV1::GetPID(Int_t is) const | |
295 | { | |
296 | if(is<0) return fProb[AliPID::kElectron]; | |
297 | if(is<AliPID::kSPECIES) return fProb[is]; | |
298 | return 0.; | |
299 | } | |
300 | ||
ae4e8b84 | 301 | //____________________________________________________________ |
81b50104 | 302 | Double_t AliTRDseedV1::GetS2DZDX(Float_t dzdx) const |
303 | { | |
304 | // Double_t p0[] = {0.03925, 0.03178}, | |
305 | // p1[] = {0.06316, 0.06669}; | |
306 | Double_t p0[] = {0.02835, 0.03925}, | |
307 | p1[] = {0.04746, 0.06316}; | |
308 | ||
309 | Double_t s2(p0[IsRowCross()]+p1[IsRowCross()]*dzdx*dzdx); | |
310 | s2*=s2; | |
311 | return s2; | |
312 | } | |
313 | ||
314 | //____________________________________________________________ | |
ae4e8b84 | 315 | inline AliTRDcluster* AliTRDseedV1::NextCluster() |
316 | { | |
71ea19a3 | 317 | // Mimic the usage of STL iterators. |
318 | // Forward iterator | |
319 | ||
ae4e8b84 | 320 | fClusterIdx++; fClusterIter++; |
8d2bec9e | 321 | while(fClusterIdx < kNclusters){ |
71ea19a3 | 322 | if(!(*fClusterIter)){ |
323 | fClusterIdx++; | |
324 | fClusterIter++; | |
325 | continue; | |
326 | } | |
327 | return *fClusterIter; | |
328 | } | |
4d6aee34 | 329 | return NULL; |
71ea19a3 | 330 | } |
331 | ||
332 | //____________________________________________________________ | |
333 | inline AliTRDcluster* AliTRDseedV1::PrevCluster() | |
334 | { | |
335 | // Mimic the usage of STL iterators. | |
336 | // Backward iterator | |
337 | ||
338 | fClusterIdx--; fClusterIter--; | |
339 | while(fClusterIdx >= 0){ | |
340 | if(!(*fClusterIter)){ | |
341 | fClusterIdx--; | |
342 | fClusterIter--; | |
343 | continue; | |
344 | } | |
345 | return *fClusterIter; | |
346 | } | |
4d6aee34 | 347 | return NULL; |
71ea19a3 | 348 | } |
349 | ||
350 | //____________________________________________________________ | |
351 | inline void AliTRDseedV1::ResetClusterIter(Bool_t forward) | |
352 | { | |
353 | // Mimic the usage of STL iterators. | |
354 | // Facilitate the usage of NextCluster for forward like | |
355 | // iterator (kTRUE) and PrevCluster for backward like iterator (kFALSE) | |
356 | ||
357 | if(forward){ | |
358 | fClusterIter = &fClusters[0]; fClusterIter--; | |
359 | fClusterIdx=-1; | |
360 | } else { | |
8d2bec9e | 361 | fClusterIter = &fClusters[kNclusters-1]; fClusterIter++; |
362 | fClusterIdx=kNclusters; | |
71ea19a3 | 363 | } |
ae4e8b84 | 364 | } |
365 | ||
16cca13f | 366 | //____________________________________________________________ |
367 | inline void AliTRDseedV1::SetCovRef(const Double_t *cov) | |
368 | { | |
369 | // Copy some "important" covariance matrix elements | |
370 | // var(y) | |
371 | // cov(y,z) var(z) | |
372 | // var(snp) | |
373 | // var(tgl) | |
374 | // cov(tgl, 1/pt) var(1/pt) | |
375 | ||
376 | memcpy(&fRefCov[0], cov, 3*sizeof(Double_t)); // yz full covariance | |
377 | fRefCov[3] = cov[ 5]; // snp variance | |
378 | fRefCov[4] = cov[ 9]; // tgl variance | |
379 | fRefCov[5] = cov[13]; // cov(tgl, 1/pt) | |
380 | fRefCov[6] = cov[14]; // 1/pt variance | |
381 | } | |
382 | ||
383 | ||
3e778975 | 384 | //____________________________________________________________ |
385 | inline void AliTRDseedV1::SetN(Int_t n) | |
386 | { | |
6ad5e6b2 | 387 | if(n<0 || n>kNclusters) return; |
980d5a2a | 388 | fN &= ~kMask; |
389 | fN |= (n&kMask); | |
3e778975 | 390 | } |
391 | ||
392 | //____________________________________________________________ | |
393 | inline void AliTRDseedV1::SetNUsed(Int_t n) | |
394 | { | |
6ad5e6b2 | 395 | if(n<0 || n>kNclusters) return; |
980d5a2a | 396 | UInt_t mask(kMask<<kNbits); |
6ad5e6b2 | 397 | fN &= ~mask; |
980d5a2a | 398 | n=n<<kNbits; fN |= (n&mask); |
3e778975 | 399 | } |
400 | ||
401 | //____________________________________________________________ | |
402 | inline void AliTRDseedV1::SetNShared(Int_t n) | |
403 | { | |
6ad5e6b2 | 404 | if(n<0 || n>kNclusters) return; |
980d5a2a | 405 | UInt_t mask((kMask<<kNbits)<<kNbits); |
6ad5e6b2 | 406 | fN &= ~mask; |
980d5a2a | 407 | n = (n<<kNbits)<<kNbits; fN|=(n&mask); |
3e778975 | 408 | } |
409 | ||
560e5c05 | 410 | //____________________________________________________________ |
4ecadb52 | 411 | inline void AliTRDseedV1::Swap(Int_t &n1, Int_t &n2) const |
560e5c05 | 412 | { |
413 | // swap values of n1 with n2 | |
414 | Int_t tmp(n1); | |
415 | n1=n2; n2=tmp; | |
416 | } | |
417 | ||
418 | //____________________________________________________________ | |
4ecadb52 | 419 | inline void AliTRDseedV1::Swap(Double_t &d1, Double_t &d2) const |
560e5c05 | 420 | { |
421 | // swap values of d1 with d2 | |
422 | Double_t tmp(d1); | |
423 | d1=d2; d2=tmp; | |
424 | } | |
425 | ||
3e778975 | 426 | |
e4f2f73d | 427 | #endif |
428 | ||
47d5d320 | 429 | |
6e49cfdb | 430 |