CbmRoot
Loading...
Searching...
No Matches
PairAnalysisSignalMC.cxx
Go to the documentation of this file.
1
2// MC signal description container
3//
4// Authors:
5// * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
6// Julian Book <Julian.Book@cern.ch>
7/*
8 A container to describe the decay of a two (three) body process
9
10 TODO: update and add default signals, single particle signals, geantid!
11
12 Monte Carlo signal definition for a two body decay:
13 Leg #1 <-- Mother #1 <-- Grandmother #1 <-- GreatGrandmother #1
14 |
15 ( Leg #2 <-- Mother #2 <-- Grandmother #2 <-- GreatGrandmother #2 )
16
17 For every leg, mother, grand-mother or great grand-mother a PDG code and a source can be specified.
18 SetLegPDGs, SetMotherPDGs, SetGrandMotherPDGs, SetGreatGrandMotherPDGs
19
20 1.) For the PDG codes, the PYTHIA standard is used.
21 A few non-existent PYTHIA codes are used to select more than one PYTHIA code. All these are described below
22 and implemented in PairAnalysisMC::ComparePDG() function:
23 0 - default, accepts all PYTHIA codes
24 100 - light unflavoured mesons in the code range 100-199
25 200 - --"-- 200-299
26 300 - strange mesons in the code range 300-399
27 400 - charmed mesons in the code range 400-499
28 401 - open charm mesons (all D and D* mesons) 400-439
29 402 - open charm mesons and baryons together 400-439, 4000-4399
30 403 - all charm hadrons (mesons and baryons) 400-499, 4000-4999
31 500 - beauty mesons in the code range 500-599
32 501 - open beauty mesons 500-549
33 502 - open beauty mesons and baryons 500-549, 5000-5499
34 503 - all beauty hadrons 500-599, 5000-5999
35 902 - all open charm open beauty mesons+baryons 400-439, 500-549, 4000-4399, 5000-5499
36 1000 - light unflavoured baryons in the code range 1000-1999
37 2000 - --"-- 2000-2999
38 3000 - strange baryons in the code range 3000-3999
39 4000 - charmed baryons in the code range 4000-4999
40 4001 - open charm baryons 4000-4399
41 5000 - beauty baryons in the code range 5000-5999
42 5001 - open beauty baryons 5000-5499
43
44 2.) If the exclusion flags are turned ON then the PDG codes required and the conventional codes described above
45 are used to exclude the selected particles.
46
47 3.) If the selection of both charges is switched ON then the PDG codes act on both particles and anti-particles.
48 SetCheckBothChargesLegs, SetCheckBothChargesMothers, SetCheckBothChargesGrandMothers
49
50 4.) Particles sources implemented:
51 TOADD: geant process id via TMCProcess
52
53 5.) The 2 legs can originate from the same or different mother particles. This can be specified via
54 the SetMothersRelation() method call.
55
56 6.) The filling of the pure MC step can be switched on using SetFillPureMCStep() method call. This should be used
57 with care since at the pure MC information level there is no cut applied and for abundant particles the
58 combinatorics can be very high.
59
60 */
61// //
63
65
66#include "PairAnalysisHelper.h"
67
69
70 const char* PairAnalysisSignalMC::fgkSignals[static_cast<int>(EDefinedSignal::kNSignals)][2] =
71 { //default signal names+titles
72 {"InclJpsi", "J/#psi (incl.)"},
73 {"NonRadJpsi", "J/#psi"},
74 {"RadJpsi", "J/#psi (rad.)"},
75 {"Psi2S", "#psi(2S)"},
76 {"Conversion", "#gamma#rightarrow e^{+}e^{-}"},
77 {"Rho0", "#rho^{0}"},
78 {"OmegaDalitz", "#omega_{Dalitz}"},
79 {"Omega", "#omega"},
80 {"Phi", "#phi"},
81 {"EtaDalitz", "#eta_{Dalitz}"},
82 {"Eta", "#eta"},
83 {"Pi0Dalitz", "#pi^{0}_{Dalitz}"},
84 {"Pi0Gamma", "#pi^{0}"},
85 {"Pi0", "#pi^{0}"},
86 {"K0Short", "K^{0}_{S}"},
87 {"Lambda", "#Lambda"},
88 {"InclElePM", "e^{+}e^{-} (incl.)"},
89 {"DeltaElectron", "#delta rays"},
90 {"PrimElectron", "e (prim.)"},
91 {"PrimMuon", "#mu (prim.)"},
92 {"PrimPion", "#pi (prim.)"},
93 {"PrimKaon", "K (prim.)"},
94 {"PrimProton", "p (prim.)"},
95 {"Deuteron", "d"},
96 {"Triton", "t"},
97 {"Helion", "^{3}He"},
98 {"Alpha", "^{4}He"}};
99
100//_________________________________________________________________________
101PairAnalysisSignalMC::PairAnalysisSignalMC() : PairAnalysisSignalMC("PairAnalysisSignalMC", "PairAnalysisSignalMC")
102{
103
104 //
105 // Default constructor
106 //
107}
108
109
110//_________________________________________________________________________
111PairAnalysisSignalMC::PairAnalysisSignalMC(const Char_t* name, const Char_t* title) : TNamed(name, title)
112{
113
114 //
115 // Named constructor
116 //
117}
118
119//_________________________________________________________________________
121{
122
123 //
124 // Constructor with default signals
125 //
126 TString title = "";
127 switch (defaultSignal) {
129 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
130 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
131 fLeg1 = 11;
132 fLeg2 = -11;
133 fMother1 = 443;
134 fMother2 = 443;
136 break;
138 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
139 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
140 fLeg1 = 11;
141 fLeg2 = -11;
142 fMother1 = 443;
143 fMother2 = 443;
146 fDalitzPdg = 22;
147 break;
149 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
150 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
151 fLeg1 = 11;
152 fLeg2 = -11;
153 fMother1 = 443;
154 fMother2 = 443;
157 fDalitzPdg = 22;
158 break;
160 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
161 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
162 fLeg1 = 11;
163 fLeg2 = -11;
164 fMother1 = 100443;
165 fMother2 = 100443;
167 break;
169 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
170 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
171 fLeg1 = 11;
172 fLeg2 = -11;
173 fMother1 = 22;
174 fMother2 = 22;
178 // fGrandMother1=111; fGrandMother2=111;
179 // fGrandMother1Exclude=kTRUE; fGrandMother1Exclude=111;
180 SetGEANTProcess(kPPair);
181 break;
183 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
184 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
185 fLeg1 = 11;
186 fLeg2 = -11;
187 fMother1 = 113;
188 fMother2 = 113;
190 SetGEANTProcess(kPPrimary); //pluto
191 break;
193 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
194 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
195 fLeg1 = 11;
196 fLeg2 = -11;
197 fMother1 = 223;
198 fMother2 = 223;
201 fDalitzPdg = 111;
202 SetGEANTProcess(kPPrimary); //pluto
203 break;
205 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
206 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
207 fLeg1 = 11;
208 fLeg2 = -11;
209 fMother1 = 223;
210 fMother2 = 223;
213 fDalitzPdg = 111;
214 SetGEANTProcess(kPPrimary); //pluto
215 break;
217 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
218 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
219 fLeg1 = 11;
220 fLeg2 = -11;
221 fMother1 = 333;
222 fMother2 = 333;
224 SetGEANTProcess(kPPrimary); //pluto
225 break;
227 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
228 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
229 fLeg1 = 11;
230 fLeg2 = -11;
231 fCheckBothChargesLeg1 = kTRUE;
232 fCheckBothChargesLeg2 = kTRUE;
233 fMother1 = 221;
234 fMother2 = 221;
237 fDalitzPdg = 22;
238 // SetGEANTProcess(kPPrimary); //pluto
239 break;
241 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
242 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
243 fLeg1 = 11;
244 fLeg2 = -11;
245 fMother1 = 221;
246 fMother2 = 221;
248 // SetGEANTProcess(kPUserDefined);
249 break;
251 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
252 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
253 fLeg1 = 11;
254 fLeg2 = -11;
255 fMother1 = 111;
256 fMother2 = 111;
258 // SetGEANTProcess(kPUserDefined);
259 break;
261 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
262 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
263 fLeg1 = 11;
264 fLeg2 = -11;
265 fMother1 = 22;
266 fMother2 = 22;
268 fGrandMother1 = 111;
269 fGrandMother2 = 111;
270 // SetGEANTProcess(kPUserDefined);
271 break;
273 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
274 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
275 fLeg1 = 11;
276 fLeg2 = -11;
277 fMother1 = 111;
278 fMother2 = 111;
281 fDalitzPdg = 22;
282 // SetGEANTProcess(kPPrimary); //pluto
283 break;
285 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
286 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
287 fLeg1 = 211;
288 fLeg2 = -211;
289 fMother1 = 310;
290 fMother2 = 310;
294 break;
296 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
297 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
298 fLeg1 = 211;
299 fLeg2 = 2212;
300 fCheckBothChargesLeg1 = kTRUE;
301 fCheckBothChargesLeg2 = kTRUE;
302 fMother1 = 3122;
303 fMother2 = 3122;
307 break;
309 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
310 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
311 fLeg1 = 11;
312 fLeg2 = -11;
313 fCheckBothChargesLeg1 = kTRUE;
314 fCheckBothChargesLeg2 = kTRUE;
317 // fMothersRelation=EBranchRelation::kSame;
318 break;
319 case EDefinedSignal::kDeltaElectron: //single delta ray electrons
320 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
321 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
322 fLeg1 = 11;
323 fLeg2 = 1;
324 fCheckBothChargesLeg1 = kTRUE;
325 SetGEANTProcess(kPDeltaRay);
326 fIsSingleParticle = kTRUE;
327 // fMother1Source=ESource::kPrimary; fMother2Source=kDontCare;
328 break;
329 case EDefinedSignal::kPrimElectron: //single electrons
330 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
331 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
332 fLeg1 = 11;
333 fLeg2 = 1;
334 fCheckBothChargesLeg1 = kTRUE;
335 //fMother1Source=ESource::kPrimary;
336 SetGEANTProcess(kPPrimary);
337 fIsSingleParticle = kTRUE;
338 break;
339 case EDefinedSignal::kPrimMuon: //single muoons
340 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
341 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
342 fLeg1 = 13;
343 fLeg2 = 1;
344 fCheckBothChargesLeg1 = kTRUE;
345 //fMother1Source=ESource::kPrimary;
346 SetGEANTProcess(kPPrimary);
347 fIsSingleParticle = kTRUE;
348 break;
349 case EDefinedSignal::kPrimPion: //single pions
350 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
351 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
352 fLeg1 = 211;
353 fLeg2 = 1;
354 fCheckBothChargesLeg1 = kTRUE;
355 //fMother1Source=ESource::kPrimary;
356 SetGEANTProcess(kPPrimary);
357 fIsSingleParticle = kTRUE;
358 break;
359 case EDefinedSignal::kPrimKaon: //single kaons
360 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
361 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
362 fLeg1 = 321;
363 fLeg2 = 1;
364 fCheckBothChargesLeg1 = kTRUE;
365 //fMother1Source=ESource::kPrimary;
366 SetGEANTProcess(kPPrimary);
367 fIsSingleParticle = kTRUE;
368 break;
369 case EDefinedSignal::kPrimProton: //single protons
370 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
371 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
372 fLeg1 = 2212;
373 fLeg2 = 1;
374 fCheckBothChargesLeg1 = kTRUE;
375 //fMother1Source=ESource::kPrimary;
376 SetGEANTProcess(kPPrimary);
377 fIsSingleParticle = kTRUE;
378 break;
380 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
381 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
382 fLeg1 = 1000010020;
383 ;
384 fLeg2 = 1;
385 fCheckBothChargesLeg1 = kTRUE;
386 //fMother1Source=ESource::kPrimary;
387 //SetGEANTProcess(kPPrimary);
388 fIsSingleParticle = kTRUE;
389 break;
391 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
392 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
393 fLeg1 = 1000010030;
394 ;
395 fLeg2 = 1;
396 fCheckBothChargesLeg1 = kTRUE;
397 //fMother1Source=ESource::kPrimary;
398 //SetGEANTProcess(kPPrimary);
399 fIsSingleParticle = kTRUE;
400 break;
402 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
403 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
404 fLeg1 = 1000020030;
405 ;
406 fLeg2 = 1;
407 fCheckBothChargesLeg1 = kTRUE;
408 //fMother1Source=ESource::kPrimary;
409 //SetGEANTProcess(kPPrimary);
410 fIsSingleParticle = kTRUE;
411 break;
413 SetNameTitle(fgkSignals[static_cast<UInt_t>(defaultSignal)][0],
414 fgkSignals[static_cast<UInt_t>(defaultSignal)][1]);
415 fLeg1 = 1000020040;
416 ;
417 fLeg2 = 1;
418 fCheckBothChargesLeg1 = kTRUE;
419 //fMother1Source=ESource::kPrimary;
420 //SetGEANTProcess(kPPrimary);
421 fIsSingleParticle = kTRUE;
422 break;
423 default:
424 Error("PairAnalysisSignalMC", "Signal NOT predefined! Either request it or configure on your own.");
425 return;
426 break;
427 }
428 // Info("PairAnalysisSignalMC","Use predefined signal selected: %s\n",GetName());
429 // Print();
430}
431
432void PairAnalysisSignalMC::Print(Option_t* /*option*/) const
433{
434 //
435 //
436 //
437 Printf("MC Signal: %s with title %s ", GetName(), GetTitle());
438 printf("\tPDGs leg1: %s%s%d%s ", (fLeg1Exclude ? "!" : ""), (fCheckBothChargesLeg1 ? "|" : ""), fLeg1,
439 (fCheckBothChargesLeg1 ? "|" : ""));
440 if (fMother1 != 0)
441 printf("<--- %s%s%d%s ", (fMother1Exclude ? "!" : ""), (fCheckBothChargesMother1 ? "|" : ""), fMother1,
442 (fCheckBothChargesMother1 ? "|" : ""));
443 if (fGrandMother1 != 0)
444 printf("<--- %s%s%d%s ", (fGrandMother1Exclude ? "!" : ""), (fCheckBothChargesGrandMother1 ? "|" : ""),
446 if (fGreatGrandMother1 != 0)
447 printf("<--- %s%s%d%s", (fGreatGrandMother1Exclude ? "!" : ""), (fCheckBothChargesGreatGrandMother1 ? "|" : ""),
449 printf("\n");
450 if (!fIsSingleParticle) {
451 // Printf("\t \t %s",(fDalitz)
452 // Printf("\t \t %s",(fMothersRelation)
453 printf("\tPDGs leg2: %s%s%d%s ", (fLeg2Exclude ? "!" : ""), (fCheckBothChargesLeg2 ? "|" : ""), fLeg2,
454 (fCheckBothChargesLeg2 ? "|" : ""));
455 if (fMother2 != 0)
456 printf("<--- %s%s%d%s ", (fMother2Exclude ? "!" : ""), (fCheckBothChargesMother2 ? "|" : ""), fMother2,
457 (fCheckBothChargesMother2 ? "|" : ""));
458 if (fGrandMother2 != 0)
459 printf("<--- %s%s%d%s ", (fGrandMother2Exclude ? "!" : ""), (fCheckBothChargesGrandMother2 ? "|" : ""),
461 if (fGreatGrandMother2 != 0)
462 printf("<--- %s%s%d%s", (fGreatGrandMother2Exclude ? "!" : ""), (fCheckBothChargesGreatGrandMother2 ? "|" : ""),
464 printf("\n");
465 }
466}
467
468
469//_________________________________________________________________________
471{
472 //
473 // Destructor
474 //
475}
476
477Double_t PairAnalysisSignalMC::GetWeight(Double_t* const values) const
478{
479 // TODO: workaround to avoid zero weights
480 if (fType == 0) return fWeight;
481
482 // kind of binary search
483 Int_t knot = fWeights->FindX(values[fType]);
484
485 Double_t x = 0.;
486 Double_t y = 0.;
487 fWeights->GetKnot(knot, x, y);
488 return y;
489}
ClassImp(PairAnalysisSignalMC) const char *PairAnalysisSignalMC
void Print(Option_t *option="") const
static const char * fgkSignals[static_cast< int >(EDefinedSignal::kNSignals)][2]
void SetGEANTProcess(TMCProcess processID, Bool_t check=kTRUE)
EBranchRelation fMothersRelation