]>
Commit | Line | Data |
---|---|---|
765d44e7 | 1 | #ifndef ALICALORIMETERUTILS_H |
2 | #define ALICALORIMETERUTILS_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | /* $Id: $ */ | |
6 | ||
7 | //_________________________________________________________________________ | |
8 | // Class utility for Calorimeter specific selection methods /// | |
9 | // | |
10 | // | |
11 | // | |
12 | //-- Author: Gustavo Conesa (LPSC-Grenoble) | |
13 | ////////////////////////////////////////////////////////////////////////////// | |
14 | ||
15 | // --- ROOT system --- | |
16 | #include "TObject.h" | |
17 | #include "TString.h" | |
18 | #include "TObjArray.h" | |
19 | class TArrayF; | |
20 | #include "TH2I.h" | |
21 | ||
22 | //--- ANALYSIS system --- | |
23 | class AliVEvent; | |
24 | class AliAODPWG4Particle; | |
c8fe2783 | 25 | class AliVCluster; |
26 | class AliVCaloCells; | |
765d44e7 | 27 | #include "AliPHOSGeoUtils.h" |
28 | #include "AliEMCALGeoUtils.h" | |
29 | ||
30 | class AliCalorimeterUtils : public TObject { | |
31 | ||
78219bac | 32 | public: |
765d44e7 | 33 | AliCalorimeterUtils() ; // ctor |
765d44e7 | 34 | virtual ~AliCalorimeterUtils() ;//virtual dtor |
78219bac | 35 | private: |
36 | AliCalorimeterUtils(const AliCalorimeterUtils & g) ; // cpy ctor | |
765d44e7 | 37 | AliCalorimeterUtils & operator = (const AliCalorimeterUtils & g) ;//cpy assignment |
38 | ||
78219bac | 39 | public: |
765d44e7 | 40 | |
41 | virtual void InitParameters(); | |
42 | virtual void Print(const Option_t * opt) const; | |
43 | ||
44 | virtual Int_t GetDebug() const { return fDebug ; } | |
45 | virtual void SetDebug(Int_t d) { fDebug = d ; } | |
46 | ||
47 | //virtual void Init(); | |
48 | ||
49 | //Calorimeters Geometry Methods | |
50 | AliEMCALGeoUtils * GetEMCALGeometry() const { return fEMCALGeo;} | |
51 | TString EMCALGeometryName() const { return fEMCALGeoName ; } | |
52 | void SetEMCALGeometryName(TString name) { fEMCALGeoName = name ; } | |
53 | void InitEMCALGeometry() ; | |
54 | Bool_t IsEMCALGeoMatrixSet() const { return fEMCALGeoMatrixSet; } | |
55 | ||
56 | AliPHOSGeoUtils * GetPHOSGeometry() const { return fPHOSGeo;} | |
57 | TString PHOSGeometryName() const { return fPHOSGeoName ; } | |
58 | void SetPHOSGeometryName(TString name) { fPHOSGeoName = name ; } | |
59 | void InitPHOSGeometry() ; | |
60 | Bool_t IsPHOSGeoMatrixSet() const {return fPHOSGeoMatrixSet ; } | |
61 | ||
62 | void SetGeometryTransformationMatrices(AliVEvent* inputEvent) ; | |
63 | ||
64 | // Bad channels | |
65 | Bool_t IsBadChannelsRemovalSwitchedOn() const { return fRemoveBadChannels ; } | |
fa991e42 | 66 | void SwitchOnBadChannelsRemoval () {fRemoveBadChannels = kTRUE ; InitEMCALBadChannelStatusMap(); InitPHOSBadChannelStatusMap();} |
67 | void SwitchOffBadChannelsRemoval() {fRemoveBadChannels = kFALSE ; } | |
765d44e7 | 68 | |
69 | void InitEMCALBadChannelStatusMap() ; | |
70 | void InitPHOSBadChannelStatusMap () ; | |
71 | ||
72 | Int_t GetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow) const { | |
37c0bcde | 73 | if(fEMCALBadChannelMap) return (Int_t) ((TH2I*)fEMCALBadChannelMap->At(iSM))->GetBinContent(iCol,iRow); |
fa991e42 | 74 | else return 0;}//Channel is ok by default |
765d44e7 | 75 | |
76 | Int_t GetPHOSChannelStatus (Int_t imod, Int_t iCol, Int_t iRow) const { | |
37c0bcde | 77 | if(fPHOSBadChannelMap)return (Int_t) ((TH2I*)fPHOSBadChannelMap->At(imod))->GetBinContent(iCol,iRow); |
fa991e42 | 78 | else return 0;}//Channel is ok by default |
765d44e7 | 79 | |
80 | void SetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) { | |
37c0bcde | 81 | if(!fEMCALBadChannelMap)InitEMCALBadChannelStatusMap() ; |
765d44e7 | 82 | ((TH2I*)fEMCALBadChannelMap->At(iSM))->SetBinContent(iCol,iRow,c);} |
83 | ||
84 | void SetPHOSChannelStatus (Int_t imod, Int_t iCol, Int_t iRow, Double_t c = 1) { | |
37c0bcde | 85 | if(!fPHOSBadChannelMap) InitPHOSBadChannelStatusMap() ; |
765d44e7 | 86 | ((TH2I*)fPHOSBadChannelMap->At(imod))->SetBinContent(iCol,iRow,c);} |
87 | ||
88 | TH2I * GetEMCALChannelStatusMap(Int_t iSM) const {return (TH2I*)fEMCALBadChannelMap->At(iSM);} | |
89 | TH2I * GetPHOSChannelStatusMap(Int_t imod) const {return (TH2I*)fPHOSBadChannelMap->At(imod);} | |
90 | ||
91 | void SetEMCALChannelStatusMap(TObjArray *map) {fEMCALBadChannelMap = map;} | |
92 | void SetPHOSChannelStatusMap (TObjArray *map) {fPHOSBadChannelMap = map;} | |
93 | ||
94 | Bool_t ClusterContainsBadChannel(TString calorimeter,UShort_t* cellList, Int_t nCells); | |
95 | ||
96 | //Calorimeter indexes information | |
97 | Int_t GetModuleNumber(AliAODPWG4Particle * particle, AliVEvent* inputEvent) const; | |
c8fe2783 | 98 | Int_t GetModuleNumber(AliVCluster * cluster) const; |
99 | // Int_t GetModuleNumber(AliESDCaloCluster * cluster) const; | |
765d44e7 | 100 | |
101 | Int_t GetModuleNumberCellIndexes(const Int_t absId, const TString calo, Int_t & icol, Int_t & irow, Int_t &iRCU) const ; | |
102 | ||
103 | //Modules fiducial region | |
c8fe2783 | 104 | Bool_t CheckCellFiducialRegion(AliVCluster* cluster, AliVCaloCells* cells, AliVEvent * event, Int_t iev=0) const ; |
105 | // Bool_t CheckCellFiducialRegion(AliESDCaloCluster* cluster, AliESDCaloCells* cells) const ; | |
765d44e7 | 106 | |
107 | void SetNumberOfCellsFromEMCALBorder(Int_t n) {fNCellsFromEMCALBorder = n; } | |
108 | Int_t GetNumberOfCellsFromEMCALBorder() const {return fNCellsFromEMCALBorder; } | |
109 | void SetNumberOfCellsFromPHOSBorder(Int_t n) {fNCellsFromPHOSBorder = n; } | |
110 | Int_t GetNumberOfCellsFromPHOSBorder() const {return fNCellsFromPHOSBorder; } | |
111 | ||
112 | void SwitchOnNoFiducialBorderInEMCALEta0() {fNoEMCALBorderAtEta0 = kTRUE; } | |
113 | void SwitchOffNoFiducialBorderInEMCALEta0() {fNoEMCALBorderAtEta0 = kFALSE; } | |
09e819c9 | 114 | |
115 | // Recalibration | |
116 | Bool_t IsRecalibrationOn() const { return fRecalibration ; } | |
117 | void SwitchOnRecalibration() {fRecalibration = kTRUE ; InitEMCALRecalibrationFactors(); InitPHOSRecalibrationFactors();} | |
118 | void SwitchOffRecalibration() {fRecalibration = kFALSE ; } | |
119 | ||
120 | void InitEMCALRecalibrationFactors() ; | |
121 | void InitPHOSRecalibrationFactors () ; | |
122 | ||
123 | Float_t GetEMCALChannelRecalibrationFactor(Int_t iSM , Int_t iCol, Int_t iRow) const { | |
78219bac | 124 | if(fEMCALRecalibrationFactors) return (Float_t) ((TH2F*)fEMCALRecalibrationFactors->At(iSM))->GetBinContent(iCol,iRow); |
125 | else return 1;} | |
126 | ||
09e819c9 | 127 | Float_t GetPHOSChannelRecalibrationFactor (Int_t imod, Int_t iCol, Int_t iRow) const { |
78219bac | 128 | if(fPHOSRecalibrationFactors)return (Float_t) ((TH2F*)fPHOSRecalibrationFactors->At(imod))->GetBinContent(iCol,iRow); |
129 | else return 1;} | |
130 | ||
09e819c9 | 131 | void SetEMCALChannelRecalibrationFactor(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) { |
78219bac | 132 | if(!fEMCALRecalibrationFactors) InitEMCALRecalibrationFactors(); |
133 | ((TH2F*)fEMCALRecalibrationFactors->At(iSM))->SetBinContent(iCol,iRow,c);} | |
09e819c9 | 134 | |
135 | void SetPHOSChannelRecalibrationFactor (Int_t imod, Int_t iCol, Int_t iRow, Double_t c = 1) { | |
78219bac | 136 | if(!fPHOSRecalibrationFactors) InitPHOSRecalibrationFactors(); |
137 | ((TH2F*)fPHOSRecalibrationFactors->At(imod))->SetBinContent(iCol,iRow,c);} | |
09e819c9 | 138 | |
139 | void SetEMCALChannelRecalibrationFactors(Int_t iSM , TH2F* h) {fEMCALRecalibrationFactors->AddAt(h,iSM);} | |
140 | void SetPHOSChannelRecalibrationFactors(Int_t imod , TH2F* h) {fPHOSRecalibrationFactors ->AddAt(h,imod);} | |
141 | ||
142 | TH2F * GetEMCALChannelRecalibrationFactors(Int_t iSM) const {return (TH2F*)fEMCALRecalibrationFactors->At(iSM);} | |
143 | TH2F * GetPHOSChannelRecalibrationFactors(Int_t imod) const {return (TH2F*)fPHOSRecalibrationFactors->At(imod);} | |
144 | ||
145 | void SetEMCALChannelRecalibrationFactors(TObjArray *map) {fEMCALRecalibrationFactors = map;} | |
146 | void SetPHOSChannelRecalibrationFactors (TObjArray *map) {fPHOSRecalibrationFactors = map;} | |
147 | ||
c8fe2783 | 148 | Float_t RecalibrateClusterEnergy(AliVCluster* cluster, AliVCaloCells * cells); |
149 | //Float_t RecalibrateClusterEnergy(AliAODCaloCluster* cluster, AliAODCaloCells * cells); | |
765d44e7 | 150 | |
151 | private: | |
152 | ||
09e819c9 | 153 | Int_t fDebug; // Debugging level |
154 | TString fEMCALGeoName; // Name of geometry to use for EMCAL. | |
155 | TString fPHOSGeoName; // Name of geometry to use for PHOS. | |
156 | AliEMCALGeoUtils * fEMCALGeo ; //! EMCAL geometry pointer | |
157 | AliPHOSGeoUtils * fPHOSGeo ; //! PHOS geometry pointer | |
158 | Bool_t fEMCALGeoMatrixSet; // Check if the transformation matrix is set for EMCAL | |
159 | Bool_t fPHOSGeoMatrixSet ; // Check if the transformation matrix is set for PHOS | |
160 | Bool_t fRemoveBadChannels; // Check the channel status provided and remove clusters with bad channels | |
2be3914b | 161 | TObjArray * fEMCALBadChannelMap; // Array of histograms with map of bad channels, EMCAL |
162 | TObjArray * fPHOSBadChannelMap; // Array of histograms with map of bad channels, PHOS | |
09e819c9 | 163 | Int_t fNCellsFromEMCALBorder; // Number of cells from EMCAL border the cell with maximum amplitude has to be. |
164 | Int_t fNCellsFromPHOSBorder; // Number of cells from PHOS border the cell with maximum amplitude has to be. | |
165 | Bool_t fNoEMCALBorderAtEta0; // Do fiducial cut in EMCAL region eta = 0? | |
166 | Bool_t fRecalibration; // Switch on or off the recalibration | |
2be3914b | 167 | TObjArray * fEMCALRecalibrationFactors; // Array of histograms with map of recalibration factors, EMCAL |
168 | TObjArray * fPHOSRecalibrationFactors; // Array of histograms with map of recalibration factors, PHOS | |
09e819c9 | 169 | |
170 | ClassDef(AliCalorimeterUtils,2) | |
765d44e7 | 171 | } ; |
172 | ||
173 | ||
174 | #endif //ALICALORIMETERUTILS_H | |
175 | ||
176 | ||
177 |