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"
19 #include "AliRunLoader.h"
21 class AliTOFcalib:public TTask{
23 AliTOFcalib(); // ctor
24 AliTOFcalib(char* headerFile, Int_t nEvents=0) ;
25 AliTOFcalib(const AliTOFcalib & calib);
27 virtual ~AliTOFcalib() ; // dtor
28 Int_t NSector()const {return fNSector;}
29 Int_t NPlate()const {return fNPlate;}
30 Int_t NStripA()const {return fNStripA;}
31 Int_t NStripB()const {return fNStripB;}
32 Int_t NStripC()const {return fNStripC;}
33 Int_t NpadZ()const {return fNpadZ;}
34 Int_t NpadX()const {return fNpadX;}
35 TClonesArray * DecalibrateDigits(TClonesArray *digits);
36 void SelectESD(AliESD *event, AliRunLoader * rl);
39 TH1F* Profile(Int_t i);
40 Int_t Size()const{return fsize;}
41 void SetFitFunctions();
42 TF1* SetFitFunctions(TH1F* histo);
43 TList* GetFitFunctions() {return flistFunc;}
44 TH1F** GetHistosToT() {return fhToT;}
46 void CorrectESDTime();
47 void CorrectESDTime(AliESD *event, AliRunLoader *rl);
49 void ReadFromCDB(Char_t *sel, Int_t nrun);
50 Int_t GetIndex(Int_t *detId);
53 class AliTOFArray : public TObject {
55 AliTOFArray(): TObject(),fSize(0),fArray(0x0){}
56 AliTOFArray(Int_t size) :
59 fArray(new TArrayF*[size]) {
61 Int_t GetSize() const {return fSize;}
62 void AddArray(Int_t pos, TArrayF * parr) {
63 if (pos>-1 && pos < fSize)
66 //AliError("Index out of range");
68 TArrayF * GetArray(Int_t pos) {
70 if (pos>-1 && pos < fSize)
73 //AliError("Index out of range");
76 virtual ~AliTOFArray() {
82 Int_t fSize; // Size of the array of TArrayFs
83 TArrayF ** fArray; //[fSize]};
89 static const Int_t fgkchannel; // max number of entries per channel
90 static const Char_t * ffile[6]; // spectra
91 Int_t fsize; // number of 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 TObjArray * fESDsel; // selected ESD tracks for calibration
100 TList *flistFunc; // functions for simulated Time Slewing spectra
101 TH1F* fhToT[6]; // simulated ToT distributions
102 Float_t fMaxToT[6]; // max simulated ToT
103 Float_t fMinToT[6]; // min simulated ToT
104 Float_t fMaxToTDistr[6]; // max value in the ToT distributions
105 AliTOFArray *fArrayToT; // array for ToT values
106 AliTOFArray *fArrayTime; // array for Time values
107 Int_t fNevents; // number of events
108 AliTOFCal *fTOFCal; // array of AliTOFChannels storing calib parameters
109 TString fT0File ; // output file;
110 TString fHeadersFile; // input file
111 AliTOFGeometry *fGeom; // AliTOFgeometry pointer
112 ClassDef(AliTOFcalib,1);
115 #endif // AliTOFcalib_H