]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALITOFCALIB_H | |
2 | #define ALITOFCALIB_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 | // class for TOF calibration:: simulation of uncalibrated data // | |
9 | ////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #define CHENTRIESSMALL 300 // number of entries per TOF channel per run | |
12 | // (to be divided by 3 to get the | |
13 | // real number of entries), smallarray | |
14 | #define MAXCHENTRIESSMALL 10000 // max number of entries per TOF channel | |
15 | // (to be divided by 3 to get the | |
16 | // real number of entries), smallarray | |
17 | ||
18 | #define NIDXSMALL 3 // number of values stored | |
19 | // after Comb PID per ESD track | |
20 | #define DELTAIDXTOT 0 // index for ToT in bigarray | |
21 | #define DELTAIDXTIME 1 // index for TOF time in big/smallarray | |
22 | #define DELTAIDXPID 2 // index for Exp Time after Comb PID | |
23 | // in smallarray | |
24 | #define MEANENTRIES 15 // Mean number of entries per channel | |
25 | // to perform calibration | |
26 | ||
27 | #include "TTask.h" | |
28 | ||
29 | class TArrayF; | |
30 | class TF1; | |
31 | class TH1F; | |
32 | class TObjArray; | |
33 | class TTree; | |
34 | class TChain; | |
35 | class TMap; | |
36 | ||
37 | //class AliESD; | |
38 | ||
39 | class AliTOFCal; | |
40 | class AliTOFRecoParam; | |
41 | class AliTOFChannelOnlineStatusArray; | |
42 | class AliTOFChannelOnlineArray; | |
43 | class AliTOFDeltaBCOffset; | |
44 | class AliTOFCTPLatency; | |
45 | class AliTOFT0Fill; | |
46 | ||
47 | class AliTOFcalib:public TTask{ | |
48 | public: | |
49 | AliTOFcalib(); // ctor | |
50 | AliTOFcalib(const AliTOFcalib & calib); // copy constructor | |
51 | AliTOFcalib& operator=(const AliTOFcalib & calib); // assignment operator | |
52 | virtual ~AliTOFcalib() ; // dtor | |
53 | void CreateCalArrays(); | |
54 | void CreateCalObjects(); | |
55 | TObjArray * GetTOFCalArrayOnline() const {return fTOFCalOnline;} | |
56 | AliTOFChannelOnlineArray * GetTOFOnlineDelay() const {return fCal;} | |
57 | AliTOFChannelOnlineStatusArray * GetTOFOnlineStatus() const {return fStatus;} | |
58 | TObjArray * GetTOFCalArrayOnlinePulser() const {return fTOFCalOnlinePulser;} | |
59 | TObjArray * GetTOFCalArrayOnlineNoise() const {return fTOFCalOnlineNoise;} | |
60 | TObjArray * GetTOFCalArrayOnlineHW() const {return fTOFCalOnlineHW;} | |
61 | TObjArray * GetTOFCalArrayOffline() const {return fTOFCalOffline;} | |
62 | TMap * GetConfigMap() const {return fConfigMap;} | |
63 | TH1F * GetTOFSimToT() const {return fTOFSimToT;} | |
64 | TTree * GetTOFCalibTree() const {return fTree;} | |
65 | TChain * GetTOFCalibChain() const {return fChain;} | |
66 | const char * GetOfflineValidity() const {return fkValidity;} | |
67 | void SetOfflineValidity(const char* validity) {fkValidity = validity;} | |
68 | Int_t NChannels()const{return fNChannels;} | |
69 | ||
70 | void CreateDeltaBCOffset(); | |
71 | void CreateCTPLatency(); | |
72 | void CreateT0Fill(); | |
73 | AliTOFDeltaBCOffset *GetDeltaBCOffset() const {return fDeltaBCOffset;}; | |
74 | AliTOFCTPLatency *GetCTPLatency() const {return fCTPLatency;}; | |
75 | AliTOFT0Fill *GetT0Fill() const {return fT0Fill;}; | |
76 | ||
77 | // Methods to retrieve/write parameters from/on CDB | |
78 | // writing | |
79 | ||
80 | void WriteSimHistoOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun, TH1F *histo); | |
81 | void WriteConfigMapOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun); | |
82 | void WriteConfigMapOnCDB(const Char_t *sel); | |
83 | // new calib objs | |
84 | void WriteParOnlineDelayOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun); | |
85 | void WriteParOnlineStatusOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun); | |
86 | void WriteParOnlineDelayOnCDB(const Char_t *sel); | |
87 | void WriteParOnlineStatusOnCDB(const Char_t *sel); | |
88 | // old calib objs | |
89 | void WriteParOnlineOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun); | |
90 | void WriteParOnlinePulserOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun); | |
91 | void WriteParOnlineNoiseOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun); | |
92 | void WriteParOnlineHWOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun); | |
93 | void WriteParOfflineOnCDB(const Char_t *sel, const Char_t *validity, Int_t minrun, Int_t maxrun); | |
94 | void WriteParOnlineOnCDB(const Char_t *sel); | |
95 | void WriteParOnlinePulserOnCDB(const Char_t *sel); // old, before unification of status info | |
96 | void WriteParOnlineNoiseOnCDB(const Char_t *sel); // old, before unification of status info | |
97 | void WriteParOnlineHWOnCDB(const Char_t *sel); // old, before unification of status info | |
98 | void WriteParOfflineOnCDB(const Char_t *sel, const Char_t *validity); | |
99 | ||
100 | void WriteDeltaBCOffsetOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun); | |
101 | void WriteCTPLatencyOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun); | |
102 | void WriteT0FillOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun); | |
103 | ||
104 | // reading | |
105 | Bool_t ReadSimHistoFromCDB(const Char_t *sel, Int_t nrun); | |
106 | Bool_t ReadConfigMapFromCDB(const Char_t *sel, Int_t nrun); | |
107 | // new objs | |
108 | Bool_t ReadParOnlineDelayFromCDB(const Char_t *sel, Int_t nrun); | |
109 | Bool_t ReadParOnlineStatusFromCDB(const Char_t *sel, Int_t nrun); | |
110 | // old objs | |
111 | Bool_t ReadParOnlineFromCDB(const Char_t *sel, Int_t nrun); | |
112 | Bool_t ReadParOnlinePulserFromCDB(const Char_t *sel, Int_t nrun); // old, before unification of status info | |
113 | Bool_t ReadParOnlineNoiseFromCDB(const Char_t *sel, Int_t nrun); // old, before unification of status info | |
114 | Bool_t ReadParOnlineHWFromCDB(const Char_t *sel, Int_t nrun); // old, before unification of status info | |
115 | Bool_t ReadParOfflineFromCDB(const Char_t *sel, Int_t nrun); | |
116 | void WriteRecParOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFRecoParam *param); | |
117 | AliTOFRecoParam * ReadRecParFromCDB(const Char_t *sel, Int_t nrun); | |
118 | void CreateTreeFromCDB(Int_t minrun, Int_t maxrun); | |
119 | void CreateTreeFromFile(Int_t minrun, Int_t maxrun); | |
120 | void CreateTreeFromGrid(Int_t minrun, Int_t maxrun); | |
121 | void CreateChainFromGrid(Int_t minrun, Int_t maxrun); | |
122 | Int_t Calibrate(Option_t *optionSave="", Option_t *optionFit="RQ"); | |
123 | Int_t Calibrate(Int_t nch,Int_t *ich, Option_t *optionSave="", Option_t *optionFit="RQ"); | |
124 | Int_t Calibrate(Int_t ichmin, Int_t ichmax, Option_t *optionSave="", Option_t *optionFit="RQ"); | |
125 | Int_t Calibrate(Int_t ich, Option_t *optionSave="", Option_t *optionFit="RQ"); | |
126 | Int_t CalibrateFromProfile(Int_t ich, Option_t *optionSave="", Option_t *optionFit="RQ"); | |
127 | TH1F* Profile(Int_t i); | |
128 | Int_t FindBins (TH1F* h, Double_t *bins) const; | |
129 | void SetNruns(Int_t nruns) {fNruns=nruns;} | |
130 | Int_t GetNruns() const {return fNruns;} | |
131 | void SetFirstRun(Int_t firstRun) {fFirstRun=firstRun;} | |
132 | Int_t GetFirstRun() const {return fFirstRun;} | |
133 | void SetLastRun(Int_t lastRun) {fLastRun=lastRun;} | |
134 | Int_t GetLastRun() const {return fLastRun;} | |
135 | ||
136 | Bool_t ReadDeltaBCOffsetFromCDB(const Char_t *sel, Int_t nrun); | |
137 | Bool_t ReadCTPLatencyFromCDB(const Char_t *sel, Int_t nrun); | |
138 | Bool_t ReadT0FillFromCDB(const Char_t *sel, Int_t nrun); | |
139 | ||
140 | private: | |
141 | Int_t fNChannels; // number of TOF channels | |
142 | ||
143 | // old calibration objects | |
144 | TObjArray *fTOFCalOnline; // array of AliTOFChannels storing calib parameters | |
145 | TObjArray *fTOFCalOnlinePulser; // array of AliTOFChannels storing calib status from pulser // old, before unification of status info | |
146 | TObjArray *fTOFCalOnlineNoise; // array of AliTOFChannels storing calib status from noise // old, before unification of status info | |
147 | TObjArray *fTOFCalOnlineHW; // array of AliTOFChannels storing calib status from hardware // old, before unification of status info | |
148 | TObjArray *fTOFCalOffline; // array of AliTOFChannels storing calib parameters | |
149 | ||
150 | // new calibration objects | |
151 | AliTOFChannelOnlineArray *fCal; // object with delay array for TOF channels | |
152 | AliTOFChannelOnlineStatusArray *fStatus; // object with status array for TOF channels | |
153 | ||
154 | TH1F *fTOFSimToT; // histo with realistic ToT signal from TB Data | |
155 | const char *fkValidity; // validity for offline calibration object | |
156 | TTree *fTree; // tree for TOF calibration | |
157 | TChain *fChain; // chain for TOF calibration | |
158 | Int_t fNruns; // number of runs to be processed | |
159 | Int_t fFirstRun; // first run for calibration obj validity | |
160 | Int_t fLastRun; // last run for calib obj validity | |
161 | TMap* fConfigMap; // map holding configuration obj | |
162 | ||
163 | AliTOFDeltaBCOffset *fDeltaBCOffset; // deltaBC offset | |
164 | AliTOFCTPLatency *fCTPLatency; // CTP latency | |
165 | AliTOFT0Fill *fT0Fill; // T0 fill | |
166 | ||
167 | ClassDef(AliTOFcalib,8); | |
168 | }; | |
169 | ||
170 | #endif // AliTOFcalib_H | |
171 |