BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
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 <Pythia8/Pythia.h>
13#include <TLorentzVector.h>
14#include <TRotation.h>
15#include <TVirtualMCDecayer.h>
16
17class TClonesArrray;
18class TObjArrray;
19class TParticle;
20class TPythia8;
21class TRandom;
22
23#include <set>
24#if PYTHIA_VERSION_INTEGER < 8304
25typedef Pythia8::ParticleDataEntry* ParticleDataEntryPtr;
26#else
27typedef Pythia8::ParticleDataEntryPtr ParticleDataEntryPtr;
28#endif
29
31{
32
33 public:
35 {
38 }; // particle container source
39
40 virtual ~MpdDecayerPyt8() { ; }
41
42 virtual void Init();
43 virtual void Decay(Int_t pdg, TLorentzVector* p);
44 virtual Int_t ImportParticles(TClonesArray* particles);
45 virtual void SetForceDecay(Int_t type);
46 virtual void ForceDecay();
48 virtual Float_t GetLifetime(Int_t kf);
49 virtual void ReadDecayTable();
50
51 virtual void SetDebugLevel(Int_t debug) { fDebug = debug; }
52 virtual void SetGlobalPolar(Int_t glob = 1) { fGlobalPolar = glob; }
53
54 static MpdDecayerPyt8* Instance();
55 void Decay(TParticle* part);
56 void AddMotherPdg(Int_t pdg);
57 // using TPythia8Decayer::Decay; // makes base class function visible
58
59 protected:
62 void ClearEvent();
63
64 private:
65 void Gdecay(Int_t idpart, TLorentzVector* p);
66 void Gdeca2(Double_t xm0, Double_t xm1, Double_t xm2, Double_t pcm[2][4]);
67 // void Anisotropy (Double_t* pvert, Double_t *rndm, Double_t polar, Double_t &phi, Double_t &costh);
68 void Anisotropy(Double_t* pvert, Double_t* rndm, TVector3& polar, Double_t& phi, Double_t& costh);
69 void ChangeBranchings();
70 void ChangeParticleBr(TObjArray* tokens, Bool_t exclusive);
71
72 static MpdDecayerPyt8* fgInstance; // singleton instance
73
74 TPythia8* fPythia8; // Pointer to pythia8
75 Int_t fDebug; // Debug level
76 Int_t fGlobalPolar; // global polarization flag
77
78 Float_t fBranch; // branching of lambda to p + \pi-
79 ParticleDataEntryPtr fLambda; // pointer to Lambda in Pythia8 database
80 TLorentzVector fMother; // mother decay point position
84 std::set<Int_t> fMothersPdg;
86
87 ClassDef(MpdDecayerPyt8, 0); // MPD Particle Decayer using Pythia8
88};
89#endif
bool Bool_t
int Int_t
float Float_t
double Double_t
#define ClassDef(name, id)
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.
ParticleDataEntryPtr fLambda
SourceFlag fSourceFlag
static MpdDecayerPyt8 * Instance()
Get the singleton object.
virtual void SetForceDecay(Int_t type)
Set forced decay mode.
TLorentzVector fMother
virtual Float_t GetPartialBranchingRatio(Int_t ipart)
virtual void Init()
Initialize the decayer.
void Gdecay(Int_t idpart, TLorentzVector *p)
Simulate two-body decay process of Lambda-hyperon to p+\pi-.
TClonesArray * fParticles
static MpdDecayerPyt8 * fgInstance
void ChangeParticleBr(TObjArray *tokens, Bool_t exclusive)
MpdDecayerPyt8()
constructor
TRotation fRotation
virtual void ReadDecayTable()
to read a decay table (not yet implemented)
std::set< Int_t > fMothersPdg
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
void Anisotropy(Double_t *pvert, Double_t *rndm, TVector3 &polar, Double_t &phi, Double_t &costh)
Simulate anisotropic (due to polarization) decay of lambda.
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.
void Gdeca2(Double_t xm0, Double_t xm1, Double_t xm2, Double_t pcm[2][4])
Simulate two-body decay process with anisotropic angular distribution in CMS.
virtual ~MpdDecayerPyt8()
TPythia8 * fPythia8
TRandom * fRandom
void AddMotherPdg(Int_t pdg)
Add PDG of particle to be decayed by this package.
friend friend class TClonesArray
Pythia8::ParticleDataEntry * ParticleDataEntryPtr
Pythia8::ParticleDataEntry * ParticleDataEntryPtr
vector< string > glob(const string &path)