UEvent.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #ifndef UEVENT_H
  2. #define UEVENT_H
  3. // C++ headers
  4. #include <limits>
  5. // ROOT headers
  6. #include "TObject.h"
  7. #include "TLorentzVector.h"
  8. // Forward declarations
  9. class TString;
  10. class TClonesArray;
  11. class UParticle;
  12. //_________________
  13. class UEvent : public TObject {
  14. public:
  15. /// Default constructor
  16. UEvent();
  17. /// Copy constructor
  18. UEvent(const UEvent& right);
  19. /// Default destructor
  20. virtual ~UEvent();
  21. /// Print event information
  22. void print(Option_t* option = "");
  23. //
  24. // Getters
  25. //
  26. /// Return event number
  27. Int_t eventNr() const { return fEventNr; }
  28. /// Return imparct parameter (fm)
  29. Double_t b() const { return (Double_t)fB; }
  30. /// Return impact parameter (fm)
  31. Double_t impact() const { return (Double_t)fB; }
  32. /// Return reaction plane angle
  33. Double_t phi() const { return (Double_t)fPhi; }
  34. /// Return number of event steps
  35. Int_t numberOfSteps() const { return (Int_t)fNes; }
  36. /// Return time step (stamp) number
  37. Int_t stepNumber() const { return (Int_t)fStepNr; }
  38. /// Return time of the step (stamp)
  39. Double_t stepT() const { return (Double_t)fStepT; }
  40. /// Return time of the step (stamp)
  41. Double_t stepTime() const { return stepT(); }
  42. /// Return comment
  43. void comment(TString& comment) const { comment = fComment; }
  44. Int_t GetNpa() const {return (Int_t)fNpa;}
  45. TClonesArray* getParticleList() const {return fParticles;}
  46. UParticle* getParticle(Int_t index) const;
  47. //
  48. // Setters
  49. //
  50. /// Set all event parameters
  51. void setParameters(const Int_t& eventNr, const Double_t& b, const Double_t& phi,
  52. const Int_t& nes, const Int_t& stepNr, const Double_t& stepT,
  53. const char* comment = "");
  54. /// Set event number
  55. void setEventNr(const Int_t& eventNr) { fEventNr = (UInt_t)eventNr; }
  56. /// Set impact parameter
  57. void setB(const Double_t& b) { fB = (Float_t)b; }
  58. /// Set impact parameter
  59. void setImpact(const Double_t& impact) { setB( impact ); }
  60. /// Set reaction plane angle
  61. void setPhi(const Double_t& phi) { fPhi = (Float_t)phi; }
  62. /// Set number of steps
  63. void setNumberOfSteps(const Int_t& nes)
  64. { fNes = ( ( nes > std::numeric_limits<unsigned short>::max() ) ?
  65. std::numeric_limits<unsigned short>::max() : (UShort_t)nes ); }
  66. /// Set number of steps
  67. void setNes(const Int_t& nes)
  68. { fNes = ( ( nes > std::numeric_limits<unsigned short>::max() ) ?
  69. std::numeric_limits<unsigned short>::max() : (UShort_t)nes ); }
  70. /// Set the current step number
  71. void setStepNr(const Int_t& stepNr)
  72. { fStepNr = ( ( stepNr > std::numeric_limits<unsigned short>::max() ) ?
  73. std::numeric_limits<unsigned short>::max() : (UShort_t)stepNr ); }
  74. /// Set time of the current step
  75. void setStepT(const Double_t& stepT) { fStepT = (Float_t)stepT; }
  76. /// Set time of the current step
  77. void setStepTime(const Double_t& time) { setStepT( time ); }
  78. /// Set comment
  79. void setComment(const char* comment) { fComment = comment; }
  80. void clear();
  81. void removeAt(Int_t i);
  82. private:
  83. /// Event number
  84. UInt_t fEventNr;
  85. /// Impact parameter (fm)
  86. Float_t fB;
  87. /// Reaction plane angle
  88. Float_t fPhi;
  89. /// Number of event steps
  90. UShort_t fNes;
  91. // Event step number
  92. UShort_t fStepNr;
  93. /// Event step time
  94. Float_t fStepT;
  95. /// Number of particles
  96. UShort_t fNpa;
  97. /// Generator-specific information
  98. TString fComment;
  99. ClassDef(UEvent, 5);
  100. };
  101. #endif