18 #include <TClonesArray.h>
29 #include "AliAnalysisUtils.h"
30 #include "AliAODEvent.h"
31 #include "AliAODMCHeader.h"
32 #include "AliAODTrack.h"
33 #include "AliAnalysisManager.h"
34 #include "AliCentrality.h"
36 #include "AliEMCALGeometry.h"
38 #include "AliEMCALTriggerPatchInfo.h"
39 #include "AliESDEvent.h"
40 #include "AliAODInputHandler.h"
41 #include "AliESDInputHandler.h"
42 #include "AliEventplane.h"
43 #include "AliGenPythiaEventHeader.h"
44 #include "AliGenHerwigEventHeader.h"
45 #include "AliInputEventHandler.h"
47 #include "AliMCEvent.h"
48 #include "AliMCParticle.h"
49 #include "AliMultiInputEventHandler.h"
50 #include "AliMultSelection.h"
52 #include "AliVCaloTrigger.h"
53 #include "AliVCluster.h"
54 #include "AliVEventHandler.h"
55 #include "AliVParticle.h"
70 fGeneralHistograms(kFALSE),
71 fLocalInitialized(kFALSE),
75 fCaloTriggerPatchInfoName(),
83 fUseAliAnaUtils(kFALSE),
84 fRejectPileup(kFALSE),
85 fTklVsClusSPDCut(kFALSE),
86 fOffTrigger(AliVEvent::kAny),
88 fMinBiasRefTrigger(
"CINT7-B-NOPF-ALLNOTRD"),
93 fMinPtTrackInEmcal(0),
94 fEventPlaneVsEmcal(-1),
101 fSelectPtHardBin(-999),
105 fNeedEmcalGeom(kTRUE),
106 fParticleCollArray(),
109 fEMCalTriggerMode(kOverlapWithLowThreshold),
110 fUseNewCentralityEstimation(kFALSE),
111 fGeneratePythiaInfoObject(kFALSE),
112 fUsePtHardBinScaling(kFALSE),
113 fMCRejectFilter(kFALSE),
114 fCountDownscaleCorrectedEvents(kFALSE),
115 fPtHardAndJetPtFactor(0.),
116 fPtHardAndClusterPtFactor(0.),
117 fPtHardAndTrackPtFactor(0.),
146 fHistXsectionAfterSel(
nullptr),
156 fHistTriggerClassesCorr(
nullptr)
183 fGeneralHistograms(kFALSE),
184 fLocalInitialized(kFALSE),
188 fCaloTriggerPatchInfoName(),
196 fUseAliAnaUtils(kFALSE),
197 fRejectPileup(kFALSE),
198 fTklVsClusSPDCut(kFALSE),
199 fOffTrigger(AliVEvent::kAny),
201 fMinBiasRefTrigger(
"CINT7-B-NOPF-ALLNOTRD"),
202 fTriggerTypeSel(kND),
206 fMinPtTrackInEmcal(0),
207 fEventPlaneVsEmcal(-1),
208 fMinEventPlane(-1e6),
214 fSelectPtHardBin(-999),
218 fNeedEmcalGeom(kTRUE),
219 fParticleCollArray(),
222 fEMCalTriggerMode(kOverlapWithLowThreshold),
223 fUseNewCentralityEstimation(kFALSE),
224 fGeneratePythiaInfoObject(kFALSE),
225 fUsePtHardBinScaling(kFALSE),
226 fMCRejectFilter(kFALSE),
227 fCountDownscaleCorrectedEvents(kFALSE),
228 fPtHardAndJetPtFactor(0.),
229 fPtHardAndClusterPtFactor(0.),
230 fPtHardAndTrackPtFactor(0.),
259 fHistXsectionAfterSel(
nullptr),
269 fHistTriggerClassesCorr(
nullptr)
281 DefineOutput(1, AliEmcalList::Class());
302 else AliError(Form(
"%s in SetClusPtCut(...): container %d not found",GetName(),c));
316 else AliError(Form(
"%s in SetClusTimeCut(...): container %d not found",GetName(),c));
329 else AliError(Form(
"%s in SetTrackPtCut(...): container %d not found",GetName(),c));
345 else AliError(Form(
"%s in SetTrackPtCut(...): container %d not found",GetName(),c));
359 else AliError(Form(
"%s in SetTrackPhiLimits(...): container %d not found",GetName(),c));
385 AliVEventHandler *evhand = mgr->GetInputEventHandler();
387 if (evhand->InheritsFrom(
"AliESDInputHandler")) {
395 AliError(
"Event handler not found!");
399 AliError(
"Analysis manager not found!");
432 fHistTrials =
new TH1F(
"fHistTrials",
"fHistTrials", 11, 0, 11);
433 fHistTrials->GetXaxis()->SetTitle(
"p_{T} hard bin");
437 fHistEvents =
new TH1F(
"fHistEvents",
"fHistEvents", 11, 0, 11);
438 fHistEvents->GetXaxis()->SetTitle(
"p_{T} hard bin");
442 fHistXsection =
new TProfile(
"fHistXsection",
"fHistXsection", 11, 0, 11);
447 const Int_t ptHardLo[11] = { 0, 5,11,21,36,57, 84,117,152,191,234};
448 const Int_t ptHardHi[11] = { 5,11,21,36,57,84,117,152,191,234,1000000};
450 for (
Int_t i = 1; i < 12; i++) {
451 fHistTrialsAfterSel->GetXaxis()->SetBinLabel(i, Form(
"%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
452 fHistEventsAfterSel->GetXaxis()->SetBinLabel(i, Form(
"%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
454 fHistTrials->GetXaxis()->SetBinLabel(i, Form(
"%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
455 fHistXsection->GetXaxis()->SetBinLabel(i, Form(
"%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
456 fHistEvents->GetXaxis()->SetBinLabel(i, Form(
"%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
460 fHistPtHard->GetXaxis()->SetTitle(
"p_{T,hard} (GeV/c)");
465 fHistZVertex =
new TH1F(
"fHistZVertex",
"Z vertex position", 60, -30, 30);
471 fHistCentrality =
new TH1F(
"fHistCentrality",
"Event centrality distribution", 200, 0, 100);
476 fHistEventPlane =
new TH1F(
"fHistEventPlane",
"Event plane", 120, -TMath::Pi(), TMath::Pi());
483 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
506 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
515 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
562 std::unique_ptr<TObjArray> triggerClasses(InputEvent()->GetFiredTriggerClasses().Tokenize(
" "));
563 TObjString* triggerClass(
nullptr);
564 for(
auto trg : *triggerClasses){
565 triggerClass =
static_cast<TObjString*
>(trg);
660 AliWarning(
"AliAnalysisTaskEmcal::AcceptCluster method is deprecated. Please use GetCusterContainer(c)->AcceptCluster(clus).");
662 if (!clus)
return kFALSE;
666 AliError(Form(
"%s:Container %d not found",GetName(),c));
669 UInt_t rejectionReason = 0;
683 AliWarning(
"AliAnalysisTaskEmcal::AcceptTrack method is deprecated. Please use GetParticleContainer(c)->AcceptParticle(clus).");
685 if (!track)
return kFALSE;
689 AliError(Form(
"%s:Container %d not found",GetName(),c));
693 UInt_t rejectionReason = 0;
715 if (file.Contains(
".zip#")) {
716 Ssiz_t pos1 = file.Index(
"root_archive",12,0,TString::kExact);
717 Ssiz_t pos = file.Index(
"#",1,pos1,TString::kExact);
718 Ssiz_t pos2 = file.Index(
".root",5,TString::kExact);
719 file.Replace(pos+1,pos2-pos1,
"");
722 file.ReplaceAll(
gSystem->BaseName(file.Data()),
"");
724 AliDebug(1,Form(
"File name: %s",file.Data()));
729 strPthard.Remove(strPthard.Last(
'/'));
730 strPthard.Remove(strPthard.Last(
'/'));
731 if (strPthard.Contains(
"AOD")) strPthard.Remove(strPthard.Last(
'/'));
732 strPthard.Remove(0,strPthard.Last(
'/')+1);
733 if (strPthard.IsDec()) pthard = strPthard.Atoi();
735 AliWarning(Form(
"Could not extract file number from path %s", strPthard.Data()));
738 std::unique_ptr<TFile> fxsec(TFile::Open(Form(
"%s%s",file.Data(),
"pyxsec.root")));
742 fxsec = std::unique_ptr<TFile>(TFile::Open(Form(
"%s%s",file.Data(),
"pyxsec_hists.root")));
743 if (!fxsec)
return kFALSE;
746 TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
747 if (!key)
return kFALSE;
749 if (!list)
return kFALSE;
750 fXsec = ((TProfile*)list->FindObject(
"h1Xsec"))->GetBinContent(1);
751 fTrials = ((TH1F*)list->FindObject(
"h1Trials"))->GetBinContent(1);
754 TTree *xtree = (
TTree*)fxsec->Get(
"Xsection");
755 if (!xtree)
return kFALSE;
758 xtree->SetBranchAddress(
"xsection",&xsection);
759 xtree->SetBranchAddress(
"ntrials",&ntrials);
785 TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
787 AliError(Form(
"%s - UserNotify: No current tree!",GetName()));
795 TFile *curfile = tree->GetCurrentFile();
797 AliError(Form(
"%s - UserNotify: No current file!",GetName()));
802 if (chain) tree = chain->GetTree();
809 if ((pthardbin < 0) || (pthardbin > 10)) pthardbin = 0;
827 AliError(Form(
"%s: Could not retrieve parton infos! %s!", GetName(),
fPythiaInfoName.Data()));
846 AliError(Form(
"%s: Could not retrieve event! Returning!", GetName()));
853 fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->
GetRunNumber());
855 AliFatal(Form(
"%s: Can not get EMCal geometry instance. If you do not need the EMCal geometry, disable it by setting task->SetNeedEmcalGeometry(kFALSE).", GetName()));
867 AliWarning(
"Could not set event plane limits because EMCal geometry was not loaded!");
874 cont->SetArray(InputEvent());
880 AliError(Form(
"%s: Could not retrieve first track branch!", GetName()));
888 cont->SetArray(InputEvent());
894 AliError(Form(
"%s: Could not retrieve first cluster branch!", GetName()));
902 AliError(Form(
"%s: Could not retrieve cells %s!", GetName(),
fCaloCellsName.Data()));
910 AliError(Form(
"%s: Could not retrieve calo triggers %s!", GetName(),
fCaloTriggersName.Data()));
939 const AliESDRun *run = esd->GetESDRun();
940 TString beamType = run->GetBeamType();
941 if (beamType ==
"p-p")
943 else if (beamType ==
"A-A")
945 else if (beamType ==
"p-A")
950 Int_t runNumber = InputEvent()->GetRunNumber();
952 if ((runNumber >= 136833 && runNumber <= 139517) ||
953 (runNumber >= 167693 && runNumber <= 170593) ||
954 (runNumber >= 244824 && runNumber <= 246994)) {
956 }
else if ((runNumber >= 188356 && runNumber <= 188366) ||
957 (runNumber >= 195164 && runNumber <= 197388) ||
958 (runNumber >= 265015 && runNumber <= 267166)) {
986 AliEMCALTriggerPatchInfo *patch;
987 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
989 if (patch->IsGammaHigh()) nG1++;
990 if (patch->IsGammaLow()) nG2++;
991 if (patch->IsJetHigh()) nJ1++;
992 if (patch->IsJetLow()) nJ2++;
993 if (patch->IsLevel0()) nL0++;
996 AliDebug(2,
"Patch summary: ");
997 AliDebug(2, Form(
"Number of patches: %d", nPatch));
998 AliDebug(2, Form(
"Jet: low[%d], high[%d]" ,nJ2, nJ1));
999 AliDebug(2, Form(
"Gamma: low[%d], high[%d]" ,nG2, nG1));
1002 if (nL0>0) SETBIT(triggers,
kL0);
1003 if (nG1>0) SETBIT(triggers,
kG1);
1004 if (nG2>0) SETBIT(triggers,
kG2);
1005 if (nJ1>0) SETBIT(triggers,
kJ1);
1006 if (nJ2>0) SETBIT(triggers,
kJ2);
1020 AliWarning(Form(
"%s: Requesting undefined trigger type!", GetName()));
1057 res = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1061 res = ((AliVAODHeader*)aev->GetHeader())->GetOfflineTrigger();
1074 fired = eev->GetFiredTriggerClasses();
1078 fired = aev->GetFiredTriggerClasses();
1081 if (!fired.Contains(
"-B-")) {
1086 std::unique_ptr<TObjArray> arr(
fTrigClass.Tokenize(
"|"));
1092 for (
Int_t i=0;i<arr->GetEntriesFast();++i) {
1098 TString objStr = obj->GetName();
1100 (objStr.Contains(
"J1") || objStr.Contains(
"J2") || objStr.Contains(
"G1") || objStr.Contains(
"G2"))) {
1105 if(objStr.Contains(
"G")) {
1109 if(objStr.Contains(trigType2) && fired.Contains(trigType2.Data())) {
1113 else if(objStr.Contains(trigType1) && fired.Contains(trigType1.Data()) && !fired.Contains(trigType2.Data())) {
1121 if (fired.Contains(obj->GetName())) {
1141 if (fCent<fMinCent || fCent>
fMaxCent) {
1177 if (vz < fMinVz || vz >
fMaxVz) {
1184 Double_t dvertex = TMath::Abs(vz-vzSPD);
1194 Bool_t trackInEmcalOk = kFALSE;
1196 for (
Int_t i = 0; i < ntracks; i++) {
1201 Double_t phiMin =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
1202 Double_t phiMax =
fGeom->GetArm1PhiMax() * TMath::DegToRad();
1203 Int_t runNumber = InputEvent()->GetRunNumber();
1204 if (runNumber>=177295 && runNumber<=197470) {
1206 phiMax = TMath::Pi();
1209 if (track->Eta() <
fGeom->GetArm1EtaMin() || track->Eta() >
fGeom->GetArm1EtaMax() || track->Phi() < phiMin || track->Phi() > phiMax)
1212 trackInEmcalOk = kTRUE;
1216 if (!trackInEmcalOk) {
1223 Int_t nTracksAcc = 0;
1225 for (
Int_t i = 0; i < ntracks; i++) {
1275 AliDebug(1,Form(
"Njets: %d, pT Hard %f",nTriggerJets,
fPtHard));
1278 for (
Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
1281 jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
1283 AliDebug(1,Form(
"jet %d; pycell jet pT %f",ijet, jet.Pt()));
1287 AliInfo(Form(
"Reject jet event with : pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n",
fPtHard, jet.Pt(),
fPtHardAndJetPtFactor));
1297 if ((
Bool_t)mccluscont) {
1298 for (
auto cluster : mccluscont->all()) {
1299 Float_t ecluster = cluster->E();
1313 if ((
Bool_t)mcpartcont) {
1314 for (
auto mctrack : mcpartcont->
all()) {
1315 Float_t trackpt = mctrack->Pt();
1338 TClonesArray *arr = 0;
1340 if (!sname.IsNull()) {
1341 arr =
dynamic_cast<TClonesArray*
>(InputEvent()->FindListObject(sname));
1343 AliWarning(Form(
"%s: Could not retrieve array with name %s!", GetName(), name));
1353 TString objname(arr->GetClass()->GetName());
1354 TClass cls(objname);
1355 if (!cls.InheritsFrom(clname)) {
1356 AliWarning(Form(
"%s: Objects of type %s in %s are not inherited from %s!",
1357 GetName(), cls.GetName(), name, clname));
1383 const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1389 const AliVVertex *vertSPD = InputEvent()->GetPrimaryVertexSPD();
1399 AliMultSelection *MultSelection =
static_cast<AliMultSelection*
>(InputEvent()->FindListObject(
"MultSelection"));
1400 if (MultSelection) {
1401 fCent = MultSelection->GetMultiplicityPercentile(
fCentEst.Data());
1404 AliWarning(Form(
"%s: Could not retrieve centrality information! Assuming 99", GetName()));
1408 AliCentrality *aliCent = InputEvent()->GetCentrality();
1413 AliWarning(Form(
"%s: Could not retrieve centrality information! Assuming 99", GetName()));
1423 AliWarning(Form(
"%s: Negative centrality: %f. Assuming 99", GetName(),
fCent));
1432 else if (
fCent > 90) {
1437 AliWarning(Form(
"%s: Negative centrality: %f. Assuming 99", GetName(),
fCent));
1450 AliWarning(Form(
"%s: fCentBin too large: cent = %f fCentBin = %d. Assuming 99", GetName(),
fCent,
fCentBin));
1455 AliEventplane *aliEP = InputEvent()->GetEventplane();
1457 fEPV0 = aliEP->GetEventplane(
"V0" ,InputEvent());
1458 fEPV0A = aliEP->GetEventplane(
"V0A",InputEvent());
1459 fEPV0C = aliEP->GetEventplane(
"V0C",InputEvent());
1461 AliWarning(Form(
"%s: Could not retrieve event plane information!", GetName()));
1471 fPythiaHeader =
dynamic_cast<AliGenPythiaEventHeader*
>(MCEvent()->GenEventHeader());
1474 AliAODMCHeader* aodMCH =
dynamic_cast<AliAODMCHeader*
>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
1477 for (
UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
1478 fPythiaHeader =
dynamic_cast<AliGenPythiaEventHeader*
>(aodMCH->GetCocktailHeader(i));
1489 const Int_t ptHardLo[11] = { 0, 5,11,21,36,57, 84,117,152,191,234};
1490 const Int_t ptHardHi[11] = { 5,11,21,36,57,84,117,152,191,234,1000000};
1505 fHerwigHeader =
dynamic_cast<AliGenHerwigEventHeader*
>(MCEvent()->GenEventHeader());
1511 AliAODMCHeader* aodMCH =
dynamic_cast<AliAODMCHeader*
>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
1514 for (
UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
1515 fHerwigHeader =
dynamic_cast<AliGenHerwigEventHeader*
>(aodMCH->GetCocktailHeader(i));
1526 const Int_t ptHardLo[11] = { 0, 5,11,21,36,57, 84,117,152,191,234};
1527 const Int_t ptHardHi[11] = { 5,11,21,36,57,84,117,152,191,234,1000000};
1539 AliEmcalContainer* cont = 0;
1542 while ((cont = static_cast<AliEmcalContainer*>(nextPartColl()))) cont->NextEvent();
1545 while ((cont = static_cast<AliParticleContainer*>(nextClusColl()))) cont->NextEvent();
1559 if (
TString(n).IsNull())
return 0;
1577 if (
TString(n).IsNull())
return 0;
1595 if (
TString(n).IsNull())
return 0;
1613 if (
TString(n).IsNull())
return 0;
1677 AliError(Form(
"%s: Particle container %d not found",GetName(),i));
1680 TString contName = cont->GetArrayName();
1681 return cont->GetArray();
1693 AliError(Form(
"%s:Cluster container %d not found",GetName(),i));
1696 return cont->GetArray();
1711 AliError(Form(
"%s: Particle container %d not found",GetName(),c));
1730 AliError(Form(
"%s: Cluster container %d not found",GetName(),c));
1747 AliError(Form(
"%s: Particle container %d not found",GetName(),i));
1750 return cont->GetNEntries();
1763 AliError(Form(
"%s: Cluster container %d not found",GetName(),i));
1766 return cont->GetNEntries();
1784 AliError(Form(
"%s: fTriggerPatchInfo not available",GetName()));
1792 AliEMCALTriggerPatchInfo *patch(NULL), *selected(NULL);
1793 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
1796 if (patch->IsMainTrigger()) {
1797 if(doSimpleOffline){
1798 if(patch->IsOfflineSimple()){
1802 if(patch->IsLevel0()) selected = patch;
1805 if(patch->IsJetHighSimple() || patch->IsJetLowSimple()){
1806 if(!selected) selected = patch;
1807 else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1811 if(patch->IsGammaHighSimple() || patch->IsGammaLowSimple()){
1812 if(!selected) selected = patch;
1813 else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1817 AliError(
"Untreated case: Main Patch is recalculated; should be in 'else' branch");
1823 if(patch->IsLevel0()) selected = patch;
1826 if(patch->IsJetHigh() || patch->IsJetLow()){
1827 if(!selected) selected = patch;
1828 else if (patch->GetADCAmp() > selected->GetADCAmp())
1833 if(patch->IsGammaHigh() || patch->IsGammaLow()){
1834 if(!selected) selected = patch;
1835 else if (patch->GetADCAmp() > selected->GetADCAmp())
1840 AliError(
"Untreated case: Main Patch is recalculated; should be in 'else' branch");
1846 if (doSimpleOffline && patch->IsOfflineSimple()) {
1847 if(!selected) selected = patch;
1848 else if (patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp())
1851 else if (!doSimpleOffline && !patch->IsOfflineSimple()) {
1852 if(!selected) selected = patch;
1853 else if (patch->GetADCAmp() > selected->GetADCAmp())
1868 if (!(InputEvent()->FindListObject(obj->GetName()))) {
1869 InputEvent()->AddObject(obj);
1873 AliFatal(Form(
"%s: Container with name %s already present. Aborting", GetName(), obj->GetName()));
1889 AliWarning(Form(
"%s - AliAnalysisTaskEmcal::IsTrackInEmcalAcceptance - Geometry is not available!", GetName()));
1896 if (part->Phi() > minPhi && part->Phi() < maxPhi) {
1906 axis->SetBinLabel(1,
"NullObject");
1907 axis->SetBinLabel(2,
"Pt");
1908 axis->SetBinLabel(3,
"Acceptance");
1909 axis->SetBinLabel(4,
"MCLabel");
1910 axis->SetBinLabel(5,
"BitMap");
1911 axis->SetBinLabel(6,
"HF cut");
1912 axis->SetBinLabel(7,
"Bit6");
1913 axis->SetBinLabel(8,
"NotHybridTrack");
1914 axis->SetBinLabel(9,
"MCFlag");
1915 axis->SetBinLabel(10,
"MCGenerator");
1916 axis->SetBinLabel(11,
"ChargeCut");
1917 axis->SetBinLabel(12,
"MinDistanceTPCSectorEdge");
1918 axis->SetBinLabel(13,
"Bit12");
1919 axis->SetBinLabel(14,
"IsEMCal");
1920 axis->SetBinLabel(15,
"Time");
1921 axis->SetBinLabel(16,
"Energy");
1922 axis->SetBinLabel(17,
"ExoticCut");
1923 axis->SetBinLabel(18,
"Bit17");
1924 axis->SetBinLabel(19,
"Area");
1925 axis->SetBinLabel(20,
"AreaEmc");
1926 axis->SetBinLabel(21,
"ZLeadingCh");
1927 axis->SetBinLabel(22,
"ZLeadingEmc");
1928 axis->SetBinLabel(23,
"NEF");
1929 axis->SetBinLabel(24,
"MinLeadPt");
1930 axis->SetBinLabel(25,
"MaxTrackPt");
1931 axis->SetBinLabel(26,
"MaxClusterPt");
1932 axis->SetBinLabel(27,
"Flavour");
1933 axis->SetBinLabel(28,
"TagStatus");
1934 axis->SetBinLabel(29,
"MinNConstituents");
1935 axis->SetBinLabel(30,
"Bit29");
1936 axis->SetBinLabel(31,
"Bit30");
1937 axis->SetBinLabel(32,
"Bit31");
1948 TVector3 vect1(part1->Px(), part1->Py(), part1->Pz());
1949 TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1950 Double_t z = (vect1 * vect2) / (vect2 * vect2);
1962 TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1963 Double_t z = (vect1 * vect2) / (vect2 * vect2);
1982 Double_t veta = t->GetTrackEtaOnEMCal();
1983 Double_t vphi = t->GetTrackPhiOnEMCal();
1986 v->GetPosition(pos);
1991 phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
2002 if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
2004 else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
2006 else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
2025 if (aodTrack->TestFilterBit(filterBit1)) {
2028 else if (aodTrack->TestFilterBit(filterBit2)) {
2029 if ((aodTrack->GetStatus()&AliVTrack::kITSrefit)!=0) {
2053 AliStack* stack = mcEvent->Stack();
2055 const Int_t nprim = stack->GetNprimary();
2057 if (nprim < 8)
return;
2059 TParticle *part6 = stack->Particle(6);
2060 TParticle *part7 = stack->Particle(7);
2068 AliGenPythiaEventHeader *pythiaGenHeader =
dynamic_cast<AliGenPythiaEventHeader*
>(mcEvent->GenEventHeader());
2069 if(pythiaGenHeader){
2082 ::Error(
"AddAODHandler",
"No analysis manager to connect to.");
2086 AliAODInputHandler* aodHandler =
new AliAODInputHandler();
2088 AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
2089 if (inputHandler && (inputHandler->IsA() == AliMultiInputEventHandler::Class())) {
2090 AliMultiInputEventHandler *multiInputHandler=(AliMultiInputEventHandler*)inputHandler;
2091 multiInputHandler->AddInputEventHandler(aodHandler);
2094 if (!inputHandler) {
2095 mgr->SetInputEventHandler(aodHandler);
2098 ::Error(
"AddAODHandler",
"inputHandler is NOT null. AOD handler was NOT added !!!");
2114 ::Error(
"AddESDHandler",
"No analysis manager to connect to.");
2118 AliESDInputHandler *esdHandler =
new AliESDInputHandler();
2120 AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
2121 if (inputHandler && (inputHandler->IsA() == AliMultiInputEventHandler::Class())) {
2122 AliMultiInputEventHandler *multiInputHandler=(AliMultiInputEventHandler*)inputHandler;
2123 multiInputHandler->AddInputEventHandler(esdHandler);
2126 if (!inputHandler) {
2127 mgr->SetInputEventHandler(esdHandler);
2130 ::Error(
"AddESDHandler",
"inputHandler is NOT null. ESD handler was NOT added !!!");
Bool_t fGeneratePythiaInfoObject
Generate Pythia info object.
TObjArray fClusterCollArray
cluster collection array
Int_t fNVertSPDCont
!event SPD vertex number of contributors
void SetParticlePtCut(Double_t cut)
Bool_t fIsPythia
trigger, if it is a PYTHIA production
void SetParton7(Float_t pt, Float_t eta, Float_t phi, Float_t mass=0)
TH1 * fHistTrials
!trials from pyxsec.root
EMCAL Level1 gamma trigger, low threshold.
AliEmcalPythiaInfo * fPythiaInfo
!event parton info
Bool_t AcceptTrack(AliVParticle *track, Int_t c=0) const
EMCAL Level1 jet trigger, low threshold.
Bool_t HasTriggerType(TriggerType triggersel)
Int_t fNTrials
!event trials
UInt_t fOffTrigger
offline trigger for event selection
Double_t fVertexSPD[3]
!event Svertex
Double_t fMinCent
min centrality for event selection
static AliEmcalDownscaleFactorsOCDB * Instance()
Double_t fTrackPtCut
cut on track pt in event selection
Recalculated jet trigger patch; does not need to be above trigger threshold.
Base task in the EMCAL framework.
Bool_t fLocalInitialized
whether or not the task has been already initialized
Bool_t fUsePtHardBinScaling
Use pt hard bin scaling in merging.
void SetPartonFlag7(Int_t flag7)
Container with name, TClonesArray and cuts for particles.
Double_t fPtHard
!event pt hard
void SetRun(int runnumber)
void SetTrackPtCut(Double_t cut, Int_t c=0)
static void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
Double_t fMinBinPt
min pt in histograms
Double_t fEPV0
!event plane V0
Bool_t fGeneralHistograms
whether or not it should fill some general histograms
Bool_t AcceptCluster(AliVCluster *clus, Int_t c=0) const
virtual void UserExecOnce()
Int_t fCentBin
!event centrality bin
TH1 * fHistEventsAfterSel
!total number of events per pt hard bin after selection
const AliMCParticleIterableContainer all() const
Float_t fPtHardAndClusterPtFactor
Factor between ptHard and cluster pT to reject/accept event.
Double_t fMinPtTrackInEmcal
min pt track in emcal
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
TH1 * fHistEventPlane
!event plane distribution
TH1 * fHistEvents
!total number of events per pt hard bin
void SetClusPtCut(Double_t cut, Int_t c=0)
AliClusterContainer * AddClusterContainer(const char *n)
Double_t fEPV0C
!event plane V0C
void SetParton6(Float_t pt, Float_t eta, Float_t phi, Float_t mass=0)
TH1 * fHistCentrality
!event centrality distribution
Container for particles within the EMCAL framework.
TObjArray fParticleCollArray
particle/track collection array
BeamType
Switch for the beam type.
void SetTrackEtaLimits(Double_t min, Double_t max, Int_t c=0)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Level1 jet trigger patch.
TProfile * fHistXsectionAfterSel
!x section from pythia header
TriggerType
Switch for EMCAL trigger types.
EMCalTriggerMode_t fEMCalTriggerMode
EMCal trigger selection mode.
virtual Bool_t FillHistograms()
Int_t GetNParticles(Int_t i=0) const
TClonesArray * fCaloClusters
!clusters
Bool_t fUseNewCentralityEstimation
Use new centrality estimation (for 2015 data)
Bool_t IsTrackInEmcalAcceptance(AliVParticle *part, Double_t edges=0.9) const
TH1 * fHistTriggerClasses
!number of events in each trigger class
Bool_t fCountDownscaleCorrectedEvents
Count event number corrected for downscaling.
Double_t fMaxVz
max vertex for event selection
void GeneratePythiaInfoObject(AliMCEvent *mcEvent)
AliEMCALGeometry * fGeom
!emcal geometry
The overlap between low and high threshold trigger is assigned to the lower threshold only...
kRecalculated gamma trigger patch; does not need to be above trigger threshold
TString fCaloTriggerPatchInfoName
trigger patch info array name
TString fCaloTriggersName
name of calo triggers collection
TH1 * fHistTriggerClassesCorr
!corrected number of events in each trigger class
Bool_t fIsHerwig
trigger, if it is a HERWIG production
AliGenPythiaEventHeader * fPythiaHeader
!event Pythia header
void SetTrackPhiLimits(Double_t min, Double_t max, Int_t c=0)
AliParticleContainer * AddParticleContainer(const char *n)
AliAnalysisUtils * fAliAnalysisUtils
!vertex selection (optional)
BeamType fForceBeamType
forced beam type
void SetUseScaling(Bool_t val)
Int_t fNcentBins
how many centrality bins
AliClusterContainer * GetClusterContainer(Int_t i=0) const
TriggerType fTriggerTypeSel
trigger type to select based on trigger patches
virtual Bool_t AcceptCluster(Int_t i, UInt_t &rejectionReason) const
virtual Bool_t FillGeneralHistograms()
TString fTrigClass
trigger class name for event selection
Float_t fPtHardAndJetPtFactor
Factor between ptHard and jet pT to reject/accept event.
AliVCluster * GetAcceptCluster(Int_t i) const
TClonesArray * GetParticleArray(Int_t i=0) const
BeamType GetBeamType() const
Double_t fMinVz
min vertex for event selection
virtual AliVParticle * GetAcceptParticle(Int_t i=-1) const
BeamType fBeamType
!event beam type
std::vector< TString > GetTriggerClasses() const
Float_t fPtHardAndTrackPtFactor
Factor between ptHard and track pT to reject/accept event.
Double_t fCent
!event centrality
Double_t fMinEventPlane
minimum event plane value
TString fCaloCellsName
name of calo cell collection
Int_t GetNClusters(Int_t i=0) const
Int_t fNVertCont
!event vertex number of contributors
Bool_t fMCRejectFilter
enable the filtering of events by tail rejection
Double_t fZvertexDiff
upper limit for distance between primary and SPD vertex
virtual Bool_t AcceptParticle(const AliVParticle *vp, UInt_t &rejectionReason) const
EMCAL Level1 jet trigger, high threshold.
Int_t fSelectPtHardBin
select one pt hard bin for analysis
AliMCParticleContainer * AddMCParticleContainer(const char *n)
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
virtual Bool_t RetrieveEventObjects()
Bool_t fRejectPileup
Reject pilup using function AliAnalysisUtils::IsPileUpEvent()
TProfile * fHistXsection
!x section from pyxsec.root
Bool_t PythiaInfoFromFile(const char *currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
void UserExec(Option_t *option)
void SetPartonFlag6(Int_t flag6)
AliVCaloCells * fCaloCells
!cells
TClonesArray * GetArrayFromEvent(const char *name, const char *clname=0)
Enhanced TList-derived class that implements correct merging for pt_hard binned production.
Double_t fEventPlaneVsEmcal
select events which have a certain event plane wrt the emcal
virtual Bool_t IsEventSelected()
TH1 * fHistPtHard
!pt hard distribution
void SetParticleEtaLimits(Double_t min, Double_t max)
AliEmcalList * fOutput
!output list
Double_t fMaxBinPt
max pt in histograms
Int_t fPtHardBin
!event pt hard bin
virtual void RunChanged(Int_t)
TClonesArray * fTracks
!tracks
TH1 * fHistTrialsAfterSel
!total number of trials per pt hard bin after selection
AliGenHerwigEventHeader * fHerwigHeader
!event Herwig header
void LoadPythiaInfo(AliVEvent *event)
Bool_t fIsEsd
!whether it's an ESD analysis
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
static AliAODInputHandler * AddAODHandler()
Double_t fVertex[3]
!event vertex
AliTrackContainer * AddTrackContainer(const char *n)
Handler for downscale factors for various triggers obtained from the OCDB.
Bool_t fCreateHisto
whether or not create histograms
Store some informaion about a Pythia eventThis class is used to store some information about a Pythia...
TH1 * fHistEventRejection
!book keep reasons for rejecting event
TClonesArray * fTriggerPatchInfo
!trigger patch info array
TClonesArray * GetClusterArray(Int_t i=0) const
Double_t fEPV0A
!event plane V0A
TString fCentEst
name of V0 centrality estimator
TString fPythiaInfoName
name of pythia info object
Int_t GetRunNumber(TString)
Declaration of class AliEmcalPythiaInfo.
void SetClusPtCut(Double_t cut)
Int_t fRunNumber
!run number (triggering RunChanged()
EMCAL Level1 gamma trigger, high threshold.
void AddObjectToEvent(TObject *obj, Bool_t attempt=kFALSE)
AliVCaloTrigger * fCaloTriggers
!calo triggers
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
TH1 * fHistZVertex
!z vertex position
Int_t fMinNTrack
minimum nr of tracks in event with pT>fTrackPtCut
static Byte_t GetTrackType(const AliVTrack *t)
Bool_t fUseAliAnaUtils
used for LHC13* data: z-vtx, Ncontributors, z-vtx resolution cuts
void SetClusTimeCut(Double_t min, Double_t max, Int_t c=0)
ULong_t fTriggers
list of fired triggers
static AliESDInputHandler * AddESDHandler()
Double_t fMaxEventPlane
maximum event plane value
void SetPythiaEventWeight(Float_t ptWeight)
Float_t fXsection
!x-section from pythia header
TH1 * fHistEventCount
!incoming and selected events
Double_t fMaxCent
max centrality for event selection
void SetClusTimeCut(Double_t min, Double_t max)
TriggerCategory
Online trigger categories.
void SetParticlePhiLimits(Double_t min, Double_t max)
AliVParticle * GetAcceptParticleFromArray(Int_t p, Int_t c=0) const
Container structure for EMCAL clusters.
TString fMinBiasRefTrigger
Name of the minmum bias reference trigger, used in the calculation of downscale-corrected event numbe...
Container for MC-true particles within the EMCAL framework.
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
AliVCluster * GetAcceptClusterFromArray(Int_t cl, Int_t c=0) const
Int_t fNbins
no. of pt bins
Bool_t fTklVsClusSPDCut
Apply tracklet-vs-cluster SPD cut to reject background events in pp.
TList * OpenFile(const char *fname)
virtual ~AliAnalysisTaskEmcal()
AliEMCALTriggerPatchInfo * GetMainTriggerPatch(TriggerCategory triggersel=kTriggerLevel1Jet, Bool_t doOfflinSimple=kFALSE)
Level1 gamma trigger patch.
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal