MpdDecayer.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // -------------------------------------------------------------------------
  2. // ----- MpdDecayer header file -----
  3. // ----- Created 22/04/2020 -----
  4. // ----- R. Akhat, A. Zinchenko -----
  5. // ----- External decayer for MPD -----
  6. // -------------------------------------------------------------------------
  7. #ifndef MPDDECAYER_H
  8. #define MPDDECAYER_H
  9. #include "TArrayF.h"
  10. #include "TRotation.h"
  11. #include "TString.h"
  12. #include "TVirtualMCDecayer.h"
  13. #include "TLorentzVector.h"
  14. #include <set>
  15. class TParticle;
  16. class TParticlePDG;
  17. class MpdDecayer : public TVirtualMCDecayer
  18. {
  19. public:
  20. // enum of decay mode types
  21. enum SourceFlag {kPythia, kCustom}; // particle container source
  22. // protected:
  23. private:
  24. TString fDecayTableFile; // File to read decay table from
  25. //EDecayType fDecay; // Forced decay mode
  26. Int_t fDecay; // Forced decay mode
  27. TArrayF fBraPart; //! Branching ratios
  28. Float_t fBratio[6];
  29. Int_t fMode[6];
  30. Float_t fBranch; // branching of lambda to p + \pi-
  31. TLorentzVector fMother;
  32. TClonesArray *fParticles;
  33. TRotation fRotation;
  34. SourceFlag fSourceFlag;
  35. std::set<Int_t> fMothersPdg;
  36. static MpdDecayer *fgInstance;
  37. // Extra functions
  38. MpdDecayer(); //AZ
  39. Int_t CountProducts (Int_t channel, Int_t particle);
  40. void Gdecay (Int_t idpart, TLorentzVector* p);
  41. void Gdeca2 (Double_t xm0, Double_t xm1, Double_t xm2, Double_t pcm[2][4]);
  42. void Anisotropy (Double_t* pvert, Double_t *rndm, Double_t polar, Double_t &phi, Double_t &costh);
  43. void DefineParticles();
  44. void PrintPDG(TParticlePDG* pdg, std::ofstream &fout);
  45. void MakeDecayList(Int_t pdgCode, std::ofstream &fout);
  46. public:
  47. //AZ MpdDecayer();
  48. virtual ~MpdDecayer() { }
  49. virtual void Init();
  50. virtual void Decay(Int_t idpart, TLorentzVector* p);
  51. void Decay(TParticle* p);
  52. virtual Int_t ImportParticles(TClonesArray *particles);
  53. virtual void SetForceDecay(Int_t type);
  54. virtual void ForceDecay();
  55. void AddMotherPdg(Int_t pdg);
  56. virtual Float_t GetPartialBranchingRatio(Int_t ipart);
  57. virtual Float_t GetLifetime(Int_t kf);
  58. virtual void ReadDecayTable();
  59. // Extension member functions
  60. virtual void SetDecayTableFile(const char* name);
  61. virtual void WriteDecayTable();
  62. //virtual void SetForceDecay(EDecayType type) { fDecay = type; }
  63. static MpdDecayer *Instance();
  64. ClassDef(MpdDecayer,0); // Particle Decayer Base Class
  65. };
  66. inline void MpdDecayer::SetDecayTableFile(const char *name)
  67. {
  68. fDecayTableFile = name;
  69. }
  70. #endif