6 #include <TClonesArray.h>
11 #include <TObjArray.h>
12 #include <TParameter.h>
14 #include "AliEMCALGeometry.h"
16 #include "AliInputEventHandler.h"
18 #include "AliOADBContainer.h"
19 #include "AliVCaloCells.h"
20 #include "AliVEvent.h"
29 fHistManager(
nullptr),
32 fRequestTrigger(AliVEvent::kAnyINT),
33 fBadChannelContainer(""),
35 fNumberOfCells(12288),
43 AliAnalysisTaskSE(name),
48 fRequestTrigger(AliVEvent::kAnyINT),
49 fBadChannelContainer(
""),
51 fNumberOfCells(12288),
55 DefineOutput(1, TList::Class());
71 fGeometry = AliEMCALGeometry::GetInstanceFromRunNumber(fInputEvent->GetRunNumber());
90 fOldRun = InputEvent()->GetRunNumber();
96 if(!TString(InputEvent()->GetFiredTriggerClasses()).Contains(
fTriggerString))
return;
101 AliVCaloCells *emcalcells = fInputEvent->GetEMCALCells();
105 Double_t amplitude, celltime, efrac;
108 Int_t sm, mod, meta, mphi, ieta, iphi;
109 for(
int icell = 0; icell < emcalcells->GetNumberOfCells(); icell++){
110 emcalcells->GetCell(icell, cellNumber, amplitude, celltime, mclabel, efrac);
118 if(celltime > -5e-8 && celltime < 1e-7)
fHistManager->
FillTH2(
"cellTimeMain", celltime, cellNumber);
121 fGeometry->GetCellIndex(cellNumber, sm, mod, mphi, meta);
122 fGeometry->GetCellPhiEtaIndexInSModule(sm, mod, mphi, meta, iphi, ieta);
131 TClonesArray *clustercont =
dynamic_cast<TClonesArray *
>(InputEvent()->FindListObject(
fNameClusters.Data()));
133 const AliVCluster *myclust =
nullptr;
134 for(TIter clusteriter = TIter(clustercont).Begin(); clusteriter != TIter::End(); ++clusteriter){
135 myclust =
dynamic_cast<const AliVCluster *
>(*clusteriter);
136 if(!myclust)
continue;
137 for(
int icell = 0; icell < myclust->GetNCells(); icell++){
139 fHistManager->
FillTH2(
"cellAmplitudeFractionCluster", myclust->GetCellAbsId(icell), myclust->GetCellAmplitudeFraction(icell));
143 AliErrorStream() << GetName() <<
": cluster container " <<
fNameClusters <<
" not found in the input event" << std::endl;
160 for(
int ism = 0; ism < 20; ++ism){
161 fHistManager->
CreateTH2(Form(
"cellAmpSM%d", ism), Form(
"Integrated cell amplitudes for SM %d; col; row", ism), 48, -0.5, 47.5, 24, -0.5, 23.5);
162 fHistManager->
CreateTH2(Form(
"cellCountSM%d", ism), Form(
"Count rate per cell for SM %d; col; row", ism), 48, -0.5, 47.5, 24, -0.5, 23.5);
165 for(
int ism = 0; ism < 20; ++ism){
166 fHistManager->
CreateTH2(Form(
"cellAmpTimeCorrSM%d", ism), Form(
"Correlation between cell amplitude and time in Supermodule %d", ism), 1000, -5e-7, 5e-7, 1000, 0., 100.);
172 AliInfoStream() << GetName() <<
": Loading bad channel map from " <<
fBadChannelContainer << std::endl;
175 AliOADBContainer contreader(
"EmcalBadChannelsAdditional");
177 TObjArray *rundata =
dynamic_cast<TObjArray *
>(contreader.GetObject(InputEvent()->
GetRunNumber()));
179 for(TIter channeliter = TIter(rundata).Begin(); channeliter != TIter::End(); ++channeliter){
virtual void RunChanged()
Class creating a linear binning, used in the histogram manager.
std::vector< Int_t > fMaskedCells
Vector of masked cells.
AliEmcalCellMonitorAmplitudeBinning()
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
ULong_t fRequestTrigger
Trigger selection.
void AddStep(Double_t max, Double_t binwidth)
void SetBadCell(Int_t cellId)
AliEmcalCellMonitorTask()
bool IsCellMasked(Int_t cellId) const
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
THashList * GetListOfHistograms() const
virtual void UserCreateOutputObjects()
TString fNameClusters
Name of the cluster container (as TClonesArray)
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Helper class creating user defined custom binning.
Defining binning in amplitude direction.
Int_t fNumberOfCells
Number of cells.
virtual void UserExec(Option_t *)
TString fTriggerString
Trigger string in addition to trigger selection.
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Bool_t fInitialized
Check whether task is initialized (for ExecOnce)
virtual ~AliEmcalCellMonitorTask()
Double_t fMinCellAmplitude
Min. cell amplitude requested for cell time and frequency.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Int_t fOldRun
! Old Run number (for run change check)
Container class for histograms for the high- charged particle analysis.
Int_t GetRunNumber(TString)
AliEMCALGeometry * fGeometry
! EMCAL geometry
TString fBadChannelContainer
Bad channel container name.
THistManager * fHistManager
! Histogram handler
void SetMinimum(Double_t min)
Simple monitoring task for cell related quantities.