UEvent.cxx 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // C++ headers
  2. #include <iostream>
  3. // ROOT headers
  4. #include "TObject.h"
  5. #include "TString.h"
  6. #include "TClonesArray.h"
  7. // UNI headers
  8. #include "UEvent.h"
  9. ClassImp(UEvent);
  10. //_________________
  11. UEvent::UEvent() : TObject(), fEventNr(0), fB(0), fPhi(0),
  12. fNes(0), fStepNr(0), fStepT(0), fComment("") {
  13. // Default constructor
  14. /* empty */
  15. }
  16. //_________________
  17. UEvent::UEvent(const UEvent& right) : TObject() {
  18. // Copy constructor
  19. fEventNr = right.fEventNr;
  20. fB = right.fB;
  21. fPhi = right.fPhi;
  22. fNes = right.fNes;
  23. fStepNr = right.fStepNr;
  24. fStepT = right.fStepT;
  25. fComment = right.fComment;
  26. }
  27. //_________________
  28. UEvent::~UEvent() {
  29. // Destructor
  30. Clear();
  31. }
  32. //_________________
  33. void UEvent::print(Option_t* option) {
  34. // Print data members to the standard output
  35. std::cout << "---------------------------------------------" << std::endl
  36. << "-I- Event -I-" << std::endl
  37. << "Event number : " << fEventNr << std::endl
  38. << "Impact parameter (fm) : " << fB << std::endl
  39. << "Reaction plane angle (rad) : " << fPhi << std::endl
  40. << "Number of time steps : " << fNes << std::endl
  41. << "Time step number : " << fStepNr << std::endl
  42. << "Time of the time step (fm) : " << fStepT << std::endl
  43. << "Comment :\n" << fComment << std::endl;
  44. #if 0
  45. TString opt = option;
  46. if(opt.Contains("all")) {
  47. // TODO: particle info?
  48. }
  49. #endif
  50. std::cout << "---------------------------------------------" << std::endl;
  51. }
  52. //_________________
  53. void UEvent::setParameters(const Int_t& eventNr, const Double_t& b,
  54. const Double_t& phi, const Int_t& nes,
  55. const Int_t& stepNr, const Double_t& stepT,
  56. const char* comment) {
  57. // Set the event parameters
  58. fEventNr = (UInt_t)eventNr;
  59. fB = (Float_t)b;
  60. fPhi = (Float_t)phi;
  61. fNes = ( ( nes > std::numeric_limits<unsigned short>::max() ) ?
  62. std::numeric_limits<unsigned short>::max() : (UShort_t)nes );
  63. fStepNr = ( ( stepNr > std::numeric_limits<unsigned short>::max() ) ?
  64. std::numeric_limits<unsigned short>::max() : (UShort_t)stepNr ) ;
  65. fStepT = (Float_t)stepT;
  66. fComment = comment;
  67. }
  68. //_________________
  69. void UEvent::clear() {
  70. /* noop */
  71. }