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