LCOV - code coverage report
Current view: top level - TOF/TOFbase - AliTOFRunParams.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 2 26 7.7 %
Date: 2016-06-14 17:26:59 Functions: 3 30 10.0 %

          Line data    Source code
       1             : #ifndef ALITOFRUNPARAMS_H
       2             : #define ALITOFRUNPARAMS_H
       3             : 
       4             : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       5             :  * See cxx source for full Copyright notice                               */
       6             : /* $Id$ */
       7             : 
       8             : // *
       9             : // *
      10             : // *
      11             : // * this class defines the TOF object to be stored
      12             : // * in OCDB on a run-by-run basis in order to have the measurement
      13             : // * of the time evolution of T0 and of TOF resolution including
      14             : // * average T0 uncertainty
      15             : // *
      16             : // *
      17             : // *
      18             : 
      19             : #include "TObject.h"
      20             : 
      21             : class TGraph;
      22             : 
      23             : class AliTOFRunParams :
      24             : public TObject
      25             : {
      26             : 
      27             :  public:
      28             : 
      29             :   AliTOFRunParams(); // default constructor
      30             :   AliTOFRunParams(Int_t nPoints, Int_t nRuns = 1); // standard constructor
      31             :   virtual ~AliTOFRunParams(); // default destructor
      32             :   AliTOFRunParams(const AliTOFRunParams &source); // copy constructor
      33             :   AliTOFRunParams &operator=(const AliTOFRunParams &source); // operator=
      34             : 
      35           0 :   Int_t GetNPoints() const {return fNPoints;}; // getter
      36           0 :   UInt_t GetTimestamp(Int_t i) const {return fTimestamp && i < fNPoints ? fTimestamp[i] : 0;}; // getter
      37           0 :   Float_t GetT0(Int_t i) const {return fT0 && i < fNPoints ? fT0[i] : 0.;}; // getter
      38           0 :   Float_t GetTOFResolution(Int_t i) const {return fTOFResolution && i < fNPoints ? fTOFResolution[i] : 0.;}; // getter
      39           0 :   Float_t GetT0Spread(Int_t i) const {return fT0Spread && i < fNPoints ? fT0Spread[i] : 0.;}; // getter
      40             :   
      41           0 :   Int_t GetNRuns() const {return fNRuns;}; // getter
      42           0 :   UInt_t GetRunNb(Int_t i) const {return fRunNb && i < fNRuns ? fRunNb[i] : 0;}; // getter
      43           0 :   UInt_t GetRunFirstPoint(Int_t i) const {return fRunFirstPoint && i < fNRuns ? fRunFirstPoint[i] : 0;}; // getter
      44           0 :   UInt_t GetRunLastPoint(Int_t i) const {return fRunLastPoint && i < fNRuns ? fRunLastPoint[i] : 0;}; // getter
      45             : 
      46           0 :   void SetTimestamp(UInt_t *value) {if (fTimestamp) for (Int_t i = 0; i < fNPoints; i++) fTimestamp[i] = value[i];}; // setter
      47           0 :   void SetT0(Float_t *value) {if (fT0) for (Int_t i = 0; i < fNPoints; i++) fT0[i] = value[i];}; // setter
      48           0 :   void SetTOFResolution(Float_t *value) {if (fTOFResolution) for (Int_t i = 0; i < fNPoints; i++) fTOFResolution[i] = value[i];}; // setter
      49           0 :   void SetT0Spread(Float_t *value) {if (fT0Spread) for (Int_t i = 0; i < fNPoints; i++) fT0Spread[i] = value[i];}; // setter
      50             : 
      51           0 :   void SetRunNb(UInt_t *value) {if (fRunNb) for (Int_t i = 0; i < fNRuns; i++) fRunNb[i] = value[i];}; // setter
      52           0 :   void SetRunFirstPoint(UInt_t *value) {if (fRunFirstPoint) for (Int_t i = 0; i < fNRuns; i++) fRunFirstPoint[i] = value[i];}; // setter
      53           0 :   void SetRunLastPoint(UInt_t *value) {if (fRunLastPoint) for (Int_t i = 0; i < fNRuns; i++) fRunLastPoint[i] = value[i];}; // setter
      54             : 
      55           0 :   void SetUseLHCClockPhase(Bool_t value) {fUseLHCClockPhase = value;}; // setter
      56             : 
      57             :   Float_t EvalT0(UInt_t timestamp); // eval T0
      58             :   Float_t EvalTOFResolution(UInt_t timestamp); // eval TOF resolution
      59             :   Float_t EvalT0Spread(UInt_t timestamp); // eval T0 spread
      60             :   
      61           0 :   Float_t AverageT0(UInt_t runNb) {return Average(fT0, runNb);}; // average T0
      62           0 :   Float_t AverageTOFResolution(UInt_t runNb) {return Average(fTOFResolution, runNb);}; // average TOF resolution
      63           0 :   Float_t AverageT0Spread(UInt_t runNb) {return Average(fT0Spread, runNb);}; // average T0 spread
      64             : 
      65           8 :   Bool_t GetUseLHCClockPhase() const {return fUseLHCClockPhase;}; // getter
      66             : 
      67           0 :   TGraph *DrawGraphT0(Option_t *option = "") {return DrawGraph(fT0, option);}; // draw graph t0
      68           0 :   TGraph *DrawGraphTOFResolution(Option_t *option = "") {return DrawGraph(fTOFResolution, option);}; // draw graph t0
      69           0 :   TGraph *DrawGraphT0Spread(Option_t *option = "") {return DrawGraph(fT0Spread, option);}; // draw graph t0
      70           0 :   TGraph *DrawCorrelationGraphTOFResolutionT0Spread(Option_t *option = "") {return DrawCorrelationGraph(fT0Spread, fTOFResolution, option);}; // draw correlation graph
      71             : 
      72             : 
      73             :  private:
      74             :   
      75             :   /* private methods */
      76             :   
      77             :   Float_t Average(Float_t *data, UInt_t runNb); // average
      78             :   Float_t Average(Float_t *data, Int_t first, Int_t last); // average
      79             :   TGraph *DrawGraph(Float_t *data, Option_t *option = ""); // draw graph
      80             :   TGraph *DrawCorrelationGraph(Float_t *datax, Float_t *datay, Option_t *option = ""); // draw graph
      81             :   
      82             :   /* data members */
      83             : 
      84             :   Int_t fNPoints;
      85             :   UInt_t *fTimestamp; //[fNPoints] time stamp
      86             :   Float_t *fT0; //[fNPoints] average T0 (ps)
      87             :   Float_t *fTOFResolution; //[fNPoints] average TOF resolution (T0 uncertainty included) (ps)
      88             :   Float_t *fT0Spread; //[fNPoints] estimated T0 spread (from vertex spread z) (ps)
      89             : 
      90             :   Int_t fNRuns;
      91             :   UInt_t *fRunNb; //[fNRuns] run number
      92             :   UInt_t *fRunFirstPoint; //[fNRuns] run start point
      93             :   UInt_t *fRunLastPoint; //[fNRuns] run last point
      94             : 
      95             :   Bool_t fUseLHCClockPhase; // use LHC clockphase
      96             : 
      97             : 
      98          50 :   ClassDef(AliTOFRunParams, 3);
      99             : };
     100             : 
     101             : #endif /* ALITOFRUNPARAMS_H */

Generated by: LCOV version 1.11