20 #include <TClonesArray.h>
22 #include <THashList.h>
25 #include <TObjArray.h>
26 #include <TParameter.h>
28 #include "AliEMCALGeometry.h"
30 #include "AliInputEventHandler.h"
32 #include "AliOADBContainer.h"
33 #include "AliVCaloCells.h"
34 #include "AliVEvent.h"
42 fLocalInitialized(kFALSE),
43 fHistManager(
nullptr),
46 fRequestTrigger(AliVEvent::kAnyINT),
47 fBadChannelContainer(""),
49 fNumberOfCells(12288),
58 fLocalInitialized(kFALSE),
62 fRequestTrigger(AliVEvent::kAnyINT),
63 fBadChannelContainer(
""),
65 fNumberOfCells(12288),
69 DefineOutput(1, TList::Class());
85 fGeometry = AliEMCALGeometry::GetInstanceFromRunNumber(fInputEvent->GetRunNumber());
104 fOldRun = InputEvent()->GetRunNumber();
115 AliVCaloCells *emcalcells = fInputEvent->GetEMCALCells();
119 Double_t amplitude, celltime, efrac;
122 Int_t sm, mod, meta, mphi, ieta, iphi;
123 for(
int icell = 0; icell < emcalcells->GetNumberOfCells(); icell++){
124 emcalcells->GetCell(icell, cellNumber, amplitude, celltime, mclabel, efrac);
132 if(celltime > -5e-8 && celltime < 1e-7)
fHistManager->
FillTH2(
"cellTimeMain", celltime, cellNumber);
135 fGeometry->GetCellIndex(cellNumber, sm, mod, mphi, meta);
136 fGeometry->GetCellPhiEtaIndexInSModule(sm, mod, mphi, meta, iphi, ieta);
145 TClonesArray *clustercont =
dynamic_cast<TClonesArray *
>(InputEvent()->FindListObject(
fNameClusters.Data()));
147 const AliVCluster *myclust =
nullptr;
148 for(TIter clusteriter = TIter(clustercont).Begin(); clusteriter != TIter::End(); ++clusteriter){
149 myclust =
dynamic_cast<const AliVCluster *
>(*clusteriter);
150 if(!myclust)
continue;
151 for(
int icell = 0; icell < myclust->GetNCells(); icell++){
153 fHistManager->
FillTH2(
"cellAmplitudeFractionCluster", myclust->GetCellAbsId(icell), myclust->GetCellAmplitudeFraction(icell));
157 AliErrorStream() << GetName() <<
": cluster container " <<
fNameClusters <<
" not found in the input event" << std::endl;
174 for(
int ism = 0; ism < 20; ++ism){
175 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);
176 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);
179 for(
int ism = 0; ism < 20; ++ism){
180 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.);
186 AliInfoStream() << GetName() <<
": Loading bad channel map from " <<
fBadChannelContainer << std::endl;
189 AliOADBContainer contreader(
"EmcalBadChannelsAdditional");
193 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="")
Fill a 2D histogram within the container.
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="")
Create a new TH2 within the container.
THashList * GetListOfHistograms() const
Get the list of histograms.
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="")
Create a new TH1 within the container.
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="")
Fill a 1D histogram within the container.
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.
Int_t GetRunNumber(TString)
AliEMCALGeometry * fGeometry
! EMCAL geometry
TString fBadChannelContainer
Bad channel container name.
THistManager * fHistManager
! Histogram handler
Bool_t fLocalInitialized
Check whether task is initialized (for ExecOnce)
void SetMinimum(Double_t min)
Simple monitoring task for cell related quantities.