15 #include <TClonesArray.h> 16 #include <THashList.h> 20 #include "AliAnalysisUtils.h" 21 #include "AliEMCALGeometry.h" 22 #include "AliEMCALTriggerPatchInfo.h" 23 #include "AliESDEvent.h" 24 #include "AliInputEventHandler.h" 25 #include "AliVEvent.h" 26 #include "AliVVertex.h" 30 #if __cplusplus < 201103L 46 AliAnalysisTaskEmcalOfflinePatchesRef::AliAnalysisTaskEmcalOfflinePatchesRef():
60 DefineOutput(1, TList::Class());
75 #if __cplusplus >= 201103L 79 std::array<TString, 3> patchnames = {
82 for(
auto mytrg : patchnames){
88 std::vector<TString> patchnames;
89 patchnames.push_back(
"EL0");
90 patchnames.push_back(
"EG1");
91 patchnames.push_back(
"EG2");
92 for(std::vector<TString>::iterator mytrg = patchnames.begin(); mytrg != patchnames.end(); ++mytrg){
95 fHistos->
CreateTH1(Form(
"hEventCount%s", triggername.Data()), Form(
"Event counter for trigger type %s", triggername.Data()), 1, 0.5, 1.5);
96 fHistos->
CreateTH2(Form(
"hPatchEnergy%s", triggername.Data()), Form(
"Patch energy versus supermodule for trigger %s", triggername.Data()), 12, -0.5, 11.5, 200, 0., 200.);
97 fHistos->
CreateTH2(Form(
"hPatchET%s", triggername.Data()), Form(
"Patch transverse energy versus supermodule for trigger %s", triggername.Data()), 12, -0.5, 11.5, 200, 0., 200.);
98 fHistos->
CreateTH2(Form(
"hPatchADC%s", triggername.Data()), Form(
"Patch online ADC versus supermodule for trigger %s", triggername.Data()), 12, -0.5, 11.5, 2100, 0., 2100.);
99 fHistos->
CreateTH2(Form(
"hPatchEnergyEta%s", triggername.Data()), Form(
"Patch energy versus eta for trigger %s", triggername.Data()), 100, -0.7, 0.7, 200., 0., 200.);
100 fHistos->
CreateTH2(Form(
"hPatchETEta%s", triggername.Data()), Form(
"Patch transverse energy versus eta for trigger %s", triggername.Data()), 100, -0.7, 0.7, 200., 0., 200.);
101 fHistos->
CreateTH2(Form(
"hPatchADCEta%s", triggername.Data()), Form(
"Patch online ADC versus eta for trigger %s", triggername.Data()), 100, -0.7, 0.7, 2100., 0., 2100.);
102 fHistos->
CreateTH2(Form(
"hEvSelPatchEnergy%s", triggername.Data()), Form(
"Patch energy versus supermodule for trigger %s in selected events", triggername.Data()), 12, -0.5, 11.5, 200, 0., 200.);
103 fHistos->
CreateTH2(Form(
"hEvSelPatchET%s", triggername.Data()), Form(
"Patch transverse energy versus supermodule for trigger %s in selected events", triggername.Data()), 12, -0.5, 11.5, 200, 0., 200.);
104 fHistos->
CreateTH2(Form(
"hEvSelPatchADC%s", triggername.Data()), Form(
"Patch online ADC versus supermodule for trigger %s in selected events", triggername.Data()), 12, -0.5, 11.5, 2100, 0., 2100.);
105 fHistos->
CreateTH2(Form(
"hEvSelPatchEnergyEta%s", triggername.Data()), Form(
"Patch energy versus eta for trigger %s in selected events", triggername.Data()), 100, -0.7, 0.7, 200., 0., 200.);
106 fHistos->
CreateTH2(Form(
"hEvSelPatchETEta%s", triggername.Data()), Form(
"Patch transverse energy versus eta for trigger %s in selected events", triggername.Data()), 100, -0.7, 0.7, 200., 0., 200.);
107 fHistos->
CreateTH2(Form(
"hEvSelPatchADCEta%s", triggername.Data()), Form(
"Patch online ADC versus eta for trigger %s in selected events", triggername.Data()), 100, -0.7, 0.7, 2100., 0., 2100.);
108 for(
int ism = 0; ism <= 9; ism++){
109 fHistos->
CreateTH2(Form(
"hPatchEnergyEta%sSM%d", triggername.Data(), ism), Form(
"Patch energy versus eta for trigger %s, Supermodule %d", triggername.Data(), ism), 100, -0.7, 0.7, 200., 0., 200.);
110 fHistos->
CreateTH2(Form(
"hPatchETEta%sSM%d", triggername.Data(), ism), Form(
"Patch transverse energy versus eta for trigger %s, Supermodule %d", triggername.Data(), ism), 100, -0.7, 0.7, 200., 0., 200.);
111 fHistos->
CreateTH2(Form(
"hPatchADCEta%sSM%d", triggername.Data(), ism), Form(
"Patch online ADC versus eta for trigger %s, Supermodule %d", triggername.Data(), ism), 100, -0.7, 0.7, 2100., 0., 2100.);
112 fHistos->
CreateTH2(Form(
"hEvSelPatchEnergyEta%sSM%d", triggername.Data(), ism), Form(
"Patch energy versus eta for trigger %s, Supermodule %d in selected events", triggername.Data(), ism), 100, -0.7, 0.7, 200., 0., 200.);
113 fHistos->
CreateTH2(Form(
"hEvSelPatchETEta%sSM%d", triggername.Data(), ism), Form(
"Patch transverse energy versus eta for trigger %s, Supermodule %d in selected events", triggername.Data(), ism), 100, -0.7, 0.7, 200., 0., 200.);
114 fHistos->
CreateTH2(Form(
"hEvSelPatchADCEta%sSM%d", triggername.Data(), ism), Form(
"Patch online ADC versus eta for trigger %s, Supermodule %d in selected events", triggername.Data(), ism), 100, -0.7, 0.7, 2100., 0., 2100.);
116 for(
int isec = 4; isec <= 9; isec++){
117 fHistos->
CreateTH2(Form(
"hPatchEnergyEta%sSector%d", triggername.Data(), isec), Form(
"Patch energy versus eta for trigger %s Sector %d", triggername.Data(), isec), 100, -0.7, 0.7, 200., 0., 200.);
118 fHistos->
CreateTH2(Form(
"hPatchETEta%sSector%d", triggername.Data(), isec), Form(
"Patch transverse energy versus eta for trigger %s Sector %d", triggername.Data(), isec), 100, -0.7, 0.7, 200., 0., 200.);
119 fHistos->
CreateTH2(Form(
"hPatchADCEta%sSector%d", triggername.Data(), isec), Form(
"Patch online ADC versus eta for trigger %s, Sector %d", triggername.Data(), isec), 100, -0.7, 0.7, 2100., 0., 2100.);
120 fHistos->
CreateTH2(Form(
"hEvSelPatchEnergyEta%sSector%d", triggername.Data(), isec), Form(
"Patch energy versus eta for trigger %s Sector %d in selectedEvents", triggername.Data(), isec), 100, -0.7, 0.7, 200., 0., 200.);
121 fHistos->
CreateTH2(Form(
"hEvSelPatchETEta%sSector%d", triggername.Data(), isec), Form(
"Patch transverse energy versus eta for trigger %s Sector %d in selectedEvents", triggername.Data(), isec), 100, -0.7, 0.7, 200., 0., 200.);
122 fHistos->
CreateTH2(Form(
"hEvSelPatchADCEta%sSector%d", triggername.Data(), isec), Form(
"Patch online ADC versus eta for trigger %s, Sector %d in selectedEvents", triggername.Data(), isec), 100, -0.7, 0.7, 2100., 0., 2100.);
130 fGeometry = AliEMCALGeometry::GetInstance();
134 TClonesArray *patches =
dynamic_cast<TClonesArray *
>(fInputEvent->FindListObject(
"EmcalTriggers"));
135 TString triggerstring = fInputEvent->GetFiredTriggerClasses();
136 UInt_t selectionstatus = fInputHandler->IsEventSelected();
137 Bool_t isMinBias = selectionstatus & AliVEvent::kINT7,
138 isEG1 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains(
"EG1"),
139 isEG2 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains(
"EG2"),
140 isEMC7 = (selectionstatus & AliVEvent::kEMC7) && triggerstring.Contains(
"EMC7");
141 if(!(isMinBias || isEG1 || isEG2 || isEMC7))
return;
142 const AliVVertex *vtx = fInputEvent->GetPrimaryVertex();
144 if(vtx->GetNContributors() < 1)
return;
145 if(fInputEvent->IsA() == AliESDEvent::Class() &&
fAnalysisUtil->IsFirstEventInChunk(fInputEvent))
return;
147 if(!
fAnalysisUtil->IsVertexSelected2013pA(fInputEvent))
return;
150 if(vtx->GetZ() < -10. || vtx->GetZ() > 10.)
return;
155 AliEMCALTriggerPatchInfo *mypatch(
nullptr);
156 Int_t supermoduleID = -1;
158 for(TIter patchiter = TIter(patches).Begin(); patchiter != TIter::End(); ++patchiter){
159 mypatch =
dynamic_cast<AliEMCALTriggerPatchInfo *
>(*patchiter);
160 if(!mypatch)
continue;
162 if(!mypatch->IsOfflineSimple())
continue;
163 if(!mypatch->IsGammaLowSimple())
continue;
164 fGeometry->SuperModuleNumberFromEtaPhi(mypatch->GetEtaCM(), mypatch->GetPhiCM(), supermoduleID);
165 Int_t sector = 4 + int(supermoduleID / 2);
166 if(mypatch->IsGammaLowSimple() && mypatch->GetPatchE() > 3){
173 if(isEMC7 && mypatch->IsGammaLowSimple())
FillTriggerPatchHistos(
"EL0", mypatch, supermoduleID, sector, kTRUE);
174 if(isEG1 && mypatch->IsGammaLowSimple())
FillTriggerPatchHistos(
"EG1", mypatch, supermoduleID, sector, kTRUE);
175 if(isEG2 && mypatch->IsGammaLowSimple())
FillTriggerPatchHistos(
"EG2", mypatch, supermoduleID, sector, kTRUE);
195 TString fbase = evsel ?
"hEvSel" :
"h";
196 fHistos->
FillTH2(Form(
"%sPatchEnergy%s", fbase.Data(), patchtype), supermoduleID, recpatch->GetPatchE());
197 fHistos->
FillTH2(Form(
"%sPatchET%s", fbase.Data(), patchtype), supermoduleID, recpatch->GetLorentzVectorCenterGeo().Et());
198 fHistos->
FillTH2(Form(
"%sPatchADC%s", fbase.Data(), patchtype), supermoduleID, recpatch->GetADCAmp());
199 fHistos->
FillTH2(Form(
"%sPatchEnergyEta%s", fbase.Data(), patchtype), recpatch->GetEtaCM(), recpatch->GetPatchE());
200 fHistos->
FillTH2(Form(
"%sPatchETEta%s", fbase.Data(), patchtype), recpatch->GetEtaCM(), recpatch->GetLorentzVectorCenterGeo().Et());
201 fHistos->
FillTH2(Form(
"%sPatchADCEta%s", fbase.Data(), patchtype), recpatch->GetEtaCM(), recpatch->GetADCAmp());
202 if(sector >= 4 && sector < 10){
203 fHistos->
FillTH2(Form(
"%sPatchEnergyEta%sSector%d", fbase.Data(), patchtype, sector), recpatch->GetEtaCM(), recpatch->GetPatchE());
204 fHistos->
FillTH2(Form(
"%sPatchETEta%sSector%d", fbase.Data(), patchtype, sector), recpatch->GetEtaCM(), recpatch->GetLorentzVectorCenterGeo().Et());
205 fHistos->
FillTH2(Form(
"%sPatchADCEta%sSector%d", fbase.Data(), patchtype, sector), recpatch->GetEtaCM(), recpatch->GetADCAmp());
207 if(supermoduleID >= 0 && supermoduleID < 10){
208 fHistos->
FillTH2(Form(
"%sPatchEnergyEta%sSM%d", fbase.Data(), patchtype, supermoduleID), recpatch->GetEtaCM(), recpatch->GetPatchE());
209 fHistos->
FillTH2(Form(
"%sPatchETEta%sSM%d", fbase.Data(), patchtype, supermoduleID), recpatch->GetEtaCM(), recpatch->GetLorentzVectorCenterGeo().Et());
210 fHistos->
FillTH2(Form(
"%sPatchADCEta%sSM%d", fbase.Data(), patchtype, supermoduleID), recpatch->GetEtaCM(), recpatch->GetADCAmp());
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 *)
virtual void UserCreateOutputObjects()
AliAnalysisUtils * fAnalysisUtil
void FillTriggerPatchHistos(const char *patchtype, const AliEMCALTriggerPatchInfo *const recpatch, Int_t supermodule, Int_t sector, Bool_t evsel)
AliAnalysisTaskEmcalOfflinePatchesRef()
virtual ~AliAnalysisTaskEmcalOfflinePatchesRef()
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.
AliEMCALGeometry * fGeometry
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
Analysis of high- tracks in triggered events.
Container class for histograms.
Int_t GetRunNumber(TString)