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"
25 class AliAnalysisTaskEMCALPi0CalibSelection : public AliAnalysisTaskSE
29 AliAnalysisTaskEMCALPi0CalibSelection(const char* name);
30 AliAnalysisTaskEMCALPi0CalibSelection(const AliAnalysisTaskEMCALPi0CalibSelection&);
31 AliAnalysisTaskEMCALPi0CalibSelection& operator=(const AliAnalysisTaskEMCALPi0CalibSelection&);
32 virtual ~AliAnalysisTaskEMCALPi0CalibSelection();
34 // Implementation of interface methods
35 virtual void UserCreateOutputObjects();
36 virtual void UserExec(Option_t * opt);
37 virtual void LocalInit() ;
39 void SetClusterMinEnergy(Float_t emin) {fEmin=emin;}
40 void SetClusterMaxEnergy(Float_t emax) {fEmax=emax;}
41 void SetClusterMinNCells(Int_t n) {fMinNCells=n;}
42 void SetNCellsGroup(Int_t n) {fGroupNCells=n;}
44 void SetLogWeight(Float_t weight) {fLogWeight=weight;}
45 //void SetCalibCorrections(AliEMCALCalibData* const cdata);
46 void CreateAODFromESD();
47 void CreateAODFromAOD();
49 void CopyAOD(Bool_t copy) { fCopyAOD = copy ; }
50 Bool_t IsAODCopied() const { return fCopyAOD ; }
52 void SetGeometryName(TString name) { fEMCALGeoName = name ; }
53 TString GeometryName() const { return fEMCALGeoName ; }
55 // Bad channels, copy from PWG4/PartCorrBase/AliCalorimeterUtils
56 Bool_t IsBadChannelsRemovalSwitchedOn() const { return fRemoveBadChannels ; }
57 void SwitchOnBadChannelsRemoval () {fRemoveBadChannels = kTRUE ; InitEMCALBadChannelStatusMap();}
58 void SwitchOffBadChannelsRemoval() {fRemoveBadChannels = kFALSE ; }
60 void InitEMCALBadChannelStatusMap() ;
62 Int_t GetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow) const {
63 if(fEMCALBadChannelMap) return (Int_t) ((TH2I*)fEMCALBadChannelMap->At(iSM))->GetBinContent(iCol,iRow);
64 else return 0;}//Channel is ok by default
66 void SetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) {
67 if(!fEMCALBadChannelMap)InitEMCALBadChannelStatusMap() ;
68 ((TH2I*)fEMCALBadChannelMap->At(iSM))->SetBinContent(iCol,iRow,c);}
70 TH2I * GetEMCALChannelStatusMap(Int_t iSM) const {return (TH2I*)fEMCALBadChannelMap->At(iSM);}
72 void SetEMCALChannelStatusMap(TObjArray *map) {fEMCALBadChannelMap = map;}
74 Bool_t ClusterContainsBadChannel(UShort_t* cellList, Int_t nCells);
77 Bool_t IsRecalibrationOn() const { return fRecalibration ; }
78 void SwitchOnRecalibration() {fRecalibration = kTRUE ; InitEMCALRecalibrationFactors();}
79 void SwitchOffRecalibration() {fRecalibration = kFALSE ; }
81 void InitEMCALRecalibrationFactors() ;
83 Float_t GetEMCALChannelRecalibrationFactor(Int_t iSM , Int_t iCol, Int_t iRow) const {
84 if(fEMCALRecalibrationFactors) return (Float_t) ((TH2F*)fEMCALRecalibrationFactors->At(iSM))->GetBinContent(iCol,iRow);
87 void SetEMCALChannelRecalibrationFactor(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) {
88 if(!fEMCALRecalibrationFactors) InitEMCALRecalibrationFactors();
89 ((TH2F*)fEMCALRecalibrationFactors->At(iSM))->SetBinContent(iCol,iRow,c);}
91 void SetEMCALChannelRecalibrationFactors(Int_t iSM , TH2F* h) {fEMCALRecalibrationFactors->AddAt(h,iSM);}
93 TH2F * GetEMCALChannelRecalibrationFactors(Int_t iSM) const {return (TH2F*)fEMCALRecalibrationFactors->At(iSM);}
95 void SetEMCALChannelRecalibrationFactors(TObjArray *map) {fEMCALRecalibrationFactors = map;}
96 Float_t RecalibrateClusterEnergy(AliAODCaloCluster* cluster, AliAODCaloCells * cells);
98 void SetInvariantMassHistoBinRange(Int_t nBins, Float_t minbin, Float_t maxbin){
99 fNbins = nBins; fMinBin = minbin; fMaxBin = maxbin; }
103 void MaxEnergyCellPos(AliAODCaloCells* const cells, AliAODCaloCluster* const clu, Int_t& iSM, Int_t& ieta, Int_t& iphi);
107 AliEMCALGeometry * fEMCALGeo; //! EMCAL geometry
108 //AliEMCALCalibData* fCalibData; // corrections to CC from the previous iteration
110 Float_t fEmin; // min. cluster energy
111 Float_t fEmax; // max. cluster energy
112 Int_t fMinNCells; // min. ncells in cluster
113 Int_t fGroupNCells; // group n cells
114 Float_t fLogWeight; // log weight used in cluster recalibration
115 Bool_t fCopyAOD; // Copy calo information only to AOD?
116 TString fEMCALGeoName; // Name of geometry to use.
118 Bool_t fRemoveBadChannels; // Check the channel status provided and remove clusters with bad channels
119 TObjArray *fEMCALBadChannelMap; // Array of histograms with map of bad channels, EMCAL
120 Bool_t fRecalibration; // Switch on or off the recalibration
121 TObjArray *fEMCALRecalibrationFactors; // Array of histograms with map of recalibration factors, EMCAL
124 Int_t fNbins; // N mass bins of invariant mass histograms
125 Float_t fMinBin; // Minimum mass bins of invariant mass histograms
126 Float_t fMaxBin; // Maximum mass bins of invariant mass histograms
128 TList* fOutputContainer; //!histogram container
129 TH1F* fHmpi0[AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows];//! two-cluster inv. mass assigned to each cell.
130 TH2F* fHmgg; //! two-cluster inv.mass vt pt of pair
131 TH1I* fhNEvents; //! Number of events counter histogram
132 TList * fCuts ; //! List with analysis cuts
134 ClassDef(AliAnalysisTaskEMCALPi0CalibSelection,3);
138 #endif //ALIANALYSISTASKEMCALPI0CALIBSELECTION_H