]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFAnalysisTaskCalibPass0.h
Fix bug in building local list of valid files.
[u/mrichter/AliRoot.git] / TOF / AliTOFAnalysisTaskCalibPass0.h
1 #ifndef ALITOFANALYSISTASKCALIBPASS0_H
2 #define ALITOFANALYSISTASKCALIBPASS0_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 ///////////////////////////////////////////////////////////////
8 //                                                           //
9 //   This class provides TOF pass0/passX calibration tools   //
10 //                                                           //
11 ///////////////////////////////////////////////////////////////
12
13 #include "AliAnalysisTaskSE.h"
14
15 class AliESDtrack;
16 class AliESDEvent;
17 class AliPhysicsSelection;
18 class AliESDtrackCuts;
19 class AliESDVertex;
20 class AliGRPManager;
21 class AliGRPObject;
22 class AliTOFcalib;
23 class TList;
24 class TH2F;
25 class TF1;
26 class TH1D;
27 class AliCDBStorage;
28
29 class AliTOFAnalysisTaskCalibPass0 :
30 public AliAnalysisTaskSE
31 {
32
33  public:
34
35   AliTOFAnalysisTaskCalibPass0(); // default constructor
36   virtual ~AliTOFAnalysisTaskCalibPass0(); // default destructor
37
38   virtual void UserCreateOutputObjects(); // user create output objects
39   virtual void UserExec(Option_t *); // user exec
40
41   /* getters */
42   AliPhysicsSelection *GetEventCuts() const {return fEventCuts;}; // getter
43   AliESDtrackCuts *GetTrackCuts() const {return fTrackCuts;}; // getter
44   AliTOFcalib *GetTOFcalib() const {return fTOFcalib;}; // getter
45   
46   /* setters */
47   void SetEventSelectionFlag(Bool_t value = kTRUE) {fEventSelectionFlag = value;}; // setter
48   void SetVertexSelectionFlag(Bool_t value = kTRUE) {fVertexSelectionFlag = value;}; // setter
49   void SetVertexCut(Double_t value) {fVertexCut = value;}; // setter
50
51   /* post-processing methods */
52   Bool_t ProcessOutput(const Char_t *filename, AliCDBStorage* db); // process output
53   Bool_t DoProcessOutput(const Char_t *filename, AliCDBStorage* db); // process output
54   Int_t GetStatus(); // get status
55   void PrintStatus(); // print status
56
57   /* static setters */
58   static void SetMinVertexIntegral(Double_t value) {fgMinVertexIntegral = value;}; // setter
59   static void SetMinDeltatIntegal(Double_t value) {fgMinDeltatIntegral = value;}; // setter
60   static void SetMinVertexIntegralSample (Double_t value) {fgMinVertexIntegralSample = value;}; // setter
61   static void SetMinDeltatIntegralSample (Double_t value) {fgMinDeltatIntegralSample = value;}; // setter
62   
63  protected:
64
65   AliTOFAnalysisTaskCalibPass0(const AliTOFAnalysisTaskCalibPass0 &); // copy constructor
66   AliTOFAnalysisTaskCalibPass0 &operator=(const AliTOFAnalysisTaskCalibPass0 &); // operator=
67
68   /* status codes */
69   enum EStatusCode_t {
70     kOk,
71     kInputError, /* open file error, missing histos */
72     kDataError, /* problems with histo information */
73     kNotActive, /* not active in data taking and/or reconstruction */
74     kLowStatistics, /* too low statistics */
75     kNoMeasurement, /* no measurement performed */
76     kStoreError, /* problems storing OCDB */
77     kNStatusCodes
78   };
79   Int_t fStatus; /* status code */
80   static const Char_t *fgkStatusCodeName[kNStatusCodes];
81
82   /* methods */
83   Bool_t InitRun(); // init run
84   Bool_t InitEvent(); // init event
85   Bool_t HasTOFMeasurement(const AliESDtrack *track) const ; // has TOF measurement
86
87   /* post-processing methods */
88   Bool_t CheckMatchingPerformance(const TH2F *histoDeltazEta, const TH2F *histoAcceptedTracksEtaPt, const TH2F *histoMatchedTracksEtaPt) const; // check matching efficiency
89   Bool_t CalibrateAndStore(TH2F *histoVertexTimestamp, TH2F *histoDeltatTimestamp, AliCDBStorage *db); // calibrate and store
90   Int_t FitPeak(TF1 *fitFunc, TH1D *h, Float_t startSigma, Float_t nSigmaMin, Float_t nSigmaMax); // fit peak
91
92   /* flags and cuts */
93   Bool_t fInitFlag; // init flag
94   Bool_t fEventSelectionFlag; // event selection flag
95   Bool_t fVertexSelectionFlag; // vertex selection flag
96   Double_t fVertexCut; // vertex cut
97
98   /* ESD analysis */
99   Int_t fRunNumber; // run number
100   AliESDEvent *fESDEvent; // ESD event
101   AliPhysicsSelection *fEventCuts; // event cuts
102   AliESDtrackCuts *fTrackCuts; // track cuts
103   UInt_t fStartTime; // start time
104   UInt_t fEndTime; // end time
105   UInt_t fEventTime; // event time
106   UInt_t fElapsedTime; // event time since start
107   const AliESDVertex *fkVertex; // vertex
108
109   /* GRP related stuff */
110   AliGRPManager *fGRPManager; // GRP manager
111   const AliGRPObject *fkGRPObject; // GRP object
112   
113   /* TOF related stuff */
114   AliTOFcalib *fTOFcalib; // TOF calib
115
116   /* lists and histos */
117   TList *fHistoList; // list of histograms
118   TH2F *fHistoVertexTimestamp; // vertex-timestamp histo
119   TH2F *fHistoDeltatTimestamp; // deltat-timestamp histo
120   TH2F *fHistoDeltazEta; // deltaz-eta histo
121   TH2F *fHistoDeltatEta; // deltaTime-eta histo
122   TH2F *fHistoDeltazCosTheta; // deltaz-costheta histo
123   TH2F *fHistoAcceptedTracksEtaPt; // accepted tracks eta-pt histo
124   TH2F *fHistoMatchedTracksEtaPt; // matched tracks eta-pt histo
125
126   /* post-processing variables */
127   static const Int_t fgkMaxNumberOfPoints; // max number of points
128   static Double_t fgMinVertexIntegral; // min vertex integral
129   static Double_t fgMinDeltatIntegral; // min vertex integral
130   static Double_t fgMinVertexIntegralSample; // min vertex integral sample
131   static Double_t fgMinDeltatIntegralSample; // min vertex integral sample
132
133
134   ClassDef(AliTOFAnalysisTaskCalibPass0, 2);
135 };
136
137 #endif /* ALIANALYSISTASKEVENTTIME_H */