CDF II
CDF KITS
source navigation ]
diff markup ]
identifier search ]
freetext search ]
file search ]
 
Architecture: i386 ]
Version: 4.10.4 ] [ 4.10.5 ] [ 4.8.4 ] [ 4.8.4l3s ] [ 4.8.5 ] [ 4.9.0 ] [ 4.9.1 ] [ 4.9.1.hpt3 ] [ 4.9.1hpt3 ] [ 4.9.1top1 ] [ 5.0.0 ] [ 5.1.0 ] [ 5.1.0beamonly ] [ 5.1.1 ] [ 5.2.0 ] [ 5.3.0 ] [ 5.3.1 ] [ 5.3.1dsp ] [ 5.3.3 ] [ 5.3.3_nt ] [ 5.3.4 ] [ 6.1.1 ] [ 6.1.1b ] [ 6.1.2 ] [ 6.1.3 ] [ 6.1.4 ] [ 6.1.4int3 ] [ 6.1.4mc ] [ 6.1.4mc_a ] [ 6.1.6 ] [ development ]

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                                 // added 3 chi*2's
027   enum {
028     kNIntegers53 = 10,
029     kNFloats53   = 20
030   };
031 
032   enum {                        // added 1 genp number Int_t
033     kNIntegers54 = 11,
034     kNFloats54   = 20
035   };                            
036   enum {                        // added iExpected (Beate)
037     kNIntegers57 = 12,
038     kNFloats57   = 20
039   };
040   enum {                        // added dE/dx
041     kNIntegers59 = 13,
042     kNFloats59   = 20
043   };
044 
045 
046 protected:
047 //------------------------------------------------------------------------------
048 //  data members
049 //------------------------------------------------------------------------------
050   TLorentzVector fMomentum;             // 4-momentum in the primary vertex
051 
052   Float_t        fCot;                  // cot(theta) of track
053   Float_t        fCurv;                 // track curvature
054   Float_t        fZ0;                   // z_0 of track in the point of CA
055   Float_t        fD0;
056   Float_t        fPhi0;
057 
058   Float_t        fPt;
059   Float_t        fEta;
060   Float_t        fT0;                   // T0 from Cot_tZero
061   Float_t        fT0Sigma;              // error on T0
062 
063   Float_t        fBcZ0;                 // beam-constrained parameters
064   Float_t        fBcD0;                 //
065   Float_t        fBcPhi0;
066   Float_t        fBcC0;
067   Float_t        fBcLam0;
068 
069   Float_t        fIso4;                 // relative isolation in cone 0.4
070   Float_t        fUd0;                  // D0 with respect to the beam axis
071   Float_t        fUiso4;                // iso as returned by top/tkiso.F
072   Float_t        fChi2;                 // chi**2 of the COT+SVX fit
073   Float_t        fChi2Cot;              // chi**2 of COT-only fit
074   Float_t        fChi2Svx;              // chi**2 of SVX-only fit
075 
076   TMatrix55      fCov;                  //|| track covariance matrix (5x5)
077   Float_t        fBcp4[4];              // beam-constrained momentum
078 
079   Int_t          fAlgorithm;            // algorithm word (bit-packed)
080   Int_t          fVind;                 // vertex number
081   Int_t          fBcvind;               // vertex # for beam-constrained fit
082 
083                                         // ***** added in v2.0 - will make it
084                                         // an integer
085                                         // track number & (obsp number << 16) 
086   Int_t          fNumber;
087                                         // COT hits (4 bytes), wiil make it an
088                                         // integer later
089                                         // fNTotalCotHits         ||
090                                         // (fNAxialCotHits  << 8) ||
091                                         // (fNStereoCotHits << 16)||
092                                         // fNCotSeg
093   Int_t          fCotHitWord;
094 
095   Int_t          fCotHitMask[3];        // mask of hit COT layers (96 bits)
096 
097                                         // SVX hit information
098                                         // fNSvxHits || (fNSvxRPhiHits << 8) ||
099                                         // (fNSvxSASHits << 16) ||
100                                         // (fNSvxZHits   << 24) 
101   Int_t          fSvxHitWord;
102   Int_t          fSvxHitMask;           // SVX hit mask
103 
104   Int_t          fGenpNumber;           // Genp particle association
105   Int_t          fSiExpWord;            // number of expected Si hits on track
106                                         // and number of hits in cone of 0.4
107   Int_t          fdEdxWord;             // bits 0:6 Nhits used, 7:31 10*dE/dx
108 //-----------------------------------------------------------------------------
109 //  transient data members, all the persistent ones should go above
110 //-----------------------------------------------------------------------------
111   Int_t          fCdfTrackId;           // ! Do not stream the id
112                                         //   variable since it is only
113                                         //   used to make TrackLinkBlock.
114   CdfTrack*      fCdfTrack;             // ! pointer to parent CdfTrack for 
115                                         //   internal use
116   Float_t        fTmp[10];              // ! for temporary analysis needs
117 //------------------------------------------------------------------------------
118 // so far - transient-only variables, you have to define them before use
119 //------------------------------------------------------------------------------
120 public:
121   TCesCluster*   fCesCluster[2];        // ! closest CES cluster [0]:s, [1]:w
122   Int_t          fSide;                 // !
123   Int_t          fWedge;                // !
124   Double_t       fXCes   [2];           // ! 
125   Double_t       fDelXCes[2];           // ! residuals - to make it simple
126   TCesShower*    fCesShower;            // ! closest CES shower (development)
127   Double_t       fCesDist;              // ! dist to the closest shower (devel)
128   Double_t       fXCesBc   [2];         // ! beam-constrained extrapolation
129   Double_t       fDelXCesBc[2];         // ! beam-constrained extrapolation
130   Double_t       fDZ0;                  // ! delta(Z) in the primary vertex
131   Int_t          fNSh;                  // ! N(showers) within fMaxDist
132   Double_t       fESh;                  // ! total E of the close showers
133   Int_t          fSideBc;               // !
134   Int_t          fWedgeBc;              // !
135 //------------------------------------------------------------------------------
136 //  functions
137 //------------------------------------------------------------------------------
138 public:
139                                         // ****** constructors and destructor
140   TStnTrack(Int_t Number = -1);
141                                         // Flag=1: Cov is 5x5, Flag=2: upper
142                                         // triangle of Cov is passed
143 
144   TStnTrack(double* Par, double* Cov, int Flag);
145   virtual ~TStnTrack();
146 //-----------------------------------------------------------------------------
147 // accessors
148 //-----------------------------------------------------------------------------
149   TLorentzVector* Momentum() { return &fMomentum; }
150   
151   Int_t  GetBcMomentum(TLorentzVector* BcMom   );
152   Int_t  GetMomentum  (TLorentzVector* Momentum);
153 //-----------------------------------------------------------------------------
154                                         // algorithm for the moment is integer
155                                         // in principle need 4-5 bits
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 // COT hit section
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 //  SVX hit section
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 // SVX geometry is such that in a given layer a track can have up to 4 hits  - 
235 // 2 on the stereo side and 2 on axial side
236 // 'HasSvxHit' returns 1 if a track has at least one hit in a given layer
237 //                     0 otherwise
238 // layers are numbered from 0(L00) to 7(outermost ISL layer)
239 //-----------------------------------------------------------------------------
240   Int_t           HasSvxHit      (Int_t Layer);
241   Int_t           HasSvxAxialHit (Int_t Layer);
242   Int_t           HasSvxStereoHit(Int_t Layer);
243 
244   // the dEdx and the number of COT hits used in the dEdx
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 //  transient-only variables
266 //-----------------------------------------------------------------------------
267   CdfTrack*       GetCdfTrack  ()       { return fCdfTrack;   }
268   Int_t           GetCdfTrackId() const { return fCdfTrackId; }
269 //-----------------------------------------------------------------------------
270 //  accessors for transient-only data members - make sure those are 
271 //  initialized - initialization is up to you!
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 //  modifiers
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 //  overloaded methods of TObject
366 //-----------------------------------------------------------------------------
367   void Print(Option_t* option = "") const;
368 //-----------------------------------------------------------------------------
369 // schema evolution
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 

source navigation ] diff markup ] identifier search ] freetext search ] file search ]

This page was automatically generated by the LXR engine.
The LXR team
Valid HTML 4.01!

Send problems or questions to cdfcode@fnal.gov