MpdBoxSetDraw.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // -------------------------------------------------------------------------
  2. // ----- MpdBoxSetDraw header file -----
  3. // ----- Created 26/03/09 by T. Stockmanns -----
  4. // -------------------------------------------------------------------------
  5. /** MpdBoxSetDraw
  6. * @author T. Stockmanns
  7. * @since 26.3.2009
  8. * Base class to display 3D Points in Eve as a BoxSet
  9. * One has to overwrite the method GetVector which takes a TObject and writes out a TVector3 which is then taken as an input
  10. * to place the points.
  11. * If one wants to change the color of the points one has to overwrite the method GetValue. This method takes a TObject and
  12. * an integer and translates this into an integer as input for the EveBoxSet method DigitValue
  13. **
  14. **/
  15. #ifndef MPDBOXSETDRAW_H
  16. #define MPDBOXSETDRAW_H
  17. #include "MpdEventManager.h"
  18. #include "FairTask.h"
  19. #include "FairRootManager.h"
  20. #include "FairTSBufferFunctional.h" // for StopTime
  21. #include "TClonesArray.h"
  22. #include "TVector3.h"
  23. #include "TObject.h"
  24. class MpdBoxSet;
  25. class MpdBoxSetDraw : public FairTask
  26. {
  27. public:
  28. /** Default constructor **/
  29. MpdBoxSetDraw();
  30. /** Standard constructor
  31. *@param name Name of task
  32. *@param iVerbose Verbosity level
  33. **/
  34. MpdBoxSetDraw(const char* name, Int_t iVerbose = 1);
  35. /** Destructor **/
  36. virtual ~MpdBoxSetDraw();
  37. /** Set verbosity level. For this task and all of the subtasks. **/
  38. virtual void SetVerbose(Int_t iVerbose) { fVerbose = iVerbose; }
  39. virtual void SetRedraw(Bool_t is_redraw) { isRedraw = is_redraw; }
  40. virtual Double_t GetTimeWindowPlus() { return fTimeWindowPlus; }
  41. virtual Double_t GetTimeWindowMinus() { return fTimeWindowMinus; }
  42. virtual void SetTimeWindowMinus(Double_t val) { fTimeWindowMinus = val; }
  43. virtual void SetTimeWindowPlus(Double_t val) { fTimeWindowPlus = val; }
  44. virtual void SetStartTime(Double_t val) { fStartTime = val; }
  45. virtual void UseEventTimeAsStartTime(Bool_t val = kTRUE) { fUseEventTime = val; }
  46. MpdBoxSet* CreateBoxSet();
  47. virtual void SetBoxDimensions(Double_t x, Double_t y, Double_t z)
  48. {
  49. fX = x;
  50. fY = y;
  51. fZ = z;
  52. }
  53. /** Executed task **/
  54. virtual void Exec(Option_t* option);
  55. void Reset();
  56. protected:
  57. virtual void SetParContainers();
  58. virtual InitStatus Init();
  59. /** Action after each event**/
  60. virtual void Finish();
  61. virtual TVector3 GetVector(TObject* obj) = 0;
  62. virtual Int_t GetValue(TObject* obj, Int_t i);
  63. virtual void AddBoxes(MpdBoxSet* set, TObject* obj, Int_t i = 0);
  64. // Verbosity level
  65. Int_t fVerbose;
  66. TClonesArray* fList; //!
  67. MpdEventManager* fEventManager; //!
  68. FairRootManager* fManager; //!
  69. MpdBoxSet* fq; //!
  70. Double_t fX, fY, fZ;
  71. Double_t fTimeWindowPlus;
  72. Double_t fTimeWindowMinus;
  73. Double_t fStartTime;
  74. Bool_t fUseEventTime;
  75. Bool_t isRedraw;
  76. private:
  77. MpdBoxSetDraw(const MpdBoxSetDraw&);
  78. MpdBoxSetDraw& operator=(const MpdBoxSetDraw&);
  79. BinaryFunctor* fStartFunctor;
  80. BinaryFunctor* fStopFunctor;
  81. ClassDef(MpdBoxSetDraw,1);
  82. };
  83. #endif