]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFcalib.h
Include Methods to derive TOF AlignObjs from Survey Data
[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
11#include "TTask.h"
0e46b9ae 12
13class TArrayF;
14class TF1;
15class TH1F;
16class TObjArray;
17
18class AliESD;
19
20class AliTOFCal;
21class AliTOFGeometry;
7037bd93 22class AliTOFRecoParam;
6dc9348d 23
24class AliTOFcalib:public TTask{
25public:
26 AliTOFcalib(); // ctor
d4ad0d6b 27 AliTOFcalib(AliTOFGeometry *geom);
7aeeaf38 28 AliTOFcalib(const AliTOFcalib & calib); // copy constructor
29 AliTOFcalib& operator=(const AliTOFcalib & calib); // assignment operator
6dc9348d 30 virtual ~AliTOFcalib() ; // dtor
31 Int_t NSector()const {return fNSector;}
32 Int_t NPlate()const {return fNPlate;}
33 Int_t NStripA()const {return fNStripA;}
34 Int_t NStripB()const {return fNStripB;}
35 Int_t NStripC()const {return fNStripC;}
36 Int_t NpadZ()const {return fNpadZ;}
37 Int_t NpadX()const {return fNpadX;}
d4ad0d6b 38 AliTOFCal * GetTOFCalArray() const {return fTOFCal;}
39 AliTOFCal * GetTOFCalSimArray() const {return fTOFSimCal;}
40 TH1F * GetTOFSimToT() const {return fTOFSimToT;}
41 void SelectESD(AliESD *event);
6dc9348d 42 void CombESDId();
43 void CalibrateESD();
44 TH1F* Profile(Int_t i);
d4ad0d6b 45 Int_t NChannels()const{return fNChannels;}
6dc9348d 46 TF1* SetFitFunctions(TH1F* histo);
d4ad0d6b 47 void CorrectESDTime();// useless method, kept to make Chiara happy
48 void CorrectESDTime(AliESD *event);
49 // Methods to retrieve/write parameters from/on CDB
50 void WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun);
51 void WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFCal *cal, TH1F *histo);
52 void ReadSimParFromCDB(Char_t *sel, Int_t nrun);
53 void WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFCal *cal);
54 void WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun);
1b20c168 55 Bool_t ReadParFromCDB(Char_t *sel, Int_t nrun);
d4ad0d6b 56 Int_t GetIndex(Int_t *detId); // Get channel index for Calibration
7037bd93 57 void WriteRecParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFRecoParam *param);
58 AliTOFRecoParam * ReadRecParFromCDB(Char_t *sel, Int_t nrun);
6dc9348d 59
60 public:
61 class AliTOFArray : public TObject {
62 public:
63 AliTOFArray(): TObject(),fSize(0),fArray(0x0){}
655e379f 64 AliTOFArray(Int_t size):
6dc9348d 65 TObject(),
66 fSize(size),
67 fArray(new TArrayF*[size]) {
68 }
7aeeaf38 69 AliTOFArray(const AliTOFArray & source):
655e379f 70 TObject(),fSize(0),fArray(0x0){ // copy constructor
7aeeaf38 71 this->fSize= source.fSize;
72 this->fArray= source.fArray;
73 };
74
75 AliTOFArray& operator=(const AliTOFArray & source) { // assignment operator
76 this->fSize= source.fSize;
77 this->fArray= source.fArray;
78 return *this;
79 }
80
6dc9348d 81 Int_t GetSize() const {return fSize;}
82 void AddArray(Int_t pos, TArrayF * parr) {
340693af 83 if (pos>-1 && pos < fSize)fArray[pos] = parr;}
84 TArrayF * GetArray(Int_t pos) const {
85 TArrayF * parr = 0x0;
86 if (pos>-1 && pos < fSize)parr = fArray[pos];
6dc9348d 87 return parr;
88 }
89 virtual ~AliTOFArray() {
90 delete [] fArray;
91 }
92
93 private:
94
95 Int_t fSize; // Size of the array of TArrayFs
96 TArrayF ** fArray; //[fSize]};
97
98 };
99
100
101private:
102 static const Int_t fgkchannel; // max number of entries per channel
d4ad0d6b 103 Int_t fNChannels; // number of TOF channels
6dc9348d 104 Int_t fNSector; // number of TOF sectors
105 Int_t fNPlate; // number of TOF plates
106 Int_t fNStripA; // number of TOF strips A
107 Int_t fNStripB; // number of TOF strips B
108 Int_t fNStripC; // number of TOF strips C
109 Int_t fNpadZ; // number of TOF pads Z
110 Int_t fNpadX; // number of TOF pads X
d4ad0d6b 111 Int_t fNevents; // number of events
6dc9348d 112 TObjArray * fESDsel; // selected ESD tracks for calibration
6dc9348d 113 AliTOFArray *fArrayToT; // array for ToT values
114 AliTOFArray *fArrayTime; // array for Time values
6dc9348d 115 AliTOFCal *fTOFCal; // array of AliTOFChannels storing calib parameters
d4ad0d6b 116 AliTOFCal *fTOFSimCal; // array of AliTOFChannels storing calib parameters
117 TH1F *fTOFSimToT; // histo with realistic ToT signal from TB Data
6dc9348d 118 ClassDef(AliTOFcalib,1);
119};
120
121#endif // AliTOFcalib_H
122