MpdDecayerPyt8.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. #ifndef MPDDECAYERPYT8_H
  9. #define MPDDECAYERPYT8_H
  10. #include <TLorentzVector.h>
  11. #include <TVirtualMCDecayer.h>
  12. #include <TRotation.h>
  13. #include <Pythia8/Pythia.h>
  14. class TClonesArrray;
  15. class TObjArrray;
  16. class TParticle;
  17. class TPythia8;
  18. class TRandom;
  19. #include <set>
  20. #if PYTHIA_VERSION_INTEGER < 8304
  21. typedef Pythia8::ParticleDataEntry* ParticleDataEntryPtr;
  22. #else
  23. typedef Pythia8::ParticleDataEntryPtr ParticleDataEntryPtr;
  24. #endif
  25. class MpdDecayerPyt8 : public TVirtualMCDecayer
  26. {
  27. public:
  28. enum SourceFlag {kPythia, kCustom}; // particle container source
  29. virtual ~MpdDecayerPyt8(){;}
  30. virtual void Init();
  31. virtual void Decay(Int_t pdg, TLorentzVector* p);
  32. virtual Int_t ImportParticles(TClonesArray *particles);
  33. virtual void SetForceDecay(Int_t type);
  34. virtual void ForceDecay();
  35. virtual Float_t GetPartialBranchingRatio(Int_t ipart);
  36. virtual Float_t GetLifetime(Int_t kf);
  37. virtual void ReadDecayTable();
  38. virtual void SetDebugLevel(Int_t debug) { fDebug = debug; }
  39. virtual void SetGlobalPolar(Int_t glob = 1) { fGlobalPolar = glob; }
  40. static MpdDecayerPyt8 *Instance();
  41. void Decay(TParticle* part);
  42. void AddMotherPdg(Int_t pdg);
  43. //using TPythia8Decayer::Decay; // makes base class function visible
  44. protected:
  45. MpdDecayerPyt8();
  46. void AppendParticle(Int_t pdg, TLorentzVector* p);
  47. void ClearEvent();
  48. private:
  49. void Gdecay (Int_t idpart, TLorentzVector* p);
  50. void Gdeca2 (Double_t xm0, Double_t xm1, Double_t xm2, Double_t pcm[2][4]);
  51. //void Anisotropy (Double_t* pvert, Double_t *rndm, Double_t polar, Double_t &phi, Double_t &costh);
  52. void Anisotropy (Double_t* pvert, Double_t *rndm, TVector3& polar, Double_t &phi, Double_t &costh);
  53. void ChangeBranchings();
  54. void ChangeParticleBr(TObjArray *tokens);
  55. static MpdDecayerPyt8 *fgInstance; // singleton instance
  56. TPythia8* fPythia8; // Pointer to pythia8
  57. Int_t fDebug; // Debug level
  58. Int_t fGlobalPolar; // global polarization flag
  59. Float_t fBranch; // branching of lambda to p + \pi-
  60. ParticleDataEntryPtr fLambda; // pointer to Lambda in Pythia8 database
  61. TLorentzVector fMother; // mother decay point position
  62. TClonesArray *fParticles;
  63. TRotation fRotation;
  64. SourceFlag fSourceFlag;
  65. std::set<Int_t> fMothersPdg;
  66. TRandom *fRandom;
  67. ClassDef(MpdDecayerPyt8, 0) // MPD Particle Decayer using Pythia8
  68. };
  69. #endif