]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFRunParams.h
Fix for TOF matching + lego_train update
[u/mrichter/AliRoot.git] / TOF / AliTOFRunParams.h
index e45ea6c043ade0c09c122471b727a1339f1256b7..42f3b0c6262faff6139ce80482146c834cc6b814 100644 (file)
@@ -18,6 +18,8 @@
 
 #include "TObject.h"
 
+class TGraph;
+
 class AliTOFRunParams :
 public TObject
 {
@@ -25,7 +27,7 @@ public TObject
  public:
 
   AliTOFRunParams(); // default constructor
-  AliTOFRunParams(Int_t nPoints); // standard constructor
+  AliTOFRunParams(Int_t nPoints, Int_t nRuns = 1); // standard constructor
   virtual ~AliTOFRunParams(); // default destructor
   AliTOFRunParams(const AliTOFRunParams &source); // copy constructor
   AliTOFRunParams &operator=(const AliTOFRunParams &source); // operator=
@@ -36,16 +38,48 @@ public TObject
   Float_t GetTOFResolution(Int_t i) const {return fTOFResolution && i < fNPoints ? fTOFResolution[i] : 0.;}; // getter
   Float_t GetT0Spread(Int_t i) const {return fT0Spread && i < fNPoints ? fT0Spread[i] : 0.;}; // getter
   
+  Int_t GetNRuns() const {return fNRuns;}; // getter
+  UInt_t GetRunNb(Int_t i) const {return fRunNb && i < fNRuns ? fRunNb[i] : 0;}; // getter
+  UInt_t GetRunFirstPoint(Int_t i) const {return fRunFirstPoint && i < fNRuns ? fRunFirstPoint[i] : 0;}; // getter
+  UInt_t GetRunLastPoint(Int_t i) const {return fRunLastPoint && i < fNRuns ? fRunLastPoint[i] : 0;}; // getter
+
   void SetTimestamp(UInt_t *value) {if (fTimestamp) for (Int_t i = 0; i < fNPoints; i++) fTimestamp[i] = value[i];}; // setter
   void SetT0(Float_t *value) {if (fT0) for (Int_t i = 0; i < fNPoints; i++) fT0[i] = value[i];}; // setter
   void SetTOFResolution(Float_t *value) {if (fTOFResolution) for (Int_t i = 0; i < fNPoints; i++) fTOFResolution[i] = value[i];}; // setter
   void SetT0Spread(Float_t *value) {if (fT0Spread) for (Int_t i = 0; i < fNPoints; i++) fT0Spread[i] = value[i];}; // setter
 
+  void SetRunNb(UInt_t *value) {if (fRunNb) for (Int_t i = 0; i < fNRuns; i++) fRunNb[i] = value[i];}; // setter
+  void SetRunFirstPoint(UInt_t *value) {if (fRunFirstPoint) for (Int_t i = 0; i < fNRuns; i++) fRunFirstPoint[i] = value[i];}; // setter
+  void SetRunLastPoint(UInt_t *value) {if (fRunLastPoint) for (Int_t i = 0; i < fNRuns; i++) fRunLastPoint[i] = value[i];}; // setter
+
+  void SetUseLHCClockPhase(Bool_t value) {fUseLHCClockPhase = value;}; // setter
+
   Float_t EvalT0(UInt_t timestamp); // eval T0
   Float_t EvalTOFResolution(UInt_t timestamp); // eval TOF resolution
   Float_t EvalT0Spread(UInt_t timestamp); // eval T0 spread
+  
+  Float_t AverageT0(UInt_t runNb) {return Average(fT0, runNb);}; // average T0
+  Float_t AverageTOFResolution(UInt_t runNb) {return Average(fTOFResolution, runNb);}; // average TOF resolution
+  Float_t AverageT0Spread(UInt_t runNb) {return Average(fT0Spread, runNb);}; // average T0 spread
+
+  Bool_t GetUseLHCClockPhase() const {return fUseLHCClockPhase;}; // getter
+
+  TGraph *DrawGraphT0(Option_t *option = "") {return DrawGraph(fT0, option);}; // draw graph t0
+  TGraph *DrawGraphTOFResolution(Option_t *option = "") {return DrawGraph(fTOFResolution, option);}; // draw graph t0
+  TGraph *DrawGraphT0Spread(Option_t *option = "") {return DrawGraph(fT0Spread, option);}; // draw graph t0
+  TGraph *DrawCorrelationGraphTOFResolutionT0Spread(Option_t *option = "") {return DrawCorrelationGraph(fT0Spread, fTOFResolution, option);}; // draw correlation graph
+
 
  private:
+  
+  /* private methods */
+  
+  Float_t Average(Float_t *data, UInt_t runNb); // average
+  Float_t Average(Float_t *data, Int_t first, Int_t last); // average
+  TGraph *DrawGraph(Float_t *data, Option_t *option = ""); // draw graph
+  TGraph *DrawCorrelationGraph(Float_t *datax, Float_t *datay, Option_t *option = ""); // draw graph
+  
+  /* data members */
 
   Int_t fNPoints;
   UInt_t *fTimestamp; //[fNPoints] time stamp
@@ -53,7 +87,15 @@ public TObject
   Float_t *fTOFResolution; //[fNPoints] average TOF resolution (T0 uncertainty included) (ps)
   Float_t *fT0Spread; //[fNPoints] estimated T0 spread (from vertex spread z) (ps)
 
-  ClassDef(AliTOFRunParams, 1);
+  Int_t fNRuns;
+  UInt_t *fRunNb; //[fNRuns] run number
+  UInt_t *fRunFirstPoint; //[fNRuns] run start point
+  UInt_t *fRunLastPoint; //[fNRuns] run last point
+
+  Bool_t fUseLHCClockPhase; // use LHC clockphase
+
+
+  ClassDef(AliTOFRunParams, 3);
 };
 
 #endif /* ALITOFRUNPARAMS_H */