BmnRoot
Loading...
Searching...
No Matches
MpdDecayerPyt8.h
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- MpdDecayerPyt8 header file -----
3// ----- Created 23/07/2020 -----
4// ----- A. Zinchenko -----
5// ----- External decayer for MPD using Pythia8 -----
6// ----- (adapted from TPythia8Decayer) -----
7// -------------------------------------------------------------------------
8
9#ifndef MPDDECAYERPYT8_H
10#define MPDDECAYERPYT8_H
11
12#include <TLorentzVector.h>
13#include <TVirtualMCDecayer.h>
14#include <TRotation.h>
15
16#include <Pythia8/Pythia.h>
17
18class TClonesArrray;
19class TObjArrray;
20class TParticle;
21class TPythia8;
22class TRandom;
23
24#include <set>
25#if PYTHIA_VERSION_INTEGER < 8304
26typedef Pythia8::ParticleDataEntry *ParticleDataEntryPtr;
27#else
28typedef Pythia8::ParticleDataEntryPtr ParticleDataEntryPtr;
29#endif
30
31class MpdDecayerPyt8 : public TVirtualMCDecayer {
32
33public:
34 enum SourceFlag { kPythia, kCustom }; // particle container source
35
36 virtual ~MpdDecayerPyt8() { ; }
37
38 virtual void Init();
39 virtual void Decay(Int_t pdg, TLorentzVector *p);
40 virtual Int_t ImportParticles(TClonesArray *particles);
41 virtual void SetForceDecay(Int_t type);
42 virtual void ForceDecay();
43 virtual Float_t GetPartialBranchingRatio(Int_t ipart);
44 virtual Float_t GetLifetime(Int_t kf);
45 virtual void ReadDecayTable();
46
47 virtual void SetDebugLevel(Int_t debug) { fDebug = debug; }
48 virtual void SetGlobalPolar(Int_t glob = 1) { fGlobalPolar = glob; }
49
50 static MpdDecayerPyt8 *Instance();
51 void Decay(TParticle *part);
52 void AddMotherPdg(Int_t pdg);
53 // using TPythia8Decayer::Decay; // makes base class function visible
54
55protected:
57 void AppendParticle(Int_t pdg, TLorentzVector *p);
58 void ClearEvent();
59
60private:
61 void Gdecay(Int_t idpart, TLorentzVector *p);
62 void Gdeca2(Double_t xm0, Double_t xm1, Double_t xm2, Double_t pcm[2][4]);
63 // void Anisotropy (Double_t* pvert, Double_t *rndm, Double_t polar, Double_t &phi, Double_t &costh);
64 void Anisotropy(Double_t *pvert, Double_t *rndm, TVector3 &polar, Double_t &phi, Double_t &costh);
65 void ChangeBranchings();
66 void ChangeParticleBr(TObjArray *tokens, Bool_t exclusive);
67
68 static MpdDecayerPyt8 *fgInstance; // singleton instance
69
70 TPythia8 *fPythia8; // Pointer to pythia8
71 Int_t fDebug; // Debug level
72 Int_t fGlobalPolar; // global polarization flag
73
74 Float_t fBranch; // branching of lambda to p + \pi-
75 ParticleDataEntryPtr fLambda; // pointer to Lambda in Pythia8 database
76 TLorentzVector fMother; // mother decay point position
77 TClonesArray *fParticles;
78 TRotation fRotation;
79 SourceFlag fSourceFlag;
80 std::set<Int_t> fMothersPdg;
81 TRandom *fRandom;
82
83 ClassDef(MpdDecayerPyt8, 0); // MPD Particle Decayer using Pythia8
84};
85#endif
virtual void SetDebugLevel(Int_t debug)
void ClearEvent()
Clear the event stack.
void AppendParticle(Int_t pdg, TLorentzVector *p)
Append a particle to the stack.
static MpdDecayerPyt8 * Instance()
Get the singleton object.
virtual void SetForceDecay(Int_t type)
Set forced decay mode.
virtual Float_t GetPartialBranchingRatio(Int_t ipart)
virtual void Init()
Initialize the decayer.
MpdDecayerPyt8()
constructor
virtual void ReadDecayTable()
to read a decay table (not yet implemented)
virtual void SetGlobalPolar(Int_t glob=1)
virtual Float_t GetLifetime(Int_t kf)
return lifetime in seconds of teh particle with PDG number pdg
virtual void ForceDecay()
ForceDecay not yet implemented.
virtual Int_t ImportParticles(TClonesArray *particles)
import the decay products into particles array
virtual void Decay(Int_t pdg, TLorentzVector *p)
Decay a single particle.
virtual ~MpdDecayerPyt8()
void AddMotherPdg(Int_t pdg)
Add PDG of particle to be decayed by this package.
Pythia8::ParticleDataEntry * ParticleDataEntryPtr
vector< string > glob(const string &path)