Oscar97Event.cxx 977 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include "Oscar97Event.h"
  2. ClassImp(Oscar97Event)
  3. //_________________
  4. Oscar97Event::Oscar97Event() :
  5. mEventNumber(0), mNTracks(0), mImpactPar(0.),
  6. mEventPlaneRot(0.) {
  7. mTrack = new TClonesArray("Oscar97Track", 1500);
  8. }
  9. //_________________
  10. Oscar97Event::~Oscar97Event() {
  11. if (mTrack) {
  12. delete mTrack;
  13. mTrack = 0;
  14. }
  15. }
  16. //_________________
  17. Oscar97Event &Oscar97Event::operator=(const Oscar97Event &event) {
  18. if (this != &event) {
  19. mEventNumber = event.mEventNumber;
  20. mNTracks = event.mNTracks;
  21. mImpactPar = event.mImpactPar;
  22. mEventPlaneRot = event.mEventPlaneRot;
  23. mTrack = event.mTrack;
  24. }
  25. return *this;
  26. }
  27. //_________________
  28. Oscar97Track *Oscar97Event::AddTrack(Int_t trackNum) {
  29. //
  30. // Add a new track
  31. //
  32. return new ((*mTrack)[trackNum]) Oscar97Track;
  33. }
  34. //_________________
  35. void Oscar97Event::Clear(Option_t* option) {
  36. mEventNumber = 0;
  37. mNTracks = 0;
  38. mImpactPar = 0.;
  39. mEventPlaneRot = 0.;
  40. mTrack->Delete();
  41. }