PandaRoot
PndSoftTriggerLine.h
Go to the documentation of this file.
1 // ************************************************************************
2 //
3 // Online SoftTrigger TriggerLine class
4 //
5 // K.Goetzen 08/2014
6 //
7 // ************************************************************************
8 
9 #ifndef PndSoftTriggerLine_H
10 #define PndSoftTriggerLine_H 1
11 
12 #include "TString.h"
13 #include <vector>
14 
16 class RhoTuple;
17 class TDatabasePDG;
18 
20  public:
21  // *** Constructors
23  PndSoftTriggerLine(int mode, TString name, TString dec, TString pre, TString ntpname);
24 
25  // *** Destructor
27 
28  // *** general methods
29  void Init(); // has to be called to initialize the trigger line after everything has set properly; creates ntuple and parses Decay pattern
30  void Print();
31 
32  // *** Modifiers
33  void SetModeCode(int mode) { fMode = mode; }
34  void SetName(TString name) { fName = name; }
35  void SetDecay(TString dec)
36  {
37  fDecay = dec;
38  ParseDecayString();
39  }
40  void SetPrefix(TString pre) { fPrefix = pre; }
41  void SetNtupleName(TString ntp) { fNTupleName = ntp; }
42 
43  void SetWriteQA(bool qa = true) { fWriteQA = qa; }
44  void SetTagActive(bool ac = true) { fActive = ac; }
45 
46  void SetQAMassWindow(double min, double max)
47  {
48  fQAMassMin = min;
49  fQAMassMax = max;
50  }
51  void SetMeanSigma(double mean, double sig)
52  {
53  fMean = mean;
54  fSigma = sig;
55  }
56  void SetThreshold(double thr) { fThresh = thr; }
57  void SetTagNSig(double nsig) { fTagNSig = nsig; }
58 
59  void SetNTagged(int n) { fNTagged = n; }
60 
61  // *** Accessors
62  int GetModeCode() { return fMode; }
63  TString GetName() { return fName; }
64  TString GetDecay() { return fDecay; }
65  TString GetPrefix() { return fPrefix; }
66  TString GetNTupleName() { return fNTupleName; }
67 
68  bool GetWriteQA() { return fWriteQA; }
69  bool GetTagActive() { return fActive; }
70  bool GetCC() { return fCC; }
71  bool GetAuxNeeded() { return fAux; }
72 
73  double GetQAMassMin() { return fQAMassMin; }
74  double GetQAMassMax() { return fQAMassMax; }
75  double GetMean() { return fMean; }
76  double GetSigma() { return fSigma; }
77  double GetThreshold() { return fThresh; }
78  double GetTagNSig() { return fTagNSig; }
79 
80  int GetNTagged() { return fNTagged; }
81 
83  {
84  if (fPdgList.size() > 0)
85  return fPdgList[0];
86  return -1;
87  }
88  int GetDaughterPdg(int idx)
89  {
90  if ((int)fPdgList.size() > idx + 1)
91  return fPdgList[idx + 1];
92  return -1;
93  }
94  int GetNDaughters() { return fPdgList.size() - 1; }
95 
96  RhoMassParticleSelector *GetQASelector() { return fQASelector; }
97  RhoMassParticleSelector *GetSelector() { return fSelector; }
98  RhoTuple *GetRhoTuple() { return fNTuple; }
99 
100  private:
101  bool ParseDecayString(); // convert the decay pattern string to a list of pdg codes (fPdgList)
102  void SetQASelector(double m, double w); // set new parameters for the QA selector
103  void SetSelector(double m, double w); // set new parameters for the mass selector
104  int SplitString(TString s, TString delim, TString *toks, int maxtoks); // splits a string into tokens; toks is the return array and has to created by the calling entity
105 
106  int fMode; // the unique mode code
107  TString fName; // name of decay mode (e.g. "D0ToKpi")
108  TString fDecay; // decay pattern (e.g. "D0 -> K- pi+")
109  TString fPrefix; // prefix used in output n-tuple (e.g. "d0")
110  TString fNTupleName; // name of the QA Ntuple
111  bool fWriteQA; // flag for output of QA tuple
112  bool fActive; // flag whether tagging for this mode is cuurently active
113  bool fCC; // flag whether charged conjugation is implied
114  bool fAux; // flag whether auxilliary resonance is present (e.g. D*0 -> D0 [K- pi+] pi0, D0 is aux res.)
115 
116  double fQAMassMin; // mass window minimum for preselection/QA tuple
117  double fQAMassMax; // mass window maximum for preselection/QA tuple
118  double fMean; // mean value for final mass cut (ideally extracted from distribution)
119  double fSigma; // sigma value for final mass cut ('')
120  double fThresh; // threshold sqrt(s) for triggering (e.g. for incl D0, it could be m_D0 + m_charmquark)
121  double fTagNSig; // number of sigmas for final mass selection
122 
123  int fNTagged; // number of tagged candidates (used by the task)
124 
125  RhoMassParticleSelector *fQASelector; // the selector for QA preselection
126  RhoMassParticleSelector *fSelector; // the final inv mass selector
127  RhoTuple *fNTuple; // the QA n-tuple
128  std::vector<int> fPdgList; // container to hold the pdg codes of the decay; [0] holds the mothers code
129 
130  TDatabasePDG *fPdg; // PDG database for lookup
131 };
132 
133 #endif
void SetQAMassWindow(double min, double max)
int GetDaughterPdg(int idx)
RhoMassParticleSelector * GetQASelector()
RhoTuple * GetRhoTuple()
__m128 m
Definition: P4_F32vec4.h:26
void SetNtupleName(TString ntp)
void SetDecay(TString dec)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:25
void SetThreshold(double thr)
void SetTagNSig(double nsig)
void SetModeCode(int mode)
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:24
void SetName(TString name)
void SetPrefix(TString pre)
RhoMassParticleSelector * GetSelector()
void SetTagActive(bool ac=true)
void SetWriteQA(bool qa=true)
void SetMeanSigma(double mean, double sig)