Allow position recaculation for EMCAL rotational and translation shifts, add asymmetr...
[u/mrichter/AliRoot.git] / PWG4 / CaloCalib / AliAnalysisTaskEMCALPi0CalibSelection.h
CommitLineData
375cec9b 1#ifndef ALIANALYSISTASKEMCALPI0CALIBSELECTION_H
2#define ALIANALYSISTASKEMCALPI0CALIBSELECTION_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// Fill histograms with two-cluster invariant mass //
9// using calibration coefficients of the previous iteration. //
10//---------------------------------------------------------------------------//
11
12// Root includes
13class TH1F;
6eb2a715 14#include "TH2I.h"
15#include "TObjArray.h"
375cec9b 16
17// AliRoot includes
18#include "AliAnalysisTaskSE.h"
19class AliEMCALGeometry;
20class AliAODCaloCluster;
21class AliAODCaloCells;
6eb2a715 22//class AliEMCALCalibData ;
375cec9b 23#include "AliEMCALGeoParams.h"
9584c261 24class AliEMCALRecoUtils;
375cec9b 25
26class AliAnalysisTaskEMCALPi0CalibSelection : public AliAnalysisTaskSE
27{
28public:
29
375cec9b 30 AliAnalysisTaskEMCALPi0CalibSelection(const char* name);
375cec9b 31 virtual ~AliAnalysisTaskEMCALPi0CalibSelection();
32
9584c261 33private:
34
35 AliAnalysisTaskEMCALPi0CalibSelection(const AliAnalysisTaskEMCALPi0CalibSelection&);
36 AliAnalysisTaskEMCALPi0CalibSelection& operator=(const AliAnalysisTaskEMCALPi0CalibSelection&);
37
38public:
39
375cec9b 40 // Implementation of interface methods
41 virtual void UserCreateOutputObjects();
42 virtual void UserExec(Option_t * opt);
6eb2a715 43 virtual void LocalInit() ;
9fdaff9a 44
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 ;}
51
6eb2a715 52 //void SetCalibCorrections(AliEMCALCalibData* const cdata);
375cec9b 53 void CreateAODFromESD();
54 void CreateAODFromAOD();
55
9fdaff9a 56 void CopyAOD(Bool_t copy) { fCopyAOD = copy ; }
375cec9b 57 Bool_t IsAODCopied() const { return fCopyAOD ; }
58
2dfb1428 59 void SwitchOnSameSM() {fSameSM = kTRUE ; }
60 void SwitchOffSameSM() {fSameSM = kFALSE ; }
61
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 ; }
66
9fdaff9a 67 void SetGeometryName(TString name) { fEMCALGeoName = name ; }
68 TString GeometryName() const { return fEMCALGeoName ; }
6eb2a715 69
cfce8d44 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; }
74
6eb2a715 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 ; }
79
80 void InitEMCALBadChannelStatusMap() ;
81
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
85
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);}
89
90 TH2I * GetEMCALChannelStatusMap(Int_t iSM) const {return (TH2I*)fEMCALBadChannelMap->At(iSM);}
9fdaff9a 91 void SetEMCALChannelStatusMap(TObjArray *map) {fEMCALBadChannelMap = map;}
6eb2a715 92
93 Bool_t ClusterContainsBadChannel(UShort_t* cellList, Int_t nCells);
94
95 // Recalibration
9fdaff9a 96 Bool_t IsRecalibrationOn() const { return fRecalibration ; }
97 void SwitchOnRecalibration() {fRecalibration = kTRUE ; InitEMCALRecalibrationFactors();}
98 void SwitchOffRecalibration() {fRecalibration = kFALSE ; }
6eb2a715 99
100 void InitEMCALRecalibrationFactors() ;
9584c261 101
6eb2a715 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);
104 else return 1;}
105
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);}
109
110 void SetEMCALChannelRecalibrationFactors(Int_t iSM , TH2F* h) {fEMCALRecalibrationFactors->AddAt(h,iSM);}
111
112 TH2F * GetEMCALChannelRecalibrationFactors(Int_t iSM) const {return (TH2F*)fEMCALRecalibrationFactors->At(iSM);}
113
114 void SetEMCALChannelRecalibrationFactors(TObjArray *map) {fEMCALRecalibrationFactors = map;}
115 Float_t RecalibrateClusterEnergy(AliAODCaloCluster* cluster, AliAODCaloCells * cells);
116
9584c261 117 void SetEMCALRecoUtils(AliEMCALRecoUtils * ru) {fRecoUtils = ru;}
9fdaff9a 118 AliEMCALRecoUtils* GetEMCALRecoUtils() const {return fRecoUtils;}
9584c261 119
6eb2a715 120 void SetInvariantMassHistoBinRange(Int_t nBins, Float_t minbin, Float_t maxbin){
121 fNbins = nBins; fMinBin = minbin; fMaxBin = maxbin; }
9584c261 122
9584c261 123 void GetMaxEnergyCellPosAndClusterPos(AliVCaloCells* cells, AliVCluster* clu, Int_t& iSM, Int_t& ieta, Int_t& iphi);
375cec9b 124
125private:
126
cf028690 127 AliEMCALGeometry * fEMCALGeo; //! EMCAL geometry
6eb2a715 128 //AliEMCALCalibData* fCalibData; // corrections to CC from the previous iteration
375cec9b 129
130 Float_t fEmin; // min. cluster energy
cf028690 131 Float_t fEmax; // max. cluster energy
9fdaff9a 132 Float_t fAsyCut; // Asymmetry cut
cf028690 133 Int_t fMinNCells; // min. ncells in cluster
70ae4900 134 Int_t fGroupNCells; // group n cells
375cec9b 135 Float_t fLogWeight; // log weight used in cluster recalibration
136 Bool_t fCopyAOD; // Copy calo information only to AOD?
2dfb1428 137 Bool_t fSameSM; // Combine clusters in channels on same SM
138 Bool_t fOldAOD; // Reading Old AODs, created before release 4.20
375cec9b 139 TString fEMCALGeoName; // Name of geometry to use.
cfce8d44 140 Int_t fNCellsFromEMCALBorder; // Number of cells from EMCAL border the cell with maximum amplitude has to be.
141
6eb2a715 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
146
9584c261 147 AliEMCALRecoUtils * fRecoUtils; // Access to reconstruction utilities
148
375cec9b 149 //Output histograms
6eb2a715 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
153
cf028690 154 TList* fOutputContainer; //!histogram container
155 TH1F* fHmpi0[AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows];//! two-cluster inv. mass assigned to each cell.
9584c261 156
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
2dfb1428 159 TH2F* fHmggSM[4]; //! two-cluster inv.mass per SM
160 TH2F* fHmggPairSM[4]; //! two-cluster inv.mass per Pair
9584c261 161
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
166
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
171
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
176
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.
180
6eb2a715 181 TH1I* fhNEvents; //! Number of events counter histogram
182 TList * fCuts ; //! List with analysis cuts
375cec9b 183
9fdaff9a 184 ClassDef(AliAnalysisTaskEMCALPi0CalibSelection,8);
375cec9b 185
186};
187
188#endif //ALIANALYSISTASKEMCALPI0CALIBSELECTION_H