UDst.cxx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // C++ headers
  2. #include <iostream>
  3. // UniGen headers
  4. #include "URun.h"
  5. #include "UEvent.h"
  6. #include "UParticle.h"
  7. #include "UDst.h" // MUST be the last one
  8. TClonesArray** UDst::uArrays = 0;
  9. //________________
  10. void UDst::unset() {
  11. // Unset pointers
  12. uArrays = 0;
  13. }
  14. //________________
  15. void UDst::set(TClonesArray** theUArrays) {
  16. // Set pointers
  17. uArrays = theUArrays;
  18. }
  19. //________________
  20. void UDst::print() {
  21. // Print all information
  22. std::cout << "\n==================== Full event information ====================\n";
  23. printRunInfo();
  24. printEventInfo();
  25. printParticles();
  26. std::cout << "\n================================================================\n";
  27. }
  28. //________________
  29. void UDst::printRunInfo() {
  30. // Print run information
  31. run()->print();
  32. }
  33. //________________
  34. void UDst::printEventInfo() {
  35. // Print event information
  36. event()->print();
  37. }
  38. //________________
  39. void UDst::printParticles() {
  40. // Print all particles
  41. if( numberOfParticles() == 0 ) {
  42. std::cout << "No particles found!" << std::endl;
  43. return;
  44. }
  45. std::cout << "\n Particle list contains: " << numberOfParticles() << " entries\n\n";
  46. // Particle loop
  47. for(UInt_t iPart=0; iPart<numberOfParticles(); iPart++) {
  48. std::cout << "+++ particles #[" << iPart << "/" << numberOfParticles << "]\n";
  49. particle(iPart)->print();
  50. }
  51. std::cout << std::endl;
  52. }