FairRoot/PandaRoot
PndSimpleCombiner.h
Go to the documentation of this file.
1 // ************************************************************************
2 //
3 // PANDA Simple Particle Combiner Class
4 //
5 // Offers simple combinatorics
6 //
7 // ************************************************************************
8 //
9 // Parameters:
10 // - fAna : PndAnalysis instance
11 // - decay : decay specification, e.g. "phi -> K+ K-; D_s+ -> phi pi+ cc" (cc indicates charged conjugate; particle used have to be defined beforehand)
12 // - params : configuration parameters, e.g. "mwin=0.5:mwin(phi)=0.2:emin=0.1:pid=Loose:pide=Tight:algo=PidChargedProbability"
13 // - mwin : mass window for all composites
14 // - mwin(X) : mass window for composite 'X'; X (or cc of X) has to appear in decay
15 // - emin : minimum energy threshold for neutrals
16 // - pmin : minimum momentum threshold for charged
17 // - pid : PID criterion ("All","VeryLoose","Loose","Tight","VeryTight","Best") for all species
18 // - pide, pidmu, pidpi, pidk, pidp : PID criterion for specific species
19 // - algo : PID algorithm (e.g. "PidAlgoEmcBayes;PidAlgoDrc" or "PidChargedProbability") for all species
20 // - algoe, ... algop : PID algorithm for specific species
21 //
22 //
23 // K.Goetzen 01/2015
24 //
25 // ************************************************************************
26 
27 #ifndef PndSimpleCombiner_H
28 #define PndSimpleCombiner_H 1
29 
30 #include "TString.h"
31 #include "RhoCandList.h"
32 #include "TDatabasePDG.h"
33 #include <vector>
34 #include <map>
35 
36 #define MAXLISTS 30
37 
38 class PndAnalysis;
42 
43 typedef std::vector<TString> StringList;
44 
46 {
47  int mpdg; // mother(this) pdg code
48  int midx; // list index
49  int ndaug; // number of daughters
50  bool daucc; // do daughters have a cc?
51  double mwin; // mass selection window width
52  double mwinlo; // selection window low edge
53  double mwinhi; // selection window high edge
54  RhoMassParticleSelector *msel; // mass selector
55  std::vector<int> dpdg; // pdg codes of daughters
56  std::vector<int> didx; // list indeces of daughters
57 };
58 
60 {
61 public:
62  // *** Constructors
63  PndSimpleCombiner(PndAnalysis *fAna, TString decay, TString params="", double Ecm=0);
64 
65  // *** Destructor
67 
68  // *** general methods
69  void SetVerbose(int verb=1) {fVerbose = verb;}
70  void Combine();
71  void Print();
72  void SetPid(TString crit="", TString algo="");
73  void SetPidElectron(TString crit="", TString algo="");
74  void SetPidMuon(TString crit="", TString algo="") ;
75  void SetPidPion(TString crit="", TString algo="") ;
76  void SetPidKaon(TString crit="", TString algo="") ;
77  void SetPidProton(TString crit="", TString algo="") ;
78 
79  int GetNLists() {return fNLists-11;}
80  bool GetList(RhoCandList &l, TString comp);
81  bool GetList(RhoCandList &l, int pdg);
82  bool GetListN(RhoCandList &l, int idx);
83 
84 private:
85  void InitDecayInfo(SCDecayInfo &info, int pdg, int idx);
86  void FillGenericLists(); // fills generic lists (e+, e-, ... gamma) which are needed for combinatorics
87  int CombineList(RhoCandList &l, int mpdg, std::vector<int> &idx); // do combinatorics for one mode
88  int SplitString(TString s, TString delim, StringList &toks);// routine to split a string in pieces
89  bool ParseDecay(TString decay); // parse the combinatorics setup
90  bool ParseParams(TString params);
91  bool CCInvariant(std::vector<int> &vpdg); // is FS its own charged conjugate?
92  bool CCInvariant(int pdg) {return (pdg == AntiPdg(pdg));} // is pdg = pdg of anti-particle
93  int AntiPdg(int pdg); // pdg of anti-particle
94 
98  int fNLists;
100  int fVerbose;
101  double fEmin;
102  double fPmin;
103  double fEcm;
104 
107 
108  std::map<int,int> fPdgIdxMap;
109  std::map<int,int> fIdxPdgMap;
110 
111  std::map<int,TString> fIdxListNameMap;
112  std::map<int,TString> fIdxPidCritMap;
113  std::map<int,TString> fIdxPidAlgoMap;
114 
115  std::vector<SCDecayInfo> fDecayInfoArray;
116 };
117 
118 #endif
RhoMomentumParticleSelector * fPSel
PndAnalysis * fAnalysis
#define MAXLISTS
void SetPidPion(TString crit="", TString algo="")
void SetPidElectron(TString crit="", TString algo="")
std::map< int, TString > fIdxPidAlgoMap
std::map< int, TString > fIdxPidCritMap
TLorentzVector s
Definition: Pnd2DStar.C:50
void SetPidProton(TString crit="", TString algo="")
std::vector< SCDecayInfo > fDecayInfoArray
bool GetListN(RhoCandList &l, int idx)
std::map< int, int > fIdxPdgMap
RhoCandList fList[MAXLISTS]
std::map< int, int > fPdgIdxMap
int SplitString(TString s, TString delim, StringList &toks)
std::vector< int > dpdg
int idx[MAX]
Definition: autocutx.C:38
std::vector< TString > StringList
int CombineList(RhoCandList &l, int mpdg, std::vector< int > &idx)
PndSimpleCombiner(PndAnalysis *fAna, TString decay, TString params="", double Ecm=0)
std::vector< TString > StringList
bool ParseDecay(TString decay)
void InitDecayInfo(SCDecayInfo &info, int pdg, int idx)
RhoEnergyParticleSelector * fESel
bool CCInvariant(std::vector< int > &vpdg)
void SetPidMuon(TString crit="", TString algo="")
std::vector< int > didx
bool CCInvariant(int pdg)
RhoMassParticleSelector * msel
void SetVerbose(int verb=1)
bool GetList(RhoCandList &l, TString comp)
void SetPidKaon(TString crit="", TString algo="")
void SetPid(TString crit="", TString algo="")
std::map< int, TString > fIdxListNameMap
bool ParseParams(TString params)