FairRoot/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 {
21 public:
22  // *** Constructors
25 
26  // *** Destructor
28 
29  // *** general methods
30  void Init(); // has to be called to initialize the trigger line after everything has set properly; creates ntuple and parses Decay pattern
31  void Print();
32 
33  // *** Modifiers
34  void SetModeCode(int mode) {fMode = mode;}
35  void SetName(TString name) {fName = name;}
36  void SetDecay(TString dec) {fDecay = dec; ParseDecayString();}
37  void SetPrefix(TString pre) {fPrefix = pre;}
38  void SetNtupleName(TString ntp) {fNTupleName = ntp;}
39 
40  void SetWriteQA(bool qa=true) {fWriteQA = qa;}
41  void SetTagActive(bool ac=true) {fActive = ac;}
42 
43  void SetQAMassWindow(double min, double max) {fQAMassMin = min; fQAMassMax = max; }
44  void SetMeanSigma(double mean, double sig) {fMean = mean; fSigma = sig; }
45  void SetThreshold(double thr) {fThresh = thr;}
46  void SetTagNSig(double nsig) {fTagNSig = nsig; }
47 
48  void SetNTagged(int n) {fNTagged = n; }
49 
50  // *** Accessors
51  int GetModeCode() {return fMode;}
52  TString GetName() {return fName;}
53  TString GetDecay() {return fDecay;}
56 
57  bool GetWriteQA() {return fWriteQA;}
58  bool GetTagActive() {return fActive;}
59  bool GetCC() {return fCC;}
60  bool GetAuxNeeded() {return fAux;}
61 
62  double GetQAMassMin() {return fQAMassMin;}
63  double GetQAMassMax() {return fQAMassMax;}
64  double GetMean() {return fMean;}
65  double GetSigma() {return fSigma;}
66  double GetThreshold() {return fThresh;}
67  double GetTagNSig() {return fTagNSig;}
68 
69  int GetNTagged() {return fNTagged;}
70 
71  int GetMotherPdg() {if (fPdgList.size()>0) return fPdgList[0]; return -1;}
72  int GetDaughterPdg(int idx) {if ((int)fPdgList.size()>idx+1) return fPdgList[idx+1]; return -1;}
73  int GetNDaughters() {return fPdgList.size()-1;}
74 
78 
79 
80 private:
81  bool ParseDecayString(); // convert the decay pattern string to a list of pdg codes (fPdgList)
82  void SetQASelector(double m, double w); // set new parameters for the QA selector
83  void SetSelector(double m, double w); // set new parameters for the mass selector
84  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
85 
86  int fMode; // the unique mode code
87  TString fName; // name of decay mode (e.g. "D0ToKpi")
88  TString fDecay; // decay pattern (e.g. "D0 -> K- pi+")
89  TString fPrefix; // prefix used in output n-tuple (e.g. "d0")
90  TString fNTupleName; // name of the QA Ntuple
91  bool fWriteQA; // flag for output of QA tuple
92  bool fActive; // flag whether tagging for this mode is cuurently active
93  bool fCC; // flag whether charged conjugation is implied
94  bool fAux; // flag whether auxilliary resonance is present (e.g. D*0 -> D0 [K- pi+] pi0, D0 is aux res.)
95 
96  double fQAMassMin; // mass window minimum for preselection/QA tuple
97  double fQAMassMax; // mass window maximum for preselection/QA tuple
98  double fMean; // mean value for final mass cut (ideally extracted from distribution)
99  double fSigma; // sigma value for final mass cut ('')
100  double fThresh; // threshold sqrt(s) for triggering (e.g. for incl D0, it could be m_D0 + m_charmquark)
101  double fTagNSig; // number of sigmas for final mass selection
102 
103  int fNTagged; // number of tagged candidates (used by the task)
104 
105  RhoMassParticleSelector *fQASelector; // the selector for QA preselection
106  RhoMassParticleSelector *fSelector; // the final inv mass selector
107  RhoTuple *fNTuple; // the QA n-tuple
108  std::vector<int> fPdgList; // container to hold the pdg codes of the decay; [0] holds the mothers code
109 
110  TDatabasePDG *fPdg; // PDG database for lookup
111 };
112 
113 #endif
void SetQAMassWindow(double min, double max)
int GetDaughterPdg(int idx)
RhoMassParticleSelector * GetQASelector()
RhoTuple * GetRhoTuple()
__m128 m
Definition: P4_F32vec4.h:28
void SetSelector(double m, double w)
TLorentzVector s
Definition: Pnd2DStar.C:50
int n
RhoMassParticleSelector * fQASelector
void SetNtupleName(TString ntp)
void SetDecay(TString dec)
TString ntpname[10]
Definition: full_core_ntp.C:43
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:26
void SetThreshold(double thr)
Int_t mode
Definition: autocutx.C:47
int idx[MAX]
Definition: autocutx.C:38
void SetTagNSig(double nsig)
std::vector< int > fPdgList
RhoMassParticleSelector * fSelector
int SplitString(TString s, TString delim, TString *toks, int maxtoks)
void SetModeCode(int mode)
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:25
TString name
int nsig
Definition: toy_core.C:46
void SetName(TString name)
void SetPrefix(TString pre)
Double_t mean[nsteps]
Definition: dedx_bands.C:65
RhoMassParticleSelector * GetSelector()
void SetQASelector(double m, double w)
void SetTagActive(bool ac=true)
void SetWriteQA(bool qa=true)
void SetMeanSigma(double mean, double sig)