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