31 #include <TClonesArray.h> 34 #include <TObjString.h> 43 #include "AliAnalysisUtils.h" 44 #include "AliAODEvent.h" 45 #include "AliAODMCHeader.h" 46 #include "AliAODTrack.h" 47 #include "AliAnalysisManager.h" 48 #include "AliCentrality.h" 50 #include "AliEMCALGeometry.h" 52 #include "AliEMCALTriggerPatchInfo.h" 53 #include "AliESDEvent.h" 54 #include "AliAODInputHandler.h" 55 #include "AliESDInputHandler.h" 56 #include "AliEventplane.h" 57 #include "AliGenPythiaEventHeader.h" 58 #include "AliGenHerwigEventHeader.h" 59 #include "AliInputEventHandler.h" 61 #include "AliMCEvent.h" 62 #include "AliMCParticle.h" 63 #include "AliMultiInputEventHandler.h" 64 #include "AliMultSelection.h" 66 #include "AliVCaloTrigger.h" 67 #include "AliVCluster.h" 68 #include "AliVEventHandler.h" 69 #include "AliVParticle.h" 70 #include "AliNanoAODHeader.h" 83 fGeneralHistograms(kFALSE),
84 fLocalInitialized(kFALSE),
89 fCaloTriggerPatchInfoName(),
98 fUseAliAnaUtils(kFALSE),
99 fRejectPileup(kFALSE),
100 fTklVsClusSPDCut(kFALSE),
101 fOffTrigger(AliVEvent::kAny),
103 fMinBiasRefTrigger(
"CINT7-B-NOPF-ALLNOTRD"),
104 fTriggerTypeSel(kND),
108 fMinPtTrackInEmcal(0),
109 fEventPlaneVsEmcal(-1),
110 fMinEventPlane(-1e6),
116 fGetPtHardBinFromName(kTRUE),
117 fSelectPtHardBin(-999),
121 fNeedEmcalGeom(kTRUE),
122 fParticleCollArray(),
125 fEMCalTriggerMode(kOverlapWithLowThreshold),
126 fUseNewCentralityEstimation(kFALSE),
127 fGeneratePythiaInfoObject(kFALSE),
128 fUsePtHardBinScaling(kFALSE),
129 fUseXsecFromHeader(kFALSE),
130 fMCRejectFilter(kFALSE),
131 fCountDownscaleCorrectedEvents(kFALSE),
132 fUseBuiltinEventSelection(kFALSE),
133 fPtHardAndJetPtFactor(0.),
134 fPtHardAndClusterPtFactor(0.),
135 fPtHardAndTrackPtFactor(0.),
137 fAliEventCuts(kFALSE),
158 fPtHardBinGlobal(-1),
159 fPtHardInitialized(false),
169 fHistXsectionAfterSel(
nullptr),
175 fHistPtHardCorrGlobal(
nullptr),
182 fHistTriggerClassesCorr(
nullptr)
309 fAliEventCuts.OverrideAutomaticTriggerSelection(AliVEvent::kAny,
true);
312 DefineOutput(1, AliEmcalList::Class());
327 else AliError(Form(
"%s in SetClusPtCut(...): container %d not found",GetName(),c));
334 else AliError(Form(
"%s in SetClusTimeCut(...): container %d not found",GetName(),c));
341 else AliError(Form(
"%s in SetTrackPtCut(...): container %d not found",GetName(),c));
350 else AliError(Form(
"%s in SetTrackPtCut(...): container %d not found",GetName(),c));
357 else AliError(Form(
"%s in SetTrackPhiLimits(...): container %d not found",GetName(),c));
364 AliVEventHandler *evhand = mgr->GetInputEventHandler();
366 if (evhand->InheritsFrom(
"AliESDInputHandler")) {
374 AliError(
"Event handler not found!");
378 AliError(
"Analysis manager not found!");
413 fHistTrials->GetXaxis()->SetTitle(
"p_{T} hard bin");
418 fHistEvents->GetXaxis()->SetTitle(
"p_{T} hard bin");
428 Bool_t binningAvailable =
false;
430 AliInfoStream() <<
"Using custom pt-hard binning" << std::endl;
432 else AliErrorStream() <<
"Pt-hard binning (" <<
fPtHardBinning.GetSize() -1 <<
") does not match the amount of bins (" <<
fNPtHardBins <<
")" << std::endl;
436 AliInfoStream() <<
"11 pt-hard bins - fall back to default binning for bin labels" << std::endl;
437 const Int_t kDefaultPtHardBinning[12] = {0,5,11,21,36,57, 84,117,152,191,234,1000000};
440 binningAvailable =
true;
442 AliErrorStream() <<
"No default binning available for " <<
fNPtHardBins <<
" pt-hard bins - bin labels will not be set." << std::endl;
446 if(binningAvailable){
457 AliErrorStream() <<
"No suitable binning available - skipping bin labels" << std::endl;
462 fHistPtHard->GetXaxis()->SetTitle(
"p_{T,hard} (GeV/c)");
483 fHistZVertex =
new TH1F(
"fHistZVertex",
"Z vertex position", 60, -30, 30);
489 fHistCentrality =
new TH1F(
"fHistCentrality",
"Event centrality distribution", 200, 0, 100);
494 fHistEventPlane =
new TH1F(
"fHistEventPlane",
"Event plane", 120, -TMath::Pi(), TMath::Pi());
502 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2) 529 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2) 538 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2) 580 std::unique_ptr<TObjArray> triggerClasses(InputEvent()->GetFiredTriggerClasses().Tokenize(
" "));
581 TObjString* triggerClass(
nullptr);
582 for(
auto trg : *triggerClasses){
583 triggerClass =
static_cast<TObjString*
>(trg);
629 AliDebugStream(1) <<
"Fallback to cross section from pythia header required" << std::endl;
675 AliWarning(
"AliAnalysisTaskEmcal::AcceptCluster method is deprecated. Please use GetCusterContainer(c)->AcceptCluster(clus).");
677 if (!clus)
return kFALSE;
681 AliError(Form(
"%s:Container %d not found",GetName(),c));
684 UInt_t rejectionReason = 0;
690 AliWarning(
"AliAnalysisTaskEmcal::AcceptTrack method is deprecated. Please use GetParticleContainer(c)->AcceptParticle(clus).");
692 if (!track)
return kFALSE;
696 AliError(Form(
"%s:Container %d not found",GetName(),c));
700 UInt_t rejectionReason = 0;
712 std::unique_ptr<TObjArray> walk(file.Tokenize(
"/"));
714 TString &tok =
static_cast<TObjString *
>(t)->String();
715 if(tok.Contains(
".zip")){
717 Int_t pos = archivetype.Index(
".zip");
718 archivetype.Replace(pos, archivetype.Length() - pos,
"");
721 if(archivetype.Length()){
722 AliDebugStream(1) <<
"Auto-detected archive type " << archivetype << std::endl;
723 Ssiz_t pos1 = file.Index(archivetype,archivetype.Length(),0,TString::kExact);
724 Ssiz_t pos = file.Index(
"#",1,pos1,TString::kExact);
725 Ssiz_t pos2 = file.Index(
".root",5,TString::kExact);
726 file.Replace(pos+1,pos2-pos1,
"");
729 file.ReplaceAll(
gSystem->BaseName(file.Data()),
"");
731 AliDebugStream(1) <<
"File name: " << file << std::endl;
736 if(file.Contains(
"__alice")){
738 Int_t pos = tmp.Index(
"__alice");
739 tmp.Replace(0, pos,
"");
740 tmp.ReplaceAll(
"__",
"/");
743 std::unique_ptr<TObjArray> toks(tmp.Tokenize(
"/"));
744 TString tag =
"_" + archivetype;
746 TString &path =
static_cast<TObjString *
>(t)->String();
747 if(path.Contains(tag)){
748 Int_t posTag = path.Index(tag);
749 path.Replace(posTag, path.Length() - posTag,
"");
751 virtualFileName +=
"/" + path;
754 virtualFileName =
file;
757 AliDebugStream(1) <<
"Physical file name " << file <<
", virtual file name " << virtualFileName << std::endl;
760 TString strPthard(virtualFileName);
783 bool binfound =
false;
784 std::unique_ptr<TObjArray> tokens(strPthard.Tokenize(
"/"));
785 for(
auto t : *tokens) {
786 TString &tok =
static_cast<TObjString *
>(t)->String();
788 Int_t number = tok.Atoi();
789 if(number > 2000 && number < 3000){
792 }
else if(number == fInputHandler->GetEvent()->GetRunNumber()){
806 AliErrorStream() <<
"Could not extract file number from path " << strPthard << std::endl;
808 AliInfoStream() <<
"Auto-detecting pt-hard bin " << pthard << std::endl;
811 AliInfoStream() <<
"File: " << file << std::endl;
814 std::unique_ptr<TFile> fxsec(TFile::Open(Form(
"%s%s",file.Data(),
"pyxsec.root")));
818 fxsec = std::unique_ptr<TFile>(TFile::Open(Form(
"%s%s",file.Data(),
"pyxsec_hists.root")));
820 AliErrorStream() <<
"Failed reading cross section from file " << file << std::endl;
826 TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
827 if (!key)
return kFALSE;
828 TList *list =
dynamic_cast<TList*
>(key->ReadObj());
829 if (!list)
return kFALSE;
830 TProfile *xSecHist =
static_cast<TProfile*
>(list->FindObject(
"h1Xsec"));
832 if(!xSecHist->GetEntries()) {
834 AliErrorStream() <<
"No cross section information available in file " << fxsec->GetName() <<
" - fall back to cross section in PYTHIA header" << std::endl;
838 fXsec = xSecHist->GetBinContent(1);
839 if(!fXsec) AliErrorStream() << GetName() <<
": Cross section 0 for file " << file << std::endl;
842 fTrials = ((TH1F*)list->FindObject(
"h1Trials"))->GetBinContent(1);
845 TTree *xtree = (
TTree*)fxsec->Get(
"Xsection");
846 if (!xtree)
return kFALSE;
849 xtree->SetBranchAddress(
"xsection",&xsection);
850 xtree->SetBranchAddress(
"ntrials",&ntrials);
869 AliInfoStream() <<
"FileChanged called for run " << InputEvent()->GetRunNumber() << std::endl;
871 TTree *
tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
873 AliErrorStream() << GetName() <<
" - FileChanged: No current tree!" << std::endl;
879 Int_t pthardbin = -1;
881 TFile *curfile = tree->GetCurrentFile();
883 AliErrorStream() << GetName() <<
" - FileChanged: No current file!" << std::endl;
888 if (chain) tree = chain->GetTree();
905 AliErrorStream() << GetName() <<
": Invalid global pt-hard bin " << pthardbin <<
" detected" << std::endl;
910 AliDebugStream(1) <<
"Using cross section from file pyxsec.root" << std::endl;
923 AliError(Form(
"%s: Could not retrieve parton infos! %s!", GetName(),
fPythiaInfoName.Data()));
932 AliError(Form(
"%s: Could not retrieve event! Returning!", GetName()));
939 fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->
GetRunNumber());
941 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()));
953 AliWarning(
"Could not set event plane limits because EMCal geometry was not loaded!");
966 AliError(Form(
"%s: Could not retrieve first track branch!", GetName()));
980 AliError(Form(
"%s: Could not retrieve first cluster branch!", GetName()));
988 AliError(Form(
"%s: Could not retrieve cells %s!", GetName(),
fCaloCellsName.Data()));
996 AliError(Form(
"%s: Could not retrieve calo triggers %s!", GetName(),
fCaloTriggersName.Data()));
1020 const AliESDRun *run = esd->GetESDRun();
1021 TString beamType = run->GetBeamType();
1022 if (beamType ==
"p-p")
1024 else if (beamType ==
"A-A")
1026 else if (beamType ==
"p-A")
1031 Int_t runNumber = InputEvent()->GetRunNumber();
1033 if ((runNumber >= 136833 && runNumber <= 139517) ||
1034 (runNumber >= 167693 && runNumber <= 170593) ||
1035 (runNumber >= 244824 && runNumber <= 246994) ||
1036 (runNumber >= 295581 && runNumber <= 297624)) {
1038 }
else if ((runNumber >= 188356 && runNumber <= 188366) ||
1039 (runNumber >= 195164 && runNumber <= 197388) ||
1040 (runNumber >= 265015 && runNumber <= 267166)) {
1062 AliEMCALTriggerPatchInfo *patch;
1063 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
1065 if (patch->IsGammaHigh()) nG1++;
1066 if (patch->IsGammaLow()) nG2++;
1067 if (patch->IsJetHigh()) nJ1++;
1068 if (patch->IsJetLow()) nJ2++;
1069 if (patch->IsLevel0()) nL0++;
1072 AliDebug(2,
"Patch summary: ");
1073 AliDebug(2, Form(
"Number of patches: %d", nPatch));
1074 AliDebug(2, Form(
"Jet: low[%d], high[%d]" ,nJ2, nJ1));
1075 AliDebug(2, Form(
"Gamma: low[%d], high[%d]" ,nG2, nG1));
1078 if (nL0>0) SETBIT(triggers,
kL0);
1079 if (nG1>0) SETBIT(triggers,
kG1);
1080 if (nG2>0) SETBIT(triggers,
kG2);
1081 if (nJ1>0) SETBIT(triggers,
kJ1);
1082 if (nJ2>0) SETBIT(triggers,
kJ2);
1090 AliWarning(Form(
"%s: Requesting undefined trigger type!", GetName()));
1109 AliDebugStream(3) <<
"Using default event selection" << std::endl;
1114 res = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1118 res = ((AliVAODHeader*)aev->GetHeader())->GetOfflineTrigger();
1140 if (fCent<fMinCent || fCent>
fMaxCent) {
1176 if (vz < fMinVz || vz >
fMaxVz) {
1183 Double_t dvertex = TMath::Abs(vz-vzSPD);
1193 Bool_t trackInEmcalOk = kFALSE;
1195 for (
Int_t i = 0; i < ntracks; i++) {
1202 Int_t runNumber = InputEvent()->GetRunNumber();
1203 if (runNumber>=177295 && runNumber<=197470) {
1205 phiMax = TMath::Pi();
1208 if (track->Eta() <
fGeom->GetArm1EtaMin() || track->Eta() >
fGeom->GetArm1EtaMax() || track->Phi() < phiMin || track->Phi() >
phiMax)
1211 trackInEmcalOk = kTRUE;
1215 if (!trackInEmcalOk) {
1222 Int_t nTracksAcc = 0;
1224 for (
Int_t i = 0; i < ntracks; i++) {
1265 AliDebugStream(3) <<
"Using default trigger selection" << std::endl;
1267 TString fired = InputEvent()->GetFiredTriggerClasses();
1268 if (!fired.Contains(
"-B-"))
return kFALSE;
1270 std::unique_ptr<TObjArray> arr(
fTrigClass.Tokenize(
"|"));
1271 if (!arr)
return kFALSE;
1273 for (
Int_t i=0;i<arr->GetEntriesFast();++i) {
1278 TString objStr = obj->GetName();
1280 (objStr.Contains(
"J1") || objStr.Contains(
"J2") || objStr.Contains(
"G1") || objStr.Contains(
"G2"))) {
1285 if(objStr.Contains(
"G")) {
1289 if(objStr.Contains(trigType2) && fired.Contains(trigType2.Data())) {
1292 }
else if(objStr.Contains(trigType1) && fired.Contains(trigType1.Data()) && !fired.Contains(trigType2.Data())) {
1300 if (fired.Contains(obj->GetName())) {
1306 if (!match)
return kFALSE;
1314 AliDebugStream(2) <<
"Using custom outlier rejection" << std::endl;
1322 AliDebug(2,Form(
"Njets: %d, pT Hard %f",nTriggerJets,
fPtHard));
1325 for (
Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
1328 jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
1330 AliDebug(2,Form(
"jet %d; pycell jet pT %f",ijet, jet.Pt()));
1334 AliInfo(Form(
"Reject jet event with : pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n",
fPtHard, jet.Pt(),
fPtHardAndJetPtFactor));
1344 if ((
Bool_t)mccluscont) {
1345 for (
auto cluster : mccluscont->all()) {
1346 Float_t ecluster = cluster->E();
1360 if ((
Bool_t)mcpartcont) {
1361 for (
auto mctrack : mcpartcont->
all()) {
1362 Float_t trackpt = mctrack->Pt();
1377 TClonesArray *arr = 0;
1379 if (!sname.IsNull()) {
1380 arr =
dynamic_cast<TClonesArray*
>(InputEvent()->FindListObject(sname));
1382 AliWarning(Form(
"%s: Could not retrieve array with name %s!", GetName(), name));
1392 TString objname(arr->GetClass()->GetName());
1393 TClass cls(objname);
1394 if (!cls.InheritsFrom(clname)) {
1395 AliWarning(Form(
"%s: Objects of type %s in %s are not inherited from %s!",
1396 GetName(), cls.GetName(), name, clname));
1418 const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1424 const AliVVertex *vertSPD = InputEvent()->GetPrimaryVertexSPD();
1431 TObject * header = InputEvent()->GetHeader();
1434 if (header->InheritsFrom(
"AliNanoAODStorage")){
1435 AliNanoAODHeader *nanoHead = (AliNanoAODHeader*)header;
1438 AliMultSelection *MultSelection =
static_cast<AliMultSelection*
>(InputEvent()->FindListObject(
"MultSelection"));
1439 if (MultSelection) {
1440 fCent = MultSelection->GetMultiplicityPercentile(
fCentEst.Data());
1443 AliWarning(Form(
"%s: Could not retrieve centrality information! Assuming 99", GetName()));
1448 if (header->InheritsFrom(
"AliNanoAODStorage")){
1449 AliNanoAODHeader *nanoHead = (AliNanoAODHeader*)header;
1452 AliCentrality *aliCent = InputEvent()->GetCentrality();
1457 AliWarning(Form(
"%s: Could not retrieve centrality information! Assuming 99", GetName()));
1468 AliWarning(Form(
"%s: Negative centrality: %f. Assuming 99", GetName(),
fCent));
1477 else if (
fCent > 90) {
1482 AliWarning(Form(
"%s: Negative centrality: %f. Assuming 99", GetName(),
fCent));
1495 AliWarning(Form(
"%s: fCentBin too large: cent = %f fCentBin = %d. Assuming 99", GetName(),
fCent,
fCentBin));
1499 if (header->InheritsFrom(
"AliNanoAODStorage")){
1500 AliNanoAODHeader *nanoHead = (AliNanoAODHeader*)header;
1501 fEPV0=nanoHead->GetVar(nanoHead->GetVarIndex(
"cstEvPlaneV0"));
1502 fEPV0A=nanoHead->GetVar(nanoHead->GetVarIndex(
"cstEvPlaneV0A"));
1503 fEPV0C=nanoHead->GetVar(nanoHead->GetVarIndex(
"cstEvPlaneV0C"));
1505 AliEventplane *aliEP = InputEvent()->GetEventplane();
1507 fEPV0 = aliEP->GetEventplane(
"V0" ,InputEvent());
1508 fEPV0A = aliEP->GetEventplane(
"V0A",InputEvent());
1509 fEPV0C = aliEP->GetEventplane(
"V0C",InputEvent());
1511 AliWarning(Form(
"%s: Could not retrieve event plane information!", GetName()));
1522 fPythiaHeader =
dynamic_cast<AliGenPythiaEventHeader*
>(MCEvent()->GenEventHeader());
1525 AliAODMCHeader* aodMCH =
dynamic_cast<AliAODMCHeader*
>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
1528 for (
UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
1529 fPythiaHeader =
dynamic_cast<AliGenPythiaEventHeader*
>(aodMCH->GetCocktailHeader(i));
1554 AliErrorStream() << GetName() <<
": Mismatch in pt-hard bin determination. Local: " <<
fPtHardBin <<
", Global: " <<
fPtHardBinGlobal << std::endl;
1564 fHerwigHeader =
dynamic_cast<AliGenHerwigEventHeader*
>(MCEvent()->GenEventHeader());
1568 AliAODMCHeader* aodMCH =
dynamic_cast<AliAODMCHeader*
>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
1571 for (
UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
1572 fHerwigHeader =
dynamic_cast<AliGenHerwigEventHeader*
>(aodMCH->GetCocktailHeader(i));
1603 while ((cont = static_cast<AliEmcalContainer*>(nextPartColl()))){
1608 while ((cont = static_cast<AliParticleContainer*>(nextClusColl()))){
1617 if (
TString(n).IsNull())
return 0;
1628 if (
TString(n).IsNull())
return 0;
1639 if (
TString(n).IsNull())
return 0;
1650 if (
TString(n).IsNull())
return 0;
1689 AliError(Form(
"%s: Particle container %d not found",GetName(),i));
1700 AliError(Form(
"%s:Cluster container %d not found",GetName(),i));
1711 AliError(Form(
"%s: Particle container %d not found",GetName(),c));
1723 AliError(Form(
"%s: Cluster container %d not found",GetName(),c));
1735 AliError(Form(
"%s: Particle container %d not found",GetName(),i));
1745 AliError(Form(
"%s: Cluster container %d not found",GetName(),i));
1755 AliError(Form(
"%s: fTriggerPatchInfo not available",GetName()));
1763 AliEMCALTriggerPatchInfo *patch(NULL), *selected(NULL);
1764 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
1767 if (patch->IsMainTrigger()) {
1768 if(doSimpleOffline){
1769 if(patch->IsOfflineSimple()){
1773 if(patch->IsLevel0()) selected = patch;
1776 if(patch->IsJetHighSimple() || patch->IsJetLowSimple()){
1777 if(!selected) selected = patch;
1778 else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1782 if(patch->IsGammaHighSimple() || patch->IsGammaLowSimple()){
1783 if(!selected) selected = patch;
1784 else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1788 AliError(
"Untreated case: Main Patch is recalculated; should be in 'else' branch");
1794 if(patch->IsLevel0()) selected = patch;
1797 if(patch->IsJetHigh() || patch->IsJetLow()){
1798 if(!selected) selected = patch;
1799 else if (patch->GetADCAmp() > selected->GetADCAmp())
1804 if(patch->IsGammaHigh() || patch->IsGammaLow()){
1805 if(!selected) selected = patch;
1806 else if (patch->GetADCAmp() > selected->GetADCAmp())
1811 AliError(
"Untreated case: Main Patch is recalculated; should be in 'else' branch");
1817 if (doSimpleOffline && patch->IsOfflineSimple()) {
1818 if(!selected) selected = patch;
1819 else if (patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp())
1822 else if (!doSimpleOffline && !patch->IsOfflineSimple()) {
1823 if(!selected) selected = patch;
1824 else if (patch->GetADCAmp() > selected->GetADCAmp())
1834 if (!(InputEvent()->FindListObject(obj->GetName()))) {
1835 InputEvent()->AddObject(obj);
1839 AliFatal(Form(
"%s: Container with name %s already present. Aborting", GetName(), obj->GetName()));
1848 AliWarning(Form(
"%s - AliAnalysisTaskEmcal::IsTrackInEmcalAcceptance - Geometry is not available!", GetName()));
1855 if (part->Phi() > minPhi && part->Phi() < maxPhi) {
1865 axis->SetBinLabel(1,
"NullObject");
1866 axis->SetBinLabel(2,
"Pt");
1867 axis->SetBinLabel(3,
"Acceptance");
1868 axis->SetBinLabel(4,
"MCLabel");
1869 axis->SetBinLabel(5,
"BitMap");
1870 axis->SetBinLabel(6,
"HF cut");
1871 axis->SetBinLabel(7,
"Bit6");
1872 axis->SetBinLabel(8,
"NotHybridTrack");
1873 axis->SetBinLabel(9,
"MCFlag");
1874 axis->SetBinLabel(10,
"MCGenerator");
1875 axis->SetBinLabel(11,
"ChargeCut");
1876 axis->SetBinLabel(12,
"MinDistanceTPCSectorEdge");
1877 axis->SetBinLabel(13,
"Bit12");
1878 axis->SetBinLabel(14,
"IsEMCal");
1879 axis->SetBinLabel(15,
"Time");
1880 axis->SetBinLabel(16,
"Energy");
1881 axis->SetBinLabel(17,
"ExoticCut");
1882 axis->SetBinLabel(18,
"Bit17");
1883 axis->SetBinLabel(19,
"Area");
1884 axis->SetBinLabel(20,
"AreaEmc");
1885 axis->SetBinLabel(21,
"ZLeadingCh");
1886 axis->SetBinLabel(22,
"ZLeadingEmc");
1887 axis->SetBinLabel(23,
"NEF");
1888 axis->SetBinLabel(24,
"MinLeadPt");
1889 axis->SetBinLabel(25,
"MaxTrackPt");
1890 axis->SetBinLabel(26,
"MaxClusterPt");
1891 axis->SetBinLabel(27,
"Flavour");
1892 axis->SetBinLabel(28,
"TagStatus");
1893 axis->SetBinLabel(29,
"MinNConstituents");
1894 axis->SetBinLabel(30,
"Bit29");
1895 axis->SetBinLabel(31,
"Bit30");
1896 axis->SetBinLabel(32,
"Bit31");
1901 TVector3 vect1(part1->Px(), part1->Py(), part1->Pz());
1902 TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1903 Double_t z = (vect1 * vect2) / (vect2 * vect2);
1909 TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1910 Double_t z = (vect1 * vect2) / (vect2 * vect2);
1921 Double_t veta = t->GetTrackEtaOnEMCal();
1922 Double_t vphi = t->GetTrackPhiOnEMCal();
1925 v->GetPosition(pos);
1930 phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
1936 if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
1938 else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1940 else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1950 if (aodTrack->TestFilterBit(filterBit1)) {
1953 else if (aodTrack->TestFilterBit(filterBit2)) {
1954 if ((aodTrack->GetStatus()&AliVTrack::kITSrefit)!=0) {
1974 AliStack*
stack = mcEvent->Stack();
1976 const Int_t nprim = stack->GetNprimary();
1978 if (nprim < 8)
return;
1980 TParticle *part6 = stack->Particle(6);
1981 TParticle *part7 = stack->Particle(7);
1989 AliGenPythiaEventHeader *pythiaGenHeader =
dynamic_cast<AliGenPythiaEventHeader*
>(mcEvent->GenEventHeader());
1990 if(pythiaGenHeader){
1999 ::Error(
"AddAODHandler",
"No analysis manager to connect to.");
2003 AliAODInputHandler* aodHandler =
new AliAODInputHandler();
2005 AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
2006 if (inputHandler && (inputHandler->IsA() == AliMultiInputEventHandler::Class())) {
2007 AliMultiInputEventHandler *multiInputHandler=(AliMultiInputEventHandler*)inputHandler;
2008 multiInputHandler->AddInputEventHandler(aodHandler);
2011 if (!inputHandler) {
2012 mgr->SetInputEventHandler(aodHandler);
2015 ::Error(
"AddAODHandler",
"inputHandler is NOT null. AOD handler was NOT added !!!");
2027 ::Error(
"AddESDHandler",
"No analysis manager to connect to.");
2031 AliESDInputHandler *esdHandler =
new AliESDInputHandler();
2033 AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
2034 if (inputHandler && (inputHandler->IsA() == AliMultiInputEventHandler::Class())) {
2035 AliMultiInputEventHandler *multiInputHandler=(AliMultiInputEventHandler*)inputHandler;
2036 multiInputHandler->AddInputEventHandler(esdHandler);
2039 if (!inputHandler) {
2040 mgr->SetInputEventHandler(esdHandler);
2043 ::Error(
"AddESDHandler",
"inputHandler is NOT null. ESD handler was NOT added !!!");
virtual Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
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)
TH2 * fHistPtHardBinCorr
!Correlation between global and local (per-event) -hard bin
TH1 * fHistTrials
!trials from pyxsec.root
Bool_t fPtHardInitialized
!flag whether the -hard bin was initialized, purely for internal processing
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
ULong_t GetTriggerList()
Get list of selected triggers of the given event.
Int_t fPtHardBinGlobal
!event -hard bin, detected from filename
EMCAL Level1 jet trigger, low threshold.
Bool_t HasTriggerType(TriggerType triggersel)
Check if event has a given trigger type.
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
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.
TH2 * fHistPtHardCorrGlobal
!Correlation between -hard value and global bin
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)
void SetTrackPtCut(Double_t cut, Int_t c=0)
Apply cut on the transverse momentum of all tracks in the track container with index c...
static void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
Calculate and difference between a track (t) and a cluster (c).
Double_t fMinBinPt
min pt in histograms
Double_t fEPV0
!event plane V0
static AliEmcalDownscaleFactorsOCDB * Instance()
Int_t fNPtHardBins
Number of -hard bins in the dataset.
Bool_t fGeneralHistograms
whether or not it should fill some general histograms
Declaration of class AliAnalysisTaskEmcalEmbeddingHelper.
Bool_t AcceptCluster(AliVCluster *clus, Int_t c=0) const
Cluster selection.
virtual void UserExecOnce()
Task initializations handled in user tasks.
Int_t fCentBin
!event centrality bin
virtual Bool_t IsTriggerSelected()
Selection of a hardware trigger.
TH1 * fHistEventsAfterSel
!total number of events per pt hard bin after selection
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
const AliMCParticleIterableContainer all() const
Int_t fMinVertexContrib
Min. number of vertex contributors.
Float_t fPtHardAndClusterPtFactor
Factor between ptHard and cluster pT to reject/accept event.
Double_t fMinPtTrackInEmcal
min pt track in emcal
TH1 * fHistEventPlane
!event plane distribution
Bool_t fUseBuiltinEventSelection
Use builtin event selection of the AliAnalysisTaskEmcal instead of AliEventCuts.
TH1 * fHistEvents
!total number of events per pt hard bin
void SetClusPtCut(Double_t cut, Int_t c=0)
Apply cut on for all clusters in container with index c.
AliClusterContainer * AddClusterContainer(const char *n)
Create new cluster container and attach it to the task.
virtual void NextEvent(const AliVEvent *event)
Preparation for the next event.
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.
Bool_t fIsEmbedded
trigger, embedded signal
TObjArray fParticleCollArray
particle/track collection array
BeamType
Switch for the beam type.
void SetTrackEtaLimits(Double_t min, Double_t max, Int_t c=0)
Apply cut on the pseudorapidity of the all tracks in the track container with index c...
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
Level1 jet trigger patch.
TProfile * fHistXsectionAfterSel
!x section from pythia header
TriggerType
Switch for EMCAL trigger types.
virtual Bool_t CheckMCOutliers()
Filter the mc tails in pt-hard distributions.
EMCalTriggerMode_t fEMCalTriggerMode
EMCal trigger selection mode.
virtual Bool_t FillHistograms()
Function filling histograms.
void SetRun(int runnumber)
Int_t GetNParticles(Int_t i=0) const
Get number of particles in container attached to this task with index i.
TClonesArray * fCaloClusters
!clusters
Bool_t fUseNewCentralityEstimation
Use new centrality estimation (for 2015 data)
Bool_t IsTrackInEmcalAcceptance(AliVParticle *part, Double_t edges=0.9) const
Determines if a track is inside the EMCal acceptance.
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)
Copy some information about the Pythia event in a PythaInfo object.
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)
Apply cut on azimuthal angle of the all tracks in the track container with index c...
AliParticleContainer * AddParticleContainer(const char *n)
Create new particle container and attach it to the task.
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
Get cluster container attached to this task.
Base class for container structures within the EMCAL framework.
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()
Filling general histograms.
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
Get TClonesArray with particles.
BeamType GetBeamType() const
Get beam type.
Double_t fMinVz
min vertex for event selection
virtual AliVParticle * GetAcceptParticle(Int_t i=-1) const
BeamType fBeamType
!event beam type
Float_t fPtHardAndTrackPtFactor
Factor between ptHard and track pT to reject/accept event.
Double_t fCent
!event centrality
TClonesArray * GetArray() const
Double_t fMinEventPlane
minimum event plane value
TString fCaloCellsName
name of calo cell collection
Int_t fMCLabelShift
if MC label > fMCLabelShift, MC label -= fMCLabelShift
Int_t GetNClusters(Int_t i=0) const
Get number of clusters in the cluster container attached to this task with index i.
Int_t fNVertCont
!event vertex number of contributors
Bool_t fMCRejectFilter
enable the filtering of events by tail rejection
Bool_t fGetPtHardBinFromName
Obtain pt-hard bin from file path.
Double_t fZvertexDiff
upper limit for distance between primary and SPD vertex
virtual Bool_t AcceptParticle(const AliVParticle *vp, UInt_t &rejectionReason) const
AliEMCALTriggerPatchInfo * GetMainTriggerPatch(TriggerCategory triggersel=kTriggerLevel1Jet, Bool_t doSimpleOffline=kFALSE)
Get main trigger match.
EMCAL Level1 jet trigger, high threshold.
Int_t fSelectPtHardBin
select one pt hard bin for analysis
AliMCParticleContainer * AddMCParticleContainer(const char *n)
Create new container for MC particles and attach it to the task.
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
Calculates the fraction of momentum z of part 1 w.r.t. part 2 in the direction of part 2...
virtual Bool_t RetrieveEventObjects()
Retrieve common objects from event.
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)
Loading PYTHIA information from external cross section file into the task.
void UserExec(Option_t *option)
Event loop, called for each event.
Int_t fMinMCLabel
minimum MC label value for the tracks/clusters being considered MC particles
void SetPartonFlag6(Int_t flag6)
AliVCaloCells * fCaloCells
!cells
const TString & GetArrayName() const
TClonesArray * GetArrayFromEvent(const char *name, const char *clname=0)
Read a TClonesArray from event.
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
Bool_t IsEventSelectedInternal()
Perform event selection (old method)
virtual Bool_t IsEventSelected()
Performing event selection.
Float_t fPtHard
!event -hard
TH1 * fHistPtHard
! -hard distribution
std::vector< TString > GetTriggerClasses() const
void SetParticleEtaLimits(Double_t min, Double_t max)
AliEventCuts fAliEventCuts
Event cuts (run2 defaults)
AliEmcalList * fOutput
!output list
Handler for downscale factors for various triggers obtained from the OCDB.
Double_t fMaxBinPt
max pt in histograms
Int_t fPtHardBin
!event -hard bin
virtual void RunChanged(Int_t)
Process tasks relevant when a file with a different run number is processed.
TClonesArray * fTracks
!tracks
TH1 * fHistTrialsAfterSel
!total number of trials per pt hard bin after selection
AliGenHerwigEventHeader * fHerwigHeader
!event Herwig header
void LoadPythiaInfo(AliVEvent *event)
Load parton info.
Bool_t fIsEsd
!whether it's an ESD analysis
static AliAODInputHandler * AddAODHandler()
Add an AOD handler to the analysis manager.
Double_t fVertex[3]
!event vertex
AliTrackContainer * AddTrackContainer(const char *n)
Create new track container and attach it to the task.
Bool_t fCreateHisto
whether or not create histograms
Bool_t UserNotify()
Notifying the user that the input data file has changed and performing steps needed to be done...
Store some informaion about a Pythia eventThis class is used to store some information about a Pythia...
TFile * file
TList with histograms for a given trigger.
TH1 * fHistEventRejection
!book keep reasons for rejecting event
TClonesArray * fTriggerPatchInfo
!trigger patch info array
TClonesArray * GetClusterArray(Int_t i=0) const
Get TClonesArray with EMCAL clusters.
Bool_t FileChanged()
Steps to be executed when a few file is loaded into the input handler.
Double_t fEPV0A
!event plane V0A
virtual void ExecOnce()
Perform steps needed to initialize the analysis.
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)
Add object to event.
AliVCaloTrigger * fCaloTriggers
!calo triggers
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
Main initialization function on the worker.
Bool_t fFileChanged
! Signal triggered when the file has changed
TH1 * fHistZVertex
!z vertex position
Int_t fMinNTrack
minimum nr of tracks in event with pT>fTrackPtCut
Int_t GetNEntries() const
static Byte_t GetTrackType(const AliVTrack *t)
Get track type encoded from bits 20 and 21.
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)
Apply cut on cluster time for clusters in container with index c.
ULong_t fTriggers
list of fired triggers
static AliESDInputHandler * AddESDHandler()
Add a ESD handler to the analysis manager.
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
Get particle p if accepted from container with index c If particle not accepted return 0...
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
Get cluster cl if accepted from container c If particle not accepted return 0.
Int_t fNbins
no. of pt bins
Bool_t fTklVsClusSPDCut
Apply tracklet-vs-cluster SPD cut to reject background events in pp.
AliAnalysisTaskEmcal()
Default constructor.
TH2 * fHistPtHardCorr
!Correlation between -hard value and bin
TArrayI fPtHardBinning
-hard binning
TList * OpenFile(const char *fname)
virtual ~AliAnalysisTaskEmcal()
Destructor.
Level1 gamma trigger patch.
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal