FairRoot/PandaRoot
KFParticleMatch.h
Go to the documentation of this file.
1 /*
2  *====================================================================
3  *
4  * CBM KF Track Quality
5  *
6  * Authors: M.Zyzak
7  *
8  * e-mail :
9  *
10  *====================================================================
11  *
12  * KF Particles Finder performance
13  *
14  *====================================================================
15  */
16 
17 #ifndef _KFParticleMatch_h_
18 #define _KFParticleMatch_h_
19 
20 #include "TObject.h"
21 #include <vector>
22 
23 class KFParticleMatch: public TObject
24 {
25  public:
26 
29 
30  Int_t GetMatch() const { return fMatch; }
31  void SetMatch(Int_t i) { fMatch=i; }
32 
33  void SetMatchType(Short_t i) { fMatchType=i; }
34 
35  Bool_t IsCombinatorialBG() const {return (fMatchType==0);}
36  Bool_t IsPhysicsBG() const {return (fMatchType==1);}
37  Bool_t IsRecoParticle() const {return (fMatchType==2);}
38 
39  private:
40  Int_t fMatch;
41  Short_t fMatchType; // 0 - combinatorial BG, 1 - physics BG, 2 - reconstructed particle
42 
44 };
45 
46 
47 struct KFMatchParticles // used for Reco to MC match as well as for MC to Reco
48 {
50 
51  bool IsMatched() const { return ids.size() != 0 || idsMI.size() != 0; };
52  bool IsMatchedWithPdg() const { return ids.size() != 0; };
53  int GetBestMatch() const {
54  if (ids.size() != 0) return ids[0];
55  else if (idsMI.size() != 0) return idsMI[0];
56  else return -1;
57  };
58  int GetBestMatchWithPdg() const {
59  if (ids.size() != 0) return ids[0];
60  else return -1;
61  };
62  std::vector<int> ids;
63  std::vector<int> idsMI; // matched but pdg is different - miss identification
64 };
65 
66 #endif // _KFParticleMatch_h_
std::vector< int > ids
Int_t GetMatch() const
Int_t i
Definition: run_full.C:25
void SetMatchType(Short_t i)
ClassDef(KFParticleMatch, 1)
std::vector< int > idsMI
void SetMatch(Int_t i)
Bool_t IsRecoParticle() const
Bool_t IsPhysicsBG() const
bool IsMatchedWithPdg() const
Bool_t IsCombinatorialBG() const
bool IsMatched() const
int GetBestMatchWithPdg() const
int GetBestMatch() const