32 #include <TClonesArray.h>
34 #include <THashList.h>
37 #include <TObjArray.h>
38 #include <TParameter.h>
40 #include "AliEMCALGeometry.h"
42 #include "AliInputEventHandler.h"
44 #include "AliOADBContainer.h"
45 #include "AliVCaloCells.h"
46 #include "AliVEvent.h"
52 using namespace PWG::EMCAL;
56 fLocalInitialized(kFALSE),
57 fHistManager(
nullptr),
60 fRequestTrigger(AliVEvent::kAnyINT),
61 fBadChannelContainer(""),
63 fNumberOfCells(12288),
70 AliEmcalCellMonitorTask::AliEmcalCellMonitorTask(
const char *name) :
72 fLocalInitialized(kFALSE),
76 fRequestTrigger(AliVEvent::kAnyINT),
77 fBadChannelContainer(
""),
79 fNumberOfCells(12288),
83 DefineOutput(1, TList::Class());
99 fGeometry = AliEMCALGeometry::GetInstanceFromRunNumber(fInputEvent->GetRunNumber());
118 fOldRun = InputEvent()->GetRunNumber();
129 AliVCaloCells *emcalcells = fInputEvent->GetEMCALCells();
133 Double_t amplitude, celltime, efrac;
136 Int_t sm, mod, meta, mphi, ieta, iphi;
137 for(
int icell = 0; icell < emcalcells->GetNumberOfCells(); icell++){
138 emcalcells->GetCell(icell, cellNumber, amplitude, celltime, mclabel, efrac);
146 if(celltime > -5e-8 && celltime < 1e-7)
fHistManager->
FillTH2(
"cellTimeMain", celltime, cellNumber);
149 fGeometry->GetCellIndex(cellNumber, sm, mod, mphi, meta);
150 fGeometry->GetCellPhiEtaIndexInSModule(sm, mod, mphi, meta, iphi, ieta);
159 TClonesArray *clustercont =
dynamic_cast<TClonesArray *
>(InputEvent()->FindListObject(
fNameClusters.Data()));
161 const AliVCluster *myclust =
nullptr;
162 for(TIter clusteriter = TIter(clustercont).Begin(); clusteriter != TIter::End(); ++clusteriter){
163 myclust =
dynamic_cast<const AliVCluster *
>(*clusteriter);
164 if(!myclust)
continue;
165 for(
int icell = 0; icell < myclust->GetNCells(); icell++){
167 fHistManager->
FillTH2(
"cellAmplitudeFractionCluster", myclust->GetCellAbsId(icell), myclust->GetCellAmplitudeFraction(icell));
171 AliErrorStream() << GetName() <<
": cluster container " <<
fNameClusters <<
" not found in the input event" << std::endl;
188 for(
int ism = 0; ism < 20; ++ism){
189 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);
190 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);
193 for(
int ism = 0; ism < 20; ++ism){
194 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.);
200 AliInfoStream() << GetName() <<
": Loading bad channel map from " <<
fBadChannelContainer << std::endl;
203 AliOADBContainer contreader(
"EmcalBadChannelsAdditional");
207 for(TIter channeliter = TIter(rundata).Begin(); channeliter != TIter::End(); ++channeliter){
AliEMCALGeometry * fGeometry
! EMCAL geometry
AliEmcalCellMonitorAmplitudeBinning()
Int_t fNumberOfCells
Number of cells.
Class creating a linear binning, used in the histogram manager.
virtual void UserCreateOutputObjects()
Int_t fOldRun
! Old Run number (for run change check)
Defining binning in amplitude direction.
void SetBadCell(Int_t cellId)
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
virtual void UserExec(Option_t *)
void AddStep(Double_t max, Double_t binwidth)
virtual void RunChanged()
TString fBadChannelContainer
Bad channel container name.
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.
Simple monitoring task for cell related quantities.
THistManager * fHistManager
! Histogram handler
THashList * GetListOfHistograms() const
Get the list of histograms.
TString fNameClusters
Name of the cluster container (as TClonesArray)
std::vector< Int_t > fMaskedCells
Vector of masked cells.
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.
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(AliAnalysisTaskDeltaPt) AliAnalysisTaskDeltaPt
Bool_t fLocalInitialized
Check whether task is initialized (for ExecOnce)
bool IsCellMasked(Int_t cellId) const
ULong_t fRequestTrigger
Trigger selection.
TString fTriggerString
Trigger string in addition to trigger selection.
Container class for histograms.
Int_t GetRunNumber(TString)
void SetMinimum(Double_t min)