4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 //////////////////////////////////////////////////////////////////
8 // class for TOF calibration:: simulation of uncalibrated data //
9 //////////////////////////////////////////////////////////////////
13 #include "AliTOFChannel.h"
14 #include "TClonesArray.h"
16 #include "AliTOFCal.h"
17 #include "AliTOFGeometry.h"
20 class AliTOFcalib:public TTask{
22 AliTOFcalib(); // ctor
23 AliTOFcalib(AliTOFGeometry *geom);
24 AliTOFcalib(const AliTOFcalib & calib);
25 virtual ~AliTOFcalib() ; // dtor
26 Int_t NSector()const {return fNSector;}
27 Int_t NPlate()const {return fNPlate;}
28 Int_t NStripA()const {return fNStripA;}
29 Int_t NStripB()const {return fNStripB;}
30 Int_t NStripC()const {return fNStripC;}
31 Int_t NpadZ()const {return fNpadZ;}
32 Int_t NpadX()const {return fNpadX;}
33 AliTOFCal * GetTOFCalArray() const {return fTOFCal;}
34 AliTOFCal * GetTOFCalSimArray() const {return fTOFSimCal;}
35 TH1F * GetTOFSimToT() const {return fTOFSimToT;}
36 void SelectESD(AliESD *event);
39 TH1F* Profile(Int_t i);
40 Int_t NChannels()const{return fNChannels;}
41 TF1* SetFitFunctions(TH1F* histo);
42 void CorrectESDTime();// useless method, kept to make Chiara happy
43 void CorrectESDTime(AliESD *event);
44 // Methods to retrieve/write parameters from/on CDB
45 void WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun);
46 void WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFCal *cal, TH1F *histo);
47 void ReadSimParFromCDB(Char_t *sel, Int_t nrun);
48 void WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFCal *cal);
49 void WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun);
50 void ReadParFromCDB(Char_t *sel, Int_t nrun);
51 Int_t GetIndex(Int_t *detId); // Get channel index for Calibration
54 class AliTOFArray : public TObject {
56 AliTOFArray(): TObject(),fSize(0),fArray(0x0){}
57 AliTOFArray(Int_t size) :
60 fArray(new TArrayF*[size]) {
62 Int_t GetSize() const {return fSize;}
63 void AddArray(Int_t pos, TArrayF * parr) {
64 if (pos>-1 && pos < fSize)
67 //AliError("Index out of range");
69 TArrayF * GetArray(Int_t pos) {
71 if (pos>-1 && pos < fSize)
74 //AliError("Index out of range");
77 virtual ~AliTOFArray() {
83 Int_t fSize; // Size of the array of TArrayFs
84 TArrayF ** fArray; //[fSize]};
90 static const Int_t fgkchannel; // max number of entries per channel
91 Int_t fNChannels; // number of TOF channels
92 Int_t fNSector; // number of TOF sectors
93 Int_t fNPlate; // number of TOF plates
94 Int_t fNStripA; // number of TOF strips A
95 Int_t fNStripB; // number of TOF strips B
96 Int_t fNStripC; // number of TOF strips C
97 Int_t fNpadZ; // number of TOF pads Z
98 Int_t fNpadX; // number of TOF pads X
99 Int_t fNevents; // number of events
100 TObjArray * fESDsel; // selected ESD tracks for calibration
101 AliTOFArray *fArrayToT; // array for ToT values
102 AliTOFArray *fArrayTime; // array for Time values
103 AliTOFCal *fTOFCal; // array of AliTOFChannels storing calib parameters
104 AliTOFCal *fTOFSimCal; // array of AliTOFChannels storing calib parameters
105 TH1F *fTOFSimToT; // histo with realistic ToT signal from TB Data
106 ClassDef(AliTOFcalib,1);
109 #endif // AliTOFcalib_H