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

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 // $Id: LCDVToplGhost.h,v 1.2 2001/10/08 17:52:15 toshi Exp $
00003 // ----------------------------------------------------------------------------
00004 
00005 #ifndef LCDVTOPLGHOST_H
00006 #define LCDVTOPLGHOST_H
00007 
00008 #include "TClonesArray.h"
00009 #include "LCDVToplTRK.h"
00010 #include "LCDVToplVRT.h"
00011 
00012 class LCDVToplGhost: public TObject {
00013 
00014 public:
00015   //Constructor and Deconstructor
00016   LCDVToplGhost();
00017   LCDVToplGhost(Int_t dblv);
00018   ~LCDVToplGhost();
00019 
00020   void  Clean(Int_t iflg=0); //Clean arrays, etc...
00021 
00022   //
00023   // ----------------------< Calcurators >--------------------------------
00024   //
00025   Double_t CalcChi2ForGhostTrackAxis(Double_t* gwidmax=0); // Calc. chi**2 for ghost track axis determination.
00026 
00027   //
00028   // ----------------------< Finders >--------------------------------
00029   //
00030   Int_t FindGhostTrack();  //Find ghost track.
00031   Int_t FindVertices(Int_t f_v0check=0); // Vertex finder.
00032   // Int_t FindVertices(); // Vertex finder.
00033 
00034   //
00035   // ----------------------< Getters >--------------------------------
00036   //
00037   //Get values of tunable inputs for ghost track algorithm
00038   Double_t GetGini() { return m_gini; } //ghost track width/cm
00039   Double_t GetGmin() { return m_gmin; } //minimum ghost track width/cm
00040   Double_t GetCmax() { return m_cmax; } //max chi2 of +ve LODI track to ghost
00041   Double_t GetPcut() { return m_pcut; } //min prob. to cluster track vertices
00042   Int_t    GetNvreq(){ return m_nvreq;} //# of reconst. vertices REQuested 
00043   Double_t GetMomf() { return m_momf; } //MOMentum Factor IP/BD discrimination
00044 
00045   Double_t  GetGhostAxisWidth() { return m_gwid; } // Ghost track width.
00046   TVector3* GetGhostAxis() { return &m_gaxi; }// Ghost track direction.
00047 
00048   //
00049   // ----------------------< Setters >--------------------------------
00050   //
00051   //Get values of tunable inputs for ghost track algorithm
00052   void SetGini(Double_t a){ m_gini =a; } //ghost track width/cm
00053   void SetGmin(Double_t a){ m_gmin =a; } //minimum ghost track width/cm
00054   void SetCmax(Double_t a){ m_cmax =a; } //max chi2 of +ve LODI track to ghost
00055   void SetPcut(Double_t a){ m_pcut =a; } //min prob. to cluster track vertices
00056   void SetNvreq(Int_t a)  { m_nvreq=a; } //# of reconst. vertices REQuested 
00057   void SetMomf(Double_t a){ m_momf =a; } //MOMentum Factor IP/BD discrimination
00058 
00059   void SetLCDVToplTRKForGhost(LCDVToplTRK* tkghost);// Set LCDVToplTRK for ghost axis.
00060 
00061   //
00062   // ----------------------< Initializers >--------------------------------
00063   //
00064   void Init();//Initialize...
00065   void InitControlParameter();
00066 
00067   //------------------------------------------------------------------
00068   // Heavy flavor jet tag relates...
00069   //------------------------------------------------------------------
00070   //
00071   // ----------------------< Getters >--------------------------------
00072   //
00073   Int_t    GetSeedVertex(); // Get seed vertex.
00074   Int_t    GetSeedVertexByNNMethod(); // Get Seed vertex by NN method.
00075 
00076   // Get NNoutput for seed vertex.
00077   Double_t GetNNoutputSeedVertex(Int_t ivrt);
00078   Double_t GetNNoutputSeedVertex(LCDVToplVRT* vrt);
00079 
00080   // Get NNoutput for track attachment.
00081   Double_t GetNNoutputTrackAttach(LCDVToplTRK* ltrk, Int_t iseedvrt);
00082   
00083   // Get NNoutput for HF tagging
00084   // void GetNNoutputHFSelect(Double_t* nnbtag, Double_t*nnctag);
00085 
00086   //
00087   // ----------------------< Calcurators >--------------------------------
00088   //
00089   void  CalcPTMass(Int_t iseedvrt=0); // Calculate PT corrected mass.
00090 
00091   //
00092   // ----------------------< Adders >--------------------------------
00093   //
00094   LCDVToplTRK* AddTrack(Int_t tkid, Double_t* tkpar, Double_t* e_tkpar,
00095                         Double_t chrg, Double_t mfld, Int_t mc_ind, 
00096                         const TVector3& ipv);   // Add track
00097   void AddVrtTrack(LCDVToplTRK* trk); // Add a track in the list of assoc. trk.
00098 
00099   //
00100   // ----------------------< Checkers >--------------------------------
00101   //
00102   void   CheckV0Vertex();
00103   Bool_t CheckKs0Vertex(LCDVToplVRT* vrt);
00104   Bool_t CheckLambda0Vertex(LCDVToplVRT* vrt);
00105 
00106   //
00107   // ----------------------< Deleters >--------------------------------
00108   //
00109   void DeleteTracks(Int_t iflg=0); // Delete LCDVToplTRK class variables.
00110   void DeleteVertices(Int_t iflg=0); // Delete LCDVToplVRT class variables.
00111 
00112   //
00113   // ----------------------< Getters >--------------------------------
00114   //
00115   TClonesArray* GetTracks()    { return m_vtrack_list; }  // Get Track array.
00116   LCDVToplTRK*  GetTrackAt(Int_t i);  // Get LCDVToplTRK
00117   Int_t         GetTrackIdx(LCDVToplTRK* trk); //Get LCDVToplTRK index.
00118   Int_t         GetTrackEntries(); // Get Number of LCDVToplTRK s.
00119 
00120   TClonesArray* GetVertices()  { return m_vertex_list; }  // Get Vertex array.
00121   LCDVToplVRT*  GetVertexAt(Int_t i); // Get LCDVToplVRT
00122   Int_t         GetVertexIdx(LCDVToplVRT* vrt); //Get Vertex index.
00123   Int_t         GetVertexEntries(); // Get Number of LCDVToplVRT s.
00124   Int_t         GetVertexEntriesExceptV0(); // Get # of LCDVToplVRT s not V0.
00125 
00126   // TObjArray*    GetVrtTracks() { return m_vrttrack_list; }
00127   Int_t         GetVrtTrackEntries(); // Get # of tracks which associate vert.
00128   LCDVToplTRK*  GetVrtTrackAt(Int_t itrk); // Get a track which assoc. vert.
00129   Double_t      GetVertexCharge(); // Get vertex charge.
00130 
00131   Int_t GetDebugLevel() { return m_dblevel; } // Get debug level.
00132 
00133   // Get the cut valuables for topological vertex finding...
00134   Double_t  GetRipe() { return m_ripe; } //xy error on IP ellipsoid, cm.
00135   Double_t  GetZipe() { return m_ripe; } //z  error on IP ellipsoid, cm.
00136   TVector3* GetPja()  { return &m_pja; } //summed track momenta.
00137 
00138   TVector3 GetInitialVertexT2T(LCDVToplTRK* trk1, 
00139                                LCDVToplTRK* trk2, 
00140                                Double_t l1=0, Double_t l2=0); //Get Initial vertex position from given tracks.
00141 
00142   TVector3  GetBeamIP()    { return  m_ipv; } // Get given beam IP.
00143   TVector3* GetBeamIPPtr() { return &m_ipv; } // Get given beam IP.
00144   void      GetBeamIPErrorMatrix(TMatrixD& a);
00145   void      GetBeamIPErrorMatrixInv(TMatrixD& a);
00146 
00147   Int_t     GetNTrk2Vrt() {return m_ntrk2vrt;}
00148   Int_t*    GetTrk2Vrt() {return m_trk2vrt;}
00149   Int_t     GetNVrt2Trk() {return m_nvrt2trk;}
00150   Int_t*    GetVrt2Trk() {return m_vrt2trk;}
00151   Double_t* GetTrkL() {return m_trkl;}
00152 
00153   //
00154   // ----------------------< Initers >--------------------------------
00155   //
00156   void InitBase(); // Initialize this class.
00157 
00158   //
00159   // ----------------------< Initers >--------------------------------
00160   //
00161   void RemoveVertexAt(Int_t);
00162   void RemoveVertex(LCDVToplVRT* vrt);
00163 
00164   //
00165   // ----------------------< Setters >--------------------------------
00166   //
00167   void SetDebugLevel(Int_t a) { m_dblevel = a; } // Set debug level.
00168 
00169   // Set the cut valuables for topological vertex finding...
00170   void SetRipe(Double_t a) { m_ripe=a; } //xy error on IP ellipsoid, cm.
00171   void SetZipe(Double_t a) { m_zipe=a; } //z  error on IP ellipsoid, cm.
00172   void SetPja(const TVector3& a) { m_pja =a; } //summed track momenta.
00173 
00174   // Set up
00175   void SetUp(const TVector3& ipv, const TVector3& bfldv);
00176   void SetUp(const TVector3& ipv, const TVector3& bfldv, const TVector3& jeta);
00177   void SetIP(const TVector3& ipv) { m_ipv = ipv; } // Set ip position.
00178   void SetBField(const TVector3& bfieldv) { m_bfield = bfieldv; } // Set Magnetic Field.
00179 
00180   void SetBeamIPErrorMatrix(TMatrixD& a);
00181   void SetBeamIPErrorMatrixInv(TMatrixD& a);
00182 
00183   //
00184   // ----------------------< Miscellaneous >--------------------------
00185   //
00186   void CalcIPErrorMatrix(); // IP error matrix calcuration.
00187   void CleanBase(Int_t iflg=0); //Clean up vertices, ...    
00188   void CompressVerticesList();
00189 
00190   //------------------------------------------------------------------
00191   // Heavy flavor jet tag relates...
00192   //------------------------------------------------------------------
00193 
00194   //
00195   // ----------------------< Getters >--------------------------------
00196   //
00197   Int_t GetSeedVertexByClassicMethod(); // Get seed vertex by classical method.
00198 
00199   // Get the Cut values for Seed Vertex Finding.
00200   Double_t GetSeedVrtRMax()        { return m_SeedVrtRMax;        }
00201   Double_t GetSeedVrtK0Mass()      { return m_SeedVrtK0Mass;      }
00202   Double_t GetSeedVrtLambda0Mass() { return m_SeedVrtLambda0Mass; }
00203   Double_t GetSeedVrtSigMin()      { return m_SeedVrtSigMin;      }
00204 
00205  // Get attacked track
00206   Bool_t GetTrackAttachByClassicMethod(LCDVToplTRK *ltrk, 
00207                                        LCDVToplVRT* vrt, 
00208                                        TVector3* xdir);
00209 
00210   // Get the Cut values for Track attaching.
00211   Double_t  GetTrdiMax() { return m_TrdiMax; }
00212   Double_t  GetLodiMin() { return m_LodiMin; }
00213   Double_t  GetLodrMin() { return m_LodrMin; }
00214   Double_t  GetLodrMax() { return m_LodrMax; }
00215   Double_t  GetAntaMax() { return m_AntaMax; }
00216 
00217   // PT correction stuff
00218   Double_t* GetPTIP()    { return m_PTIP;    }
00219   Double_t  GetPTIPXY()  { return m_PTIP[0]; }
00220   Double_t  GetPTIPZ()   { return m_PTIP[1]; }
00221   Double_t  GetNVsigma() { return m_NVsigma; }
00222 
00223   // Vertex mass and momentum...
00224   Double_t       GetRawMass()  { return m_Rmass;    }
00225   Double_t       GetPtMass()   { return m_PtMass;   }
00226   Double_t       GetPtMassErr(){ return m_PtMassEr; }
00227   Double_t       GetMassTag()  { return m_Masstag;  }
00228   Double_t       GetMissPt()   { return m_MissPt;   }
00229   TLorentzVector GetP4Vertex() { return m_p4Vertex; }
00230 
00231   // Get NN...
00232   Int_t    GetUseNN()              { return m_UseNN;     }
00233   Double_t GetSeedVertexNN()       { return m_SeedVrtNN; }
00234   Double_t GetSeedVertex1PrngNN()  { return m_SeedVrt1PrngNN; }
00235   Double_t GetTrackAttachNN()      { return m_TrackAttNN;}
00236   Double_t GetBSelectNN()          { return m_SelectBNN; }
00237   Double_t GetCSelectNN()          { return m_SelectCNN; }
00238 
00239   // NN output for HF jet tag. if < 0.0, no seed vertex...
00240   Double_t GetHFBTagNN() { return m_HFBTagNN; } // NN output for b-tag
00241   Double_t GetHFCTagNN() { return m_HFCTagNN; } // NN output for b-tag
00242   Int_t    GetHF1Prong() { return m_HF1Prong; } // Is this one-prong-vrt. tag?
00243 
00244   Int_t    GetVertexEntriesWithNN(Int_t iseed=0); // Get Number of LCDVToplVRT s with NN cut
00245 
00246   Int_t GetMcJetFlav() { return m_mcjetflav; }
00247 
00248   //
00249   // ----------------------< Setters >--------------------------------
00250   //
00251 
00252   // Set the Cut values for Seed Vertex Finding.
00253   void SetSeedVrtRMax(Double_t a)        { m_SeedVrtRMax=a;        }
00254   void SetSeedVrtK0Mass(Double_t a)      { m_SeedVrtK0Mass=a;      }
00255   void SetSeedVrtLambda0Mass(Double_t a) { m_SeedVrtLambda0Mass=a; }
00256   void SetSeedVrtSigMin(Double_t a)      { m_SeedVrtSigMin=a;      }
00257 
00258   // Set the Cut values for Track attaching.
00259   void SetTrdiMax(Double_t a) { m_TrdiMax=a; }
00260   void SetLodiMin(Double_t a) { m_LodiMin=a; }
00261   void SetLodrMin(Double_t a) { m_LodrMin=a; }
00262   void SetLodrMax(Double_t a) { m_LodrMax=a; }
00263   void SetAntaMax(Double_t a) { m_AntaMax=a; }
00264 
00265   // PT correction stuff
00266   void SetPTIP(Double_t* a)  { m_PTIP[0] = a[0]; m_PTIP[1] = a[1];}
00267   void SetPTIPXY(Double_t a) { m_PTIP[0] = a; }
00268   void SetPTIPZ(Double_t a)  { m_PTIP[1] = a; }
00269   void SetNVsigma(Double_t a){ m_NVsigma = a; }
00270   
00271   // Set NN...
00272   void SetUseNN(Int_t a)                 { m_UseNN=a;     }
00273   void SetSeedVertexNN(Double_t a)       { m_SeedVrtNN=a; }
00274   void SetSeedVertex1PrngNN(Double_t a)  { m_SeedVrt1PrngNN=a; }
00275   void SetTrackAttachNN(Double_t a)      { m_TrackAttNN=a;}
00276   void SetBSelectNN(Double_t a)          { m_SelectBNN=a;  }
00277   void SetCSelectNN(Double_t a)          { m_SelectCNN=a;  }
00278 
00279   void SetMcJetFlav(Int_t a) { m_mcjetflav=a; } // Set MC information.
00280 
00281   void SetPtrVertexTrack();
00282 
00283   //
00284   // ----------------------< Miscellaneous >--------------------------
00285   //
00286   void  Doit(); // Do everything for HF tag
00287   void  CalcHFTagNN(Int_t iseed=0);// (i) seed vertex index
00288   void  CalcHFTagNN_NoVertex();//
00289 
00290   //Add, remove, and merge vertex...
00291   /*
00292   void AddVertex(LCDVToplVRT* vrt);
00293   void AddVertexIntoTrack(LCDVToplTRK* trk,LCDVToplVRT* vrt);
00294   void AddVrtTrack(LCDVToplTRK* trk);
00295   void MergeVertex(LCDVToplVRT* vrti,LCDVToplVRT* vrtj,Int_t f_fit);
00296   void MergeVertex(Int_t i,Int_t j, Int_t f_fit);
00297   void SortVertexByVsig();
00298   void SortVertexByDecayLength();
00299   void SortVertexByVsigInTrack(LCDVToplTRK* trk);
00300   void SortVertexByVsigInAllTrack();
00301   */
00302 
00303 private:
00304   //
00305   //---< tunable inpts for ghost track algorithm >---> Start
00306   //
00307   Float_t m_gini; // Initial ghost track width/cm. =25.0e-4 (default)
00308   Float_t m_gmin; // Minimum ghost track width/cm. =25.0e-4 (default)
00309   Float_t m_cmax; // Max chi**2 of +ve LODI track to ghost. =1.0 (default)
00310   Float_t m_pcut; // Min prob. to cluster track vertices. =0.01 (default)
00311 
00312   // # of reconstructed vertices REQuested 
00313   // m_nvreq = 0, no request, PCUT is used
00314   // m_nvreq > 0, vertex clustering stops when vertex candidates reduces to
00315   //              m_nvreq.
00316   Int_t m_nvreq; //=0 (default) (!!!not implemented!!!)
00317 
00318   // MOMentum Factor IP/BD discrimination
00319   // m_momf=1.0 is fairly large momentum weight
00320   Float_t m_momf;//=0 (default)
00321 
00322   //
00323   //---< tunable inpts for ghost track algorithm >---> End
00324   //
00325   TVector3 m_gaxi; // The ghost track direction.
00326   Double_t m_gwid; // Fitted ghost track gaussian width (cm)
00327 
00328   //
00329   // general ZVTOP input
00330   // 
00331   Float_t m_ripe; // xy error on IP ellipsoid in ZVTOP, cm. =3.0e-4 (default)
00332   Float_t m_zipe; // z error on IP ellipsoid in ZVTOP, cm. =6.0e-4 (default)
00333  
00334   //XYZ location of IP
00335   TVector3 m_ipv;     // IP
00336   Double_t m_iper[6];    // IP error
00337   Double_t m_iper_inv[6];// IP error inv.
00338     
00339   TVector3 m_bfield; //Magnetic Field Vector
00340 
00341   TVector3 m_pja;    //XYZ, jet axis for vertex finding.
00342 
00343   TVector3 m_ptk;    //sum of track momentum vector.
00344 
00345   Int_t         m_nvtrack;       // # of tracks.
00346   TClonesArray* m_vtrack_list;   // list of track objects for vertex finding.
00347   Int_t         m_nvertex;       // # of vertices.
00348   TClonesArray* m_vertex_list;   // list of reconstructed vertex objects.
00349   Int_t         m_nvrttrack;     // # of tracks which associate to vertices.
00350   Int_t         m_vrttrack_list[100]; //
00351 
00352   Int_t m_dblevel; //Debug level.
00353 
00354   //
00355   // PT corrected mass....
00356   //
00357   
00358   // Cut values for Seed Vertex Finding.
00359   Float_t m_SeedVrtRMax;   // Rmax cut: Default 2.3
00360   Float_t m_SeedVrtK0Mass; // Mass cut to reject K0S: 0.005 GeV
00361   Float_t m_SeedVrtLambda0Mass; // Mass cut to reject K0S: 0.005 GeV
00362   Float_t m_SeedVrtSigMin; // Sig min cut : 2.0 sigma
00363 
00364   // Cut calues for track attatcement
00365   Float_t m_TrdiMax; // Att. trk. Max DOCA to vertex axis.:  Default 0.1
00366   Float_t m_LodiMin; // Att. trk. POCA min longi dist along VTX axis.: 0.05
00367   Float_t m_LodrMin; // Att. trk. POCA min longi dist/seed vertex dist.: 0.25
00368   Float_t m_LodrMax; // Att. trk. POCA max longi dist/seed vertex dist.: 2.0
00369   Float_t m_AntaMax; // Att. trk. max angle between track and vertex direction
00370   
00371   // PT correction stuff
00372   Double_t m_PTIP[2]; // IP error for PT correction, xy and z.: ~1.5 sigma
00373   Float_t  m_NVsigma; // # of sigma for Vertex error for PT correction.: 1.0
00374 
00375   // NN valiables
00376   Int_t    m_UseNN;      // use NN for HF-jet tag 0:not use/1:use Zpole/2:use.. ... default 0.
00377   Float_t  m_SeedVrtNN;  // NN cut for seed vertex selection... default 0.3
00378   Float_t  m_SeedVrt1PrngNN;// NN cut for seed 1prng vertex ... default 0.7
00379   Float_t  m_TrackAttNN; // NN cut for track attachment... default 0.5
00380   Float_t  m_SelectBNN;   // NN cut for b tag... default 0.5
00381   Float_t  m_SelectCNN;   // NN cut for c tag... default 0.5
00382 
00383   // Output from CalcPTMass
00384   Float_t m_Rmass    ;// Raw Mass
00385   Float_t m_PtMass   ;// Pt corrected Mass
00386   Float_t m_PtMassEr ;// Pt corrected Mass with IP errors
00387   Float_t m_Masstag  ;// Pt corrected IP err with 2*raw mass oritection
00388   Float_t m_MissPt   ;// Missing Pt
00389   TLorentzVector m_p4Vertex; //Four vector of the vertex
00390 
00391   // Output for NN tag
00392   Float_t m_HFBTagNN; // NN output for b-tag.
00393   Float_t m_HFCTagNN; // NN output for c-tag.
00394   Int_t   m_HF1Prong; // =1: one-prong tag/ =2: No Vertex tag/ =0: other
00395 
00396   // MC information
00397   Int_t m_mcjetflav; // MC jet flavor
00398 
00399   Int_t     m_ntrk2vrt; // array size of m_trk2vrt
00400   Int_t*    m_trk2vrt;  //[m_ntrk2vrt] Map track->vertex
00401   Int_t     m_nvrt2trk; // array size of m_trk2vrt
00402   Int_t*    m_vrt2trk;  //[m_nvrt2trk] Map track->vertex
00403   Double_t* m_trkl;     //[m_ntrk2vrt] array of L of tracks
00404   
00405 public:
00406   ClassDef(LCDVToplGhost,1) // Main class for a vertex finding with ghost track algorithm.
00407     
00408 };
00409 #endif

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