URun.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. #ifndef URUN_H
  2. #define URUN_H
  3. // C++ headers
  4. #include <limits>
  5. // ROOT headers
  6. #include "TNamed.h"
  7. #include "TString.h"
  8. //_________________
  9. class URun : public TNamed {
  10. public:
  11. /// Default constructor
  12. URun();
  13. /// Parametrized constructor
  14. URun(const char* generator, const char* comment, const Int_t& aProj,
  15. const Int_t& zProj, const Double_t& pProj, const Int_t& aTarg,
  16. const Int_t& zTarg, const Double_t& pTarg, const Double_t& bMin,
  17. const Double_t& bMax, const Int_t& bWeight, const Double_t& phiMin,
  18. const Double_t& phiMax, const Double_t& sigma, const Int_t& nEvents);
  19. /// Default destructor
  20. virtual ~URun();
  21. /// Print run info
  22. void print(Option_t* option = "");
  23. /// Proton mass (GeV/c^2)
  24. static Double_t mProtMass;
  25. /// Neutron mass (GeV/c^2)
  26. static Double_t mNeutMass;
  27. /// Charged pion mass (GeV/c^2)
  28. static Double_t mPionMass;
  29. //
  30. // Getters
  31. //
  32. /// Return generator name
  33. void generator(TString& generator) { generator = fGenerator; }
  34. /// Return comment
  35. void comment(TString& comment) { comment = fComment; }
  36. /// Return decayer name
  37. void decayer(TString& decayer) { decayer = fDecayer; }
  38. /// Return number of nucleons in the projectile
  39. Int_t aProj() const { return (Int_t)fAProj; }
  40. /// Return number of protons in the projectile
  41. Int_t zProj() const { return (Int_t)fZProj; }
  42. /// Return momentum of the projectile
  43. Double_t pProj() const { return (Double_t)fPProj; }
  44. /// Return number of nucleons in the target
  45. Int_t aTarg() const { return (Int_t)fATarg; }
  46. /// Return number of protons in the target
  47. Int_t zTarg() const { return (Int_t)fZTarg; }
  48. /// Return momentum of the target
  49. Double_t pTarg() const { return (Double_t)fPTarg; }
  50. /// Return minimal impact parameter requested
  51. Double_t bMin() const { return (Double_t)fBMin; }
  52. /// Return maximal impact parameter requested
  53. Double_t bMax() const { return (Double_t)fBMax; }
  54. /// Impact parameter weighting:
  55. /// \param 0 for geometrical weights (bdb)
  56. /// \param 1 for flat distribution
  57. Int_t bWeight() const { return (fBWeight) ? 1 : 0 ; }
  58. /// Return maximal phi angle requested
  59. Double_t phiMax() const { return (Double_t)fPhiMax; }
  60. /// Return minimal phi angle requested
  61. Double_t phiMin() const { return (Double_t)fPhiMin; }
  62. /// Return cross section
  63. Double_t xSection() const { return (Double_t)fXSection; }
  64. /// Return requested number of events to generate
  65. UInt_t nEvents() const { return fNEvents; }
  66. /// Return center-of-mass energy
  67. Double_t sqrtS();
  68. /// Return center-of-mass energy per nucleon
  69. Double_t nnSqrtS();
  70. /// Return energy of the projectile
  71. Double_t projectileEnergy();
  72. /// Return energy of the target
  73. Double_t targetEnergy();
  74. /// Return center-of-mass velocity
  75. Double_t betaCM();
  76. /// Return center-of-mass lorentz factor
  77. Double_t gammaCM();
  78. //
  79. // setParameters
  80. //
  81. /// Set amount of event that was requested
  82. void setNEvents(const Int_t& nEvents)
  83. { if (nEvents<0) {fNEvents=0;}
  84. else { fNEvents = ( (nEvents > std::numeric_limits<int>::max() ) ?
  85. std::numeric_limits<unsigned int>::max() : (UInt_t)nEvents ); } }
  86. /// Set momentum of the projectile
  87. void setPProj(const Double_t& pProj) { fPProj = (Float_t)pProj; }
  88. /// Set momentum of the target
  89. void setPTarg(const Double_t& pTarg) { fPTarg = (Float_t)pTarg; }
  90. /// Set decayer type
  91. void setDecayer(TString decayer) { fDecayer = decayer; }
  92. private:
  93. /// Generator description
  94. TString fGenerator;
  95. /// Run comment
  96. TString fComment;
  97. /// Decayer description
  98. TString fDecayer;
  99. /// Projectile mass number
  100. Short_t fAProj;
  101. /// Projectile charge
  102. Short_t fZProj;
  103. /// Projectile momentum per nucleon (GeV)
  104. Float_t fPProj;
  105. /// Target mass number
  106. Short_t fATarg;
  107. /// Target charge
  108. Short_t fZTarg;
  109. /// Target momentum per nucleon (GeV)
  110. Float_t fPTarg;
  111. /// Minimum impact parameter
  112. Float_t fBMin;
  113. /// Maximum impact parameter
  114. Float_t fBMax;
  115. /// Impact parameter weighting:
  116. /// \param 0 for geometrical weights (bdb)
  117. /// \param 1 for flat distribution
  118. Bool_t fBWeight;
  119. /// Event plane minimum angle (rad)
  120. Float_t fPhiMin;
  121. /// Event plane maximum angle (rad)
  122. Float_t fPhiMax;
  123. /// Cross-section (mb)
  124. Float_t fXSection;
  125. /// Requested number of events
  126. UInt_t fNEvents;
  127. ClassDef(URun,3);
  128. };
  129. #endif