19 #include <TClonesArray.h>
22 #include <TObjString.h>
31 #include "AliAnalysisUtils.h"
32 #include "AliAODEvent.h"
33 #include "AliAODMCHeader.h"
34 #include "AliAODTrack.h"
35 #include "AliAnalysisManager.h"
36 #include "AliCentrality.h"
38 #include "AliEMCALGeometry.h"
40 #include "AliEMCALTriggerPatchInfo.h"
41 #include "AliESDEvent.h"
42 #include "AliAODInputHandler.h"
43 #include "AliESDInputHandler.h"
44 #include "AliEventplane.h"
45 #include "AliGenPythiaEventHeader.h"
46 #include "AliGenHerwigEventHeader.h"
47 #include "AliInputEventHandler.h"
49 #include "AliMCEvent.h"
50 #include "AliMCParticle.h"
51 #include "AliMultiInputEventHandler.h"
52 #include "AliMultSelection.h"
54 #include "AliVCaloTrigger.h"
55 #include "AliVCluster.h"
56 #include "AliVEventHandler.h"
57 #include "AliVParticle.h"
72 fGeneralHistograms(kFALSE),
73 fLocalInitialized(kFALSE),
77 fCaloTriggerPatchInfoName(),
85 fUseAliAnaUtils(kFALSE),
86 fRejectPileup(kFALSE),
87 fTklVsClusSPDCut(kFALSE),
88 fOffTrigger(AliVEvent::kAny),
90 fMinBiasRefTrigger(
"CINT7-B-NOPF-ALLNOTRD"),
95 fMinPtTrackInEmcal(0),
96 fEventPlaneVsEmcal(-1),
103 fSelectPtHardBin(-999),
107 fNeedEmcalGeom(kTRUE),
108 fParticleCollArray(),
111 fEMCalTriggerMode(kOverlapWithLowThreshold),
112 fUseNewCentralityEstimation(kFALSE),
113 fGeneratePythiaInfoObject(kFALSE),
114 fUsePtHardBinScaling(kFALSE),
115 fUseXsecFromHeader(kFALSE),
116 fMCRejectFilter(kFALSE),
117 fCountDownscaleCorrectedEvents(kFALSE),
118 fPtHardAndJetPtFactor(0.),
119 fPtHardAndClusterPtFactor(0.),
120 fPtHardAndTrackPtFactor(0.),
151 fHistXsectionAfterSel(
nullptr),
161 fHistTriggerClassesCorr(
nullptr)
188 fGeneralHistograms(kFALSE),
189 fLocalInitialized(kFALSE),
193 fCaloTriggerPatchInfoName(),
201 fUseAliAnaUtils(kFALSE),
202 fRejectPileup(kFALSE),
203 fTklVsClusSPDCut(kFALSE),
204 fOffTrigger(AliVEvent::kAny),
206 fMinBiasRefTrigger(
"CINT7-B-NOPF-ALLNOTRD"),
207 fTriggerTypeSel(kND),
211 fMinPtTrackInEmcal(0),
212 fEventPlaneVsEmcal(-1),
213 fMinEventPlane(-1e6),
219 fSelectPtHardBin(-999),
223 fNeedEmcalGeom(kTRUE),
224 fParticleCollArray(),
227 fEMCalTriggerMode(kOverlapWithLowThreshold),
228 fUseNewCentralityEstimation(kFALSE),
229 fGeneratePythiaInfoObject(kFALSE),
230 fUsePtHardBinScaling(kFALSE),
231 fUseXsecFromHeader(kFALSE),
232 fMCRejectFilter(kFALSE),
233 fCountDownscaleCorrectedEvents(kFALSE),
234 fPtHardAndJetPtFactor(0.),
235 fPtHardAndClusterPtFactor(0.),
236 fPtHardAndTrackPtFactor(0.),
267 fHistXsectionAfterSel(
nullptr),
277 fHistTriggerClassesCorr(
nullptr)
289 DefineOutput(1, AliEmcalList::Class());
310 else AliError(Form(
"%s in SetClusPtCut(...): container %d not found",GetName(),c));
324 else AliError(Form(
"%s in SetClusTimeCut(...): container %d not found",GetName(),c));
337 else AliError(Form(
"%s in SetTrackPtCut(...): container %d not found",GetName(),c));
353 else AliError(Form(
"%s in SetTrackPtCut(...): container %d not found",GetName(),c));
367 else AliError(Form(
"%s in SetTrackPhiLimits(...): container %d not found",GetName(),c));
393 AliVEventHandler *evhand = mgr->GetInputEventHandler();
395 if (evhand->InheritsFrom(
"AliESDInputHandler")) {
403 AliError(
"Event handler not found!");
407 AliError(
"Analysis manager not found!");
441 fHistTrials->GetXaxis()->SetTitle(
"p_{T} hard bin");
446 fHistEvents->GetXaxis()->SetTitle(
"p_{T} hard bin");
456 Bool_t binningAvailable =
false;
458 AliInfoStream() <<
"Using custom pt-hard binning" << std::endl;
460 else AliErrorStream() <<
"Pt-hard binning (" <<
fPtHardBinning.GetSize() -1 <<
") does not match the amount of bins (" <<
fNPtHardBins <<
")" << std::endl;
464 AliInfoStream() <<
"11 pt-hard bins - fall back to default binning for bin labels" << std::endl;
465 const Int_t kDefaultPtHardBinning[12] = {0,5,11,21,36,57, 84,117,152,191,234,1000000};
468 binningAvailable =
true;
470 AliErrorStream() <<
"No default binning available for " <<
fNPtHardBins <<
" pt-hard bins - bin labels will not be set." << std::endl;
474 if(binningAvailable){
485 AliErrorStream() <<
"No suitable binning available - skipping bin labels" << std::endl;
490 fHistPtHard->GetXaxis()->SetTitle(
"p_{T,hard} (GeV/c)");
495 fHistZVertex =
new TH1F(
"fHistZVertex",
"Z vertex position", 60, -30, 30);
501 fHistCentrality =
new TH1F(
"fHistCentrality",
"Event centrality distribution", 200, 0, 100);
506 fHistEventPlane =
new TH1F(
"fHistEventPlane",
"Event plane", 120, -TMath::Pi(), TMath::Pi());
513 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
536 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
545 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
592 std::unique_ptr<TObjArray> triggerClasses(InputEvent()->GetFiredTriggerClasses().Tokenize(
" "));
593 TObjString* triggerClass(
nullptr);
594 for(
auto trg : *triggerClasses){
595 triggerClass =
static_cast<TObjString*
>(trg);
655 AliDebugStream(1) <<
"Fallback to cross section from pythia header required" << std::endl;
707 AliWarning(
"AliAnalysisTaskEmcal::AcceptCluster method is deprecated. Please use GetCusterContainer(c)->AcceptCluster(clus).");
709 if (!clus)
return kFALSE;
713 AliError(Form(
"%s:Container %d not found",GetName(),c));
716 UInt_t rejectionReason = 0;
730 AliWarning(
"AliAnalysisTaskEmcal::AcceptTrack method is deprecated. Please use GetParticleContainer(c)->AcceptParticle(clus).");
732 if (!track)
return kFALSE;
736 AliError(Form(
"%s:Container %d not found",GetName(),c));
740 UInt_t rejectionReason = 0;
763 std::unique_ptr<TObjArray> walk(file.Tokenize(
"/"));
765 TString &tok =
static_cast<TObjString *
>(t)->String();
766 if(tok.Contains(
".zip")){
768 Int_t pos = archivetype.Index(
".zip");
769 archivetype.Replace(pos, archivetype.Length() - pos,
"");
772 if(archivetype.Length()){
773 AliDebugStream(1) <<
"Auto-detected archive type " << archivetype << std::endl;
774 Ssiz_t pos1 = file.Index(archivetype,archivetype.Length(),0,TString::kExact);
775 Ssiz_t pos = file.Index(
"#",1,pos1,TString::kExact);
776 Ssiz_t pos2 = file.Index(
".root",5,TString::kExact);
777 file.Replace(pos+1,pos2-pos1,
"");
780 file.ReplaceAll(
gSystem->BaseName(file.Data()),
"");
782 AliDebugStream(1) <<
"File name: " << file << std::endl;
787 if(file.Contains(
"__alice")){
789 Int_t pos = tmp.Index(
"__alice");
790 tmp.Replace(0, pos,
"");
791 tmp.ReplaceAll(
"__",
"/");
794 std::unique_ptr<TObjArray> toks(tmp.Tokenize(
"/"));
795 TString tag =
"_" + archivetype;
797 TString &path =
static_cast<TObjString *
>(t)->String();
798 if(path.Contains(tag)){
799 Int_t posTag = path.Index(tag);
800 path.Replace(posTag, path.Length() - posTag,
"");
802 virtualFileName +=
"/" + path;
805 virtualFileName =
file;
808 AliDebugStream(1) <<
"Physical file name " << file <<
", virtual file name " << virtualFileName << std::endl;
811 TString strPthard(virtualFileName);
834 bool binfound =
false;
835 std::unique_ptr<TObjArray> tokens(strPthard.Tokenize(
"/"));
836 for(
auto t : *tokens) {
837 TString &tok =
static_cast<TObjString *
>(t)->String();
839 Int_t number = tok.Atoi();
840 if(number > 2000 && number < 3000){
843 }
else if(number == fInputEvent->GetRunNumber()){
856 AliErrorStream() <<
"Could not extract file number from path " << strPthard << std::endl;
858 AliInfoStream() <<
"Auto-detecting pt-hard bin " << pthard << std::endl;
862 std::unique_ptr<TFile> fxsec(TFile::Open(Form(
"%s%s",file.Data(),
"pyxsec.root")));
866 fxsec = std::unique_ptr<TFile>(TFile::Open(Form(
"%s%s",file.Data(),
"pyxsec_hists.root")));
873 TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
874 if (!key)
return kFALSE;
876 if (!list)
return kFALSE;
877 TProfile *xSecHist =
static_cast<TProfile*
>(list->FindObject(
"h1Xsec"));
879 if(!xSecHist->GetEntries()) {
881 AliErrorStream() <<
"No cross section information available in file " << fxsec->GetName() <<
" - fall back to cross section in PYTHIA header" << std::endl;
885 fXsec = xSecHist->GetBinContent(1);
888 fTrials = ((TH1F*)list->FindObject(
"h1Trials"))->GetBinContent(1);
891 TTree *xtree = (
TTree*)fxsec->Get(
"Xsection");
892 if (!xtree)
return kFALSE;
895 xtree->SetBranchAddress(
"xsection",&xsection);
896 xtree->SetBranchAddress(
"ntrials",&ntrials);
922 TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
924 AliError(Form(
"%s - UserNotify: No current tree!",GetName()));
932 TFile *curfile = tree->GetCurrentFile();
934 AliError(Form(
"%s - UserNotify: No current file!",GetName()));
939 if (chain) tree = chain->GetTree();
945 if ((pthardbin < 0) || (pthardbin >
fNPtHardBins-1)) pthardbin = 0;
948 AliDebugStream(1) <<
"Using cross section from file pyxsec.root" << std::endl;
965 AliError(Form(
"%s: Could not retrieve parton infos! %s!", GetName(),
fPythiaInfoName.Data()));
984 AliError(Form(
"%s: Could not retrieve event! Returning!", GetName()));
991 fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->
GetRunNumber());
993 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()));
1005 AliWarning(
"Could not set event plane limits because EMCal geometry was not loaded!");
1018 AliError(Form(
"%s: Could not retrieve first track branch!", GetName()));
1032 AliError(Form(
"%s: Could not retrieve first cluster branch!", GetName()));
1040 AliError(Form(
"%s: Could not retrieve cells %s!", GetName(),
fCaloCellsName.Data()));
1048 AliError(Form(
"%s: Could not retrieve calo triggers %s!", GetName(),
fCaloTriggersName.Data()));
1077 const AliESDRun *run = esd->GetESDRun();
1078 TString beamType = run->GetBeamType();
1079 if (beamType ==
"p-p")
1081 else if (beamType ==
"A-A")
1083 else if (beamType ==
"p-A")
1088 Int_t runNumber = InputEvent()->GetRunNumber();
1090 if ((runNumber >= 136833 && runNumber <= 139517) ||
1091 (runNumber >= 167693 && runNumber <= 170593) ||
1092 (runNumber >= 244824 && runNumber <= 246994)) {
1094 }
else if ((runNumber >= 188356 && runNumber <= 188366) ||
1095 (runNumber >= 195164 && runNumber <= 197388) ||
1096 (runNumber >= 265015 && runNumber <= 267166)) {
1124 AliEMCALTriggerPatchInfo *patch;
1125 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
1127 if (patch->IsGammaHigh()) nG1++;
1128 if (patch->IsGammaLow()) nG2++;
1129 if (patch->IsJetHigh()) nJ1++;
1130 if (patch->IsJetLow()) nJ2++;
1131 if (patch->IsLevel0()) nL0++;
1134 AliDebug(2,
"Patch summary: ");
1135 AliDebug(2, Form(
"Number of patches: %d", nPatch));
1136 AliDebug(2, Form(
"Jet: low[%d], high[%d]" ,nJ2, nJ1));
1137 AliDebug(2, Form(
"Gamma: low[%d], high[%d]" ,nG2, nG1));
1140 if (nL0>0) SETBIT(triggers,
kL0);
1141 if (nG1>0) SETBIT(triggers,
kG1);
1142 if (nG2>0) SETBIT(triggers,
kG2);
1143 if (nJ1>0) SETBIT(triggers,
kJ1);
1144 if (nJ2>0) SETBIT(triggers,
kJ2);
1158 AliWarning(Form(
"%s: Requesting undefined trigger type!", GetName()));
1195 res = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1199 res = ((AliVAODHeader*)aev->GetHeader())->GetOfflineTrigger();
1212 fired = eev->GetFiredTriggerClasses();
1216 fired = aev->GetFiredTriggerClasses();
1219 if (!fired.Contains(
"-B-")) {
1224 std::unique_ptr<TObjArray> arr(
fTrigClass.Tokenize(
"|"));
1230 for (
Int_t i=0;i<arr->GetEntriesFast();++i) {
1236 TString objStr = obj->GetName();
1238 (objStr.Contains(
"J1") || objStr.Contains(
"J2") || objStr.Contains(
"G1") || objStr.Contains(
"G2"))) {
1243 if(objStr.Contains(
"G")) {
1247 if(objStr.Contains(trigType2) && fired.Contains(trigType2.Data())) {
1251 else if(objStr.Contains(trigType1) && fired.Contains(trigType1.Data()) && !fired.Contains(trigType2.Data())) {
1259 if (fired.Contains(obj->GetName())) {
1279 if (fCent<fMinCent || fCent>
fMaxCent) {
1315 if (vz < fMinVz || vz >
fMaxVz) {
1322 Double_t dvertex = TMath::Abs(vz-vzSPD);
1332 Bool_t trackInEmcalOk = kFALSE;
1334 for (
Int_t i = 0; i < ntracks; i++) {
1339 Double_t phiMin =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
1340 Double_t phiMax =
fGeom->GetArm1PhiMax() * TMath::DegToRad();
1341 Int_t runNumber = InputEvent()->GetRunNumber();
1342 if (runNumber>=177295 && runNumber<=197470) {
1344 phiMax = TMath::Pi();
1347 if (track->Eta() <
fGeom->GetArm1EtaMin() || track->Eta() >
fGeom->GetArm1EtaMax() || track->Phi() < phiMin || track->Phi() > phiMax)
1350 trackInEmcalOk = kTRUE;
1354 if (!trackInEmcalOk) {
1361 Int_t nTracksAcc = 0;
1363 for (
Int_t i = 0; i < ntracks; i++) {
1413 AliDebug(1,Form(
"Njets: %d, pT Hard %f",nTriggerJets,
fPtHard));
1416 for (
Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
1419 jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
1421 AliDebug(1,Form(
"jet %d; pycell jet pT %f",ijet, jet.Pt()));
1425 AliInfo(Form(
"Reject jet event with : pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n",
fPtHard, jet.Pt(),
fPtHardAndJetPtFactor));
1435 if ((
Bool_t)mccluscont) {
1436 for (
auto cluster : mccluscont->all()) {
1437 Float_t ecluster = cluster->E();
1451 if ((
Bool_t)mcpartcont) {
1452 for (
auto mctrack : mcpartcont->
all()) {
1453 Float_t trackpt = mctrack->Pt();
1476 TClonesArray *arr = 0;
1478 if (!sname.IsNull()) {
1479 arr =
dynamic_cast<TClonesArray*
>(InputEvent()->FindListObject(sname));
1481 AliWarning(Form(
"%s: Could not retrieve array with name %s!", GetName(), name));
1491 TString objname(arr->GetClass()->GetName());
1492 TClass cls(objname);
1493 if (!cls.InheritsFrom(clname)) {
1494 AliWarning(Form(
"%s: Objects of type %s in %s are not inherited from %s!",
1495 GetName(), cls.GetName(), name, clname));
1521 const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1527 const AliVVertex *vertSPD = InputEvent()->GetPrimaryVertexSPD();
1537 AliMultSelection *MultSelection =
static_cast<AliMultSelection*
>(InputEvent()->FindListObject(
"MultSelection"));
1538 if (MultSelection) {
1539 fCent = MultSelection->GetMultiplicityPercentile(
fCentEst.Data());
1542 AliWarning(Form(
"%s: Could not retrieve centrality information! Assuming 99", GetName()));
1546 AliCentrality *aliCent = InputEvent()->GetCentrality();
1551 AliWarning(Form(
"%s: Could not retrieve centrality information! Assuming 99", GetName()));
1561 AliWarning(Form(
"%s: Negative centrality: %f. Assuming 99", GetName(),
fCent));
1570 else if (
fCent > 90) {
1575 AliWarning(Form(
"%s: Negative centrality: %f. Assuming 99", GetName(),
fCent));
1588 AliWarning(Form(
"%s: fCentBin too large: cent = %f fCentBin = %d. Assuming 99", GetName(),
fCent,
fCentBin));
1593 AliEventplane *aliEP = InputEvent()->GetEventplane();
1595 fEPV0 = aliEP->GetEventplane(
"V0" ,InputEvent());
1596 fEPV0A = aliEP->GetEventplane(
"V0A",InputEvent());
1597 fEPV0C = aliEP->GetEventplane(
"V0C",InputEvent());
1599 AliWarning(Form(
"%s: Could not retrieve event plane information!", GetName()));
1609 fPythiaHeader =
dynamic_cast<AliGenPythiaEventHeader*
>(MCEvent()->GenEventHeader());
1612 AliAODMCHeader* aodMCH =
dynamic_cast<AliAODMCHeader*
>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
1615 for (
UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
1616 fPythiaHeader =
dynamic_cast<AliGenPythiaEventHeader*
>(aodMCH->GetCocktailHeader(i));
1644 fHerwigHeader =
dynamic_cast<AliGenHerwigEventHeader*
>(MCEvent()->GenEventHeader());
1648 AliAODMCHeader* aodMCH =
dynamic_cast<AliAODMCHeader*
>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
1651 for (
UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
1652 fHerwigHeader =
dynamic_cast<AliGenHerwigEventHeader*
>(aodMCH->GetCocktailHeader(i));
1680 AliEmcalContainer* cont = 0;
1683 while ((cont = static_cast<AliEmcalContainer*>(nextPartColl()))) cont->NextEvent();
1686 while ((cont = static_cast<AliParticleContainer*>(nextClusColl()))) cont->NextEvent();
1700 if (
TString(n).IsNull())
return 0;
1718 if (
TString(n).IsNull())
return 0;
1736 if (
TString(n).IsNull())
return 0;
1754 if (
TString(n).IsNull())
return 0;
1818 AliError(Form(
"%s: Particle container %d not found",GetName(),i));
1821 TString contName = cont->GetArrayName();
1822 return cont->GetArray();
1834 AliError(Form(
"%s:Cluster container %d not found",GetName(),i));
1837 return cont->GetArray();
1852 AliError(Form(
"%s: Particle container %d not found",GetName(),c));
1871 AliError(Form(
"%s: Cluster container %d not found",GetName(),c));
1888 AliError(Form(
"%s: Particle container %d not found",GetName(),i));
1891 return cont->GetNEntries();
1904 AliError(Form(
"%s: Cluster container %d not found",GetName(),i));
1907 return cont->GetNEntries();
1925 AliError(Form(
"%s: fTriggerPatchInfo not available",GetName()));
1933 AliEMCALTriggerPatchInfo *patch(NULL), *selected(NULL);
1934 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
1937 if (patch->IsMainTrigger()) {
1938 if(doSimpleOffline){
1939 if(patch->IsOfflineSimple()){
1943 if(patch->IsLevel0()) selected = patch;
1946 if(patch->IsJetHighSimple() || patch->IsJetLowSimple()){
1947 if(!selected) selected = patch;
1948 else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1952 if(patch->IsGammaHighSimple() || patch->IsGammaLowSimple()){
1953 if(!selected) selected = patch;
1954 else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1958 AliError(
"Untreated case: Main Patch is recalculated; should be in 'else' branch");
1964 if(patch->IsLevel0()) selected = patch;
1967 if(patch->IsJetHigh() || patch->IsJetLow()){
1968 if(!selected) selected = patch;
1969 else if (patch->GetADCAmp() > selected->GetADCAmp())
1974 if(patch->IsGammaHigh() || patch->IsGammaLow()){
1975 if(!selected) selected = patch;
1976 else if (patch->GetADCAmp() > selected->GetADCAmp())
1981 AliError(
"Untreated case: Main Patch is recalculated; should be in 'else' branch");
1987 if (doSimpleOffline && patch->IsOfflineSimple()) {
1988 if(!selected) selected = patch;
1989 else if (patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp())
1992 else if (!doSimpleOffline && !patch->IsOfflineSimple()) {
1993 if(!selected) selected = patch;
1994 else if (patch->GetADCAmp() > selected->GetADCAmp())
2009 if (!(InputEvent()->FindListObject(obj->GetName()))) {
2010 InputEvent()->AddObject(obj);
2014 AliFatal(Form(
"%s: Container with name %s already present. Aborting", GetName(), obj->GetName()));
2030 AliWarning(Form(
"%s - AliAnalysisTaskEmcal::IsTrackInEmcalAcceptance - Geometry is not available!", GetName()));
2037 if (part->Phi() > minPhi && part->Phi() < maxPhi) {
2047 axis->SetBinLabel(1,
"NullObject");
2048 axis->SetBinLabel(2,
"Pt");
2049 axis->SetBinLabel(3,
"Acceptance");
2050 axis->SetBinLabel(4,
"MCLabel");
2051 axis->SetBinLabel(5,
"BitMap");
2052 axis->SetBinLabel(6,
"HF cut");
2053 axis->SetBinLabel(7,
"Bit6");
2054 axis->SetBinLabel(8,
"NotHybridTrack");
2055 axis->SetBinLabel(9,
"MCFlag");
2056 axis->SetBinLabel(10,
"MCGenerator");
2057 axis->SetBinLabel(11,
"ChargeCut");
2058 axis->SetBinLabel(12,
"MinDistanceTPCSectorEdge");
2059 axis->SetBinLabel(13,
"Bit12");
2060 axis->SetBinLabel(14,
"IsEMCal");
2061 axis->SetBinLabel(15,
"Time");
2062 axis->SetBinLabel(16,
"Energy");
2063 axis->SetBinLabel(17,
"ExoticCut");
2064 axis->SetBinLabel(18,
"Bit17");
2065 axis->SetBinLabel(19,
"Area");
2066 axis->SetBinLabel(20,
"AreaEmc");
2067 axis->SetBinLabel(21,
"ZLeadingCh");
2068 axis->SetBinLabel(22,
"ZLeadingEmc");
2069 axis->SetBinLabel(23,
"NEF");
2070 axis->SetBinLabel(24,
"MinLeadPt");
2071 axis->SetBinLabel(25,
"MaxTrackPt");
2072 axis->SetBinLabel(26,
"MaxClusterPt");
2073 axis->SetBinLabel(27,
"Flavour");
2074 axis->SetBinLabel(28,
"TagStatus");
2075 axis->SetBinLabel(29,
"MinNConstituents");
2076 axis->SetBinLabel(30,
"Bit29");
2077 axis->SetBinLabel(31,
"Bit30");
2078 axis->SetBinLabel(32,
"Bit31");
2089 TVector3 vect1(part1->Px(), part1->Py(), part1->Pz());
2090 TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
2091 Double_t z = (vect1 * vect2) / (vect2 * vect2);
2103 TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
2104 Double_t z = (vect1 * vect2) / (vect2 * vect2);
2123 Double_t veta = t->GetTrackEtaOnEMCal();
2124 Double_t vphi = t->GetTrackPhiOnEMCal();
2127 v->GetPosition(pos);
2132 phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
2143 if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
2145 else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
2147 else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
2166 if (aodTrack->TestFilterBit(filterBit1)) {
2169 else if (aodTrack->TestFilterBit(filterBit2)) {
2170 if ((aodTrack->GetStatus()&AliVTrack::kITSrefit)!=0) {
2194 AliStack* stack = mcEvent->Stack();
2196 const Int_t nprim = stack->GetNprimary();
2198 if (nprim < 8)
return;
2200 TParticle *part6 = stack->Particle(6);
2201 TParticle *part7 = stack->Particle(7);
2209 AliGenPythiaEventHeader *pythiaGenHeader =
dynamic_cast<AliGenPythiaEventHeader*
>(mcEvent->GenEventHeader());
2210 if(pythiaGenHeader){
2223 ::Error(
"AddAODHandler",
"No analysis manager to connect to.");
2227 AliAODInputHandler* aodHandler =
new AliAODInputHandler();
2229 AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
2230 if (inputHandler && (inputHandler->IsA() == AliMultiInputEventHandler::Class())) {
2231 AliMultiInputEventHandler *multiInputHandler=(AliMultiInputEventHandler*)inputHandler;
2232 multiInputHandler->AddInputEventHandler(aodHandler);
2235 if (!inputHandler) {
2236 mgr->SetInputEventHandler(aodHandler);
2239 ::Error(
"AddAODHandler",
"inputHandler is NOT null. AOD handler was NOT added !!!");
2255 ::Error(
"AddESDHandler",
"No analysis manager to connect to.");
2259 AliESDInputHandler *esdHandler =
new AliESDInputHandler();
2261 AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
2262 if (inputHandler && (inputHandler->IsA() == AliMultiInputEventHandler::Class())) {
2263 AliMultiInputEventHandler *multiInputHandler=(AliMultiInputEventHandler*)inputHandler;
2264 multiInputHandler->AddInputEventHandler(esdHandler);
2267 if (!inputHandler) {
2268 mgr->SetInputEventHandler(esdHandler);
2271 ::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
void SetArray(const AliVEvent *event)
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 -hard bin scaling in merging.
void SetPartonFlag7(Int_t flag7)
Container with name, TClonesArray and cuts for particles.
Bool_t fUseXsecFromHeader
! Use cross section from header instead of pyxsec.root (purely transient)
Double_t fPtHard
!event -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
Int_t fNPtHardBins
Number of -hard bins in the dataset.
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 -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
void SetArray(const AliVEvent *event)
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.
TArrayI fPtHardBinning
-hard binning
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