001 #ifndef STNTUPLE_TStnTrack
002 #define STNTUPLE_TStnTrack
003
004 #include "TLorentzVector.h"
005 #include "TArrayF.h"
006
007 #include "Stntuple/base/TMatrix55.hh"
008
009 class StnTrackBlock_t;
010 class CdfTrack;
011 class TCesCluster;
012 class TCesShower;
013 class TStnDataBlock;
014 class AbsEvent;
015
016 class TStnTrack: public TObject {
017
018 friend Int_t StntupleInitTrack(TStnTrack*, const CdfTrack*, Int_t Mode);
019 friend Int_t StnRun1InitTrack (TStnTrack* Vert,StnTrackBlock_t* R1V,Int_t I);
020 friend Int_t StntupleInitTrackBlock(TStnDataBlock*, AbsEvent*, int);
021
022 enum {
023 kNIntegers52 = 10,
024 kNFloats52 = 17
025 };
026
027 enum {
028 kNIntegers53 = 10,
029 kNFloats53 = 20
030 };
031
032 enum {
033 kNIntegers54 = 11,
034 kNFloats54 = 20
035 };
036 enum {
037 kNIntegers57 = 12,
038 kNFloats57 = 20
039 };
040 enum {
041 kNIntegers59 = 13,
042 kNFloats59 = 20
043 };
044
045
046 protected:
047
048
049
050 TLorentzVector fMomentum;
051
052 Float_t fCot;
053 Float_t fCurv;
054 Float_t fZ0;
055 Float_t fD0;
056 Float_t fPhi0;
057
058 Float_t fPt;
059 Float_t fEta;
060 Float_t fT0;
061 Float_t fT0Sigma;
062
063 Float_t fBcZ0;
064 Float_t fBcD0;
065 Float_t fBcPhi0;
066 Float_t fBcC0;
067 Float_t fBcLam0;
068
069 Float_t fIso4;
070 Float_t fUd0;
071 Float_t fUiso4;
072 Float_t fChi2;
073 Float_t fChi2Cot;
074 Float_t fChi2Svx;
075
076 TMatrix55 fCov;
077 Float_t fBcp4[4];
078
079 Int_t fAlgorithm;
080 Int_t fVind;
081 Int_t fBcvind;
082
083
084
085
086 Int_t fNumber;
087
088
089
090
091
092
093 Int_t fCotHitWord;
094
095 Int_t fCotHitMask[3];
096
097
098
099
100
101 Int_t fSvxHitWord;
102 Int_t fSvxHitMask;
103
104 Int_t fGenpNumber;
105 Int_t fSiExpWord;
106
107 Int_t fdEdxWord;
108
109
110
111 Int_t fCdfTrackId;
112
113
114 CdfTrack* fCdfTrack;
115
116 Float_t fTmp[10];
117
118
119
120 public:
121 TCesCluster* fCesCluster[2];
122 Int_t fSide;
123 Int_t fWedge;
124 Double_t fXCes [2];
125 Double_t fDelXCes[2];
126 TCesShower* fCesShower;
127 Double_t fCesDist;
128 Double_t fXCesBc [2];
129 Double_t fDelXCesBc[2];
130 Double_t fDZ0;
131 Int_t fNSh;
132 Double_t fESh;
133 Int_t fSideBc;
134 Int_t fWedgeBc;
135
136
137
138 public:
139
140 TStnTrack(Int_t Number = -1);
141
142
143
144 TStnTrack(double* Par, double* Cov, int Flag);
145 virtual ~TStnTrack();
146
147
148
149 TLorentzVector* Momentum() { return &fMomentum; }
150
151 Int_t GetBcMomentum(TLorentzVector* BcMom );
152 Int_t GetMomentum (TLorentzVector* Momentum);
153
154
155
156
157 Int_t Algorithm () const { return (fAlgorithm) & 0xff; }
158 Int_t CotParentAlgo() const { return (fAlgorithm >> 8) & 0xff; }
159 Int_t IsCMUFid () const { return (fAlgorithm >> 16) & 0x1; }
160 Int_t IsCMPFid () const { return (fAlgorithm >> 17) & 0x1; }
161 Int_t IsCMXFid () const { return (fAlgorithm >> 18) & 0x1; }
162 Int_t IsBMUFid () const { return (fAlgorithm >> 19) & 0x1; }
163 Int_t IsCMUFid2 () const { return (fAlgorithm >> 20) & 0x1; }
164 Int_t IsCMPFid2 () const { return (fAlgorithm >> 21) & 0x1; }
165 Int_t IsCMXFid2 () const { return (fAlgorithm >> 22) & 0x1; }
166 Int_t IsBMUFid2 () const { return (fAlgorithm >> 23) & 0x1; }
167 Int_t FidEleStatus () const { return (fAlgorithm >> 24) & 0xff;}
168
169 Float_t Lam0 () const { return fCot; }
170 Float_t Eta () const { return fEta; }
171 Float_t C0 () const { return fCurv; }
172 Float_t D0 () const { return fD0; }
173 Float_t Z0 () const { return fZ0; }
174 Float_t X0 () const { return -fD0*sin(fPhi0)*Charge(); }
175 Float_t Y0 () const { return fD0*cos(fPhi0)*Charge(); }
176 Float_t Phi0 () const { return fPhi0; }
177 Float_t Pt () const { return fPt; }
178 Float_t Charge () const { return (fCurv > 0) ? 1. : -1.; }
179 Float_t T0 () const { return fT0; }
180 Float_t T0Sigma() const { return fT0Sigma;}
181 Float_t Iso4 () const { return fIso4; }
182 Float_t Chi2 () const { return fChi2; }
183 Float_t Chi2Cot() const { return fChi2Cot; }
184 Float_t PhoenixChi2DofSeed() const { return fChi2Cot; }
185 Float_t Chi2Svx() const { return fChi2Svx; }
186
187 Float_t Chi2CotDof() const { return fChi2Cot/(NCotHitsTot()-4.9999); }
188
189 Float_t BcLam0 () const { return fBcLam0; }
190 Float_t BcC0 () const { return fBcC0; }
191 Float_t BcZ0 () const { return fBcZ0; }
192 Float_t BcPhi0 () const { return fBcPhi0; }
193 Float_t BcD0 () const { return fBcD0; }
194
195 TMatrix55* Cov () { return &fCov; }
196
197
198
199 Int_t CotHitMask(int im) const { return fCotHitMask[im]; }
200
201 Int_t HasCotHit (int il) const {
202 int iw = il/32;
203 int ib = il-iw*32;
204 return (fCotHitMask[iw] >> ib) &0x1;
205 }
206
207 Int_t NCotHits(Int_t Isl) const;
208
209 Int_t NCotHitsTot() const { return (fCotHitWord ) & 0xff; }
210 Int_t NCotHitsAx () const { return (fCotHitWord >> 8) & 0xff; }
211 Int_t NCotHitsSt () const { return (fCotHitWord >> 16) & 0xff; }
212 Int_t NAxSeg () const { return (fCotHitWord >> 24) & 0xf; }
213 Int_t NStSeg () const { return (fCotHitWord >> 28) & 0xf; }
214
215 Int_t NCotStSeg(Int_t MinHits) const;
216 Int_t NCotAxSeg(Int_t MinHits) const;
217
218
219
220 Int_t NSvxHits () const { return (fSvxHitWord ) & 0xff; }
221 Int_t NSvxRPhiHits () const { return (fSvxHitWord >> 8) & 0xff; }
222 Int_t NSvxSASHits () const { return (fSvxHitWord >> 16) & 0xff; }
223 Int_t NSvxZHits () const { return (fSvxHitWord >> 24) & 0xff; }
224
225 Int_t NSvxStereoHits () const { return NSvxSASHits()+NSvxZHits(); }
226 Int_t SvxHitMask () const { return fSvxHitMask; }
227
228 Int_t Is3D () const { return (NStSeg() > 0); }
229
230 Int_t NSiExpected () const {return (fSiExpWord ) &0xff;}
231 Int_t NSiExpectedPhi () const {return (fSiExpWord >> 8 ) &0xff;}
232 Int_t NSiHitCone () const {return (fSiExpWord >>16 ) &0xffff;}
233
234
235
236
237
238
239
240 Int_t HasSvxHit (Int_t Layer);
241 Int_t HasSvxAxialHit (Int_t Layer);
242 Int_t HasSvxStereoHit(Int_t Layer);
243
244
245 Float_t Dedx () const {return float(fdEdxWord>>7)/10.0;}
246 Int_t NDedx () const {return fdEdxWord&0x7F;}
247
248 Int_t Number () const { return fNumber & 0xffff; }
249
250 Int_t McNumber () const {
251 Warning("McNumber",
252 "deprecated, use TStnTrack::ObspNumber instead. -thanks, Pasha");
253 return (fNumber >> 16) & 0xffff;
254 }
255
256 Int_t ObspNumber () const {
257 return int (short ((fNumber >> 16) & 0xffff));
258 }
259
260 Int_t GenpNumber () const { return fGenpNumber; }
261 Int_t VertexNumber () const { return fVind; }
262
263 Int_t CotRefitStatus() const { return fBcvind & 0xffff; }
264
265
266
267 CdfTrack* GetCdfTrack () { return fCdfTrack; }
268 Int_t GetCdfTrackId() const { return fCdfTrackId; }
269
270
271
272
273 Int_t Side () const { return fSide; }
274 Int_t Wedge () const { return fWedge; }
275 Float_t ZCes () const { return fXCes[0]; }
276 Float_t XCes () const { return fXCes[1]; }
277 Float_t XCes (Int_t I) const { return fXCes[I]; }
278 TCesCluster* GetCesCluster(Int_t I) const { return fCesCluster[I]; }
279 Double_t DelZCes () const { return fDelXCes[0]; }
280 Double_t DelXCes () const { return fDelXCes[1]; }
281 Double_t DelXCes (Int_t I) const { return fDelXCes[I]; }
282
283 Int_t SideBc () const { return fSideBc; }
284 Int_t WedgeBc () const { return fWedgeBc; }
285 Float_t ZCesBc () const { return fXCesBc[0]; }
286 Float_t XCesBc () const { return fXCesBc[1]; }
287 Float_t XCesBc (Int_t I) const { return fXCesBc[I]; }
288 Double_t DelZCesBc () const { return fDelXCesBc[0]; }
289 Double_t DelXCesBc () const { return fDelXCesBc[1]; }
290 Double_t DelXCesBc (Int_t I) const { return fDelXCesBc[I]; }
291 Double_t DZ0 () const { return fDZ0; }
292
293 TCesShower* GetCesShower () const { return fCesShower; }
294 Double_t CesDist () const { return fCesDist ; }
295 Int_t NSh () const { return fNSh ; }
296 Double_t ESh () const { return fESh ; }
297
298 Float_t& Tmp (Int_t I) { return fTmp[I]; }
299
300
301
302 void SetVertexNumber(int iv ) { fVind = iv; }
303 void SetIso4 (float Iso4) { fIso4 = Iso4; }
304 void SetCdfTrack (CdfTrack* Track) { fCdfTrack = Track; }
305 void SetCdfTrackId (Int_t Id) { fCdfTrackId = Id; }
306
307 void SetNumber (int it) {
308 fNumber = (fNumber & 0xffff0000) | (it & 0xffff);
309 }
310 void SetObspNumber (int it) {
311 fNumber = (fNumber & 0x0000ffff) | ((it << 16) & 0xffff0000);
312 }
313 void SetGenpNumber (int it ) { fGenpNumber = it; }
314
315 void SetLam0 (Float_t Lam0) { fCot = Lam0; }
316 void SetC0 (Float_t C0 ) { fCurv = C0; }
317 void SetZ0 (Float_t Z0 ) { fZ0 = Z0; }
318 void SetPhi0 (Float_t Phi0) { fPhi0 = Phi0; }
319 void SetD0 (Float_t D0 ) { fD0 = D0; }
320 void SetDZ0 (Float_t DZ0 ) { fDZ0 = DZ0; }
321
322 void SetParameters(Float_t Lam0, Float_t C0, Float_t Z0,
323 Float_t Phi0, Float_t D0);
324
325 void SetParameters(Float_t* Par);
326 void SetParameters(Double_t* Par);
327 void SetCovariance(Float_t* Cov);
328 void SetCovariance(Double_t* Cov);
329 void SetCovariance(TMatrix55& Cov);
330
331 void SetCesParameters(Int_t Side, Int_t Wedge,
332 Double_t XCes, Double_t ZCes ,
333 Int_t BeamConstrained = 0)
334 {
335 if (BeamConstrained == 0) {
336 fSide = Side; fWedge = Wedge; fXCes [0] = ZCes; fXCes [1] = XCes;
337 }
338 else {
339 fSideBc = Side; fWedgeBc = Wedge; fXCesBc[0] = ZCes; fXCesBc[1] = XCes;
340 }
341 }
342
343 void SetCesCluster(Int_t I, TCesCluster* Cluster,
344 Double_t DelX, int Bc = 0) {
345 fCesCluster[I] = Cluster;
346 fDelXCes [I] = DelX;
347 if (Bc != 0) fDelXCesBc[I] = DelX;
348 }
349
350 void SetCesShower(TCesShower* Shower, Double_t Dist) {
351 fCesShower = Shower;
352 fCesDist = Dist;
353 }
354
355 void SetShowerInfo(Int_t NSh, Double_t ESh) {
356 fNSh = NSh;
357 fESh = ESh;
358 }
359
360 void SetCesBcResiduals(Double_t DelZ, Double_t DelX) {
361 fDelXCesBc[0] = DelZ;
362 fDelXCesBc[1] = DelX;
363 }
364
365
366
367 void Print(Option_t* option = "") const;
368
369
370
371 void ReadV51 (TBuffer& R__b);
372 void ReadV52 (TBuffer& R__b);
373 void ReadV53 (TBuffer& R__b);
374 void ReadV54_56(TBuffer& R__b);
375 void ReadV57_58(TBuffer& R__b);
376
377 ClassDef(TStnTrack,59)
378 };
379
380 #endif
381
382
Send problems or questions to cdfcode@fnal.gov