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