1 #ifndef ALITOFCALIBHISTO_H
2 #define ALITOFCALIBHISTO_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
9 // * AliTOFcalibHisto - class to handle TOF calibration histograms,
10 // * map histograms and more
13 // * autors: Roberto Preghenella (R+)
14 // * concacts: preghenella@bo.infn.it
25 class AliTOFcalibHisto :
79 /* number of histos */
102 AliTOFcalibHisto(); /* default constructor */
103 virtual ~AliTOFcalibHisto(); /* default destructor */
106 static const Char_t *GetCalibHistoFileName() {return fgCalibHistoFileName.Data();}; /* get calib histo file name */
107 static const Char_t *GetCalibParFileName() {return fgCalibParFileName.Data();}; /* get calib par file name */
108 static const Char_t *GetCalibStatFileName() {return fgCalibStatFileName.Data();}; /* get calib stat file name */
111 static void SetCalibHistoFileName(const Char_t *value) {fgCalibHistoFileName = value;}; /* set calib histo file name */
112 static void SetCalibParFileName(const Char_t *value) {fgCalibParFileName = value;}; /* set calib par file name */
113 static void SetCalibStatFileName(const Char_t *value) {fgCalibStatFileName = value;}; /* set calib stat file name */
114 static void SetCableCorrectionFlag(Int_t i, Bool_t flag) {if (i < kNcorrections) fgCableCorrectionFlag[i] = flag;}; // set cable correction flag
115 static void SetFullCorrectionFlag(Int_t i, Bool_t flag) {if (i < kNcorrections) fgFullCorrectionFlag[i] = flag;}; // set full correction flag
118 static Int_t GetIndexEO(Int_t ddl, Int_t trm, Int_t chain, Int_t tdc, Int_t channel) {return (channel + 8 * tdc + 120 * chain + 240 * trm + 2400 * ddl);}; /* get index EO */
119 void LoadCalibHisto(); /* load calib histo */
120 void LoadCalibPar(); /* load calib par */
121 void LoadCalibStat(); /* load calib stat */
122 void WriteCalibHisto(); /* write calib histo */
123 void WriteCalibStat(); /* write calib stat */
124 Double_t GetCalibConst(Int_t histo) {return GetHisto(fCalibConst[histo], 0);}; /* get calib const */
125 Double_t GetCalibMap(Int_t histo, Int_t index) {return GetHisto(fCalibMap[histo], index);}; /* get calib map */
126 Double_t GetCalibPar(Int_t histo, Int_t index) {return GetHisto(fCalibPar[histo], index);}; /* get calib par */
127 Bool_t GetCalibStat(Int_t histo, Int_t index) {return GetHisto(fCalibStat[histo], index) != 0. ? kTRUE : kFALSE;}; /* get calib stat */
128 Double_t GetCorrection(Int_t corr, Int_t index, Double_t tot = 0.); /* get correction */
129 Double_t GetNominalCorrection(Int_t index); /* get nominal correction */
130 void ApplyNominalCorrection(AliESDtrack *track); /* apply nominal corrections */
132 Double_t GetCableCorrection(Int_t index); /* get cable correction */
133 Double_t GetFullCorrection(Int_t index, Double_t tot = 0.); /* get full correction */
135 Bool_t GetStatus(Int_t index); /* get status */
139 static TFile *fgCalibHistoFile; /* calib histo file */
140 static TFile *fgCalibParFile; /* calib par file */
141 static TFile *fgCalibStatFile; /* calib stat file */
143 static TString fgCalibHistoFileName; /* calib histo file name */
144 static TString fgCalibParFileName; /* calib par file name */
145 static TString fgCalibStatFileName; /* calib par file name */
146 static const TString fgkCalibConstName[kNcalibConsts]; // calib const name array */
147 static const TString fgkCalibMapName[kNcalibMaps]; // calib map name array */
148 static const TString fgkCalibParName[kNcalibPars]; // calib par name array */
149 static const TString fgkCalibStatName[kNcalibStats]; // calib stat name array */
151 static const Double_t fgkLHCperiod; /* LHC clock period */
152 static const Double_t fgkAmphenolCableDelay; /* Amphenol cable delay */
153 static const Double_t fgkFlatCableDelay; /* flat cable delay */
154 static const Double_t fgkInterfaceCardDelay; /* interface card delay */
156 static const Int_t fgkNchannels; /* number of readout channels (DO) */
157 static const Int_t fgkNchannelsEO; /* number of readout channels (EO) */
158 static const Int_t fgkDDLBCshift[72]; /* DDL BC shifts due to TTC fibers */
159 static const Double_t fgkFlatCableLength[91]; /* strip flat-cable length */
160 static const Double_t fgkInterfaceCardLength[48]; /* interface card length */
162 static Bool_t fgCableCorrectionFlag[kNcorrections]; // cable correction flag
163 static Bool_t fgFullCorrectionFlag[kNcorrections]; // full correction flag
165 static const Int_t fgkStripStat[18][91]; // strip status
167 TH1D *fCalibConst[kNcalibConsts]; // calib const array
168 TH1D *fCalibMap[kNcalibMaps]; // calib map array
169 TH1D *fCalibPar[kNcalibPars]; // calib par array
170 TH1D *fCalibStat[kNcalibStats]; // calib stat array
173 void LoadHisto(TFile * const file, TH1D **histo, const Char_t *name); /* create histo */
174 void CreateHisto(TH1D **histo, const Char_t *name, Int_t size); /* create histo */
175 void WriteHisto(TFile *file, TH1D *histo); /* write histo */
176 void SetHisto(TH1D *histo, Int_t index, Double_t value); /* set histo */
177 Double_t GetHisto(TH1D *histo, Int_t index); /* get histo */
179 AliTOFcalibHisto(const AliTOFcalibHisto &source) : TObject(source) {}; /* copy constructor */
180 AliTOFcalibHisto &operator=(const AliTOFcalibHisto &) {return *this;}; /* operator= */
182 ClassDef(AliTOFcalibHisto, 1);
186 #endif /* ALITOFCALIBHISTO_H */