UEvent.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. #ifndef UEVENT_H
  2. #define UEVENT_H
  3. /**
  4. * derived from Unigen project
  5. * https://www.gsi.de/work/wissenschaftliche_netzwerke/helmholtz_virtuelle_institute/unigen.htm
  6. */
  7. #include "TObject.h"
  8. #include "TLorentzVector.h"
  9. #include "TNamed.h"
  10. class TString;
  11. class TClonesArray;
  12. class UParticle;
  13. /**
  14. * unigen event
  15. */
  16. class UEvent : public TNamed {
  17. private:
  18. /**
  19. * Event number
  20. */
  21. Int_t fEventNr;
  22. /**
  23. * Impact parameter (fm)
  24. */
  25. Double_t fB;
  26. /**
  27. * Reaction plane angle
  28. */
  29. Double_t fPhi;
  30. /**
  31. * Number of event steps
  32. */
  33. Int_t fNes;
  34. /**
  35. * Event step number
  36. */
  37. Int_t fStepNr;
  38. /**
  39. * Event step time
  40. */
  41. Double_t fStepT;
  42. /**
  43. * Number of particles
  44. */
  45. Int_t fNpa;
  46. /**
  47. * Generator-specific information
  48. */
  49. TString fComment;
  50. /**
  51. * Array of particles
  52. */
  53. TClonesArray* fParticles;
  54. public:
  55. /**
  56. * default constructor
  57. */
  58. UEvent();
  59. /**
  60. * copy constructor
  61. * @param right object to copy
  62. */
  63. UEvent(const UEvent& right);
  64. /**
  65. * assignement operator
  66. */
  67. UEvent operator=(const UEvent &right);
  68. virtual ~UEvent();
  69. /**
  70. * print info about event
  71. * @param option if "all" then particles are also printed
  72. */
  73. void Print(Option_t* option = "");
  74. /**
  75. *
  76. * @return event number
  77. */
  78. inline Int_t GetEventNr() const {return fEventNr;}
  79. /**
  80. *
  81. * @return impact paramter
  82. */
  83. inline Double_t GetB() const {return fB;}
  84. /**
  85. *
  86. * @return reaction plane angle
  87. */
  88. inline Double_t GetPhi() const {return fPhi;}
  89. /**
  90. *
  91. * @return number of event steps
  92. */
  93. inline Int_t GetNes() const {return fNes;}
  94. /**
  95. *
  96. * @return event step number
  97. */
  98. inline Int_t GetStepNr() const {return fStepNr;}
  99. /**
  100. *
  101. * @return event step time
  102. */
  103. inline Double_t GetStepT() const {return fStepT;}
  104. /**
  105. *
  106. * @return number of tracks
  107. */
  108. inline Int_t GetNpa() const {return fNpa;}
  109. /**
  110. *
  111. * @return list of particles
  112. */
  113. inline TClonesArray* GetParticleList() const {return fParticles;}
  114. /**
  115. *
  116. * @param comment comment
  117. */
  118. inline void GetComment(TString& comment) const {comment = fComment;}
  119. /**
  120. *
  121. * @param index particle posistion
  122. * @return particle at given position
  123. */
  124. UParticle* GetParticle(Int_t index) const;
  125. /**
  126. * set event parameters
  127. * @param eventNr event number
  128. * @param b impact parameter
  129. * @param phi reaction plane nagle
  130. * @param nes number of steps
  131. * @param stepNr step number
  132. * @param stepT step time
  133. * @param comment comment
  134. */
  135. void SetParameters(Int_t eventNr, Double_t b, Double_t phi, Int_t nes,
  136. Int_t stepNr, Double_t stepT, const char* comment = "");
  137. /**
  138. *
  139. * @param eventNr event nubmer
  140. */
  141. inline void SetEventNr(Int_t eventNr) {fEventNr = eventNr;}
  142. /**
  143. *
  144. * @param b impact parameter
  145. */
  146. inline void SetB (Double_t b) {fB = b;}
  147. /**
  148. *
  149. * @param phi reaction plane angle
  150. */
  151. inline void SetPhi (Double_t phi) {fPhi = phi;}
  152. /**
  153. *
  154. * @param nes number of steps
  155. */
  156. inline void SetNes (Int_t nes) {fNes = nes;}
  157. /**
  158. *
  159. * @param stepNr step number
  160. */
  161. inline void SetStepNr (Int_t stepNr) {fStepNr = stepNr;}
  162. /**
  163. *
  164. * @param stepT step time
  165. */
  166. inline void SetStepT (Double_t stepT) {fStepT = stepT;}
  167. /**
  168. *
  169. * @param comment comment
  170. */
  171. inline void SetComment(const char* comment) {fComment = comment;}
  172. /**
  173. * add particle
  174. * @param index particle position
  175. * @param pdg pid of track
  176. * @param status particle status
  177. * @param parent parent index
  178. * @param parentDecay parent decay index
  179. * @param mate index of last collision partner
  180. * @param decay decay index (-1 if not decayed)
  181. * @param child index of first and last child
  182. * @param px px momentum
  183. * @param py py momentum
  184. * @param pz pz momentum
  185. * @param e energy
  186. * @param x freezout -x
  187. * @param y freezout -y
  188. * @param z freezout - z
  189. * @param t freezout - t
  190. * @param weight particle weight
  191. */
  192. void AddParticle(Int_t index, Int_t pdg, Int_t status,
  193. Int_t parent, Int_t parentDecay,
  194. Int_t mate, Int_t decay, Int_t child[2],
  195. Double_t px, Double_t py, Double_t pz, Double_t e,
  196. Double_t x, Double_t y, Double_t z, Double_t t,
  197. Double_t weight);
  198. /**
  199. *
  200. * @param index particle position
  201. * @param pdg pid of track
  202. * @param status track status
  203. * @param parent parent index
  204. * @param parentDecay parent decay index
  205. * @param mate index of last collision partner
  206. * @param decay decay index (-1 if not decayed)
  207. * @param child index of first and last child
  208. * @param mom momentum
  209. * @param pos freezout coordinates as
  210. * @param weight
  211. */
  212. void AddParticle(Int_t index, Int_t pdg, Int_t status,
  213. Int_t parent, Int_t parentDecay,
  214. Int_t mate, Int_t decay, Int_t child[2],
  215. TLorentzVector mom, TLorentzVector pos,
  216. Double_t weight);
  217. // void Rebuild(UEvent* ev);
  218. /**
  219. *
  220. * @param particle particle to add
  221. */
  222. void AddParticle(const UParticle& particle);
  223. /**
  224. * clear this
  225. */
  226. void Clear();
  227. /**
  228. * clear this
  229. * @param otp clear option
  230. */
  231. void Clear(Option_t *otp){Clear();};
  232. /**
  233. * remove particle
  234. * @param i particle position
  235. */
  236. void RemoveAt(Int_t i);
  237. ClassDef(UEvent, 3)
  238. };
  239. #endif