UManager.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef UManager_h
  2. #define UManager_h
  3. // ROOT headers
  4. #include "TObject.h"
  5. // Forward declarations
  6. class TFile;
  7. class TTree;
  8. class TList;
  9. class UTask;
  10. class URun;
  11. class UEvent;
  12. class UParticle;
  13. //_________________
  14. class UManager : public TObject {
  15. public:
  16. /// Constructor
  17. UManager();
  18. /// Destructor
  19. virtual ~UManager();
  20. static UManager* Instance();
  21. void SetInputFile(const char *fileName);
  22. void CloseInputFile();
  23. void SetOutputFile(const char *fileName, Bool_t writeTree = kTRUE);
  24. void CloseOutputFile();
  25. Int_t GetEntries();
  26. void GetEntry(Int_t i);
  27. void AddTask(UTask *task);
  28. void Init();
  29. void Run(Int_t a = -1, Int_t b = -1);
  30. void WriteEvent(Bool_t flag = kTRUE) {fWrite = flag;}
  31. void Fill();
  32. void createRun(const char* generator, const char* comment,
  33. const Int_t& aProj, const Int_t& zProj, const Double_t& pProj,
  34. const Int_t& aTarg, const Int_t& zTarg, const Double_t& pTarg,
  35. const Double_t& bMin, const Double_t& bMax, const Int_t& bWeight,
  36. const Double_t& phiMin, const Double_t& phiMax,
  37. const Double_t& sigma, const Int_t& nEvents);
  38. URun* run() const { return fRun; }
  39. UEvent* event() const { return fEvent; }
  40. private:
  41. /// Instance of the manager
  42. static UManager *fgInstance;
  43. /// List of tasks
  44. TList *fTaskList;
  45. /// Input file
  46. TFile *fInFile;
  47. /// Output file
  48. TFile *fOutFile;
  49. /// Input tree
  50. TTree *fInTree;
  51. /// Output tree
  52. TTree *fOutTree;
  53. /// Run object
  54. URun *fRun;
  55. /// Event
  56. UEvent *fEvent;
  57. /// Particle
  58. UParticle *fParticle;
  59. /// Output flag
  60. Bool_t fWrite;
  61. ClassDef(UManager, 1);
  62. };
  63. #endif // UManager_h