CbmRoot
Loading...
Searching...
No Matches
PairAnalysisSignalMC.h
Go to the documentation of this file.
1#ifndef PAIRANALYSISSIGNALMC_H
2#define PAIRANALYSISSIGNALMC_H
3
4/* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7#include <TMCProcess.h>
8#include <TNamed.h>
9#include <TSpline.h>
10//#include <TGraph.h>
11//#include <TF1.h>
12
13
14//__________________________________________________________________
15class PairAnalysisSignalMC : public TNamed {
16
17public:
18 enum class EBranchRelation
19 {
20 kUndefined = 0,
21 kSame,
23 };
34 enum class EDalitz
35 {
36 kWhoCares = 0,
39 };
71
73 PairAnalysisSignalMC(const Char_t* name, const Char_t* title);
75 virtual ~PairAnalysisSignalMC();
76
77 void SetLegPDGs(Int_t pdg1, Int_t pdg2, Bool_t exclude1 = kFALSE, Bool_t exclude2 = kFALSE)
78 {
79 fLeg1 = pdg1;
80 fLeg2 = pdg2;
81 fLeg1Exclude = exclude1;
82 fLeg2Exclude = exclude2;
83 }
84 void SetMotherPDGs(Int_t pdg1, Int_t pdg2, Bool_t exclude1 = kFALSE, Bool_t exclude2 = kFALSE)
85 {
86 fMother1 = pdg1;
87 fMother2 = pdg2;
88 fMother1Exclude = exclude1;
89 fMother2Exclude = exclude2;
90 }
91 void SetGrandMotherPDGs(Int_t pdg1, Int_t pdg2, Bool_t exclude1 = kFALSE, Bool_t exclude2 = kFALSE)
92 {
93 fGrandMother1 = pdg1;
94 fGrandMother2 = pdg2;
95 fGrandMother1Exclude = exclude1;
96 fGrandMother2Exclude = exclude2;
97 }
98 void SetGreatGrandMotherPDGs(Int_t pdg1, Int_t pdg2, Bool_t exclude1 = kFALSE, Bool_t exclude2 = kFALSE)
99 {
100 fGreatGrandMother1 = pdg1;
101 fGreatGrandMother2 = pdg2;
102 fGreatGrandMother1Exclude = exclude1;
103 fGreatGrandMother2Exclude = exclude2;
104 }
106 {
107 fLeg1Source = s1;
108 fLeg2Source = s2;
109 }
111 {
112 fMother1Source = s1;
113 fMother2Source = s2;
114 }
120 void SetCheckBothChargesLegs(Bool_t flag1, Bool_t flag2)
121 {
122 fCheckBothChargesLeg1 = flag1;
123 fCheckBothChargesLeg2 = flag2;
124 }
125 void SetCheckBothChargesMothers(Bool_t flag1, Bool_t flag2)
126 {
129 }
130 void SetCheckBothChargesGrandMothers(Bool_t flag1, Bool_t flag2)
131 {
134 }
136 void SetGEANTProcess(TMCProcess processID, Bool_t check = kTRUE)
137 {
138 fGEANTProcess = processID;
139 fCheckGEANTProcess = check;
140 }
141 // void SetWeight(TSpline3 *wghts, UInt_t var) { if(&fWeights) delete &fWeights; fWeights = *wghts; fType=var; }
142 void SetWeight(TSpline3* wghts, UInt_t var)
143 {
144 if (fWeights) delete fWeights;
145 fWeights = wghts;
146 fType = var;
147 }
148 void SetWeight(Double_t wght) { fWeight = wght; }
149 void SetFillPureMCStep(Bool_t fill = kTRUE) { fFillPureMCStep = fill; }
150 void SetIsSingleParticle(Bool_t fill = kTRUE) { fIsSingleParticle = fill; }
151
152 Int_t GetLegPDG(Int_t branch) const { return (branch == 1 ? fLeg1 : fLeg2); }
153 Int_t GetMotherPDG(Int_t branch) const { return (branch == 1 ? fMother1 : fMother2); }
154 Int_t GetGrandMotherPDG(Int_t branch) const { return (branch == 1 ? fGrandMother1 : fGrandMother2); }
155 Int_t GetGreatGrandMotherPDG(Int_t branch) const { return (branch == 1 ? fGreatGrandMother1 : fGreatGrandMother2); }
156 Bool_t GetLegPDGexclude(Int_t branch) const { return (branch == 1 ? fLeg1Exclude : fLeg2Exclude); }
157 Bool_t GetMotherPDGexclude(Int_t branch) const { return (branch == 1 ? fMother1Exclude : fMother2Exclude); }
158 Bool_t GetGrandMotherPDGexclude(Int_t branch) const
159 {
160 return (branch == 1 ? fGrandMother1Exclude : fGrandMother2Exclude);
161 }
162 Bool_t GetGreatGrandMotherPDGexclude(Int_t branch) const
163 {
165 }
166 ESource GetLegSource(Int_t branch) const { return (branch == 1 ? fLeg1Source : fLeg2Source); }
167 ESource GetMotherSource(Int_t branch) const { return (branch == 1 ? fMother1Source : fMother2Source); }
168 ESource GetGrandMotherSource(Int_t branch) const { return (branch == 1 ? fGrandMother1Source : fGrandMother2Source); }
169 Bool_t GetCheckBothChargesLegs(Int_t branch) const
170 {
171 return (branch == 1 ? fCheckBothChargesLeg1 : fCheckBothChargesLeg2);
172 }
173 Bool_t GetCheckBothChargesMothers(Int_t branch) const
174 {
175 return (branch == 1 ? fCheckBothChargesMother1 : fCheckBothChargesMother2);
176 }
177 Bool_t GetCheckBothChargesGrandMothers(Int_t branch) const
178 {
180 }
181 Bool_t GetCheckBothChargesGreatGrandMothers(Int_t branch) const
182 {
184 }
186 TMCProcess GetGEANTProcess() const { return fGEANTProcess; }
187 Bool_t GetCheckGEANTProcess() const { return fCheckGEANTProcess; }
188 Double_t GetWeight() const { return fWeight; }
189 // Double_t GetWeight(Double_t *const values) const {return (&fWeights ? fWeights.Eval(values[fType]) : fWeight); }
190 // Double_t GetWeight(Double_t *const values) const {return (fType>0 ? fWeights->Eval(values[fType]) : fWeight); }
191 // TODO: workaround
192 Double_t GetWeight(Double_t* const values) const; // {return (fType>0 ? fWeights->Eval(values[fType]) : fWeight); }
193 Bool_t GetFillPureMCStep() const { return fFillPureMCStep; }
194 Bool_t IsSingleParticle() const { return fIsSingleParticle; }
195
196 void SetIsDalitz(EDalitz dal, Int_t pdg = 0)
197 {
198 fDalitz = dal;
199 fDalitzPdg = pdg;
200 }
201 EDalitz GetDalitz() const { return fDalitz; }
202 Int_t GetDalitzPdg() const { return fDalitzPdg; }
203
204 static const char* fgkSignals[static_cast<int>(EDefinedSignal::kNSignals)][2]; //default signal names+titles
205
206 void Print(Option_t* option = "") const;
207
208private:
209 // PDG codes for legs, mothers and grand-mothers
210 Int_t fLeg1 = 0; // leg 1 PDG
211 Int_t fLeg2 = 0; // leg 2 PDG
212 Int_t fMother1 = 0; // mother 1 PDG
213 Int_t fMother2 = 0; // mother 2 PDG
214 Int_t fGrandMother1 = 0; // grandmother 1 PDG
215 Int_t fGrandMother2 = 0; // grandmother 2 PDG
216 Int_t fGreatGrandMother1 = 0; // great grandmother 1 PDG
217 Int_t fGreatGrandMother2 = 0; // great grandmother 2 PDG
218
219 // Toggle on/off the use of the PDG codes as inclusion or exclusion
220 // Example: if fLeg1=211 and fLeg1Exclude=kTRUE than all codes will be accepted for leg 1 with
221 // the exception of 211 (pions)
222 Bool_t fLeg1Exclude = kFALSE; // leg 1
223 Bool_t fLeg2Exclude = kFALSE; // leg 2
224 Bool_t fMother1Exclude = kFALSE; // mother 1
225 Bool_t fMother2Exclude = kFALSE; // mother 2
226 Bool_t fGrandMother1Exclude = kFALSE; // grandmother 1
227 Bool_t fGrandMother2Exclude = kFALSE; // grandmother 2
228 Bool_t fGreatGrandMother1Exclude = kFALSE; // great grandmother 1
229 Bool_t fGreatGrandMother2Exclude = kFALSE; // great grandmother 2
230
231 // Particle sources
238
239 // Flaggs whether to check both charges of a given PDG code
240 Bool_t fCheckBothChargesLeg1 = kFALSE; // check both charges of the legs pdg
241 Bool_t fCheckBothChargesLeg2 = kFALSE; // leg2
242 Bool_t fCheckBothChargesMother1 = kFALSE; // mother 1
243 Bool_t fCheckBothChargesMother2 = kFALSE; // mother 2
244 Bool_t fCheckBothChargesGrandMother1 = kFALSE; // grand mother 1
245 Bool_t fCheckBothChargesGrandMother2 = kFALSE; // grand mother 2
246 Bool_t fCheckBothChargesGreatGrandMother1 = kFALSE; // great grand mother 1
247 Bool_t fCheckBothChargesGreatGrandMother2 = kFALSE; // great grand mother 2
248 Bool_t fCheckGEANTProcess = kFALSE; // GEANT process
249
250 EBranchRelation fMothersRelation = EBranchRelation::kUndefined; // mother 1&2 relation (same, different or whatever)
251 TMCProcess fGEANTProcess = kPPrimary; // GEANT process ID (see roots TMCProcess)
252 Double_t fWeight = 1.; // weighting factor
253 TSpline3* fWeights = NULL; //> weighting factors
254 UInt_t fType = 0; // lookup variable for weighting factors
255
256 // dalitz decays
257 EDalitz fDalitz = EDalitz::kWhoCares; // check for dalitz decay
258 Int_t fDalitzPdg = 0; // dalitz PDG
259
260 Bool_t fFillPureMCStep = kFALSE; // check and fill the pure MC step
261 Bool_t fIsSingleParticle = kFALSE; // single particle MC signal such as e,pi,K,p
262
265
266 ClassDef(PairAnalysisSignalMC, 5); // MC signal defintions
267};
268
269#endif
void Print(Option_t *option="") const
void SetWeight(Double_t wght)
void SetCheckBothChargesGrandMothers(Bool_t flag1, Bool_t flag2)
static const char * fgkSignals[static_cast< int >(EDefinedSignal::kNSignals)][2]
void SetMothersRelation(EBranchRelation relation)
void SetIsSingleParticle(Bool_t fill=kTRUE)
void SetGrandMotherPDGs(Int_t pdg1, Int_t pdg2, Bool_t exclude1=kFALSE, Bool_t exclude2=kFALSE)
Bool_t GetMotherPDGexclude(Int_t branch) const
void SetGrandMotherSources(ESource s1, ESource s2)
Bool_t GetCheckBothChargesGrandMothers(Int_t branch) const
void SetGreatGrandMotherPDGs(Int_t pdg1, Int_t pdg2, Bool_t exclude1=kFALSE, Bool_t exclude2=kFALSE)
void SetFillPureMCStep(Bool_t fill=kTRUE)
void SetLegPDGs(Int_t pdg1, Int_t pdg2, Bool_t exclude1=kFALSE, Bool_t exclude2=kFALSE)
void SetWeight(TSpline3 *wghts, UInt_t var)
Bool_t GetLegPDGexclude(Int_t branch) const
EBranchRelation GetMothersRelation() const
PairAnalysisSignalMC(const PairAnalysisSignalMC &c)
void SetLegSources(ESource s1, ESource s2)
PairAnalysisSignalMC & operator=(const PairAnalysisSignalMC &c)
Bool_t GetCheckBothChargesGreatGrandMothers(Int_t branch) const
void SetMotherSources(ESource s1, ESource s2)
void SetMotherPDGs(Int_t pdg1, Int_t pdg2, Bool_t exclude1=kFALSE, Bool_t exclude2=kFALSE)
Bool_t GetCheckBothChargesLegs(Int_t branch) const
ClassDef(PairAnalysisSignalMC, 5)
Bool_t GetCheckBothChargesMothers(Int_t branch) const
void SetGEANTProcess(TMCProcess processID, Bool_t check=kTRUE)
Bool_t GetCheckGEANTProcess() const
Int_t GetGrandMotherPDG(Int_t branch) const
Bool_t GetGrandMotherPDGexclude(Int_t branch) const
Int_t GetGreatGrandMotherPDG(Int_t branch) const
void SetCheckBothChargesMothers(Bool_t flag1, Bool_t flag2)
Int_t GetMotherPDG(Int_t branch) const
ESource GetGrandMotherSource(Int_t branch) const
void SetCheckBothChargesLegs(Bool_t flag1, Bool_t flag2)
ESource GetLegSource(Int_t branch) const
EBranchRelation fMothersRelation
Int_t GetLegPDG(Int_t branch) const
Bool_t GetGreatGrandMotherPDGexclude(Int_t branch) const
void SetIsDalitz(EDalitz dal, Int_t pdg=0)
TMCProcess GetGEANTProcess() const
ESource GetMotherSource(Int_t branch) const