AliTPCTransform.h - removing warning visible in
[u/mrichter/AliRoot.git] / TOF / AliTOFcalib.h
CommitLineData
6dc9348d 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
0a749fa5 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
6dc9348d 27#include "TTask.h"
0e46b9ae 28
29class TArrayF;
30class TF1;
31class TH1F;
32class TObjArray;
0a749fa5 33class TTree;
296591ad 34class TChain;
17149e6b 35class TMap;
0e46b9ae 36
5c7c93fa 37//class AliESD;
0e46b9ae 38
39class AliTOFCal;
7037bd93 40class AliTOFRecoParam;
17149e6b 41class AliTOFChannelOnlineStatusArray;
42class AliTOFChannelOnlineArray;
6dc9348d 43
44class AliTOFcalib:public TTask{
45public:
46 AliTOFcalib(); // ctor
7aeeaf38 47 AliTOFcalib(const AliTOFcalib & calib); // copy constructor
48 AliTOFcalib& operator=(const AliTOFcalib & calib); // assignment operator
6dc9348d 49 virtual ~AliTOFcalib() ; // dtor
0a749fa5 50 void CreateCalArrays();
24d1e16e 51 void CreateCalObjects();
0a749fa5 52 TObjArray * GetTOFCalArrayOnline() const {return fTOFCalOnline;}
17149e6b 53 AliTOFChannelOnlineArray * GetTOFOnlineDelay() const {return fCal;}
54 AliTOFChannelOnlineStatusArray * GetTOFOnlineStatus() const {return fStatus;}
7fffa85b 55 TObjArray * GetTOFCalArrayOnlinePulser() const {return fTOFCalOnlinePulser;}
56 TObjArray * GetTOFCalArrayOnlineNoise() const {return fTOFCalOnlineNoise;}
57 TObjArray * GetTOFCalArrayOnlineHW() const {return fTOFCalOnlineHW;}
0a749fa5 58 TObjArray * GetTOFCalArrayOffline() const {return fTOFCalOffline;}
17149e6b 59 TMap * GetConfigMap() const {return fConfigMap;}
d4ad0d6b 60 TH1F * GetTOFSimToT() const {return fTOFSimToT;}
0a749fa5 61 TTree * GetTOFCalibTree() const {return fTree;}
296591ad 62 TChain * GetTOFCalibChain() const {return fChain;}
0a749fa5 63 const char * GetOfflineValidity() const {return fkValidity;}
64 void SetOfflineValidity(const char* validity) {fkValidity = validity;}
d4ad0d6b 65 Int_t NChannels()const{return fNChannels;}
17149e6b 66
d4ad0d6b 67 // Methods to retrieve/write parameters from/on CDB
17149e6b 68 // writing
69
a6e0ebfe 70 void WriteSimHistoOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun, TH1F *histo);
71 void WriteConfigMapOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun);
72 void WriteConfigMapOnCDB(const Char_t *sel);
17149e6b 73 // new calib objs
a6e0ebfe 74 void WriteParOnlineDelayOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun);
75 void WriteParOnlineStatusOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun);
76 void WriteParOnlineDelayOnCDB(const Char_t *sel);
77 void WriteParOnlineStatusOnCDB(const Char_t *sel);
17149e6b 78 // old calib objs
a6e0ebfe 79 void WriteParOnlineOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun);
80 void WriteParOnlinePulserOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun);
81 void WriteParOnlineNoiseOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun);
82 void WriteParOnlineHWOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun);
83 void WriteParOfflineOnCDB(const Char_t *sel, const Char_t *validity, Int_t minrun, Int_t maxrun);
84 void WriteParOnlineOnCDB(const Char_t *sel);
85 void WriteParOnlinePulserOnCDB(const Char_t *sel); // old, before unification of status info
86 void WriteParOnlineNoiseOnCDB(const Char_t *sel); // old, before unification of status info
87 void WriteParOnlineHWOnCDB(const Char_t *sel); // old, before unification of status info
88 void WriteParOfflineOnCDB(const Char_t *sel, const Char_t *validity);
17149e6b 89
90 // reading
a6e0ebfe 91 Bool_t ReadSimHistoFromCDB(const Char_t *sel, Int_t nrun);
92 Bool_t ReadConfigMapFromCDB(const Char_t *sel, Int_t nrun);
17149e6b 93 // new objs
a6e0ebfe 94 Bool_t ReadParOnlineDelayFromCDB(const Char_t *sel, Int_t nrun);
95 Bool_t ReadParOnlineStatusFromCDB(const Char_t *sel, Int_t nrun);
17149e6b 96 // old objs
a6e0ebfe 97 Bool_t ReadParOnlineFromCDB(const Char_t *sel, Int_t nrun);
98 Bool_t ReadParOnlinePulserFromCDB(const Char_t *sel, Int_t nrun); // old, before unification of status info
99 Bool_t ReadParOnlineNoiseFromCDB(const Char_t *sel, Int_t nrun); // old, before unification of status info
100 Bool_t ReadParOnlineHWFromCDB(const Char_t *sel, Int_t nrun); // old, before unification of status info
101 Bool_t ReadParOfflineFromCDB(const Char_t *sel, Int_t nrun);
102 void WriteRecParOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFRecoParam *param);
103 AliTOFRecoParam * ReadRecParFromCDB(const Char_t *sel, Int_t nrun);
0a749fa5 104 void CreateTreeFromCDB(Int_t minrun, Int_t maxrun);
105 void CreateTreeFromFile(Int_t minrun, Int_t maxrun);
106 void CreateTreeFromGrid(Int_t minrun, Int_t maxrun);
296591ad 107 void CreateChainFromGrid(Int_t minrun, Int_t maxrun);
0a749fa5 108 Int_t Calibrate(Option_t *optionSave="", Option_t *optionFit="RQ");
109 Int_t Calibrate(Int_t nch,Int_t *ich, Option_t *optionSave="", Option_t *optionFit="RQ");
110 Int_t Calibrate(Int_t ichmin, Int_t ichmax, Option_t *optionSave="", Option_t *optionFit="RQ");
111 Int_t Calibrate(Int_t ich, Option_t *optionSave="", Option_t *optionFit="RQ");
112 Int_t CalibrateFromProfile(Int_t ich, Option_t *optionSave="", Option_t *optionFit="RQ");
113 TH1F* Profile(Int_t i);
114 Int_t FindBins (TH1F* h, Double_t *bins) const;
115 void SetNruns(Int_t nruns) {fNruns=nruns;}
116 Int_t GetNruns() const {return fNruns;}
0cb9d099 117 void SetFirstRun(Int_t firstRun) {fFirstRun=firstRun;}
118 Int_t GetFirstRun() const {return fFirstRun;}
119 void SetLastRun(Int_t lastRun) {fLastRun=lastRun;}
120 Int_t GetLastRun() const {return fLastRun;}
6dc9348d 121
122private:
d4ad0d6b 123 Int_t fNChannels; // number of TOF channels
17149e6b 124
125 // old calibration objects
0a749fa5 126 TObjArray *fTOFCalOnline; // array of AliTOFChannels storing calib parameters
17149e6b 127 TObjArray *fTOFCalOnlinePulser; // array of AliTOFChannels storing calib status from pulser // old, before unification of status info
128 TObjArray *fTOFCalOnlineNoise; // array of AliTOFChannels storing calib status from noise // old, before unification of status info
129 TObjArray *fTOFCalOnlineHW; // array of AliTOFChannels storing calib status from hardware // old, before unification of status info
0a749fa5 130 TObjArray *fTOFCalOffline; // array of AliTOFChannels storing calib parameters
17149e6b 131
132 // new calibration objects
133 AliTOFChannelOnlineArray *fCal; // object with delay array for TOF channels
134 AliTOFChannelOnlineStatusArray *fStatus; // object with status array for TOF channels
135
d4ad0d6b 136 TH1F *fTOFSimToT; // histo with realistic ToT signal from TB Data
0a749fa5 137 const char *fkValidity; // validity for offline calibration object
138 TTree *fTree; // tree for TOF calibration
296591ad 139 TChain *fChain; // chain for TOF calibration
0a749fa5 140 Int_t fNruns; // number of runs to be processed
0cb9d099 141 Int_t fFirstRun; // first run for calibration obj validity
142 Int_t fLastRun; // last run for calib obj validity
17149e6b 143 TMap* fConfigMap; // map holding configuration obj
0cb9d099 144
17149e6b 145 ClassDef(AliTOFcalib,7);
6dc9348d 146};
147
148#endif // AliTOFcalib_H
149