/Home/aooliver/hepsoft/lcdroot/LCDRootApps/PhUtil/inc/LCDVTopl.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 // $Id: LCDVTopl.h,v 1.3 2001/10/08 17:52:03 toshi Exp $
00003 // ----------------------------------------------------------------------------
00004 //
00005 // LCDVtopl.h
00006 //
00007 // Feb 14 2001 Toshi Abe  Modify GetSeedVertex...
00008 // Sep 11 2000 M.Iwasaki  Add CalcPTMass and GetSeedVertex functions.
00009 // Aug 15 2000 Toshi Abe  Program creation. 
00010 //                        Original version copied from D.Jackson's ZVTOP3
00011 //
00012 #ifndef LCDVTOPL_H
00013 #define LCDVTOPL_H
00014 
00015 #include "TClonesArray.h"
00016 #include "LCDVToplTRK.h"
00017 #include "LCDVToplVRT.h"
00018 
00019 extern "C"{
00020     Int_t LCDNNSeedVertex(Float_t *in, Float_t *out, Int_t init);
00021     Int_t LCDNNTrackAttach(Float_t *in, Float_t *out, Int_t init);
00022     Int_t LCDNNHFSelect(Float_t *in, Float_t *out, Int_t init);
00023 }
00024 
00025 class LCDVTopl: public TObject {
00026 
00027 public:
00028   //Constructor and Deconstructor
00029   LCDVTopl();
00030   LCDVTopl(TObjArray* track_list, Int_t ntrk, Int_t* track_indecies, 
00031            const TVector3& ip_position, const TVector3& bfield_vector);
00032   LCDVTopl(TObjArray* track_list, Int_t ntrk, Int_t* track_indecies, 
00033            const TVector3& ip_position, const TVector3& bfield_vector,
00034            const TVector3& jet_axis);
00035   LCDVTopl(TObjArray* track_list, 
00036            const TVector3& ip_position, const TVector3& bfield_vector,
00037            const TVector3& jet_axis);
00038   ~LCDVTopl();
00039   
00040   void SetUpLCDVTopl(TObjArray* track_list, Int_t ntrk, Int_t* track_indecies, 
00041                      const TVector3& ip_position, 
00042                      const TVector3& bfield_vector);
00043   void SetUpLCDVTopl(TObjArray* track_list, Int_t ntrk, Int_t* track_indecies, 
00044                      const TVector3& ip_position, 
00045                      const TVector3& bfield_vector,
00046                      const TVector3& jet_axis);
00047   void SetUpLCDVTopl(TObjArray* track_list, 
00048                      const TVector3& ip_position, 
00049                      const TVector3& bfield_vector,
00050                      const TVector3& jet_axis);
00051 
00052   Double_t       GetRipe() { return ripe; } //Get Ripe cut value
00053   Double_t       GetZipe() { return zipe; } //Get Zipe cut value
00054   TVector3       GetPja()  { return pja;  } //Get pja      value
00055   TVector3       GetPtks() { return ptks; } //Get ptrks    value
00056   Double_t       GetRcut() { return rcut; } //Get rcut cut value
00057   Double_t       GetXcut() { return xcut; } //Get xcut cut value
00058   Double_t       GetKang() { return kang; } //Get kang cut value
00059   Double_t       GetKipw() { return kipw; } //Get kipw cut value
00060   
00061   // Get the Cut values for Track attaching.
00062   Double_t       GetTrdiMax() { return m_TrdiMax; }
00063   Double_t       GetLodiMin() { return m_LodiMin; }
00064   Double_t       GetLodrMin() { return m_LodrMin; }
00065   Double_t       GetLodrMax() { return m_LodrMax; }
00066   Double_t       GetAntaMax() { return m_AntaMax; }
00067 
00068   // Set the Cut values for Seed Vertex Finding.
00069   Double_t       GetSeedVrtRMax()        { return m_SeedVrtRMax;        }
00070   Double_t       GetSeedVrtK0Mass()      { return m_SeedVrtK0Mass;      }
00071   Double_t       GetSeedVrtLambda0Mass() { return m_SeedVrtLambda0Mass; }
00072   Double_t       GetSeedVrtSigMin()      { return m_SeedVrtSigMin;      }
00073   
00074   // PT correction stuff
00075   Double_t*      GetPTIP()    { return m_PTIP;    }
00076   Double_t       GetPTIPXY()  { return m_PTIP[0]; }
00077   Double_t       GetPTIPZ()   { return m_PTIP[1]; }
00078   Double_t       GetNVsigma() { return m_NVsigma; }
00079 
00080   Double_t       GetIPProbabirity(TVector3 xvrt);//Get IP probabirity
00081   //Get Initial vertexposition track and track 
00082   TVector3       GetInitialVertexT2T(Int_t itrk,Int_t jtrk);
00083   //Get Initial vertexposition ip and track 
00084   TVector3       GetInitialVertexIP2T(Int_t jtrk);
00085   //Get vertex significance
00086   Double_t       GetVertexSignificance(TVector3 xvrt);
00087   //Get min(Vr/min(V))
00088   Double_t       GetMinVrOverMinVs(LCDVToplVRT* vrt1, LCDVToplVRT* vrt2, 
00089                                    Int_t nstp);
00090   Double_t       GetMinVrOverMinVs(LCDVToplVRT* vrt1, LCDVToplVRT* vrt2);
00091   //Get Vertex by simple iteration
00092   TVector3       GetVertexBySimpleIteration(LCDVToplVRT* vrt);
00093   //Get Vertex Charge
00094   Double_t       GetVertexCharge();
00095   
00096   // Return ID number of Seed Vertex. 
00097   Int_t          GetSeedVertex(); // = -1 There is no seed vertex.
00098   Int_t          GetSeedVertexByClassicMethod(); // imethod=1
00099   Int_t          GetSeedVertexByNNMethod(); // imethod=2
00100   
00101   // Vertex mass and momentum...
00102   Double_t       GetRawMass()  { return m_Rmass;    }
00103   Double_t       GetPtMass()   { return m_PtMass;   }
00104   Double_t       GetPtMassErr(){ return m_PtMassEr; }
00105   Double_t       GetMassTag()  { return m_Masstag;  }
00106   Double_t       GetMissPt()   { return m_MissPt; }
00107   TLorentzVector GetP4Vertex() { return m_p4Vertex; }
00108 
00109   
00110   // Tracks and vertieces...
00111   Int_t          GetTrackEntries();  //Get # of tracks
00112   LCDVToplTRK*   GetTrackAt(Int_t i);
00113   Int_t          GetVertexEntries();
00114   Int_t          GetVertexEntriesExceptV0();
00115   LCDVToplVRT*   GetVertexAt(Int_t i);
00116   Int_t          GetVrtTrackEntries();
00117   LCDVToplTRK*   GetVrtTrackAt(Int_t i);
00118   
00119   // Nsig...
00120   Int_t          GetNsig(Double_t nsigma, TVector3 axis, TVector3 xfrom, 
00121                          TMatrixD& exfrom);
00122   Int_t          GetNsig(Double_t nsigma);
00123   Int_t          GetNsig(Double_t nsigma, TVector3 axis, TVector3 xfrom, 
00124                          TMatrixD& exfrom,TObjArray* nsig_list);
00125   Int_t          GetNsig(Double_t nsigma,TObjArray* nsig_list);
00126   Int_t          GetNsig(Double_t nsigma, TVector3 axis, TVector3 xfrom, 
00127                          TMatrixD& exfrom,TObjArray* nsig_list,
00128                          Double_t rnsigcut, Double_t znsigcut);
00129   Int_t          GetNsig(Double_t nsigma,TObjArray* nsig_list,
00130                          Double_t rnsigcut, Double_t znsigcut);
00131 
00132   // Debug level
00133   Int_t          GetDebugLevel() { return dblv;} //Get Debug Level
00134 
00135   // Get NN...
00136   Bool_t         GetUseNN()              { return m_UseNN;     }
00137   Double_t       GetSeedVertexNN()       { return m_SeedVrtNN; }
00138   Double_t       GetTrackAttachNN()      { return m_TrackAttNN;}
00139   Double_t       GetHFSelectNN()         { return m_SelectNN; }
00140   Double_t       GetHFTagNN(); // NN output for HF jet tag
00141       //if < 0.0, no seed vertex...
00142   Double_t       GetHFTagNN(Int_t iseed); // NN output for HF jet tag
00143       //if < 0.0, no seed vertex...
00144 
00145   // Set the cut valuables for topological vertex finding...
00146   void           SetLCDVToplTRKs(TObjArray*, Int_t, Int_t*);
00147   void           SetRipe(Double_t a) { ripe=a; } //Unit in cm.
00148   void           SetZipe(Double_t a) { zipe=a; } //Unit in cm.
00149   void           SetPja(TVector3 a)  { pja =a; }
00150   void           SetRcut(Double_t a) { rcut=a; }
00151   void           SetXcut(Double_t a) { xcut=a; }
00152   void           SetKang(Double_t a) { kang=a; }
00153   void           SetKipw(Double_t a) { kipw=a; }
00154   
00155   // Set the Cut values for Seed Vertex Finding.
00156   void           SetSeedVrtRMax(Double_t a)        { m_SeedVrtRMax=a;        }
00157   void           SetSeedVrtK0Mass(Double_t a)      { m_SeedVrtK0Mass=a;      }
00158   void           SetSeedVrtLambda0Mass(Double_t a) { m_SeedVrtLambda0Mass=a; }
00159   void           SetSeedVrtSigMin(Double_t a)      { m_SeedVrtSigMin=a;      }
00160   void           SetSeedVrtNN(Double_t a)          { m_SeedVrtNN=a;          }
00161   
00162   // Set the Cut values for Track attaching.
00163   void           SetTrdiMax(Double_t a) { m_TrdiMax=a; }
00164   void           SetLodiMin(Double_t a) { m_LodiMin=a; }
00165   void           SetLodrMin(Double_t a) { m_LodrMin=a; }
00166   void           SetLodrMax(Double_t a) { m_LodrMax=a; }
00167   void           SetAntaMax(Double_t a) { m_AntaMax=a; }
00168 
00169   // PT correction stuff
00170   void           SetPTIP(Double_t* a)  { m_PTIP[0] = a[0]; m_PTIP[1] = a[1];}
00171   void           SetPTIPXY(Double_t a) { m_PTIP[0] = a; }
00172   void           SetPTIPZ(Double_t a)  { m_PTIP[1] = a; }
00173   void           SetNVsigma(Double_t a){ m_NVsigma = a; }
00174   
00175   // Set debug level
00176   void           SetDebugLevel(Int_t a) { dblv=a; } //Set Debug Level
00177 
00178   // Set NN...
00179   void           SetUseNN(Bool_t a)                { m_UseNN=a;     }
00180   void           SetSeedVertexNN(Double_t a)       { m_SeedVrtNN=a; }
00181   void           SetTrackAttachNN(Double_t a)      { m_TrackAttNN=a;}
00182   void           SetHFSelectNN(Double_t a)         { m_SelectNN=a;  }
00183 
00184   void           CalcIPErrorMatrix();
00185   
00186   void           CalcPTMass();
00187   void           CalcPTMass(Int_t iseedvrt);
00188   
00189   void           CheckV0Vertex();
00190   Bool_t         CheckKs0Vertex(LCDVToplVRT* vrt);
00191   Bool_t         CheckLambda0Vertex(LCDVToplVRT* vrt);
00192   
00193   TClonesArray*  Tracks()    { return vtrack_list; }
00194   TClonesArray*  Vertices()  { return vertex_list; }
00195   TObjArray*     VrtTracks() { return vrttrack_list; }
00196   
00197   void           Clean();
00198   void           DeleteTracks();
00199   void           DeleteVertices();
00200   
00201   //Add, remove, and merge vertex...
00202   void           AddVertex(LCDVToplVRT*);
00203   void           AddVertexIntoTrack(LCDVToplTRK*,LCDVToplVRT*);
00204   void           AddVrtTrack(LCDVToplTRK* trk);
00205   void           CompressVerticesList();
00206   void           RemoveVertexAt(Int_t);
00207   void           RemoveVertex(LCDVToplVRT* vrt);
00208   void           MergeVertex(LCDVToplVRT* vrti,LCDVToplVRT* vrtj,Int_t f_fit);
00209   void           MergeVertex(Int_t i,Int_t j, Int_t f_fit);
00210   void           SortVertexByVsig();
00211   void           SortVertexByDecayLength();
00212   void           SortVertexByVsigInTrack(LCDVToplTRK* trk);
00213   void           SortVertexByVsigInAllTrack();
00214   
00215   //Topological vertex finding alghorithm.
00216   //all other vertices must contain at least 2 tracks and
00217   //are ordered according to their distance from the IP.
00218   Int_t          FindVertices(Int_t f_v0check);
00219   Int_t          FindVertices();
00220   
00221   void           Init();//Initialize...
00222   void           InitControlParameter();
00223 
00224   void           PrintOutForDebug();//Debug print out function
00225 
00226 private:
00227 
00228   //-------------< Control Parameter >------------------
00229   //
00230   // general ZVTOP input
00231  
00232   // xy error on IP ellipsoid in ZVTOP, cm.
00233   Double_t ripe; //=3.0e-4 (default)
00234 
00235   // z error on IP ellipsoid in ZVTOP, cm.
00236   Double_t zipe; //=6.0e-4 (default)
00237  
00238   // MC=1 : include Monte Carlo information in
00239   // the output. 
00240   //    Int_t mc;
00241  
00242   // resolubility cut, can vary as 0.0 < VCUT < 1.0,
00243   // larger values produce more vertices.
00244   Double_t rcut; //=0.6 (default)
00245   
00246   // cut on the chi**2 contribution of a track to a vertex.
00247   Double_t xcut; //=10.0 (default)
00248 
00249   // Weights vertex finding probability by the
00250   // factor exp(-KANG*A**2) where A is the angle
00251   // in radians between the line joining the IP
00252   // to the 3D spatial co-ordinate and the jet
00253   // axis. (+ve values ~10 increase vertex 
00254   // finding efficiency in core of jet).
00255   Double_t kang; //=5.0 (default)
00256   
00257   // i.p track weight, weights the significance
00258   // of the IP, large values will tend to absorb
00259   // nearby vertices/fakes into the primary vertex.
00260   Double_t kipw; //=1.0 (default)
00261   
00262   //12 XYZ location of IP
00263   TVector3    ipv;
00264   TMatrixD    iper;
00265   TMatrixD    iper_inv;
00266     
00267   TVector3 bfield; //Magnetic Field Vector
00268 
00269   Double_t dcut; //???
00270   
00271   Int_t    nstep; //???
00272 
00273   //12 XYZ,magnitude of summed track momenta
00274   TVector3    pja;
00275 
00276   //
00277   // PT corrected mass....
00278   //
00279   
00280   // Cut values for Seed Vertex Finding.
00281   Double_t m_SeedVrtRMax;   // Rmax cut: Default 2.3
00282   Double_t m_SeedVrtK0Mass; // Mass cut to reject K0S: 0.015 GeV
00283   Double_t m_SeedVrtLambda0Mass; // Mass cut to reject K0S: 0.015 GeV
00284   Double_t m_SeedVrtSigMin; // Sig min cut : 2.0 sigma
00285 
00286   // Cut calues for track attatcement
00287   // Attatch track Max DOCA to vertex axis.
00288   Double_t m_TrdiMax; // TRDI cut : Default 0.1
00289   // Attatch track POCA min longi dist along VTX axis
00290   Double_t m_LodiMin; // Lodi cut : Default 0.05
00291   // Attatch track POCA min longi dist/seed vertex dist.
00292   Double_t m_LodrMin; // Lodr cut | Cefault 0.25
00293   // Attatch track POCA max longi dist/seed vertex dist.
00294   Double_t m_LodrMax; // Lodr cut | Cefault 2.0
00295   // Attatch track max angle between track and vertex direction
00296   Double_t m_AntaMax;
00297   
00298   // PT correction stuff
00299   // IP error for PT correction, xy and z
00300   Double_t m_PTIP[2]; // Default ~1.5 sigma ... 0.0010(xy) and 0.0040(z)
00301   // Number of sigma for Vertex error for PT correction
00302   Double_t m_NVsigma; // Default 1.0
00303 
00304   // NN valiables
00305   Bool_t   m_UseNN;      // use NN for HF-jet tag... default kFALSE.
00306   Double_t m_SeedVrtNN;  // NN cut for seed vertex selection... default 0.7
00307   Double_t m_TrackAttNN; // NN cut for track attachment... default 0.6
00308   Double_t m_SelectNN;   // NN cut for heavy flavour tag... default 0.5
00309 
00310 
00311   Int_t    dblv;  //Debug level
00312 
00313   //-------------< Out Parameter >------------------
00314 
00315   // Output from CalcPTMass
00316   Double_t m_Rmass    ;// Raw Mass
00317   Double_t m_PtMass   ;// Pt corrected Mass
00318   Double_t m_PtMassEr ;// Pt corrected Mass with IP errors
00319   Double_t m_Masstag  ;// Pt corrected IP err with 2*raw mass oritection
00320   Double_t m_MissPt   ;// Missing Pt
00321   TLorentzVector m_p4Vertex; //Four vector of the vertex
00322   
00323   TVector3    ptks;  //12 XYZ,magnitude of summed track momenta
00324   
00325   TClonesArray* vtrack_list;  // list of track objects for vertex finding.
00326   
00327   TClonesArray* vertex_list;  // list of reconstructed vertex objects
00328   
00329   TObjArray*    vrttrack_list;  // list of track objects in vertex;
00330 
00331 public:
00332   ClassDef(LCDVTopl,2) // Main class for a topological vertexing.
00333     
00334 };
00335 #endif

Generated on Tue Jul 18 18:33:57 2006 for LCDROOT by  doxygen 1.4.6