1 #ifndef ALIHLTTRDCALIBRA_H
2 #define ALIHLTTRDCALIBRA_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 ///////////////////////////////////////////////////////////////////////////////
10 // TRD calibration class for the HLT parameters //
12 ///////////////////////////////////////////////////////////////////////////////
18 #include "TProfile2D.h"
26 class AliTRDmcmTracklet;
28 class AliHLTTRDCalibra : public TObject {
33 static AliHLTTRDCalibra *Instance();
34 static void Terminate();
35 static void Destroy();
37 AliHLTTRDCalibra(const AliHLTTRDCalibra &c);
38 AliHLTTRDCalibra &operator=(const AliHLTTRDCalibra &) { return *this; }
40 // Functions for initialising the AliHLTTRDCalibra in the code
41 Bool_t Init2Dhistos();
43 // Functions for filling the histos in the code
44 Bool_t UpdateHistogramcm(AliTRDmcmTracklet *trk);
47 Bool_t IsPadOn(Int_t detector, Int_t col, Int_t row) const;
49 // Functions for writting the 2D
53 Bool_t ModePadFragmentation(Int_t iPlane,Int_t iChamb, Int_t iSect, Int_t i);
54 void ModePadCalibration(Int_t iChamb, Int_t i);
57 // Set of Get the variables
60 // Choice to fill or not the 2D
61 void SetOn() { fOn = kTRUE; }
62 Bool_t GetOn() const { return fOn; }
65 TH2I *GetCH2d() const { return fCH2d; }
66 TProfile2D *GetPH2d() const { return fPH2d; }
67 TProfile2D *GetPRF2d() const { return fPRF2d; }
70 void SetRelativeScale(Float_t relativeScale);
71 void SetThresholdClusterPRF2(Float_t thresholdClusterPRF2) { fThresholdClusterPRF2 = thresholdClusterPRF2; }
72 void SetNz(Int_t i, Short_t nz);
73 void SetNrphi(Int_t i, Short_t nrphi);
74 void SetProcent(Float_t procent) { fProcent = procent; }
75 void SetDifference(Short_t difference) { fDifference = difference; }
76 void SetNumberClusters(Short_t numberClusters) { fNumberClusters = numberClusters; }
77 void SetNumberBinCharge(Short_t numberBinCharge) { fNumberBinCharge = numberBinCharge; }
78 void SetNumberBinPRF(Short_t numberBinPRF) { fNumberBinPRF = numberBinPRF; }
80 Float_t GetThresholdClusterPRF2() const { return fThresholdClusterPRF2; }
81 Short_t GetNz(Int_t i) const { return fNz[i]; }
82 Short_t GetNrphi(Int_t i) const { return fNrphi[i]; }
83 Float_t GetProcent() const { return fProcent; }
84 Short_t GetDifference() const { return fDifference; }
85 Short_t GetNumberClusters() const { return fNumberClusters; }
86 Short_t GetNumberBinCharge() const { return fNumberBinCharge; }
87 Short_t GetNumberBinPRF() const { return fNumberBinPRF; }
90 void SetWriteName(TString writeName) { fWriteName = writeName; }
91 TString GetWriteName() const { return fWriteName; }
94 // Internal variables to be sure!
98 Short_t GetNnz(Int_t i) const { return fNnZ[i]; }
99 Short_t GetNnrphi(Int_t i) const { return fNnRphi[i]; }
100 Short_t GetNfragz(Int_t i) const { return fNfragZ[i]; }
101 Short_t GetNfragrphi(Int_t i) const { return fNfragRphi[i]; }
102 Short_t GetDetChamb0(Int_t i) const { return fDetChamb0[i]; }
103 Short_t GetDetChamb2(Int_t i) const { return fDetChamb2[i]; }
107 // This is a singleton, contructor is private!
109 virtual ~AliHLTTRDCalibra();
113 // Choice to fill or not the 2D
114 Bool_t fOn; // Chose to fill the 2D histos
116 // How to fill the 2D
117 Float_t fRelativeScale; // Scale of the deposited charge
118 Float_t fThresholdClusterPRF2; // Threshold on cluster pad signals for PRF peripherique
119 Short_t fNz[3]; // Mode of calibration
120 Short_t fNrphi[3]; // Mode of calibration
121 Int_t fNtotal[3]; // Total number of Xbins
124 TString fWriteName; // Where the 2D histos are written
127 // Internal variables
130 // Fill the 2D histos in the offline tracking
131 Bool_t fGoodTrack; // If goes through a kaputt pad
132 Float_t *fAmpTotal; //! Energy deposited in the calibration group by the track
133 Short_t *fPHPlace; //! Calibration group of PH
134 Float_t *fPHValue; //! PH
135 Short_t fNumberClusters; // Minimum number of clusters in the tracklets
136 Float_t fProcent; // Limit to take the info of the most important calibration group if the track goes through 2 groups (CH)
137 Short_t fDifference; // Limit to take the info of the most important calibration group if the track goes through 2 groups (CH)
138 Int_t fNumberTrack; // How many tracks could be used
139 Int_t fNumberUsedCh[2]; // How many tracks have been really used for the gain (0, strict; 1 with fProcent)
140 Int_t fNumberUsedPh[2]; // How many tracks have been really used for the drift velocity (0, strict; 1 with fDifference)
146 // Variables in the loop for the coef or more general
147 Int_t fTimeMax; // Number of time bins
148 Float_t fSf; // Sampling frequence
151 Short_t fNnZ[3]; // Number of pad rows in a group
152 Short_t fNnRphi[3]; // Number of pad cols in a group
153 Short_t fNfragZ[3]; // Number of pad row group
154 Short_t fNfragRphi[3]; // Number of pad col group
155 Short_t fRowMin[3]; // Limits of the group in pad row
156 Short_t fRowMax[3]; // Limits of the group in pad row
157 Short_t fColMin[3]; // Limits of the group in pad col
158 Short_t fColMax[3]; // Limits of the group in pad col
159 Int_t fXbins[3]; // First Xbins of the detector
160 Short_t fDetChamb0[3]; // Number of XBins for chamber != 2
161 Short_t fDetChamb2[3]; // Number of Xbins for chamber 2
165 Short_t fNumberBinCharge; // Number of bins for the gain factor
168 Short_t fNumberBinPRF; // Number of bin for the PRF
170 // Histograms to store the info from the digits, from the tracklets or from the tracks
171 TProfile2D *fPH2d; // 2D average pulse height
172 TProfile2D *fPRF2d; // 2D PRF
173 TH2I *fCH2d; // 2D deposited charge
176 // A lot of internal functions......
179 // Init AliHLTTRDCalibra
182 // Create the 2D histo to be filled Online
183 void CreateCH2d(Int_t nn);
184 void CreatePH2d(Int_t nn);
185 void CreatePRF2d(Int_t nn);
188 void FillTheInfoOfTheTrackPH();
189 void FillTheInfoOfTheTrackCH();
190 void ResetfVariables();
191 Bool_t LocalisationDetectorXbins(Int_t detector);
193 // Pad group calibration mode
194 void ReconstructionRowPadGroup(Int_t idect, Int_t i);
195 void CalculXBins(Int_t idect, Int_t i);
201 // Some basic geometry function
202 virtual Int_t GetPlane(Int_t d) const;
203 virtual Int_t GetChamber(Int_t d) const;
204 virtual Int_t GetSector(Int_t d) const;
206 // Instance of this class and so on
207 static AliHLTTRDCalibra *fgInstance; // Instance
208 static Bool_t fgTerminated; // If terminated
210 ClassDef(AliHLTTRDCalibra,2) // TRD Calibration class