UManager.h 1.6 KB

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