UEvent.h 3.2 KB

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