1 #ifndef ALIANALYSISTASKEMCALPI0CALIBSELECTION_H
2 #define ALIANALYSISTASKEMCALPI0CALIBSELECTION_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 //---------------------------------------------------------------------------//
8 // Fill histograms with two-cluster invariant mass //
9 // using calibration coefficients of the previous iteration. //
10 //---------------------------------------------------------------------------//
15 #include "TObjArray.h"
18 #include "AliAnalysisTaskSE.h"
19 class AliEMCALGeometry;
20 class AliAODCaloCluster;
21 class AliAODCaloCells;
22 //class AliEMCALCalibData ;
23 #include "AliEMCALGeoParams.h"
24 class AliEMCALRecoUtils;
26 class AliAnalysisTaskEMCALPi0CalibSelection : public AliAnalysisTaskSE
30 AliAnalysisTaskEMCALPi0CalibSelection(const char* name);
31 virtual ~AliAnalysisTaskEMCALPi0CalibSelection();
35 AliAnalysisTaskEMCALPi0CalibSelection(const AliAnalysisTaskEMCALPi0CalibSelection&);
36 AliAnalysisTaskEMCALPi0CalibSelection& operator=(const AliAnalysisTaskEMCALPi0CalibSelection&);
40 // Implementation of interface methods
41 virtual void UserCreateOutputObjects();
42 virtual void UserExec(Option_t * opt);
43 virtual void LocalInit() ;
45 void SetAsymmetryCut(Float_t asy) {fAsyCut = asy ;}
46 void SetClusterMinEnergy(Float_t emin) {fEmin = emin;}
47 void SetClusterMaxEnergy(Float_t emax) {fEmax = emax;}
48 void SetClusterMinNCells(Int_t n) {fMinNCells = n ;}
49 void SetNCellsGroup(Int_t n) {fGroupNCells = n ;}
50 void SetLogWeight(Float_t w) {fLogWeight = w ;}
52 //void SetCalibCorrections(AliEMCALCalibData* const cdata);
53 void CreateAODFromESD();
54 void CreateAODFromAOD();
56 void CopyAOD(Bool_t copy) { fCopyAOD = copy ; }
57 Bool_t IsAODCopied() const { return fCopyAOD ; }
59 void SwitchOnSameSM() {fSameSM = kTRUE ; }
60 void SwitchOffSameSM() {fSameSM = kFALSE ; }
62 Int_t GetEMCALClusters(AliVEvent* event, TRefArray *clusters) const;
63 Bool_t IsEMCALCluster(AliVCluster *clus) const;
64 void SwitchOnOldAODs() {fOldAOD = kTRUE ; }
65 void SwitchOffOldAODs() {fOldAOD = kFALSE ; }
67 void SetGeometryName(TString name) { fEMCALGeoName = name ; }
68 TString GeometryName() const { return fEMCALGeoName ; }
70 //Modules fiducial region
71 Bool_t CheckCellFiducialRegion(AliVCluster* cluster, AliVCaloCells* cells) ;
72 void SetNumberOfCellsFromEMCALBorder(Int_t n) {fNCellsFromEMCALBorder = n; }
73 Int_t GetNumberOfCellsFromEMCALBorder() const {return fNCellsFromEMCALBorder; }
75 // Bad channels, copy from PWG4/PartCorrBase/AliCalorimeterUtils
76 Bool_t IsBadChannelsRemovalSwitchedOn() const { return fRemoveBadChannels ; }
77 void SwitchOnBadChannelsRemoval () {fRemoveBadChannels = kTRUE ; InitEMCALBadChannelStatusMap();}
78 void SwitchOffBadChannelsRemoval() {fRemoveBadChannels = kFALSE ; }
80 void InitEMCALBadChannelStatusMap() ;
82 Int_t GetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow) const {
83 if(fEMCALBadChannelMap) return (Int_t) ((TH2I*)fEMCALBadChannelMap->At(iSM))->GetBinContent(iCol,iRow);
84 else return 0;}//Channel is ok by default
86 void SetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) {
87 if(!fEMCALBadChannelMap)InitEMCALBadChannelStatusMap() ;
88 ((TH2I*)fEMCALBadChannelMap->At(iSM))->SetBinContent(iCol,iRow,c);}
90 TH2I * GetEMCALChannelStatusMap(Int_t iSM) const {return (TH2I*)fEMCALBadChannelMap->At(iSM);}
91 void SetEMCALChannelStatusMap(TObjArray *map) {fEMCALBadChannelMap = map;}
93 Bool_t ClusterContainsBadChannel(UShort_t* cellList, Int_t nCells);
96 Bool_t IsRecalibrationOn() const { return fRecalibration ; }
97 void SwitchOnRecalibration() {fRecalibration = kTRUE ; InitEMCALRecalibrationFactors();}
98 void SwitchOffRecalibration() {fRecalibration = kFALSE ; }
100 void InitEMCALRecalibrationFactors() ;
102 Float_t GetEMCALChannelRecalibrationFactor(Int_t iSM , Int_t iCol, Int_t iRow) const {
103 if(fEMCALRecalibrationFactors) return (Float_t) ((TH2F*)fEMCALRecalibrationFactors->At(iSM))->GetBinContent(iCol,iRow);
106 void SetEMCALChannelRecalibrationFactor(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) {
107 if(!fEMCALRecalibrationFactors) InitEMCALRecalibrationFactors();
108 ((TH2F*)fEMCALRecalibrationFactors->At(iSM))->SetBinContent(iCol,iRow,c);}
110 void SetEMCALChannelRecalibrationFactors(Int_t iSM , TH2F* h) {fEMCALRecalibrationFactors->AddAt(h,iSM);}
112 TH2F * GetEMCALChannelRecalibrationFactors(Int_t iSM) const {return (TH2F*)fEMCALRecalibrationFactors->At(iSM);}
114 void SetEMCALChannelRecalibrationFactors(TObjArray *map) {fEMCALRecalibrationFactors = map;}
115 Float_t RecalibrateClusterEnergy(AliAODCaloCluster* cluster, AliAODCaloCells * cells);
117 void SetEMCALRecoUtils(AliEMCALRecoUtils * ru) {fRecoUtils = ru;}
118 AliEMCALRecoUtils* GetEMCALRecoUtils() const {return fRecoUtils;}
120 void SetInvariantMassHistoBinRange(Int_t nBins, Float_t minbin, Float_t maxbin){
121 fNbins = nBins; fMinBin = minbin; fMaxBin = maxbin; }
123 void GetMaxEnergyCellPosAndClusterPos(AliVCaloCells* cells, AliVCluster* clu, Int_t& iSM, Int_t& ieta, Int_t& iphi);
127 AliEMCALGeometry * fEMCALGeo; //! EMCAL geometry
128 //AliEMCALCalibData* fCalibData; // corrections to CC from the previous iteration
130 Float_t fEmin; // min. cluster energy
131 Float_t fEmax; // max. cluster energy
132 Float_t fAsyCut; // Asymmetry cut
133 Int_t fMinNCells; // min. ncells in cluster
134 Int_t fGroupNCells; // group n cells
135 Float_t fLogWeight; // log weight used in cluster recalibration
136 Bool_t fCopyAOD; // Copy calo information only to AOD?
137 Bool_t fSameSM; // Combine clusters in channels on same SM
138 Bool_t fOldAOD; // Reading Old AODs, created before release 4.20
139 TString fEMCALGeoName; // Name of geometry to use.
140 Int_t fNCellsFromEMCALBorder; // Number of cells from EMCAL border the cell with maximum amplitude has to be.
142 Bool_t fRemoveBadChannels; // Check the channel status provided and remove clusters with bad channels
143 TObjArray *fEMCALBadChannelMap; // Array of histograms with map of bad channels, EMCAL
144 Bool_t fRecalibration; // Switch on or off the recalibration
145 TObjArray *fEMCALRecalibrationFactors; // Array of histograms with map of recalibration factors, EMCAL
147 AliEMCALRecoUtils * fRecoUtils; // Access to reconstruction utilities
150 Int_t fNbins; // N mass bins of invariant mass histograms
151 Float_t fMinBin; // Minimum mass bins of invariant mass histograms
152 Float_t fMaxBin; // Maximum mass bins of invariant mass histograms
154 TList* fOutputContainer; //!histogram container
155 TH1F* fHmpi0[AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows];//! two-cluster inv. mass assigned to each cell.
157 TH2F* fHmgg; //! two-cluster inv.mass vs pt of pair
158 TH2F* fHmggDifferentSM; //! two-cluster inv.mass vs pt of pair, each cluster in different SM
159 TH2F* fHmggSM[4]; //! two-cluster inv.mass per SM
160 TH2F* fHmggPairSM[4]; //! two-cluster inv.mass per Pair
162 TH2F* fHOpeningAngle; //! two-cluster opening angle vs pt of pair, with mass close to pi0
163 TH2F* fHOpeningAngleDifferentSM; //! two-cluster opening angle vs pt of pair, each cluster in different SM, with mass close to pi0
164 TH2F* fHOpeningAngleSM[4]; //! two-cluster opening angle vs pt per SM,with mass close to pi0
165 TH2F* fHOpeningAnglePairSM[4]; //! two-cluster opening angle vs pt per Pair,with mass close to pi0
167 TH2F* fHIncidentAngle; //! cluster incident angle vs pt of pair, with mass close to pi0
168 TH2F* fHIncidentAngleDifferentSM; //! cluster incident angle vs pt of pair, each cluster in different SM, with mass close to pi0
169 TH2F* fHIncidentAngleSM[4]; //! cluster incident angle vs pt per SM,with mass close to pi0
170 TH2F* fHIncidentAnglePairSM[4]; //! cluster incident angle vs pt per Pair,with mass close to pi0
172 TH2F* fHAsymmetry; //! two-cluster asymmetry vs pt of pair, with mass close to pi0
173 TH2F* fHAsymmetryDifferentSM; //! two-cluster asymmetry vs pt of pair, each cluster in different SM, with mass close to pi0
174 TH2F* fHAsymmetrySM[4]; //! two-cluster asymmetry vs pt per SM,with mass close to pi0
175 TH2F* fHAsymmetryPairSM[4]; //! two-cluster asymmetry vs pt per Pair,with mass close to pi0
177 TH2F* fhTowerDecayPhotonHit[4] ; //! Cells ordered in column/row for different module, number of times a decay photon hits
178 TH2F* fhTowerDecayPhotonEnergy[4] ; //! Cells ordered in column/row for different module, accumulated energy in the tower by decay photons.
179 TH2F* fhTowerDecayPhotonAsymmetry[4] ; //! Cells ordered in column/row for different module, accumulated asymmetry in the tower by decay photons.
181 TH1I* fhNEvents; //! Number of events counter histogram
182 TList * fCuts ; //! List with analysis cuts
184 ClassDef(AliAnalysisTaskEMCALPi0CalibSelection,8);
188 #endif //ALIANALYSISTASKEMCALPI0CALIBSELECTION_H