CbmRoot
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 public:
27 
28  Int_t GetMatch() const { return fMatch; }
29  void SetMatch(Int_t i) { fMatch = i; }
30 
31  void SetMatchType(Short_t i) { fMatchType = i; }
32 
33  Bool_t IsCombinatorialBG() const { return (fMatchType == 0); }
34  Bool_t IsPhysicsBG() const { return (fMatchType == 1); }
35  Bool_t IsRecoParticle() const { return (fMatchType == 2); }
36 
37 private:
38  Int_t fMatch;
39  Short_t
40  fMatchType; // 0 - combinatorial BG, 1 - physics BG, 2 - reconstructed particle
41 
43 };
44 
45 
46 struct KFMatchParticles // used for Reco to MC match as well as for MC to Reco
47 {
48  KFMatchParticles() : ids(), idsMI() {};
49 
50  bool IsMatched() const { return ids.size() != 0 || idsMI.size() != 0; };
51  bool IsMatchedWithPdg() const { return ids.size() != 0; };
52  int GetBestMatch() const {
53  if (ids.size() != 0)
54  return ids[0];
55  else if (idsMI.size() != 0)
56  return idsMI[0];
57  else
58  return -1;
59  };
60  int GetBestMatchWithPdg() const {
61  if (ids.size() != 0)
62  return ids[0];
63  else
64  return -1;
65  };
66  std::vector<int> ids;
67  std::vector<int> idsMI; // matched but pdg is different - miss identification
68 };
69 
70 #endif // _KFParticleMatch_h_
KFParticleMatch::IsCombinatorialBG
Bool_t IsCombinatorialBG() const
Definition: KFParticleMatch.h:33
KFParticleMatch
Definition: KFParticleMatch.h:23
KFParticleMatch::IsRecoParticle
Bool_t IsRecoParticle() const
Definition: KFParticleMatch.h:35
KFParticleMatch::SetMatch
void SetMatch(Int_t i)
Definition: KFParticleMatch.h:29
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
KFMatchParticles::KFMatchParticles
KFMatchParticles()
Definition: KFParticleMatch.h:48
KFParticleMatch::ClassDef
ClassDef(KFParticleMatch, 1)
KFMatchParticles::idsMI
std::vector< int > idsMI
Definition: KFParticleMatch.h:67
KFParticleMatch::KFParticleMatch
KFParticleMatch()
Definition: KFParticleMatch.cxx:20
KFMatchParticles::GetBestMatchWithPdg
int GetBestMatchWithPdg() const
Definition: KFParticleMatch.h:60
KFParticleMatch::fMatch
Int_t fMatch
Definition: KFParticleMatch.h:38
KFParticleMatch::~KFParticleMatch
~KFParticleMatch()
Definition: KFParticleMatch.cxx:22
KFParticleMatch::GetMatch
Int_t GetMatch() const
Definition: KFParticleMatch.h:28
KFParticleMatch::IsPhysicsBG
Bool_t IsPhysicsBG() const
Definition: KFParticleMatch.h:34
KFParticleMatch::fMatchType
Short_t fMatchType
Definition: KFParticleMatch.h:40
KFMatchParticles::IsMatchedWithPdg
bool IsMatchedWithPdg() const
Definition: KFParticleMatch.h:51
KFMatchParticles::GetBestMatch
int GetBestMatch() const
Definition: KFParticleMatch.h:52
KFMatchParticles
Definition: KFParticleMatch.h:47
KFMatchParticles::ids
std::vector< int > ids
Definition: KFParticleMatch.h:65
KFParticleMatch::SetMatchType
void SetMatchType(Short_t i)
Definition: KFParticleMatch.h:31
KFMatchParticles::IsMatched
bool IsMatched() const
Definition: KFParticleMatch.h:50