17 #include <Riostream.h> 19 #include <TClonesArray.h> 23 #include <THnSparse.h> 24 #include <THashList.h> 29 #include "AliCentrality.h" 30 #include "AliVCluster.h" 31 #include "AliVParticle.h" 32 #include "AliVTrack.h" 34 #include "AliEMCALGeometry.h" 35 #include "AliEMCALGeoParams.h" 37 #include "AliVVZERO.h" 38 #include "AliESDUtils.h" 51 fParticleLevel(kFALSE),
57 fDoLeadingObjectPosition(0),
58 fMaxCellsInCluster(50),
61 fSeparateEMCalDCal(kTRUE),
72 fHistCellIDvsE(0),fHistCellIDvsELow(0),fHistCellEtaPhi(0),
73 fHistClusterIDvsE(0),fHistClusterIDvsELow(0),fHistClusterEtaPhi(0),fHistNrCellsInCluster(0),
75 fOutputList_Event(), fOutputList_Cell(), fOutputList_Cluster(),
76 fHistManager("AliAnalysisTaskEmcalRun2QA")
84 fParticleLevel(kFALSE),
90 fDoLeadingObjectPosition(0),
91 fMaxCellsInCluster(50),
94 fSeparateEMCalDCal(kTRUE),
104 fHistCellIDvsE(0),fHistCellIDvsELow(0),fHistCellEtaPhi(0),
105 fHistClusterIDvsE(0),fHistClusterIDvsELow(0),fHistClusterEtaPhi(0),fHistNrCellsInCluster(0),
107 fOutputList_Event(), fOutputList_Cell(), fOutputList_Cluster(),
116 fRtoD=180.0/TMath::Pi();
139 if(
fDebug==1)cout<<
"Inside of: AliAnalysisTaskEmcalRun2QA::UserCreateOutputObjects()"<<endl;
146 AliEmcalContainer* cont = 0;
175 Int_t fNMaxCols = AliEMCALGeoParams::fgkEMCALCols;
176 Int_t fNMaxRows = AliEMCALGeoParams::fgkEMCALRows;
196 cout<<
"Info1: "<<endl;
198 Int_t NRows = AliEMCALGeoParams::fgkEMCALRows;
200 Int_t NCol = AliEMCALGeoParams::fgkEMCALCols;
202 Int_t NSMod = AliEMCALGeoParams::fgkEMCALModules;
204 cout<<
"number of mo from geoparams: "<<NSMod<<endl;
205 cout<<
"number of col from geoparams: "<<NCol<<endl;
206 cout<<
"number of row from geoparams: "<<NRows<<endl;
207 cout<<
"Number of rows: "<<NRows<<
", rowsMax: "<<
fNMaxRowsAbs<<
", Number of collumns:"<<NCol<<
", colMax: "<<
fNMaxColsAbs<<endl;
214 cont = cont_it.second;
219 histname = TString::Format(
"%s/fHistRejectionReason_%d", cont->GetArrayName().Data(), i);
220 title = histname +
";Rejection reason;#it{E}_{cluster} (GeV);counts";
224 histname = TString::Format(
"%s/fHistClusPosition_%d", cont->GetArrayName().Data(), i);
225 title = histname +
";#it{x} (cm);#it{y} (cm);#it{z} (cm)";
226 fHistManager.
CreateTH3(histname.Data(), title.Data(), 50, -500, 500, 50, -500, 500, 50, -500, 500);
228 histname = TString::Format(
"%s/fHistClusPhiEtaEnergy_%d", cont->GetArrayName().Data(), i);
229 title = histname +
";#eta;#phi;#it{E}_{cluster} (GeV)";
230 fHistManager.
CreateTH3(histname.Data(), title.Data(), 50, -1, 1, 50, 0, TMath::TwoPi(),
nPtBins, 0,
fMaxPt);
233 histname = TString::Format(
"%s/fHistClusEnergy_%d", cont->GetArrayName().Data(), i);
234 title = histname +
";#it{E}_{cluster} (GeV);counts";
237 histname = TString::Format(
"%s/fHistClusNonLinCorrEnergy_%d", cont->GetArrayName().Data(), i);
238 title = histname +
";#it{E}_{cluster} (GeV);counts";
241 histname = TString::Format(
"%s/fHistClusHadCorrEnergy_%d", cont->GetArrayName().Data(), i);
242 title = histname +
";#it{E}_{cluster} (GeV);counts";
246 cout<<
"create histograms for cluster name: "<<cont->GetArrayName()<<endl;
255 fHistClusterIDvsE[i] =
new TH2F(Form(
"fHistClusterIDvsE_%d",i),Form(
"fHistClusterIDvsE_%d",i),18000,0,18000,100,0,50);
256 if(i==fNumOfSuperMod)
fHistClusterIDvsE[i]->GetXaxis()->SetTitle(
"Leading cell ID (all SuperModules");
257 else fHistClusterIDvsE[i]->GetXaxis()->SetTitle(Form(
"Leading cell ID (SuperMod No. %d)",i));
261 fHistClusterIDvsELow[i] =
new TH2F(Form(
"fHistClusterIDvsELow_%d",i),Form(
"fHistClusterIDvsELow_%d",i),18000,0,18000,200,0,2);
262 if(i==fNumOfSuperMod)
fHistClusterIDvsELow[i]->GetXaxis()->SetTitle(
"Leading cell ID (all SuperModules");
263 else fHistClusterIDvsELow[i]->GetXaxis()->SetTitle(Form(
"Leading cell ID (SuperMod No. %d)",i));
276 if(i==fNumOfSuperMod)
fHistClusterEtaPhi[i]->GetXaxis()->SetTitle(
"Leading cell column (#eta direction)(all SuperModules)");
277 else fHistClusterEtaPhi[i]->GetXaxis()->SetTitle(Form(
"Leading cell column (#eta direction)(SuperMod No. %d)",i));
282 fHistNrCellsInCluster[i] =
new TH1F(Form(
"fHistNrCellsInCluster_%d",i),Form(
"fHistNrCellsInCluster_%d",i),30,0,30);
283 if(i==fNumOfSuperMod)
fHistNrCellsInCluster[i]->GetXaxis()->SetTitle(
"Number of cells (all SuperModules)");
302 fHistCellIDvsE[i] =
new TH2F(Form(
"fHistCellIDvsE_%d",i),Form(
"fHistCellIDvsE_%d",i),18000,0,18000,100,0,50);
303 if(i==fNumOfSuperMod)
fHistCellIDvsE[i]->GetXaxis()->SetTitle(
"Cell ID (all SuperModules");
304 else fHistCellIDvsE[i]->GetXaxis()->SetTitle(Form(
"Cell ID (SuperMod No. %d)",i));
305 fHistCellIDvsE[i]->GetYaxis()->SetTitle(
"Energy probably in GeV");
308 fHistCellIDvsELow[i] =
new TH2F(Form(
"fHistCellIDvsELow_%d",i),Form(
"fHistCellIDvsELow_%d",i),18000,0,18000,200,0,2);
309 if(i==fNumOfSuperMod)
fHistCellIDvsELow[i]->GetXaxis()->SetTitle(
"Cell ID (all SuperModules");
310 else fHistCellIDvsELow[i]->GetXaxis()->SetTitle(Form(
"Cell ID (SuperMod No. %d)",i));
326 if(i==fNumOfSuperMod)
fHistCellEtaPhi[i]->GetXaxis()->SetTitle(
"column (#eta direction)(all SuperModules)");
327 else fHistCellEtaPhi[i]->GetXaxis()->SetTitle(Form(
"column (#eta direction)(SuperMod No. %d)",i));
345 axistitle[dim] =
"Centrality %";
353 axistitle[dim] = Form(
"Centrality %s %%",
fCentMethod2.Data());
362 axistitle[dim] = Form(
"Centrality %s %%",
fCentMethod3.Data());
371 axistitle[dim] =
"V0A total multiplicity";
377 axistitle[dim] =
"V0C total multiplicity";
385 axistitle[dim] =
"V0A+V0C total multiplicity";
394 axistitle[dim] =
"#psi_{EP}";
396 min[dim] = -TMath::Pi();
397 max[dim] = TMath::Pi();
404 axistitle[dim] =
"No. of tracks";
418 axistitle[dim] =
"#it{p}_{T,track}^{leading} (GeV/c)";
426 axistitle[dim] =
"#eta_{track}^{leading}";
432 axistitle[dim] =
"#phi_{track}^{leading}";
435 max[dim] = TMath::TwoPi();
440 if (fClusterCollArray.size() > 0)
442 axistitle[dim] =
"No. of clusters";
460 axistitle[dim] =
"#it{E}_{EMCal cluster}^{leading} (GeV)";
466 axistitle[dim] =
"#it{E}_{DCal cluster}^{leading} (GeV)";
474 axistitle[dim] =
"#eta_{EMCal cluster}^{leading}";
480 axistitle[dim] =
"#phi_{EMCal cluster}^{leading}";
483 max[dim] = TMath::TwoPi();
486 axistitle[dim] =
"#eta_{DCal cluster}^{leading}";
492 axistitle[dim] =
"#phi_{DCal cluster}^{leading}";
495 max[dim] = TMath::TwoPi();
501 axistitle[dim] =
"#it{E}_{cluster}^{leading} (GeV)";
509 axistitle[dim] =
"#eta_{cluster}^{leading}";
515 axistitle[dim] =
"#phi_{cluster}^{leading}";
518 max[dim] = TMath::TwoPi();
526 axistitle[dim] =
"No. of cells";
532 max[dim] = 10000-0.5;
545 for (
Int_t i = 0; i < dim; i++)
546 hn->GetAxis(i)->SetTitle(axistitle[i]);
556 if(
fDebug==1)cout<<
"Inside of: AliAnalysisTaskEmcalRun2QA::ExecOnce()"<<endl;
572 fVZERO = InputEvent()->GetVZEROData();
575 AliError(
"AliVVZERO not available");
581 cout<<
"- - - - - fCaloUtils initialized - - - "<<endl;
588 cout<<
"- - - - - fCaloUtils initialized end- - - "<<endl;
592 cout<<
"- - - - - no fCaloUtils initialized - - - "<<endl;
597 cout<<
"Will cause major error in histogram arrays - change hard coded value of fNumOfSuperMod!"<<endl;
598 cout<<
"Hard coded value is: "<<
fNumOfSuperMod<<
", value from fGeom is: "<<
fGeom->GetNumberOfSuperModules()<<endl;
602 cout<<
"Info: "<<endl;
604 Int_t NRows = AliEMCALGeoParams::fgkEMCALRows;
605 Int_t NCol = AliEMCALGeoParams::fgkEMCALCols;
606 Int_t NSMod = AliEMCALGeoParams::fgkEMCALModules;
608 cout<<
"number of mo from geoparams: "<<NSMod<<endl;
609 cout<<
"number of col from geoparams: "<<NCol<<endl;
610 cout<<
"number of row from geoparams: "<<NRows<<endl;
611 cout<<
"Number of rows: "<<NRows<<
", rowsMax: "<<
fNMaxRowsAbs<<
", Number of collumns:"<<NCol<<
", colMax: "<<
fNMaxColsAbs<<endl;
620 if(
fDebug==1)cout<<
"Inside of: AliAnalysisTaskEmcalRun2QA::RetrieveEventObjects()"<<endl;
628 AliCentrality *aliCent = InputEvent()->GetCentrality();
651 if(
fDebug==1)cout<<
"Inside of: AliAnalysisTaskEmcalRun2QA::FillHistograms()"<<endl;
658 for (
Int_t i = 0; i < 2; i++)
666 AliDebug(2,Form(
"%d cells found in the event", eventQA.
fNCells));
686 if(
fDebug==1)cout<<
"Inside of: AliAnalysisTaskEmcalRun2QA::FillEventQAHisto()"<<endl;
695 for (
Int_t i = 0; i < histEventQA->GetNdimensions(); i++)
698 if (
title==
"Centrality %")
699 contents[i] = eventQA.
fCent;
701 contents[i] = eventQA.
fCent2;
703 contents[i] = eventQA.
fCent3;
704 else if (
title==
"V0A total multiplicity")
705 contents[i] = eventQA.
fV0A;
706 else if (
title==
"V0C total multiplicity")
707 contents[i] = eventQA.
fV0C;
708 else if (
title==
"V0A+V0C total multiplicity")
709 contents[i] = eventQA.
fV0A+eventQA.
fV0C;
710 else if (
title==
"#psi_{RP}")
711 contents[i] = eventQA.
fEP;
712 else if (
title==
"No. of clusters")
713 contents[i] = globalNclusters;
714 else if (
title==
"No. of cells")
716 else if (
title==
"#it{p}_{T,track}^{leading} (GeV/c)")
718 else if (
title==
"#eta_{track}^{leading}")
720 else if (
title==
"#phi_{track}^{leading}")
722 else if (
title==
"#it{E}_{cluster}^{leading} (GeV)")
723 contents[i] = globalMaxCluster.E();
724 else if (
title==
"#eta_{cluster}^{leading}")
725 contents[i] = globalMaxCluster.Eta();
726 else if (
title==
"#phi_{cluster}^{leading}")
727 contents[i] = globalMaxCluster.Phi();
728 else if (
title==
"#it{E}_{EMCal cluster}^{leading} (GeV)")
730 else if (
title==
"#eta_{EMCal cluster}^{leading}")
732 else if (
title==
"#phi_{EMCal cluster}^{leading}")
734 else if (
title==
"#it{E}_{DCal cluster}^{leading} (GeV)")
736 else if (
title==
"#phi_{DCal cluster}^{leading}")
738 else if (
title==
"#eta_{DCal cluster}^{leading}")
741 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
744 histEventQA->Fill(contents);
755 cout<<
"Will cause major error in histogram arrays - change hard coded value of fNumOfSuperMod!"<<endl;
774 for (
Int_t pos = 0; pos < ncells; pos++)
779 fGeom->EtaPhiFromIndex(absId,CellEta,CellPhi);
780 Int_t smNo =
fGeom->GetSuperModuleNumber(absId);
787 cout<<
" Problem! wrong calculated number of max col and max rows"<<endl;
788 cout<<
"current col: "<<icolAbs<<
", max col"<<
fNMaxColsAbs<<endl;
789 cout<<
"current row: "<<irowAbs<<
", max row"<<
fNMaxRowsAbs<<endl;
831 UInt_t rejectionReason = 0;
836 histname = TString::Format(
"%s/fHistRejectionReason_%d", clusters->GetArrayName().Data(),
fCentBin);
837 fHistManager.
FillTH2(histname, clusters->GetRejectionReasonBitPosition(rejectionReason), it->first.E());
842 it->second->GetPosition(pos);
845 Int_t NCells = it->second->GetNCells();
849 Double_t ClusterRawEnergy = it->second->E();
851 for (
Int_t iCell = 0; iCell < NCells; iCell++)
853 Int_t cellId = it->second->GetCellAbsId(iCell);
854 Double_t cellFrac = it->second->GetCellAmplitudeFraction(iCell);
858 FirstCellEnergy=Eseed;
861 if(Eseed>FirstCellEnergy)cout<<
"Problem: Energy bigger than first."<<iCell<<endl;
864 Int_t smNo =
fGeom->GetSuperModuleNumber(FirstCellID);
865 fGeom->EtaPhiFromIndex(FirstCellID,CellEta,CellPhi);
885 histname = TString::Format(
"%s/fHistClusPosition_%d", clusters->GetArrayName().Data(),
fCentBin);
888 Double_t phi = it->first.Phi_0_2pi();
892 histname = TString::Format(
"%s/fHistClusPhiEtaEnergy_%d", clusters->GetArrayName().Data(),
fCentBin);
898 histname = TString::Format(
"%s/fHistClusMCEnergyFraction_%d", clusters->GetArrayName().Data(),
fCentBin);
904 histname = TString::Format(
"%s/fHistClusEnergy_%d", clusters->GetArrayName().Data(),
fCentBin);
907 if (it->second->GetNonLinCorrEnergy() > 0.)
909 histname = TString::Format(
"%s/fHistClusNonLinCorrEnergy_%d", clusters->GetArrayName().Data(),
fCentBin);
913 if (it->second->GetHadCorrEnergy() > 0.)
915 histname = TString::Format(
"%s/fHistClusHadCorrEnergy_%d", clusters->GetArrayName().Data(),
fCentBin);
Float_t fPtBinWidth
Histogram pt bin width.
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
THistManager fHistManager
Histogram manager.
THashList * CreateHistoGroup(const char *groupname)
Create a new group of histograms within a parent group.
AliEMCALGeometry * fGeom
!emcal geometry
EBeamType_t fBeamType
!event beam type
TList * fOutput
!output list
TList * fOutputList_Cell
Output list for Event QA histograms.
AliCalorimeterUtils * fCaloUtils
Cells in cluster per supermodule.
Int_t fNTotClusters[2]
!Total number of accepted clusters in current event (DCal/EMCal)
Double_t fV0CTotMult
!Event V0C total multiplicity
Double_t fEPV0
!event plane V0
TH2 ** fHistClusterEtaPhi
Cluster QA histogram.
bidirectional stl iterator over the EMCAL iterable container
Int_t fDoLeadingObjectPosition
Add axis for leading object position (eta-phi)
Float_t fMaxPt
Histogram pt limit.
TH2 ** fHistCellIDvsE
Output list for Cluster QA histograms.
Int_t fNMaxRowsAbs
Number of rows in one supermodule.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
void FillTH3(const char *hname, double x, double y, double z, double weight=1., Option_t *opt="")
Fill a 3D histogram within the container.
AliVVZERO * fVZERO
!Event V0 object
TH2 ** fHistCellEtaPhi
Cell QA histogram.
TString fCaloCellsName
name of calo cell collection
Int_t fDoV0QA
Add V0 QA histograms.
Float_t fCellEnergyCut
Energy cell cut.
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal
EBeamType_t fForceBeamType
forced beam type
void UserCreateOutputObjects()
AliVCaloCells * fCaloCells
!cells
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.
TObject * FindObject(const char *name) const
Find an object inside the container.
Double_t fCent2
!Event centrality with method 2
THashList * GetListOfHistograms() const
Get the list of histograms.
AliTLorentzVector fMaxCluster[2]
TH1 ** fHistNrCellsInCluster
Cluster QA histogram.
Base task in the EMCAL framework (lighter version of AliAnalysisTaskEmcal)
Double_t Phi_0_2pi() const
Double_t fVertex[3]
!event vertex
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
Double_t fV0ATotMult
!Event V0A total multiplicity
virtual Bool_t AcceptCluster(Int_t i, UInt_t &rejectionReason) const
AliAnalysisTaskEmcalRun2QA()
Implementation of a task to perform basic QA on EMCal and DCal clusters and cells.
TList * fOutputList_Event
Int_t GetNumberOfSuperModulesUsed() const
Bool_t RetrieveEventObjects()
virtual ~AliAnalysisTaskEmcalRun2QA()
Int_t fCentBin
!event centrality bin
Int_t fNMaxColsAbs
Number of columns in one supermodule.
AliTLorentzVector fLeadingCluster[2]
!Leading cluster in current event (EMCal/DCal)
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
virtual Bool_t RetrieveEventObjects()
void SetNumberOfSuperModulesUsed(Int_t nSM)
Float_t fRtoD
Transformation of rad to deg.
TString fCentMethod2
Centrality method 2.
const AliClusterIterableMomentumContainer all_momentum() const
Int_t GetNCentBins() const
TH2 ** fHistClusterIDvsELow
Cluster QA histogram.
std::map< std::string, AliParticleContainer * > fParticleCollArray
particle/track collection array
AliTLorentzVector fMaxTrack
Double_t fCent3
!Event centrality with method 3
TH2 ** fHistClusterIDvsE
Cell QA histogram.
Int_t fNumOfSuperMod
Number of supermodules.
TH2 ** fHistCellIDvsELow
Cell QA histogram.
TList * fOutputList_Cluster
Output list for Cell QA histograms.
TString fCentMethod3
Centrality method 3.
Class with utils specific to calorimeter clusters/cells.
void AccessGeometry(AliVEvent *inputEvent)
Bool_t fSeparateEMCalDCal
Separate EMCal from DCal in QA plots.
Bool_t fDebug
Prints out some extra information.
std::map< std::string, AliClusterContainer * > fClusterCollArray
cluster collection array
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Create a new THnSparse within the container.
void AccessOADB(AliVEvent *event)
Container structure for EMCAL clusters.
void SetMakeGeneralHistograms(Bool_t g)
Double_t fCent
!event centrality
Int_t fDoEPQA
Add event plane QA histograms.
void FillEventQAHisto(const EventQA_t &eventQA)
TH3 * CreateTH3(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, int nbinsz, double zmin, double zmax, Option_t *opt="")
Create a new TH2 within the container.
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
Int_t GetModuleNumberCellIndexesAbsCaloMap(Int_t absId, Int_t calo, Int_t &icol, Int_t &irow, Int_t &iRCU, Int_t &icolAbs, Int_t &irowAbs) const
Declaration of class AliAnalysisTaskEmcalRun2QA.