PandaRoot
PndParticleRequirements.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndParticleRequirements header file -----
3 // ----- Created 16/09/19 by T.Stockmann -----
4 // -------------------------------------------------------------------------
5 
12 #pragma once
13 
14 #include "TVector3.h"
15 #include "TVector2.h"
16 #include "TList.h"
17 
18 #include "PndMCTrackInfo.h"
19 #include <iostream>
20 #include <string>
21 
23 
24  public:
27 
29  virtual ~PndParticleRequirements();
30 
32  void Print(std::ostream &out = std::cout);
33  std::string ShortRequirementsAsString();
34 
35  void Init();
36 
37  friend std::ostream &operator<<(std::ostream &out, PndParticleRequirements &track)
38  {
39  track.Print(out);
40  return out;
41  }
42 
45  void SetMinDecayTime(Double_t val) { fMinDecayTime = val; }
46  void SetMaxDecayTime(Double_t val) { fMaxDecayTime = val; }
47 
48  void SetPIDMothers(std::vector<int> val) { fPIDMothers = val; }
49  void SetPIDDaughters(std::vector<int> val) { fPIDDaughters = val; }
50  void SetPID(int val) { fPID = val; }
51  void SetStage(int val) { fStage = val; }
52  void SetMinTrackingPoints(int val) { fMinTrackingPoints = val; }
53  void AddMaxMomentumDifference(int branchType, TVector2 val) { fMomentumDifference[branchType] = val; }
54  void AddTypeRequirements(int branchType, int howOftenSeen) { fTypeCount[branchType] = howOftenSeen; }
55  void SetCheckTracking(TString barrelPrefix, TString forwardPrefix, TString particlePropagatorName);
56  void SetCheckPid(TString algorithms, double minProb)
57  {
58  fPidAlgorithms = algorithms;
59  fMinPidProb = minProb;
60  fCheckPid = true;
61  }
62 
63  void SetCheckNeutral();
64  int GetNRequirements();
65 
66  int GetPdgCode() const { return fPID; };
67  std::vector<int> GetMothers() const { return fPIDMothers; }
68  std::vector<int> GetDaughters() const { return fPIDDaughters; }
69  int GetStage() const { return fStage; }
70  std::map<int, TVector2> GetMomentumDifference() const { return fMomentumDifference; }
71  std::map<int, int> GetTypeCount() const { return fTypeCount; }
72  Double_t GetMinDecayTime() const { return fMinDecayTime; }
73  Double_t GetMaxDecayTime() const { return fMaxDecayTime; }
74  int GetMinTrackingPoints() const { return fMinTrackingPoints; }
75  bool GetCheckTracking() const { return fCheckTracking; }
76  bool GetCheckNeutral() const { return fCheckNeutral; }
77  bool GetCheckPid() const { return fCheckPid; }
79 
80  std::vector<int> CheckTrack(PndMCTrackInfo &info);
81  void Found() { fFound = true; }
82  void ClearFound() { fFound = false; }
83  bool GetFound() const { return fFound; }
84 
85  protected:
86  int CheckMothers(std::vector<int> mothers);
87  int CheckDaughters(std::vector<int> daughters);
88  int CheckStage(int stage);
89  std::vector<int> CheckTracking(PndMCTrackInfo &info);
90  std::vector<int> CheckTypeCount(PndMCTrackInfo &info);
91  std::vector<int> CheckMomentum(PndMCTrackInfo &info);
92  int CheckPid(PndMCTrackInfo &info);
93  int CheckOverall(std::vector<int> results);
94  void InitTracking();
95  void InitPid();
96  void InitNeutral();
97 
98  private:
99  Double_t fMinDecayTime;
100  Double_t fMaxDecayTime;
101  std::vector<int> fPIDMothers;
102  std::vector<int> fPIDDaughters;
103  int fPID;
104  Int_t fStage;
105  std::map<int, TVector2> fMomentumDifference; //< difference between p transversal and p longitudinal between reco track and MC track
106  std::map<int, int> fTypeCount;
107  TString fBarrelTrackerPrefix;
108  TString fForwardTrackerPrefix;
109  TString fPropagatorParticle;
110  TString fPidAlgorithms;
111  std::vector<int> fCheckBranchesBarrel;
112  std::vector<int> fCheckBranchesForward;
113  int fCheckBranchChargedCand; // branchID of ChargedCand
114  int fMinTrackingPoints;
115  std::vector<TVector2> fMomentumResolution;
116  std::vector<int> fPidBranches; //< list of branches taking into account for PID determination
117  double fMinPidProb; //< required minimum pid probability
118 
119  bool fFound;
120  bool fCheckTracking;
121  bool fCheckNeutral;
122  bool fCheckPoints;
123  bool fCheckPid;
124 
125  ClassDef(PndParticleRequirements, 1);
126 };
127 
int CheckPid(PndMCTrackInfo &info)
void AddTypeRequirements(int branchType, int howOftenSeen)
int CheckStage(int stage)
std::vector< int > CheckTrack(PndMCTrackInfo &info)
void SetMinDecayTime(Double_t val)
int CheckDaughters(std::vector< int > daughters)
PndPidProbability GetPidProbability(PndMCTrackInfo &info)
void SetPIDDaughters(std::vector< int > val)
std::map< int, TVector2 > GetMomentumDifference() const
void SetCheckPid(TString algorithms, double minProb)
std::vector< int > CheckTracking(PndMCTrackInfo &info)
void SetMaxDecayTime(Double_t val)
void SetPIDMothers(std::vector< int > val)
std::string ShortRequirementsAsString()
void Print(std::ostream &out=std::cout)
void AddMaxMomentumDifference(int branchType, TVector2 val)
std::vector< int > GetMothers() const
int CheckOverall(std::vector< int > results)
friend std::ostream & operator<<(std::ostream &out, PndParticleRequirements &track)
std::vector< int > CheckTypeCount(PndMCTrackInfo &info)
std::vector< int > GetDaughters() const
int CheckMothers(std::vector< int > mothers)
std::map< int, int > GetTypeCount() const
void SetCheckTracking(TString barrelPrefix, TString forwardPrefix, TString particlePropagatorName)
std::vector< int > CheckMomentum(PndMCTrackInfo &info)
virtual ~PndParticleRequirements()