]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFcalib.h
Rearrangement of Calibration objects for simulation
[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;
0e46b9ae 34
35class AliESD;
36
37class AliTOFCal;
7037bd93 38class AliTOFRecoParam;
6dc9348d 39
40class AliTOFcalib:public TTask{
41public:
42 AliTOFcalib(); // ctor
7aeeaf38 43 AliTOFcalib(const AliTOFcalib & calib); // copy constructor
44 AliTOFcalib& operator=(const AliTOFcalib & calib); // assignment operator
6dc9348d 45 virtual ~AliTOFcalib() ; // dtor
0a749fa5 46 void CreateCalArrays();
0a749fa5 47 TObjArray * GetTOFCalArrayOnline() const {return fTOFCalOnline;}
48 TObjArray * GetTOFCalArrayOffline() const {return fTOFCalOffline;}
d4ad0d6b 49 TH1F * GetTOFSimToT() const {return fTOFSimToT;}
0a749fa5 50 TTree * GetTOFCalibTree() const {return fTree;}
51 const char * GetOfflineValidity() const {return fkValidity;}
52 void SetOfflineValidity(const char* validity) {fkValidity = validity;}
d4ad0d6b 53 Int_t NChannels()const{return fNChannels;}
d4ad0d6b 54 // Methods to retrieve/write parameters from/on CDB
40212801 55 void WriteSimHistoOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, TH1F *histo);
0a749fa5 56 void WriteParOnlineOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun);
57 void WriteParOfflineOnCDB(Char_t *sel, const Char_t *validity, Int_t minrun, Int_t maxrun);
0cb9d099 58 void WriteParOnlineOnCDB(Char_t *sel);
59 void WriteParOfflineOnCDB(Char_t *sel, const Char_t *validity);
40212801 60 Bool_t ReadSimHistoFromCDB(Char_t *sel, Int_t nrun);
0a749fa5 61 Bool_t ReadParOnlineFromCDB(Char_t *sel, Int_t nrun);
62 Bool_t ReadParOfflineFromCDB(Char_t *sel, Int_t nrun);
7037bd93 63 void WriteRecParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFRecoParam *param);
64 AliTOFRecoParam * ReadRecParFromCDB(Char_t *sel, Int_t nrun);
0a749fa5 65 void CreateTreeFromCDB(Int_t minrun, Int_t maxrun);
66 void CreateTreeFromFile(Int_t minrun, Int_t maxrun);
67 void CreateTreeFromGrid(Int_t minrun, Int_t maxrun);
68 Int_t Calibrate(Option_t *optionSave="", Option_t *optionFit="RQ");
69 Int_t Calibrate(Int_t nch,Int_t *ich, Option_t *optionSave="", Option_t *optionFit="RQ");
70 Int_t Calibrate(Int_t ichmin, Int_t ichmax, Option_t *optionSave="", Option_t *optionFit="RQ");
71 Int_t Calibrate(Int_t ich, Option_t *optionSave="", Option_t *optionFit="RQ");
72 Int_t CalibrateFromProfile(Int_t ich, Option_t *optionSave="", Option_t *optionFit="RQ");
73 TH1F* Profile(Int_t i);
74 Int_t FindBins (TH1F* h, Double_t *bins) const;
75 void SetNruns(Int_t nruns) {fNruns=nruns;}
76 Int_t GetNruns() const {return fNruns;}
0cb9d099 77 void SetFirstRun(Int_t firstRun) {fFirstRun=firstRun;}
78 Int_t GetFirstRun() const {return fFirstRun;}
79 void SetLastRun(Int_t lastRun) {fLastRun=lastRun;}
80 Int_t GetLastRun() const {return fLastRun;}
6dc9348d 81
82private:
d4ad0d6b 83 Int_t fNChannels; // number of TOF channels
0a749fa5 84 TObjArray *fTOFCalOnline; // array of AliTOFChannels storing calib parameters
85 TObjArray *fTOFCalOffline; // array of AliTOFChannels storing calib parameters
d4ad0d6b 86 TH1F *fTOFSimToT; // histo with realistic ToT signal from TB Data
0a749fa5 87 const char *fkValidity; // validity for offline calibration object
88 TTree *fTree; // tree for TOF calibration
89 Int_t fNruns; // number of runs to be processed
0cb9d099 90 Int_t fFirstRun; // first run for calibration obj validity
91 Int_t fLastRun; // last run for calib obj validity
92
40212801 93 ClassDef(AliTOFcalib,4);
6dc9348d 94};
95
96#endif // AliTOFcalib_H
97