Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

TMBTrack.hpp

Go to the documentation of this file.
00001 #ifndef TMB_TREE_TMBTRACK_HPP__
00002 #define TMB_TREE_TMBTRACK_HPP__
00003 
00004 #include "tmb_tree/TMBLorentzVector.hpp"
00005 
00006 #ifndef ROOT_TRef
00007 #include "TRef.h"
00008 #endif
00009 
00010 #ifndef ROOT_TRefArray
00011 #include "TRefArray.h"
00012 #endif
00013 
00014 class TMBIsoTrack;
00015 class TMBVertex;
00016 
00021 class TMBTrack : public TMBLorentzVector {
00022 
00023 private:
00024 
00025   // Persistent attributes.
00026 
00027   Int_t _q;                  // Charge
00028   Double32_t _chi2_ndof;     // Chisquare/dof.
00029   Double32_t _smtdedx;       // dE/dx in smt.
00030   Double32_t _smtededx;      // dE/dx in smt error.
00031   UInt_t _hitmask[3];        // hit mask.
00032   TRef _isotref;             // Ref. to TMBIsoTrack.
00033 
00034   // Magnetic field Bz.  Used for propagation.
00035   // Tmb_analyze fills this attribute with Bz(0,0,0).  
00036   // Since Bz doesn't change from event to event, this attribute will
00037   // compress to insignificant size.
00038 
00039   Double32_t _bz;
00040 
00041   // TRF dca track parameters.
00042   // Par0 and par1 are regular persistent attributes.
00043   // Par2-par4 redundant with the base class and are cached transiently.
00044   // All trf track parameters are available as methods.
00045   //
00046   // par0 = r at dca (signed).
00047   // par1 = z at dca.
00048   // par2 = phidir (phi of momentum vector).
00049   // par3 = tan(lambda).
00050   // par4 = q/pT.
00051 
00052   Double32_t _rdca;     // Signed radial impact parameter (TRF par0).
00053   Double32_t _z;        // Z at dca (TRF par1).
00054 
00055   //
00056   // TRF track parameter covariance matrix:
00057   // (0,0) 
00058   // (1,0) (1,1) 
00059   // (2,0) (2,1) (2,2)
00060   // (3,0) (3,1) (3,2) (3,3)
00061   // (4,0) (4,1) (4,2) (4,3) (4,4)
00062   //
00063 
00064   Double32_t _trerrs[15];
00065 
00066   // TRF DCA Surface parameters: (xdca, ydca).
00067   // Surface parameters are (0,0) by default, and are also (0,0) for
00068   // TMBTracks created by tmb_analyze (therefore these attributes should
00069   // compress to insignificant size).  Otherwise, they are regular 
00070   // persistent attributes which can be accessed and modified by 
00071   // propagation.  
00072 
00073   Double32_t _xdca;          // x of dca surface.
00074   Double32_t _ydca;          // y of dca surface.
00075 
00076   // Track parameters at PS.
00077   // Here we use straight Cartesian position and momentum rather than trf
00078   // track and surface parameters.
00079 
00080   Double32_t _x_ps;          // x at PS.
00081   Double32_t _y_ps;          // y at PS.
00082   Double32_t _z_ps;          // z at PS.
00083   Double32_t _px_ps;         // px at PS.
00084   Double32_t _py_ps;         // py at PS.
00085   Double32_t _pz_ps;         // pz at PS.
00086 
00087   // Transient attributes.
00088 
00089   mutable TMBVector3 _last_p;      
00090 
00091   mutable bool _trpars_valid;      
00092   mutable Double_t _trpars[5];     
00093   mutable bool _trpos_valid;       
00094   mutable Double_t _trpos[3];      
00095 
00096  public:
00097 
00098   // Constructors, destructor.
00099 
00100   TMBTrack();
00101   TMBTrack(const Double_t* trpars, const Double_t* trerrs, 
00102            Double_t bz,
00103            const UInt_t* hitmask, Double_t chi2_ndof, 
00104            Double_t smtdedx, Double_t smt_ededx,
00105            const Double_t* ps_position, const Double_t* ps_momentum,
00106            const Double_t* surfpars,
00107            const TRef& isotref=TRef());
00108 
00109   virtual ~TMBTrack();
00110   virtual void Clear(Option_t* opt);
00111 
00112   // Accessors.
00113 
00114   Int_t charge() const {return _q;}
00115   Double_t getChi2Ndf() const {return _chi2_ndof;}
00116   Double_t get_smtdedx() const {return _smtdedx;}
00117   Double_t getrms_smtdedx() const {return _smtededx;}
00118   Double_t bz() const {return _bz;}
00119   Double_t det_etaCFT() const; // detector eta of track for external CFT layer
00120 
00121   // TRF track parameters.
00122 
00123   const Double_t* trpars() const {fill_trpars(); return _trpars;}
00124   Double_t trpars(Int_t i) const {fill_trpars(); return _trpars[i];}
00125   Double_t rdca() const {return _rdca;}        // R at dca.
00126   Double_t z() const {return _z;}              // Z at dca.
00127   Double_t phid() const {return trpars(2);}    // Phidir
00128   Double_t tlm() const {return trpars(3);}     // Tan(lambda).
00129   Double_t qpt() const {return trpars(4);}     // q/pT.
00130 
00131   // TRF error matrix.
00132 
00133   const Double_t* trerrs() const  {return _trerrs;}
00134   Double_t trerrs(Int_t i) const {return _trerrs[i];}
00135   Double_t trerrs(Int_t i, Int_t j) const  {
00136     return _trerrs[i>j ? i*(i+1)/2 + j : j*(j+1)/2 + i];}
00137 
00138   // Surface parameters.
00139 
00140   Double_t xdca() const {return _xdca;}
00141   Double_t ydca() const {return _ydca;}
00142 
00143   // Track position 3-vector (x,y,z).
00144 
00145   const Double_t* position() const {fill_trpos(); return _trpos;}
00146   Double_t x() const {return position()[0];}
00147   Double_t y() const {return position()[1];}
00148 
00149   // Track Cartesian position and momentum at PS.
00150 
00151   const Double_t* ps_position() const {return &_x_ps;}
00152   const Double_t* ps_momentum() const {return &_px_ps;}
00153 
00154   // Hit mask.
00155 
00156   const UInt_t* hitmask() const {return _hitmask;}
00157   UInt_t hitmask(Int_t i) const {return _hitmask[i];}
00158   Int_t nhit() const;
00159   Int_t ncft() const;
00160   Int_t nsmt() const {return nhit() - ncft();}
00161 
00162   // Associated IsoTrack.
00163 
00164   const TMBIsoTrack* getIsoTrk() const;
00165   void setIsoTRef(const TRef& isotref) {_isotref=isotref;}
00166 
00167   // Analysis methods.
00168 
00169   // Propagate to new dca surface.  This method makes use of short-distance
00170   // approximations, including the approximation that the magnetic field is
00171   // constant/uniform in the z-direction.  It is intended for propagating 
00172   // the default dca surface to nearby vertices or the true beam position.
00173 
00174   void propagate(const Double_t* surfpars) {
00175     propagate(surfpars[0], surfpars[1]);}
00176   void propagate(const TMBVertex* vert);
00177   void propagate(Double_t dcax, Double_t dcay);
00178 
00179   // 2D impact parameter wrt arbitrary vertex.  
00180   //
00181   // Result is stored in length 2 array ip.
00182   // Error matrix is optionally in length 3 array iperr.
00183 
00184   void impact(const TMBVertex* vert, Double_t* ip, Double_t* iperr=0) const;
00185   void impact(Double_t x, Double_t y, Double_t z, Double_t* ip, 
00186               Double_t* iperr=0) const;
00187 
00188   // Non-const versions propagate track to vertex dca surface as a side 
00189   // effect.
00190 
00191   void impact(const TMBVertex* vert, Double_t* ip, Double_t* iperr=0);
00192   void impact(Double_t x, Double_t y, Double_t z, Double_t* ip, 
00193               Double_t* iperr=0);
00194 
00195   // Vertex constraint.
00196   //
00197   // Modify track parameters so that this track has zero impact parameter 
00198   // with respect to the specified vertex.  As a side effect, the track
00199   // is propagated to the dca surface going though the vertex.
00200   //
00201   // After calling this method, the surface parameters will be the x and y 
00202   // of the vertex, the z track parameter will be the z of the vertex, and
00203   // the radial impact parameter will be zero.
00204   //
00205   // The error of the vertex is taken into account.  The vertex error does 
00206   // not affect the contrained track parameters, but only the error matrix.
00207   // It is assumed that this track has contributed with unit weight to
00208   // the vertex.  This implies that the vertex errors are no larger than
00209   // the track errors of the first two track parameters (they could be much 
00210   // smaller).
00211 
00212   void constrain(const TMBVertex* vert);
00213 
00214   // This version of the constrain method assusmes zero vertex error.
00215   // The resultant track error matrix has zero error for the first two
00216   // track parameters.
00217 
00218   void constrain(Double_t x, Double_t y);
00219 
00220  private:
00221 
00222   // These methods are used to fill transient attributes.
00223 
00224   void fill_trpars() const;
00225   void fill_trpos() const;
00226 
00227   ClassDef(TMBTrack, 2);
00228 };
00229 
00230 #endif // TMB_TREE_TMBTRACK_HPP__

Generated on Tue Mar 28 10:13:05 2006 for CAF by doxygen 1.3.4