]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDPreprocessorOffline.h
Bug fixes as suggested by Matus and updates for pass0 making also the postcorrection...
[u/mrichter/AliRoot.git] / TRD / AliTRDPreprocessorOffline.h
1 #ifndef ALITRDPREPROCESSOROFFLINE_H
2 #define ALITRDPREPROCESSOROFFLINE_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 //    Class to create OCDB entries - processing the results of the OFFLINE calibration
10 //
11
12
13 #include "TNamed.h"
14 class TObjArray;
15 class AliTRDCalDet;
16 class TH2I;
17 class TProfile2D;
18 class AliTRDCalibraVdriftLinearFit;
19 class TH1I;
20 class TH2F;
21 class TString;
22
23
24 class AliTRDPreprocessorOffline:public TNamed { 
25 public:
26   enum{
27     kGain = 0,
28       kVdriftPHDet = 1,
29       kVdriftPHPad = 2,
30       kT0PHDet = 3,
31       kT0PHPad = 4,
32       kVdriftLinear = 5,
33       kLorentzLinear = 6,
34       kPRF = 7
35       };   
36   
37   AliTRDPreprocessorOffline();
38   virtual ~AliTRDPreprocessorOffline();
39
40   void SetLinearFitForVdrift(Bool_t methodsecond) { fMethodSecond = methodsecond;};
41   Bool_t GetLinearFitForVdrift() const { return fMethodSecond;};
42   void SetNameList(TString nameList) { fNameList = nameList;};
43   TString GetNameList() const { return fNameList;}; 
44   void SetCalDetGain(AliTRDCalDet *calDetGainUsed) {fCalDetGainUsed = calDetGainUsed;};
45   void SetCalDetVdrift(AliTRDCalDet *calDetVdriftUsed) {fCalDetVdriftUsed = calDetVdriftUsed;};
46   AliTRDCalDet *GetCalDetGain() const { return fCalDetGainUsed;};
47   AliTRDCalDet *GetCalDetVdrift() const { return fCalDetVdriftUsed;};
48
49   Bool_t Init(const Char_t* fileName);
50   
51   void CalibVdriftT0(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage="");
52   void CalibGain(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber,  TString  ocdbStorage="");
53   void CalibPRF(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber,  TString  ocdbStorage="");
54   
55   Bool_t ReadGainGlobal(const Char_t* fileName="CalibObjects.root");
56   Bool_t ReadVdriftT0Global(const Char_t* fileName="CalibObjects.root");
57   Bool_t ReadVdriftLinearFitGlobal(const Char_t* fileName="CalibObjects.root");
58   Bool_t ReadPRFGlobal(const Char_t* fileName="CalibObjects.root");
59
60   Bool_t AnalyzeGain(); 
61   Bool_t AnalyzeVdriftT0(); 
62   Bool_t AnalyzeVdriftLinearFit(); 
63   Bool_t AnalyzePRF(); 
64   
65   void CorrectFromDetGainUsed();
66   void CorrectFromDetVdriftUsed();
67
68   void UpdateOCDBT0(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath);
69   void UpdateOCDBVdrift(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath);
70   void UpdateOCDBGain(Int_t  startRunNumber, Int_t endRunNumber, const char* storagePath);
71   void UpdateOCDBPRF(Int_t  startRunNumber, Int_t endRunNumber, const char* storagePath);
72
73   Int_t    GetVersionGainUsed() const                                { return fVersionGainUsed;        }
74   Int_t    GetSubVersionGainUsed() const                             { return fSubVersionGainUsed;     }
75   Int_t    GetVersionVdriftUsed() const                              { return fVersionVdriftUsed;      }
76   Int_t    GetSubVersionVdriftUsed() const                           { return fSubVersionVdriftUsed;   }
77   
78   
79  private:
80   Bool_t fMethodSecond;                   // Second Method for drift velocity   
81   TString fNameList;                      // Name of the list
82   AliTRDCalDet *fCalDetGainUsed;          // CalDet used and to be corrected for
83   AliTRDCalDet *fCalDetVdriftUsed;        // CalDet used and to be corrected for
84   TH2I *fCH2d;                            // Gain
85   TProfile2D *fPH2d;                      // Drift velocity first method
86   TProfile2D *fPRF2d;                     // PRF
87   AliTRDCalibraVdriftLinearFit *fAliTRDCalibraVdriftLinearFit; // Drift velocity second method
88   TH1I *fNEvents;                         // Number of events 
89   TH2F *fAbsoluteGain;                    // Absolute Gain calibration
90   TObjArray * fPlots;                     // array with some plots to check
91   TObjArray * fCalibObjects;              // array with calibration objects 
92   Int_t    fVersionGainUsed;              // VersionGainUsed 
93   Int_t    fSubVersionGainUsed;           // SubVersionGainUsed
94   Int_t    fVersionVdriftUsed;            // VersionVdriftUsed 
95   Int_t    fSubVersionVdriftUsed;         // SubVersionVdriftUsed
96
97   Int_t GetSubVersion(TString name) const;
98   Int_t GetVersion(TString name) const;
99
100   
101
102 private:
103   AliTRDPreprocessorOffline& operator=(const AliTRDPreprocessorOffline&); // not implemented
104   AliTRDPreprocessorOffline(const AliTRDPreprocessorOffline&); // not implemented
105   ClassDef(AliTRDPreprocessorOffline,1)
106 };
107
108 #endif
109