31 #include <TClonesArray.h>
36 #include <THnSparse.h>
38 #include <TLorentzVector.h>
41 #include "AliAnalysisManager.h"
42 #include <AliInputEventHandler.h>
43 #include <AliVEventHandler.h>
44 #include "AliESDInputHandler.h"
45 #include "AliVCluster.h"
46 #include "AliVTrack.h"
47 #include "AliVVZERO.h"
50 #include "AliAODCaloTrigger.h"
51 #include "AliEMCALGeometry.h"
52 #include "AliVCaloCells.h"
55 #include "AliEMCALTriggerPatchInfo.h"
56 #include "AliAODHeader.h"
69 fDebug(kFALSE), fAttachToEvent(kTRUE),
71 fMaxPatchEnergy(0), fMaxPatchADCEnergy(0),
74 fMainTrigCat(kTriggerLevel1Jet),
77 fTriggerCategory(kTriggerRecalcGamma),
78 fMainTrigSimple(kFALSE),
80 fTrkBias(0), fClusBias(0),
81 doComments(0), fUseALLrecalcPatches(0),
82 fClusterTriggeredEventname("CLUSTERthatTriggeredEvent"),
84 fMainPatchType(kManual),
87 fh3PtEtaPhiTracks(0), fh3PtEtaPhiTracksOnEmcal(0), fh3PtEtaPhiTracksToProp(0), fh3PtEtaPhiTracksProp(0), fh3PtEtaPhiTracksNoProp(0),
89 fh3PatchEnergyEtaPhiCenterJ1(0), fh3PatchEnergyEtaPhiCenterJ2(0), fh3PatchEnergyEtaPhiCenterJ1J2(0),
90 fh3PatchADCEnergyEtaPhiCenterJ1(0), fh3PatchADCEnergyEtaPhiCenterJ2(0), fh3PatchADCEnergyEtaPhiCenterJ1J2(0),
91 fh3PatchEnergyEtaPhiCenterG1(0), fh3PatchEnergyEtaPhiCenterG2(0), fh3PatchEnergyEtaPhiCenterG1G2(0),
92 fh3PatchADCEnergyEtaPhiCenterG1(0), fh3PatchADCEnergyEtaPhiCenterG2(0), fh3PatchADCEnergyEtaPhiCenterG1G2(0),
93 fh3PatchADCEnergyEtaPhiCenterAll(0),
94 fh3EEtaPhiCell(0), fh2ECellVsCent(0), fh2CellEnergyVsTime(0), fh3EClusELeadingCellVsTime(0),
96 fHistEventSelectionQA(0), fhQAinfoAllPatchesCounter(0), fhQAinfoCounter(0), fhQAmaxinfoCounter(0),
97 fhRecalcGammaPatchEnergy(0), fhGammaLowPatchEnergy(0), fhGammaLowSimplePatchEnergy(0),
98 fhRecalcJetPatchEnergy(0), fhJetLowPatchEnergy(0), fhJetLowSimplePatchEnergy(0),
99 fhMainTriggerPatchEnergy(0),
100 fClusterTriggeredEvent(0), fRecalcTriggerPatches(0),
101 fhnPatchMaxClus(0x0), fhnPatchMatch(0x0), fhnPatchMatch2(0x0)
104 for(
Int_t j=0; j<16; j++) {
105 fHistdPhidEtaPatchCluster[j] = 0;
108 SetMakeGeneralHistograms(kTRUE);
114 fDebug(kFALSE), fAttachToEvent(kTRUE),
116 fMaxPatchEnergy(0), fMaxPatchADCEnergy(0),
119 fMainTrigCat(kTriggerLevel1Jet),
122 fTriggerCategory(kTriggerRecalcGamma),
123 fMainTrigSimple(kFALSE),
125 fTrkBias(0), fClusBias(0),
126 doComments(0), fUseALLrecalcPatches(0),
127 fClusterTriggeredEventname(
"CLUSTERthatTriggeredEvent"),
129 fMainPatchType(kManual),
132 fh3PtEtaPhiTracks(0), fh3PtEtaPhiTracksOnEmcal(0), fh3PtEtaPhiTracksToProp(0), fh3PtEtaPhiTracksProp(0), fh3PtEtaPhiTracksNoProp(0),
133 fh3EEtaPhiCluster(0),
134 fh3PatchEnergyEtaPhiCenterJ1(0), fh3PatchEnergyEtaPhiCenterJ2(0), fh3PatchEnergyEtaPhiCenterJ1J2(0),
135 fh3PatchADCEnergyEtaPhiCenterJ1(0), fh3PatchADCEnergyEtaPhiCenterJ2(0), fh3PatchADCEnergyEtaPhiCenterJ1J2(0),
136 fh3PatchEnergyEtaPhiCenterG1(0), fh3PatchEnergyEtaPhiCenterG2(0), fh3PatchEnergyEtaPhiCenterG1G2(0),
137 fh3PatchADCEnergyEtaPhiCenterG1(0), fh3PatchADCEnergyEtaPhiCenterG2(0), fh3PatchADCEnergyEtaPhiCenterG1G2(0),
138 fh3PatchADCEnergyEtaPhiCenterAll(0),
139 fh3EEtaPhiCell(0), fh2ECellVsCent(0), fh2CellEnergyVsTime(0), fh3EClusELeadingCellVsTime(0),
141 fHistEventSelectionQA(0), fhQAinfoAllPatchesCounter(0), fhQAinfoCounter(0), fhQAmaxinfoCounter(0),
142 fhRecalcGammaPatchEnergy(0), fhGammaLowPatchEnergy(0), fhGammaLowSimplePatchEnergy(0),
143 fhRecalcJetPatchEnergy(0), fhJetLowPatchEnergy(0), fhJetLowSimplePatchEnergy(0),
144 fhMainTriggerPatchEnergy(0),
145 fClusterTriggeredEvent(0), fRecalcTriggerPatches(0),
146 fhnPatchMaxClus(0x0), fhnPatchMatch(0x0), fhnPatchMatch2(0x0)
149 for(
Int_t j=0; j<16; j++) {
202 TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
205 if(!firedTrigClass.Contains(trigType1.Data()) || !firedTrigClass.Contains(trigType2.Data()) )
209 else if(
fTriggerClass.Contains(trigType1.Data()) && firedTrigClass.Contains(trigType2.Data()))
228 UInt_t trig = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
293 Int_t nG1 = 0, nG2 = 0, nJ1 = 0, nJ2 = 0, nL0 = 0;
296 UInt_t trig = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
299 TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
302 AliEMCALTriggerPatchInfo *patch;
304 for (
Int_t iPatch = 0, patchacc = 0; iPatch < nPatch; iPatch++) {
306 if (!patch)
continue;
309 if (patch->IsGammaHigh()) nG1++;
310 if (patch->IsGammaLow()) nG2++;
311 if (patch->IsJetHigh()) nJ1++;
312 if (patch->IsJetLow()) nJ2++;
313 if (patch->IsLevel0()) nL0++;
332 if(!patch->IsRecalcGamma())
continue;
335 if(!patch->IsRecalcJet())
continue;
339 (*fRecalcTriggerPatches)[patchacc] = patch;
343 cout<<
"Have a recalculated patch: "<<endl;
344 cout<<Form(
"Cent = %f, #Patch = %i, #Acc = %i, PatchE = %f, PhiCM = %f, EtaCM = %f",
fCent, iPatch, patchacc, patch->GetPatchE(), patch->GetPhiCM(), patch->GetEtaCM())<<endl;
352 if(patch->GetPatchE()>emax) {
354 emax = patch->GetPatchE();
363 AliError(Form(
"ERROR: Cluster container doesn't exist\n"));
368 if(!leadclus)
return;
371 double leadclusEta = 0, leadclusPhi = 0, leadclusE = 0;
372 TLorentzVector clusvect;
373 leadclus->GetMomentum(clusvect, const_cast<Double_t*>(
fVertex));
374 leadclusEta = clusvect.Eta();
375 leadclusPhi = clusvect.Phi();
376 leadclusE = leadclus->E();
379 double fMaxPatchPhiCM =
fMaxPatch->GetPhiCM();
380 double fMaxPatchPhiGeo =
fMaxPatch->GetPhiGeo();
381 double fMaxPatchEtaCM =
fMaxPatch->GetEtaCM();
382 double fMaxPatchEtaGeo =
fMaxPatch->GetEtaGeo();
392 double dEtaGeo = 1.0*TMath::Abs(leadclusEta - fMaxPatchEtaGeo);
393 double dEtaCM = 1.0*TMath::Abs(leadclusEta - fMaxPatchEtaCM);
394 double dPhiGeo = 1.0*TMath::Abs(leadclusPhi - fMaxPatchPhiGeo);
395 double dPhiCM = 1.0*TMath::Abs(leadclusPhi - fMaxPatchPhiCM);
396 double maxPatchE =
fMaxPatch->GetPatchE();
397 double maxPatchADC =
fMaxPatch->GetADCAmpGeVRough();
409 Double_t fill[7] = {dEtaGeo, dEtaCM, dPhiGeo, dPhiCM, maxPatchADC, maxPatchE, leadclusE};
426 Bool_t oldStatus = TH1::AddDirectoryStatus();
427 TH1::AddDirectory(kFALSE);
429 fhNEvents =
new TH1F(
"fhNEvents",
"fhNEvents;selection;N_{evt}",5,0,5);
432 fhTriggerbit =
new TProfile(
"fhTriggerbit",
"fhTriggerbit;;TriggerBit",1,0,1);
435 Int_t fgkNCentBins = 21;
439 for(
Int_t i=0; i<=fgkNCentBins; i++) binsCent[i]=(
Double_t)kMinCent + (kMaxCent-kMinCent)/fgkNCentBins*(
Double_t)i ;
440 binsCent[fgkNCentBins-1] = 100.5;
441 binsCent[fgkNCentBins] = 101.5;
443 Int_t fgkNdEPBins = 18*8;
445 Float_t kMaxdEP = 1.*TMath::Pi()/2.;
447 for(
Int_t i=0; i<=fgkNdEPBins; i++) binsdEP[i]=(
Double_t)kMindEP + (kMaxdEP-kMindEP)/fgkNdEPBins*(
Double_t)i ;
449 Int_t fgkNPtBins = 200;
453 for(
Int_t i=0; i<=fgkNPtBins; i++) binsPt[i]=(
Double_t)kMinPt + (kMaxPt-kMinPt)/fgkNPtBins*(
Double_t)i ;
455 Int_t fgkNPhiBins = 18*8;
457 Float_t kMaxPhi = 2.*TMath::Pi();
459 for(
Int_t i=0; i<=fgkNPhiBins; i++) binsPhi[i]=(
Double_t)kMinPhi + (kMaxPhi-kMinPhi)/fgkNPhiBins*(
Double_t)i ;
461 Int_t fgkNEtaBins = 100;
465 for(
Int_t i=0; i<=fgkNEtaBins; i++) binsEta[i]=(
Double_t)fgkEtaMin + (fgkEtaMax-fgkEtaMin)/fgkNEtaBins*(
Double_t)i ;
467 Int_t fgkNConstBins = 100;
471 for(
Int_t i=0; i<=fgkNConstBins; i++) binsConst[i]=(
Double_t)kMinConst + (kMaxConst-kMinConst)/fgkNConstBins*(
Double_t)i ;
473 Int_t fgkNTimeBins = 100;
477 for(
Int_t i=0; i<=fgkNTimeBins; i++) binsTime[i]=(
Double_t)kMinTime + (kMaxTime-kMinTime)/fgkNTimeBins*(
Double_t)i ;
479 Int_t fgkNVZEROBins = 100;
483 for(
Int_t i=0; i<=fgkNVZEROBins; i++) binsVZERO[i]=(
Double_t)kMinVZERO + (kMaxVZERO-kMinVZERO)/fgkNVZEROBins*(
Double_t)i ;
486 enBinEdges[0][0] = 1.;
487 enBinEdges[0][1] = 0.1;
488 enBinEdges[1][0] = 5.;
489 enBinEdges[1][1] = 0.5;
490 enBinEdges[2][0] = 100.;
491 enBinEdges[2][1] = 1.;
494 const Float_t enmax1 = enBinEdges[0][0];
495 const Float_t enmin2 = enmax1 ;
496 const Float_t enmax2 = enBinEdges[1][0];
497 const Float_t enmin3 = enmax2 ;
498 const Float_t enmax3 = enBinEdges[2][0];
499 const Int_t nbin11 = (int)((enmax1-enmin1)/enBinEdges[0][1]);
500 const Int_t nbin12 = (int)((enmax2-enmin2)/enBinEdges[1][1])+nbin11;
501 const Int_t nbin13 = (int)((enmax3-enmin3)/enBinEdges[2][1])+nbin12;
503 Int_t fgkNEnBins=nbin13;
505 for(
Int_t i=0; i<=fgkNEnBins; i++) {
506 if(i<=nbin11) binsEn[i]=(
Double_t)enmin1 + (enmax1-enmin1)/nbin11*(
Double_t)i ;
507 if(i<=nbin12 && i>nbin11) binsEn[i]=(
Double_t)enmin2 + (enmax2-enmin2)/(nbin12-nbin11)*((
Double_t)i-(
Double_t)nbin11) ;
508 if(i<=nbin13 && i>nbin12) binsEn[i]=(
Double_t)enmin3 + (enmax3-enmin3)/(nbin13-nbin12)*((
Double_t)i-(
Double_t)nbin12) ;
511 fh3PtEtaPhiTracks =
new TH3F(
"fh3PtEtaPhiTracks",
"fh3PtEtaPhiTracks;#it{p}_{T}^{track}_{vtx};#eta_{vtx};#varphi_{vtx}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
514 fh3PtEtaPhiTracksOnEmcal =
new TH3F(
"fh3PtEtaPhiTracksOnEmcal",
"fh3PtEtaPhiTracksOnEmcal;#it{p}_{T}^{track}_{emc};#eta_{emc};#varphi_{emc}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
517 fh3PtEtaPhiTracksToProp =
new TH3F(
"fh3PtEtaPhiTracksToProp",
"fh3PtEtaPhiTracksToProp;#it{p}_{T}^{track}_{vtx};#eta_{vtx};#varphi_{vtx}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
520 fh3PtEtaPhiTracksProp =
new TH3F(
"fh3PtEtaPhiTracksProp",
"fh3PtEtaPhiTracksProp;#it{p}_{T}^{track}_{vtx};#eta_{vtx};#varphi_{vtx}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
523 fh3PtEtaPhiTracksNoProp =
new TH3F(
"fh3PtEtaPhiTracksNoProp",
"fh3PtEtaPhiTracksNoProp;#it{p}_{T}^{track}_{vtx};#eta_{vtx};#varphi_{vtx}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
526 fh3EEtaPhiCluster =
new TH3F(
"fh3EEtaPhiCluster",
"fh3EEtaPhiCluster;E_{clus};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
529 fh3PatchEnergyEtaPhiCenterJ1 =
new TH3F(
"fh3PatchEnergyEtaPhiCenterJ1",
"fh3PatchEnergyEtaPhiCenterJ1;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
532 fh3PatchEnergyEtaPhiCenterJ2 =
new TH3F(
"fh3PatchEnergyEtaPhiCenterJ2",
"fh3PatchEnergyEtaPhiCenterJ2;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
535 fh3PatchEnergyEtaPhiCenterJ1J2 =
new TH3F(
"fh3PatchEnergyEtaPhiCenterJ1J2",
"fh3PatchEnergyEtaPhiCenterJ1J2;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
538 fh3PatchADCEnergyEtaPhiCenterJ1 =
new TH3F(
"fh3PatchADCEnergyEtaPhiCenterJ1",
"fh3PatchADCEnergyEtaPhiCenterJ1;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
541 fh3PatchADCEnergyEtaPhiCenterJ2 =
new TH3F(
"fh3PatchADCEnergyEtaPhiCenterJ2",
"fh3PatchADCEnergyEtaPhiCenterJ2;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
544 fh3PatchADCEnergyEtaPhiCenterJ1J2 =
new TH3F(
"fh3PatchADCEnergyEtaPhiCenterJ1J2",
"fh3PatchADCEnergyEtaPhiCenterJ1J2;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
547 fh3PatchEnergyEtaPhiCenterG1 =
new TH3F(
"fh3PatchEnergyEtaPhiCenterG1",
"fh3PatchEnergyEtaPhiCenterG1;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
550 fh3PatchEnergyEtaPhiCenterG2 =
new TH3F(
"fh3PatchEnergyEtaPhiCenterG2",
"fh3PatchEnergyEtaPhiCenterG2;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
553 fh3PatchEnergyEtaPhiCenterG1G2 =
new TH3F(
"fh3PatchEnergyEtaPhiCenterG1G2",
"fh3PatchEnergyEtaPhiCenterG1G2;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
556 fh3PatchADCEnergyEtaPhiCenterG1 =
new TH3F(
"fh3PatchADCEnergyEtaPhiCenterG1",
"fh3PatchADCEnergyEtaPhiCenterG1;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
559 fh3PatchADCEnergyEtaPhiCenterG2 =
new TH3F(
"fh3PatchADCEnergyEtaPhiCenterG2",
"fh3PatchADCEnergyEtaPhiCenterG2;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
562 fh3PatchADCEnergyEtaPhiCenterG1G2 =
new TH3F(
"fh3PatchADCEnergyEtaPhiCenterG1G2",
"fh3PatchADCEnergyEtaPhiCenterG1G2;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
565 fh3PatchADCEnergyEtaPhiCenterAll =
new TH3F(
"fh3PatchADCEnergyEtaPhiCenterAll",
"fh3PatchADCEnergyEtaPhiCenterAll;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
568 fh3EEtaPhiCell =
new TH3F(
"fh3EEtaPhiCell",
"fh3EEtaPhiCell;E_{cell};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
571 fh2ECellVsCent =
new TH2F(
"fh2ECellVsCent",
"fh2ECellVsCent;centrality;E_{cell}",101,-1,100,500,0.,5.);
574 fh2CellEnergyVsTime =
new TH2F(
"fh2CellEnergyVsTime",
"fh2CellEnergyVsTime;E_{cell};time",fgkNEnBins,binsEn,fgkNTimeBins,binsTime);
577 fh3EClusELeadingCellVsTime =
new TH3F(
"fh3EClusELeadingCellVsTime",
"fh3EClusELeadingCellVsTime;E_{cluster};E_{leading cell};time_{leading cell}",fgkNEnBins,binsEn,fgkNEnBins,binsEn,fgkNTimeBins,binsTime);
580 fhQAinfoAllPatchesCounter =
new TH1F(
"fhQAinfoAllPatchesCounter",
"QA trigger info counters for all patches", 20, 0.5, 20.5);
583 fhQAinfoCounter =
new TH1F(
"fhQAinfoCounter",
"QA trigger info counters", 20, 0.5, 20.5);
586 fhQAmaxinfoCounter =
new TH1F(
"fhQAmaxinfoCounter",
"QA Max patch trigger info counters", 20, 0.5, 20.5);
598 fhRecalcJetPatchEnergy =
new TH1F(
"fhRecalcJetPatchEnergy",
"Recalculated Jet Patch Energy", 200, 0, 100);
601 fhJetLowPatchEnergy =
new TH1F(
"fhJetLowPatchEnergy",
"Jet Low Patch Energy", 200, 0, 100);
610 fHistClusEnergy =
new TH1F(
"fHistClusEnergy",
"Cluster Energy distribution", 200, 0, 50);
613 for(
Int_t j=0; j<16; j++) {
614 fHistdPhidEtaPatchCluster[j] =
new TH2F(Form(
"fHistdPhidEtaPatchCluster_%d",j),
"dPhi-dEta distribution between max recalculated Gamma patch and most energetic cluster", 144, 0, 2.016, 144, 0, 2.016);
622 for (
Int_t i=0; i<nDim; i++){
628 nbins[4]=100; xmax[4]=100;
629 nbins[5]=100; xmax[5]=100.;
630 nbins[6]=100; xmax[6]=100.;
632 fhnPatchMaxClus =
new THnSparseF(
"fhnPatchMaxClus",
"fhn Patch Max Cluster Distributions", nDim,nbins,xmin,xmax);
647 nbins1[0]=10; xmin1[0]=0.; xmax1[0]=100.;
648 nbins1[1]=200; xmin1[1]=0.; xmax1[1]=50;
649 nbins1[2]=144; xmin1[2]=0.; xmax1[2]=2.016;
650 nbins1[3]=144; xmin1[3]=0.; xmax1[3]=2.016;
651 nbins1[4]=300; xmin1[4]=0.; xmax1[4]=300;
652 nbins1[5]=500; xmin1[5]=0.; xmax1[5]=500;
655 fhnPatchMatch =
new THnSparseF(
"fhnPatchMatch",
"fhn Patch Match before cuts", nDim1,nbins1,xmin1,xmax1);
665 fhnPatchMatch2 =
new THnSparseF(
"fhnPatchMatch2",
"fhn Patch Match after cuts", nDim1,nbins1,xmin1,xmax1);
679 for (
Int_t i=0; i<nDim2; i++){
684 nbins2[0]=10; xmax2[0]=100;
685 nbins2[1]=200; xmax2[1]=50.;
686 nbins2[2]=72; xmin2[2]=1.2; xmax2[2]=3.4;
687 nbins2[3]=56; xmin2[3]=-0.7; xmax2[3]=0.7;
688 nbins2[4]=500; xmax2[4]=500.;
689 nbins2[5]=500; xmax2[5]=500.;
690 nbins2[6]=300; xmax2[6]=300.;
691 nbins2[7]=300; xmax2[7]=300.;
692 nbins2[8]=72; xmin2[8]=1.4; xmax2[9]=3.2;
693 nbins2[9]=56; xmin2[9]=-0.7; xmax2[9]=0.7;
713 fHistEventSelectionQA =
new TH1F(
"fHistEventSelectionQA",
"Trigger Selection Counter", 20, 0.5, 20.5);
733 THnSparse *hn =
dynamic_cast<THnSparse*
>(
fOutput->At(i));
737 TH1::AddDirectory(oldStatus);
741 if(binsCent)
delete [] binsCent;
742 if(binsdEP)
delete [] binsdEP;
743 if(binsEn)
delete [] binsEn;
744 if(binsPt)
delete [] binsPt;
745 if(binsPhi)
delete [] binsPhi;
746 if(binsEta)
delete [] binsEta;
747 if(binsConst)
delete [] binsConst;
748 if(binsTime)
delete [] binsTime;
749 if(binsVZERO)
delete [] binsVZERO;
758 UInt_t trig = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
761 TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
769 AliError(Form(
"ERROR: list not attached\n"));
779 partCont->ResetCurrentID();
782 Double_t trkphi = track->Phi()*TMath::RadToDeg();
786 if(track->Pt()>=0.350) {
787 if (TMath::Abs(track->Eta())<=0.9 && trkphi > 10 && trkphi < 250) {
790 if(track->GetTrackPtOnEMCal()>=0)
fh3PtEtaPhiTracksProp->Fill(track->Pt(),track->Eta(),track->Phi());
800 TClonesArray *clusters = 0x0;
801 clusters =
dynamic_cast<TClonesArray*
>(list->FindObject(
"EmcCaloClusters"));
803 AliError(Form(
"Pointer to clusters %s == 0",
"EmcCaloClusters"));
808 const Int_t Nclusters = clusters->GetEntries();
809 for (
Int_t iclus = 0; iclus < Nclusters; iclus++){
810 AliVCluster* clus =
static_cast<AliVCluster*
>(clusters->At(iclus));
812 AliError(Form(
"Couldn't get AliVCluster %d\n", iclus));
817 if (!clus->IsEMCAL()) {
818 AliDebug(2,Form(
"%s: Cluster is not emcal",GetName()));
824 clus->GetMomentum(lp, const_cast<Double_t*>(
fVertex));
832 for (
Int_t ic = 0, clusacc = 0; ic < nclusters; ic++) {
833 AliVCluster *cluster =
static_cast<AliVCluster*
>(clusCont->
GetCluster(ic));
835 AliDebug(2,Form(
"Could not receive cluster %d", ic));
840 if (!cluster->IsEMCAL()) {
841 AliDebug(2,Form(
"%s: Cluster is not emcal",GetName()));
846 cluster->GetMomentum(lp, const_cast<Double_t*>(
fVertex));
850 Double_t leadCellT = cluster->GetTOF();
855 Double_t ClusterEta = 0., ClusterPhi = 0., ClusterE = 0.;
856 ClusterEta = lp.Eta();
857 ClusterPhi = lp.Phi();
858 ClusterE = cluster->E();
865 double fMaxPatchPhiGeo =
fMaxPatch->GetPhiGeo();
866 double fMaxPatchEtaGeo =
fMaxPatch->GetEtaGeo();
867 double dPhiPatchLeadCl = 1.0*TMath::Abs(fMaxPatchPhiGeo - ClusterPhi);
868 double dEtaPatchLeadCl = 1.0*TMath::Abs(fMaxPatchEtaGeo - ClusterEta);
882 for(
int maxbinE = 0; maxbinE<16; maxbinE++) {
if(ClusterE > maxbinE)
fHistdPhidEtaPatchCluster[maxbinE]->Fill(dPhiPatchLeadCl, dEtaPatchLeadCl); }
887 if(ClusterEta > etamin && ClusterEta < etamax && ClusterPhi > phimin && ClusterPhi < phimax)
fhnPatchMatch2->Fill(fillarr);
892 if(ClusterEta > etamin && ClusterEta < etamax && ClusterPhi > phimin && ClusterPhi < phimax){
894 cout<<
"*********************************************"<<endl;
895 cout<<
"Proper match (cluster to fired max patch): "<<endl;
896 cout<<Form(
"MaxClusterE = %f, Phi = %f, Eta = %f", ClusterE, ClusterPhi, ClusterEta)<<endl;
897 cout<<
"*********************************************"<<endl;
905 (*fClusterTriggeredEvent)[clusacc] = cluster;
920 AliEMCALTriggerPatchInfo *patch;
921 for(
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
926 double fPatchPhiGeo = patch->GetPhiGeo();
927 double fPatchEtaGeo = patch->GetEtaGeo();
928 double dPhiPatchCl = 1.0*TMath::Abs(fPatchPhiGeo - ClusterPhi);
929 double dEtaPatchCl = 1.0*TMath::Abs(fPatchEtaGeo - ClusterEta);
938 double etamin = TMath::Min(patch->GetEtaMin(), patch->GetEtaMax());
939 double etamax = TMath::Max(patch->GetEtaMin(), patch->GetEtaMax());
940 double phimin = TMath::Min(patch->GetPhiMin(), patch->GetPhiMax());
941 double phimax = TMath::Max(patch->GetPhiMin(), patch->GetPhiMax());
943 for(
int maxbinE = 0; maxbinE<16; maxbinE++) {
if(ClusterE > maxbinE)
fHistdPhidEtaPatchCluster[maxbinE]->Fill(dPhiPatchCl, dEtaPatchCl); }
949 if(ClusterEta > etamin && ClusterEta < etamax && ClusterPhi > phimin && ClusterPhi < phimax)
fhnPatchMatch2->Fill(fillarr);
954 if(ClusterEta > etamin && ClusterEta < etamax && ClusterPhi > phimin && ClusterPhi < phimax){
956 cout<<
"*********************************************"<<endl;
957 cout<<
"Proper match (cluster to fired max patch): ";
958 cout<<Form(
"Centrality = %f",
fCent)<<endl;
959 cout<<Form(
"PatchE = %f, PhiMin = %f, PhiMax = %f, EtaMin = %f, EtaMax = %f, Patch# = %i", kEnergyOffline, phimin, phimax, etamin, etamax, iPatch)<<endl;
960 cout<<Form(
"ClusterE = %f, Phi = %f, Eta = %f", ClusterE, ClusterPhi, ClusterEta)<<endl;
961 cout<<
"*********************************************"<<endl;
969 (*fClusterTriggeredEvent)[clusacc] = cluster;
989 for(
Int_t iCell=0; iCell<nCells; ++iCell) {
994 fGeom->GetGlobal(cellId, pos);
995 TLorentzVector lv(pos,cellE);
998 if(cellPhi<0.) cellPhi+=TMath::TwoPi();
999 if(cellPhi>TMath::TwoPi()) cellPhi-=TMath::TwoPi();
1001 AliDebug(2,Form(
"cell energy = %f time = %f",cellE,cellT*1e9));
1017 fGeom = AliEMCALGeometry::GetInstance(
"EMCAL_COMPLETEV1");
1039 Int_t iCellAbsIdMax = -1;
1040 Int_t nCells = clus->GetNCells();
1041 for(
Int_t i = 0; i<nCells; i++) {
1042 Int_t absId = clus->GetCellAbsId(i);
1046 iCellAbsIdMax = absId;
1049 return iCellAbsIdMax;
1058 if(absID>-1)
return fCaloCells->GetCellAmplitude(absID);
1074 Int_t imod = -1, iphi =-1, ieta=-1, iTower = -1, iIphi = -1, iIeta = -1;
1075 fGeom->GetCellIndex(absID,imod,iTower,iIphi,iIeta);
1076 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1078 if( iphi < AliEMCALGeoParams::fgkEMCALRows-1)
1079 absID1 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
1081 absID2 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
1083 if( ieta == AliEMCALGeoParams::fgkEMCALCols-1 && !(imod%2) ) {
1084 absID3 =
fGeom->GetAbsCellIdFromCellIndexes(imod+1, iphi, 0);
1085 absID4 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
1087 else if( ieta == 0 && imod%2 ) {
1088 absID3 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
1089 absID4 =
fGeom->GetAbsCellIdFromCellIndexes(imod-1, iphi, AliEMCALGeoParams::fgkEMCALCols-1);
1092 if( ieta < AliEMCALGeoParams::fgkEMCALCols-1 )
1093 absID3 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
1095 absID4 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
1103 ecross = ecell1+ecell2+ecell3+ecell4;
1113 if( dphi<-1*TMath::Pi() )
1114 dphi = dphi + 1*TMath::Pi();
1115 if( dphi>1*TMath::Pi())
1116 dphi = dphi - 1*TMath::Pi();
1118 if( (dphi>0) && (dphi<1*TMath::Pi()/2) ){
1120 }
else if( (dphi>1*TMath::Pi()/2) && (dphi<1*TMath::Pi()) ){
1121 dphi = 1*TMath::Pi() - dphi;
1122 }
else if( (dphi<0) && (dphi>-1*TMath::Pi()/2) ){
1124 }
else if( (dphi<-1*TMath::Pi()/2) && (dphi>-1*TMath::Pi()) ){
1125 dphi = dphi + 1*TMath::Pi();
1133 if(fPatch->IsLevel0()) h->Fill(1);
1134 if(fPatch->IsJetLow()) h->Fill(2);
1135 if(fPatch->IsJetHigh()) h->Fill(3);
1136 if(fPatch->IsGammaLow()) h->Fill(4);
1137 if(fPatch->IsGammaHigh()) h->Fill(5);
1138 if(fPatch->IsMainTrigger()) h->Fill(6);
1139 if(fPatch->IsJetLowSimple()) h->Fill(7);
1140 if(fPatch->IsJetHighSimple()) h->Fill(8);
1141 if(fPatch->IsGammaLowSimple()) h->Fill(9);
1142 if(fPatch->IsGammaHighSimple()) h->Fill(10);
1143 if(fPatch->IsMainTriggerSimple()) h->Fill(11);
1144 if(fPatch->IsOfflineSimple()) h->Fill(12);
1145 if(fPatch->IsRecalcJet()) h->Fill(13);
1146 if(fPatch->IsRecalcGamma()) h->Fill(14);
1147 if(trig & AliVEvent::kEMCEJE) h->Fill(19);
1148 if(trig & AliVEvent::kEMCEGA) h->Fill(20);
1150 h->GetXaxis()->SetBinLabel(1,
"Level0");
1151 h->GetXaxis()->SetBinLabel(2,
"JetLow");
1152 h->GetXaxis()->SetBinLabel(3,
"JetHigh");
1153 h->GetXaxis()->SetBinLabel(4,
"GammaLow");
1154 h->GetXaxis()->SetBinLabel(5,
"GammaHigh");
1155 h->GetXaxis()->SetBinLabel(6,
"MainTrigger");
1156 h->GetXaxis()->SetBinLabel(7,
"JetLowSimple");
1157 h->GetXaxis()->SetBinLabel(8,
"JetHighSimple");
1158 h->GetXaxis()->SetBinLabel(9,
"GammaLowSimple");
1159 h->GetXaxis()->SetBinLabel(10,
"GammaHighSimple");
1160 h->GetXaxis()->SetBinLabel(11,
"MainTriggerSimple");
1161 h->GetXaxis()->SetBinLabel(12,
"OfflineSimple");
1162 h->GetXaxis()->SetBinLabel(13,
"RecalcJet");
1163 h->GetXaxis()->SetBinLabel(14,
"RecalcGamma");
1164 h->GetXaxis()->SetBinLabel(15,
"");
1165 h->GetXaxis()->SetBinLabel(16,
"");
1166 h->GetXaxis()->SetBinLabel(17,
"");
1167 h->GetXaxis()->SetBinLabel(18,
"");
1168 h->GetXaxis()->SetBinLabel(19,
"kEMCEJE");
1169 h->GetXaxis()->SetBinLabel(20,
"kEMCEGA");
1179 Bool_t hasfound = kFALSE;
1180 for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
1181 AliEMCALTriggerPatchInfo *mypatch =
static_cast<AliEMCALTriggerPatchInfo *
>(*patchIter);
1182 Double_t etamin = TMath::Min(mypatch->GetEtaMin(), mypatch->GetEtaMax()),
1183 etamax = TMath::Max(mypatch->GetEtaMin(), mypatch->GetEtaMax()),
1184 phimin = TMath::Min(mypatch->GetPhiMin(), mypatch->GetPhiMax()),
1185 phimax = TMath::Max(mypatch->GetPhiMin(), mypatch->GetPhiMax());
1186 if(etaclust > etamin && etaclust < etamax && phiclust >
phimin && phiclust < phimax){
1196 if(trig == 0) h->Fill(1);
1197 if(trig & AliVEvent::kAny) h->Fill(2);
1198 if(trig & AliVEvent::kAnyINT) h->Fill(3);
1199 if(trig & AliVEvent::kMB) h->Fill(4);
1200 if(trig & AliVEvent::kINT7) h->Fill(5);
1201 if(trig & AliVEvent::kEMC1) h->Fill(6);
1202 if(trig & AliVEvent::kEMC7) h->Fill(7);
1203 if(trig & AliVEvent::kEMC8) h->Fill(8);
1204 if(trig & AliVEvent::kEMCEJE) h->Fill(9);
1205 if(trig & AliVEvent::kEMCEGA) h->Fill(10);
1206 if(trig & AliVEvent::kCentral) h->Fill(11);
1207 if(trig & AliVEvent::kSemiCentral) h->Fill(12);
1208 if(trig & AliVEvent::kINT8) h->Fill(13);
1210 if(trig & (AliVEvent::kEMCEJE | AliVEvent::kMB)) h->Fill(14);
1211 if(trig & (AliVEvent::kEMCEGA | AliVEvent::kMB)) h->Fill(15);
1212 if(trig & (AliVEvent::kAnyINT | AliVEvent::kMB)) h->Fill(16);
1214 if(trig & (AliVEvent::kEMCEJE & (AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral))) h->Fill(17);
1215 if(trig & (AliVEvent::kEMCEGA & (AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral))) h->Fill(18);
1216 if(trig & (AliVEvent::kAnyINT & (AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral))) h->Fill(19);
1219 h->GetXaxis()->SetBinLabel(1,
"no trigger");
1220 h->GetXaxis()->SetBinLabel(2,
"kAny");
1221 h->GetXaxis()->SetBinLabel(3,
"kAnyINT");
1222 h->GetXaxis()->SetBinLabel(4,
"kMB");
1223 h->GetXaxis()->SetBinLabel(5,
"kINT7");
1224 h->GetXaxis()->SetBinLabel(6,
"kEMC1");
1225 h->GetXaxis()->SetBinLabel(7,
"kEMC7");
1226 h->GetXaxis()->SetBinLabel(8,
"kEMC8");
1227 h->GetXaxis()->SetBinLabel(9,
"kEMCEJE");
1228 h->GetXaxis()->SetBinLabel(10,
"kEMCEGA");
1229 h->GetXaxis()->SetBinLabel(11,
"kCentral");
1230 h->GetXaxis()->SetBinLabel(12,
"kSemiCentral");
1231 h->GetXaxis()->SetBinLabel(13,
"kINT8");
1232 h->GetXaxis()->SetBinLabel(14,
"kEMCEJE or kMB");
1233 h->GetXaxis()->SetBinLabel(15,
"kEMCEGA or kMB");
1234 h->GetXaxis()->SetBinLabel(16,
"kAnyINT or kMB");
1235 h->GetXaxis()->SetBinLabel(17,
"kEMCEJE & (kMB or kCentral or kSemiCentral)");
1236 h->GetXaxis()->SetBinLabel(18,
"kEMCEGA & (kMB or kCentral or kSemiCentral)");
1237 h->GetXaxis()->SetBinLabel(19,
"kAnyINT & (kMB or kCentral or kSemiCentral)");
1240 h->LabelsOption(
"v");
TH3F * fh3PatchADCEnergyEtaPhiCenterG2
patch ADC energy vs eta, phi at center of patch, high threshold
TH1 * FillTriggerPatchQA(TH1 *h, UInt_t t, AliEMCALTriggerPatchInfo *fPatch)
virtual AliVParticle * GetNextAcceptParticle()
THnSparse * fhnPatchMatch
// patch-maxclus distributions sparse matrix
TH3F * fh3PtEtaPhiTracksOnEmcal
pt,eta,phi of tracks at vertex
THnSparse * fhnPatchMatch2
// QA before matching patch sparse matrix
TH3F * fh3PatchADCEnergyEtaPhiCenterJ1
patch energy vs eta, phi at center of patch, low + high threshold
Recalculated jet trigger patch; does not need to be above trigger threshold.
Base task in the EMCAL framework.
TH3F * fh3PatchADCEnergyEtaPhiCenterAll
patch ADC energy vs eta, phi at center of patch, low + high threshold
TH3F * fh3PatchEnergyEtaPhiCenterJ2
patch energy vs eta, phi at center of patch, high threshold
TH3F * fh3PatchEnergyEtaPhiCenterG1G2
patch energy vs eta, phi at center of patch, low threshold
TH3F * fh3PtEtaPhiTracksNoProp
pt,eta,phi of tracks at vertex
void FillTriggerPatchHistos()
TH1F * fHistEventSelectionQA
TH1F * fhGammaLowPatchEnergy
Recalculated Gamma Patch Energy distribution.
void Terminate(Option_t *option)
Online amplitude of the patch, from L0 time sums.
AliVCluster * GetLeadingCluster(const char *opt="")
TH1F * fhQAinfoAllPatchesCounter
trigger event class QA
TH2F * fh2ECellVsCent
cell E, eta, phi
Container for particles within the EMCAL framework.
AliParticleContainer * GetParticleContainer(Int_t i=0) const
TH3F * fh3PatchEnergyEtaPhiCenterJ1
cluster E, eta, phi
TH1 * FillEventTriggerQA(TH1 *h, UInt_t t)
Bool_t CorrelateToTrigger(Double_t etaclust, Double_t phiclust, TList *triggerpatches) const
TH3F * fh3PatchEnergyEtaPhiCenterG2
patch energy vs eta, phi at center of patch, high threshold
AliEMCALGeometry * fGeom
!emcal geometry
kRecalculated gamma trigger patch; does not need to be above trigger threshold
TH1F * fhGammaLowSimplePatchEnergy
Gamma Low Patch Energy distribution.
TH3F * fh3PatchEnergyEtaPhiCenterJ1J2
patch energy vs eta, phi at center of patch, low threshold
TH2F * fh2CellEnergyVsTime
cell E vs centrality
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Int_t GetNClusters() const
ClassImp(AliAnalysisTaskEmcalTriggerPatchClusterMatch) AliAnalysisTaskEmcalTriggerPatchClusterMatch
Double_t fCent
!event centrality
TH3F * fh3PtEtaPhiTracksProp
pt,eta,phi of tracks at vertex
TProfile * fhTriggerbit
Histo number of events.
TH1F * fhRecalcJetPatchEnergy
Gamma Low Simple Patch Energy distribution.
AliVCluster * GetCluster(Int_t i) const
TH1F * fhJetLowSimplePatchEnergy
Jet Low patch energy distribution.
virtual ~AliAnalysisTaskEmcalTriggerPatchClusterMatch()
TriggerCategory fTriggerCategory
TH3F * fh3PatchEnergyEtaPhiCenterG1
patch ADC energy vs eta, phi at center of patch, low + high threshold
TH3F * fh3EEtaPhiCell
patch ADC energy vs eta, phi at center of patch, all trigger patches
AliVCaloCells * fCaloCells
!cells
TH1F * fhQAmaxinfoCounter
TH3F * fh3PatchADCEnergyEtaPhiCenterJ1J2
patch ADC energy vs eta, phi at center of patch, low threshold
Bool_t fUseALLrecalcPatches
TClonesArray * fClusterTriggeredEvent
AliEmcalList * fOutput
!output list
AliAnalysisTaskEmcalTriggerPatchClusterMatch()
void UserCreateOutputObjects()
Double_t fVertex[3]
!event vertex
TString fClusterTriggeredEventname
TH1F * fHistClusEnergy
cluster energy vs energy of leading cell in cluster vs time of the leading cell
void SetMakeGeneralHistograms(Bool_t g)
THnSparse * fhnPatchMaxClus
recalculated patches
AliEMCALTriggerPatchInfo * fMaxPatch
TClonesArray * fTriggerPatchInfo
!trigger patch info array
TClonesArray * fRecalcTriggerPatches
clusters
TH2F * fHistdPhidEtaPatchCluster[16]
Main Trigger patch energy distribution.
Float_t RelativeEP(Double_t objAng, Double_t EPAng) const
Int_t GetLeadingCellId(const AliVCluster *clus) const
void UserCreateOutputObjects()
TH3F * fh3PatchADCEnergyEtaPhiCenterG1G2
patch ADC energy vs eta, phi at center of patch, low threshold
TH3F * fh3PtEtaPhiTracks
histogram containing the triggerbit (fOfflineTriggerMask)
Double_t fMaxPatchADCEnergy
TH1F * fhRecalcGammaPatchEnergy
Offline energy, from cells, calibrated, exluding hot towers.
TH3F * fh3EClusELeadingCellVsTime
emcal cell energy vs time
Container structure for EMCAL clusters.
TH3F * fh3PatchADCEnergyEtaPhiCenterJ2
patch ADC energy vs eta, phi at center of patch, high threshold
TH1F * fhMainTriggerPatchEnergy
Jet Low Simple patch energy distribution.
TH1F * fhJetLowPatchEnergy
Recalculated Jet Patch Energy distribution.
Double_t GetECross(Int_t absID) const
TH3F * fh3EEtaPhiCluster
pt,eta,phi of tracks at vertex
TH1F * fhNEvents
method to select main patch
TH3F * fh3PtEtaPhiTracksToProp
pt,eta,phi of tracks at Emcal surface
TH3F * fh3PatchADCEnergyEtaPhiCenterG1
patch energy vs eta, phi at center of patch, low + high threshold
Double_t GetEnergyLeadingCell(const AliVCluster *clus) const