]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/CaloCalib/AliAnalysisTaskEMCALPi0CalibSelection.h
readout resolution added
[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"
24
25class AliAnalysisTaskEMCALPi0CalibSelection : public AliAnalysisTaskSE
26{
27public:
28
375cec9b 29 AliAnalysisTaskEMCALPi0CalibSelection(const char* name);
30 AliAnalysisTaskEMCALPi0CalibSelection(const AliAnalysisTaskEMCALPi0CalibSelection&);
31 AliAnalysisTaskEMCALPi0CalibSelection& operator=(const AliAnalysisTaskEMCALPi0CalibSelection&);
32 virtual ~AliAnalysisTaskEMCALPi0CalibSelection();
33
34 // Implementation of interface methods
35 virtual void UserCreateOutputObjects();
36 virtual void UserExec(Option_t * opt);
6eb2a715 37 virtual void LocalInit() ;
38
375cec9b 39 void SetClusterMinEnergy(Float_t emin) {fEmin=emin;}
cf028690 40 void SetClusterMaxEnergy(Float_t emax) {fEmax=emax;}
6eb2a715 41 void SetClusterMinNCells(Int_t n) {fMinNCells=n;}
42 void SetNCellsGroup(Int_t n) {fGroupNCells=n;}
cf028690 43
375cec9b 44 void SetLogWeight(Float_t weight) {fLogWeight=weight;}
6eb2a715 45 //void SetCalibCorrections(AliEMCALCalibData* const cdata);
375cec9b 46 void CreateAODFromESD();
47 void CreateAODFromAOD();
48
49 void CopyAOD(Bool_t copy) { fCopyAOD = copy ; }
50 Bool_t IsAODCopied() const { return fCopyAOD ; }
51
2dfb1428 52 void SwitchOnSameSM() {fSameSM = kTRUE ; }
53 void SwitchOffSameSM() {fSameSM = kFALSE ; }
54
55 Int_t GetEMCALClusters(AliVEvent* event, TRefArray *clusters) const;
56 Bool_t IsEMCALCluster(AliVCluster *clus) const;
57 void SwitchOnOldAODs() {fOldAOD = kTRUE ; }
58 void SwitchOffOldAODs() {fOldAOD = kFALSE ; }
59
375cec9b 60 void SetGeometryName(TString name) { fEMCALGeoName = name ; }
61 TString GeometryName() const { return fEMCALGeoName ; }
6eb2a715 62
63 // Bad channels, copy from PWG4/PartCorrBase/AliCalorimeterUtils
64 Bool_t IsBadChannelsRemovalSwitchedOn() const { return fRemoveBadChannels ; }
65 void SwitchOnBadChannelsRemoval () {fRemoveBadChannels = kTRUE ; InitEMCALBadChannelStatusMap();}
66 void SwitchOffBadChannelsRemoval() {fRemoveBadChannels = kFALSE ; }
67
68 void InitEMCALBadChannelStatusMap() ;
69
70 Int_t GetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow) const {
71 if(fEMCALBadChannelMap) return (Int_t) ((TH2I*)fEMCALBadChannelMap->At(iSM))->GetBinContent(iCol,iRow);
72 else return 0;}//Channel is ok by default
73
74 void SetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) {
75 if(!fEMCALBadChannelMap)InitEMCALBadChannelStatusMap() ;
76 ((TH2I*)fEMCALBadChannelMap->At(iSM))->SetBinContent(iCol,iRow,c);}
77
78 TH2I * GetEMCALChannelStatusMap(Int_t iSM) const {return (TH2I*)fEMCALBadChannelMap->At(iSM);}
79
80 void SetEMCALChannelStatusMap(TObjArray *map) {fEMCALBadChannelMap = map;}
81
82 Bool_t ClusterContainsBadChannel(UShort_t* cellList, Int_t nCells);
83
84 // Recalibration
85 Bool_t IsRecalibrationOn() const { return fRecalibration ; }
86 void SwitchOnRecalibration() {fRecalibration = kTRUE ; InitEMCALRecalibrationFactors();}
87 void SwitchOffRecalibration() {fRecalibration = kFALSE ; }
88
89 void InitEMCALRecalibrationFactors() ;
90
91 Float_t GetEMCALChannelRecalibrationFactor(Int_t iSM , Int_t iCol, Int_t iRow) const {
92 if(fEMCALRecalibrationFactors) return (Float_t) ((TH2F*)fEMCALRecalibrationFactors->At(iSM))->GetBinContent(iCol,iRow);
93 else return 1;}
94
95 void SetEMCALChannelRecalibrationFactor(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) {
96 if(!fEMCALRecalibrationFactors) InitEMCALRecalibrationFactors();
97 ((TH2F*)fEMCALRecalibrationFactors->At(iSM))->SetBinContent(iCol,iRow,c);}
98
99 void SetEMCALChannelRecalibrationFactors(Int_t iSM , TH2F* h) {fEMCALRecalibrationFactors->AddAt(h,iSM);}
100
101 TH2F * GetEMCALChannelRecalibrationFactors(Int_t iSM) const {return (TH2F*)fEMCALRecalibrationFactors->At(iSM);}
102
103 void SetEMCALChannelRecalibrationFactors(TObjArray *map) {fEMCALRecalibrationFactors = map;}
104 Float_t RecalibrateClusterEnergy(AliAODCaloCluster* cluster, AliAODCaloCells * cells);
105
106 void SetInvariantMassHistoBinRange(Int_t nBins, Float_t minbin, Float_t maxbin){
107 fNbins = nBins; fMinBin = minbin; fMaxBin = maxbin; }
108
375cec9b 109private:
110
6eb2a715 111 void MaxEnergyCellPos(AliAODCaloCells* const cells, AliAODCaloCluster* const clu, Int_t& iSM, Int_t& ieta, Int_t& iphi);
375cec9b 112
113private:
114
cf028690 115 AliEMCALGeometry * fEMCALGeo; //! EMCAL geometry
6eb2a715 116 //AliEMCALCalibData* fCalibData; // corrections to CC from the previous iteration
375cec9b 117
118 Float_t fEmin; // min. cluster energy
cf028690 119 Float_t fEmax; // max. cluster energy
120 Int_t fMinNCells; // min. ncells in cluster
70ae4900 121 Int_t fGroupNCells; // group n cells
375cec9b 122 Float_t fLogWeight; // log weight used in cluster recalibration
123 Bool_t fCopyAOD; // Copy calo information only to AOD?
2dfb1428 124 Bool_t fSameSM; // Combine clusters in channels on same SM
125 Bool_t fOldAOD; // Reading Old AODs, created before release 4.20
375cec9b 126 TString fEMCALGeoName; // Name of geometry to use.
6eb2a715 127
128 Bool_t fRemoveBadChannels; // Check the channel status provided and remove clusters with bad channels
129 TObjArray *fEMCALBadChannelMap; // Array of histograms with map of bad channels, EMCAL
130 Bool_t fRecalibration; // Switch on or off the recalibration
131 TObjArray *fEMCALRecalibrationFactors; // Array of histograms with map of recalibration factors, EMCAL
132
375cec9b 133 //Output histograms
6eb2a715 134 Int_t fNbins; // N mass bins of invariant mass histograms
135 Float_t fMinBin; // Minimum mass bins of invariant mass histograms
136 Float_t fMaxBin; // Maximum mass bins of invariant mass histograms
137
cf028690 138 TList* fOutputContainer; //!histogram container
139 TH1F* fHmpi0[AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows];//! two-cluster inv. mass assigned to each cell.
70ae4900 140 TH2F* fHmgg; //! two-cluster inv.mass vt pt of pair
2dfb1428 141 TH2F* fHmggDifferentSM; //! two-cluster inv.mass vt pt of pair, each cluster in different SM
142 TH2F* fHmggSM[4]; //! two-cluster inv.mass per SM
143 TH2F* fHmggPairSM[4]; //! two-cluster inv.mass per Pair
6eb2a715 144 TH1I* fhNEvents; //! Number of events counter histogram
145 TList * fCuts ; //! List with analysis cuts
375cec9b 146
2dfb1428 147 ClassDef(AliAnalysisTaskEMCALPi0CalibSelection,4);
375cec9b 148
149};
150
151#endif //ALIANALYSISTASKEMCALPI0CALIBSELECTION_H