UDst.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef UDst_h
  2. #define UDst_h
  3. // ROOT headers
  4. #include "TClonesArray.h"
  5. // UniGen headers
  6. #include "UArrays.h"
  7. // Forward declarations
  8. class UEvent;
  9. class URun;
  10. class UParticle;
  11. //________________
  12. class UDst {
  13. public:
  14. /// Default constructor
  15. UDst() { /* emtpy */ }
  16. /// Destructor
  17. ~UDst() { /* emtpy */ }
  18. /// Set pointers to the TClonesArrays
  19. static void set(TClonesArray** array);
  20. /// Reset pointers to the TClonesArrays to 0
  21. static void unset();
  22. /// Return pointer to the i-th TClonesArray
  23. static TClonesArray* uArray(Int_t type) { return uArrays[type]; }
  24. /// Return pointer to the URun information
  25. static URun* run() { return (URun*)uArrays[UArrays::Run]->UncheckedAt(0); }
  26. /// Return pointer to the UEvent information
  27. static UEvent* event() { return (UEvent*)uArrays[UArrays::Event]->UncheckedAt(0); }
  28. /// Return pointer to the i-th particle
  29. static UParticle* particle(Int_t i) { return (UParticle*)uArrays[UArrays::Particle]->UncheckedAt(i); }
  30. /// Return number of particles in the current events
  31. static UInt_t numberOfParticles() { return uArrays[UArrays::Particle]->GetEntries(); }
  32. /// Print information
  33. static void print();
  34. /// Print run information
  35. static void printRunInfo();
  36. /// Print event information
  37. static void printEventInfo();
  38. /// Print particle information
  39. static void printParticles();
  40. private:
  41. /// Array of TClonesArrays
  42. static TClonesArray** uArrays;
  43. };
  44. #endif // #define UDst_h