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"
69 fGeneralHistograms(kFALSE),
70 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 fUseXsecFromHeader(kFALSE),
114 fMCRejectFilter(kFALSE),
115 fCountDownscaleCorrectedEvents(kFALSE),
116 fPtHardAndJetPtFactor(0.),
117 fPtHardAndClusterPtFactor(0.),
118 fPtHardAndTrackPtFactor(0.),
140 fPtHardBinGlobal(-1),
150 fHistXsectionAfterSel(
nullptr),
156 fHistPtHardCorrGlobal(
nullptr),
163 fHistTriggerClassesCorr(
nullptr)
180 fGeneralHistograms(kFALSE),
181 fLocalInitialized(kFALSE),
182 fFileChanged(kFALSE),
186 fCaloTriggerPatchInfoName(),
194 fUseAliAnaUtils(kFALSE),
195 fRejectPileup(kFALSE),
196 fTklVsClusSPDCut(kFALSE),
197 fOffTrigger(AliVEvent::kAny),
199 fMinBiasRefTrigger(
"CINT7-B-NOPF-ALLNOTRD"),
200 fTriggerTypeSel(kND),
204 fMinPtTrackInEmcal(0),
205 fEventPlaneVsEmcal(-1),
206 fMinEventPlane(-1e6),
212 fSelectPtHardBin(-999),
216 fNeedEmcalGeom(kTRUE),
217 fParticleCollArray(),
220 fEMCalTriggerMode(kOverlapWithLowThreshold),
221 fUseNewCentralityEstimation(kFALSE),
222 fGeneratePythiaInfoObject(kFALSE),
223 fUsePtHardBinScaling(kFALSE),
224 fUseXsecFromHeader(kFALSE),
225 fMCRejectFilter(kFALSE),
226 fCountDownscaleCorrectedEvents(kFALSE),
227 fPtHardAndJetPtFactor(0.),
228 fPtHardAndClusterPtFactor(0.),
229 fPtHardAndTrackPtFactor(0.),
251 fPtHardBinGlobal(-1),
261 fHistXsectionAfterSel(
nullptr),
267 fHistPtHardCorrGlobal(
nullptr),
274 fHistTriggerClassesCorr(
nullptr)
286 DefineOutput(1, AliEmcalList::Class());
298 else AliError(Form(
"%s in SetClusPtCut(...): container %d not found",GetName(),c));
305 else AliError(Form(
"%s in SetClusTimeCut(...): container %d not found",GetName(),c));
312 else AliError(Form(
"%s in SetTrackPtCut(...): container %d not found",GetName(),c));
321 else AliError(Form(
"%s in SetTrackPtCut(...): container %d not found",GetName(),c));
328 else AliError(Form(
"%s in SetTrackPhiLimits(...): container %d not found",GetName(),c));
335 AliVEventHandler *evhand = mgr->GetInputEventHandler();
337 if (evhand->InheritsFrom(
"AliESDInputHandler")) {
345 AliError(
"Event handler not found!");
349 AliError(
"Analysis manager not found!");
383 fHistTrials->GetXaxis()->SetTitle(
"p_{T} hard bin");
388 fHistEvents->GetXaxis()->SetTitle(
"p_{T} hard bin");
398 Bool_t binningAvailable =
false;
400 AliInfoStream() <<
"Using custom pt-hard binning" << std::endl;
402 else AliErrorStream() <<
"Pt-hard binning (" <<
fPtHardBinning.GetSize() -1 <<
") does not match the amount of bins (" <<
fNPtHardBins <<
")" << std::endl;
406 AliInfoStream() <<
"11 pt-hard bins - fall back to default binning for bin labels" << std::endl;
407 const Int_t kDefaultPtHardBinning[12] = {0,5,11,21,36,57, 84,117,152,191,234,1000000};
410 binningAvailable =
true;
412 AliErrorStream() <<
"No default binning available for " <<
fNPtHardBins <<
" pt-hard bins - bin labels will not be set." << std::endl;
416 if(binningAvailable){
427 AliErrorStream() <<
"No suitable binning available - skipping bin labels" << std::endl;
432 fHistPtHard->GetXaxis()->SetTitle(
"p_{T,hard} (GeV/c)");
453 fHistZVertex =
new TH1F(
"fHistZVertex",
"Z vertex position", 60, -30, 30);
459 fHistCentrality =
new TH1F(
"fHistCentrality",
"Event centrality distribution", 200, 0, 100);
464 fHistEventPlane =
new TH1F(
"fHistEventPlane",
"Event plane", 120, -TMath::Pi(), TMath::Pi());
471 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
494 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
503 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
540 std::unique_ptr<TObjArray> triggerClasses(InputEvent()->GetFiredTriggerClasses().Tokenize(
" "));
541 TObjString* triggerClass(
nullptr);
542 for(
auto trg : *triggerClasses){
543 triggerClass =
static_cast<TObjString*
>(trg);
589 AliDebugStream(1) <<
"Fallback to cross section from pythia header required" << std::endl;
633 AliWarning(
"AliAnalysisTaskEmcal::AcceptCluster method is deprecated. Please use GetCusterContainer(c)->AcceptCluster(clus).");
635 if (!clus)
return kFALSE;
639 AliError(Form(
"%s:Container %d not found",GetName(),c));
642 UInt_t rejectionReason = 0;
648 AliWarning(
"AliAnalysisTaskEmcal::AcceptTrack method is deprecated. Please use GetParticleContainer(c)->AcceptParticle(clus).");
650 if (!track)
return kFALSE;
654 AliError(Form(
"%s:Container %d not found",GetName(),c));
658 UInt_t rejectionReason = 0;
670 std::unique_ptr<TObjArray> walk(file.Tokenize(
"/"));
672 TString &tok =
static_cast<TObjString *
>(t)->String();
673 if(tok.Contains(
".zip")){
675 Int_t pos = archivetype.Index(
".zip");
676 archivetype.Replace(pos, archivetype.Length() - pos,
"");
679 if(archivetype.Length()){
680 AliDebugStream(1) <<
"Auto-detected archive type " << archivetype << std::endl;
681 Ssiz_t pos1 = file.Index(archivetype,archivetype.Length(),0,TString::kExact);
682 Ssiz_t pos = file.Index(
"#",1,pos1,TString::kExact);
683 Ssiz_t pos2 = file.Index(
".root",5,TString::kExact);
684 file.Replace(pos+1,pos2-pos1,
"");
687 file.ReplaceAll(
gSystem->BaseName(file.Data()),
"");
689 AliDebugStream(1) <<
"File name: " << file << std::endl;
694 if(file.Contains(
"__alice")){
696 Int_t pos = tmp.Index(
"__alice");
697 tmp.Replace(0, pos,
"");
698 tmp.ReplaceAll(
"__",
"/");
701 std::unique_ptr<TObjArray> toks(tmp.Tokenize(
"/"));
702 TString tag =
"_" + archivetype;
704 TString &path =
static_cast<TObjString *
>(t)->String();
705 if(path.Contains(tag)){
706 Int_t posTag = path.Index(tag);
707 path.Replace(posTag, path.Length() - posTag,
"");
709 virtualFileName +=
"/" + path;
712 virtualFileName =
file;
715 AliDebugStream(1) <<
"Physical file name " << file <<
", virtual file name " << virtualFileName << std::endl;
718 TString strPthard(virtualFileName);
741 bool binfound =
false;
742 std::unique_ptr<TObjArray> tokens(strPthard.Tokenize(
"/"));
743 for(
auto t : *tokens) {
744 TString &tok =
static_cast<TObjString *
>(t)->String();
746 Int_t number = tok.Atoi();
747 if(number > 2000 && number < 3000){
750 }
else if(number == fInputHandler->GetEvent()->GetRunNumber()){
764 AliErrorStream() <<
"Could not extract file number from path " << strPthard << std::endl;
766 AliInfoStream() <<
"Auto-detecting pt-hard bin " << pthard << std::endl;
769 AliInfoStream() <<
"File: " << file << std::endl;
772 std::unique_ptr<TFile> fxsec(TFile::Open(Form(
"%s%s",file.Data(),
"pyxsec.root")));
776 fxsec = std::unique_ptr<TFile>(TFile::Open(Form(
"%s%s",file.Data(),
"pyxsec_hists.root")));
778 AliErrorStream() <<
"Failed reading cross section from file " << file << std::endl;
784 TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
785 if (!key)
return kFALSE;
787 if (!list)
return kFALSE;
788 TProfile *xSecHist =
static_cast<TProfile*
>(list->FindObject(
"h1Xsec"));
790 if(!xSecHist->GetEntries()) {
792 AliErrorStream() <<
"No cross section information available in file " << fxsec->GetName() <<
" - fall back to cross section in PYTHIA header" << std::endl;
796 fXsec = xSecHist->GetBinContent(1);
797 if(!fXsec) AliErrorStream() << GetName() <<
": Cross section 0 for file " << file << std::endl;
800 fTrials = ((TH1F*)list->FindObject(
"h1Trials"))->GetBinContent(1);
803 TTree *xtree = (
TTree*)fxsec->Get(
"Xsection");
804 if (!xtree)
return kFALSE;
807 xtree->SetBranchAddress(
"xsection",&xsection);
808 xtree->SetBranchAddress(
"ntrials",&ntrials);
826 AliInfoStream() <<
"FileChanged called for run " << InputEvent()->GetRunNumber() << std::endl;
828 TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
830 AliErrorStream() << GetName() <<
" - FileChanged: No current tree!" << std::endl;
836 Int_t pthardbin = -1;
838 TFile *curfile = tree->GetCurrentFile();
840 AliErrorStream() << GetName() <<
" - FileChanged: No current file!" << std::endl;
845 if (chain) tree = chain->GetTree();
854 AliErrorStream() << GetName() <<
": Invalid global pt-hard bin " << pthardbin <<
" detected" << std::endl;
859 AliDebugStream(1) <<
"Using cross section from file pyxsec.root" << std::endl;
872 AliError(Form(
"%s: Could not retrieve parton infos! %s!", GetName(),
fPythiaInfoName.Data()));
881 AliError(Form(
"%s: Could not retrieve event! Returning!", GetName()));
888 fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->
GetRunNumber());
890 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()));
902 AliWarning(
"Could not set event plane limits because EMCal geometry was not loaded!");
915 AliError(Form(
"%s: Could not retrieve first track branch!", GetName()));
929 AliError(Form(
"%s: Could not retrieve first cluster branch!", GetName()));
937 AliError(Form(
"%s: Could not retrieve cells %s!", GetName(),
fCaloCellsName.Data()));
945 AliError(Form(
"%s: Could not retrieve calo triggers %s!", GetName(),
fCaloTriggersName.Data()));
969 const AliESDRun *run = esd->GetESDRun();
970 TString beamType = run->GetBeamType();
971 if (beamType ==
"p-p")
973 else if (beamType ==
"A-A")
975 else if (beamType ==
"p-A")
980 Int_t runNumber = InputEvent()->GetRunNumber();
982 if ((runNumber >= 136833 && runNumber <= 139517) ||
983 (runNumber >= 167693 && runNumber <= 170593) ||
984 (runNumber >= 244824 && runNumber <= 246994)) {
986 }
else if ((runNumber >= 188356 && runNumber <= 188366) ||
987 (runNumber >= 195164 && runNumber <= 197388) ||
988 (runNumber >= 265015 && runNumber <= 267166)) {
1010 AliEMCALTriggerPatchInfo *patch;
1011 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
1013 if (patch->IsGammaHigh()) nG1++;
1014 if (patch->IsGammaLow()) nG2++;
1015 if (patch->IsJetHigh()) nJ1++;
1016 if (patch->IsJetLow()) nJ2++;
1017 if (patch->IsLevel0()) nL0++;
1020 AliDebug(2,
"Patch summary: ");
1021 AliDebug(2, Form(
"Number of patches: %d", nPatch));
1022 AliDebug(2, Form(
"Jet: low[%d], high[%d]" ,nJ2, nJ1));
1023 AliDebug(2, Form(
"Gamma: low[%d], high[%d]" ,nG2, nG1));
1026 if (nL0>0) SETBIT(triggers,
kL0);
1027 if (nG1>0) SETBIT(triggers,
kG1);
1028 if (nG2>0) SETBIT(triggers,
kG2);
1029 if (nJ1>0) SETBIT(triggers,
kJ1);
1030 if (nJ2>0) SETBIT(triggers,
kJ2);
1038 AliWarning(Form(
"%s: Requesting undefined trigger type!", GetName()));
1054 res = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1058 res = ((AliVAODHeader*)aev->GetHeader())->GetOfflineTrigger();
1071 fired = eev->GetFiredTriggerClasses();
1075 fired = aev->GetFiredTriggerClasses();
1078 if (!fired.Contains(
"-B-")) {
1083 std::unique_ptr<TObjArray> arr(
fTrigClass.Tokenize(
"|"));
1089 for (
Int_t i=0;i<arr->GetEntriesFast();++i) {
1095 TString objStr = obj->GetName();
1097 (objStr.Contains(
"J1") || objStr.Contains(
"J2") || objStr.Contains(
"G1") || objStr.Contains(
"G2"))) {
1102 if(objStr.Contains(
"G")) {
1106 if(objStr.Contains(trigType2) && fired.Contains(trigType2.Data())) {
1110 else if(objStr.Contains(trigType1) && fired.Contains(trigType1.Data()) && !fired.Contains(trigType2.Data())) {
1118 if (fired.Contains(obj->GetName())) {
1138 if (fCent<fMinCent || fCent>
fMaxCent) {
1174 if (vz < fMinVz || vz >
fMaxVz) {
1181 Double_t dvertex = TMath::Abs(vz-vzSPD);
1191 Bool_t trackInEmcalOk = kFALSE;
1193 for (
Int_t i = 0; i < ntracks; i++) {
1198 Double_t phiMin =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
1199 Double_t phiMax =
fGeom->GetArm1PhiMax() * TMath::DegToRad();
1200 Int_t runNumber = InputEvent()->GetRunNumber();
1201 if (runNumber>=177295 && runNumber<=197470) {
1203 phiMax = TMath::Pi();
1206 if (track->Eta() <
fGeom->GetArm1EtaMin() || track->Eta() >
fGeom->GetArm1EtaMax() || track->Phi() < phiMin || track->Phi() > phiMax)
1209 trackInEmcalOk = kTRUE;
1213 if (!trackInEmcalOk) {
1220 Int_t nTracksAcc = 0;
1222 for (
Int_t i = 0; i < ntracks; i++) {
1267 AliDebug(1,Form(
"Njets: %d, pT Hard %f",nTriggerJets,
fPtHard));
1270 for (
Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
1273 jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
1275 AliDebug(1,Form(
"jet %d; pycell jet pT %f",ijet, jet.Pt()));
1279 AliInfo(Form(
"Reject jet event with : pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n",
fPtHard, jet.Pt(),
fPtHardAndJetPtFactor));
1289 if ((
Bool_t)mccluscont) {
1290 for (
auto cluster : mccluscont->all()) {
1291 Float_t ecluster = cluster->E();
1305 if ((
Bool_t)mcpartcont) {
1306 for (
auto mctrack : mcpartcont->
all()) {
1307 Float_t trackpt = mctrack->Pt();
1322 TClonesArray *arr = 0;
1324 if (!sname.IsNull()) {
1325 arr =
dynamic_cast<TClonesArray*
>(InputEvent()->FindListObject(sname));
1327 AliWarning(Form(
"%s: Could not retrieve array with name %s!", GetName(), name));
1337 TString objname(arr->GetClass()->GetName());
1338 TClass cls(objname);
1339 if (!cls.InheritsFrom(clname)) {
1340 AliWarning(Form(
"%s: Objects of type %s in %s are not inherited from %s!",
1341 GetName(), cls.GetName(), name, clname));
1363 const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1369 const AliVVertex *vertSPD = InputEvent()->GetPrimaryVertexSPD();
1379 AliMultSelection *MultSelection =
static_cast<AliMultSelection*
>(InputEvent()->FindListObject(
"MultSelection"));
1380 if (MultSelection) {
1381 fCent = MultSelection->GetMultiplicityPercentile(
fCentEst.Data());
1384 AliWarning(Form(
"%s: Could not retrieve centrality information! Assuming 99", GetName()));
1388 AliCentrality *aliCent = InputEvent()->GetCentrality();
1393 AliWarning(Form(
"%s: Could not retrieve centrality information! Assuming 99", GetName()));
1403 AliWarning(Form(
"%s: Negative centrality: %f. Assuming 99", GetName(),
fCent));
1412 else if (
fCent > 90) {
1417 AliWarning(Form(
"%s: Negative centrality: %f. Assuming 99", GetName(),
fCent));
1430 AliWarning(Form(
"%s: fCentBin too large: cent = %f fCentBin = %d. Assuming 99", GetName(),
fCent,
fCentBin));
1435 AliEventplane *aliEP = InputEvent()->GetEventplane();
1437 fEPV0 = aliEP->GetEventplane(
"V0" ,InputEvent());
1438 fEPV0A = aliEP->GetEventplane(
"V0A",InputEvent());
1439 fEPV0C = aliEP->GetEventplane(
"V0C",InputEvent());
1441 AliWarning(Form(
"%s: Could not retrieve event plane information!", GetName()));
1451 fPythiaHeader =
dynamic_cast<AliGenPythiaEventHeader*
>(MCEvent()->GenEventHeader());
1454 AliAODMCHeader* aodMCH =
dynamic_cast<AliAODMCHeader*
>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
1457 for (
UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
1458 fPythiaHeader =
dynamic_cast<AliGenPythiaEventHeader*
>(aodMCH->GetCocktailHeader(i));
1481 AliErrorStream() << GetName() <<
": Mismatch in pt-hard bin determination. Local: " <<
fPtHardBin <<
", Global: " <<
fPtHardBinGlobal << std::endl;
1490 fHerwigHeader =
dynamic_cast<AliGenHerwigEventHeader*
>(MCEvent()->GenEventHeader());
1494 AliAODMCHeader* aodMCH =
dynamic_cast<AliAODMCHeader*
>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
1497 for (
UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
1498 fHerwigHeader =
dynamic_cast<AliGenHerwigEventHeader*
>(aodMCH->GetCocktailHeader(i));
1526 AliEmcalContainer* cont = 0;
1529 while ((cont = static_cast<AliEmcalContainer*>(nextPartColl()))) cont->NextEvent();
1532 while ((cont = static_cast<AliParticleContainer*>(nextClusColl()))) cont->NextEvent();
1539 if (
TString(n).IsNull())
return 0;
1550 if (
TString(n).IsNull())
return 0;
1561 if (
TString(n).IsNull())
return 0;
1572 if (
TString(n).IsNull())
return 0;
1611 AliError(Form(
"%s: Particle container %d not found",GetName(),i));
1614 TString contName = cont->GetArrayName();
1615 return cont->GetArray();
1622 AliError(Form(
"%s:Cluster container %d not found",GetName(),i));
1625 return cont->GetArray();
1633 AliError(Form(
"%s: Particle container %d not found",GetName(),c));
1645 AliError(Form(
"%s: Cluster container %d not found",GetName(),c));
1657 AliError(Form(
"%s: Particle container %d not found",GetName(),i));
1660 return cont->GetNEntries();
1667 AliError(Form(
"%s: Cluster container %d not found",GetName(),i));
1670 return cont->GetNEntries();
1677 AliError(Form(
"%s: fTriggerPatchInfo not available",GetName()));
1685 AliEMCALTriggerPatchInfo *patch(NULL), *selected(NULL);
1686 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
1689 if (patch->IsMainTrigger()) {
1690 if(doSimpleOffline){
1691 if(patch->IsOfflineSimple()){
1695 if(patch->IsLevel0()) selected = patch;
1698 if(patch->IsJetHighSimple() || patch->IsJetLowSimple()){
1699 if(!selected) selected = patch;
1700 else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1704 if(patch->IsGammaHighSimple() || patch->IsGammaLowSimple()){
1705 if(!selected) selected = patch;
1706 else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1710 AliError(
"Untreated case: Main Patch is recalculated; should be in 'else' branch");
1716 if(patch->IsLevel0()) selected = patch;
1719 if(patch->IsJetHigh() || patch->IsJetLow()){
1720 if(!selected) selected = patch;
1721 else if (patch->GetADCAmp() > selected->GetADCAmp())
1726 if(patch->IsGammaHigh() || patch->IsGammaLow()){
1727 if(!selected) selected = patch;
1728 else if (patch->GetADCAmp() > selected->GetADCAmp())
1733 AliError(
"Untreated case: Main Patch is recalculated; should be in 'else' branch");
1739 if (doSimpleOffline && patch->IsOfflineSimple()) {
1740 if(!selected) selected = patch;
1741 else if (patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp())
1744 else if (!doSimpleOffline && !patch->IsOfflineSimple()) {
1745 if(!selected) selected = patch;
1746 else if (patch->GetADCAmp() > selected->GetADCAmp())
1756 if (!(InputEvent()->FindListObject(obj->GetName()))) {
1757 InputEvent()->AddObject(obj);
1761 AliFatal(Form(
"%s: Container with name %s already present. Aborting", GetName(), obj->GetName()));
1770 AliWarning(Form(
"%s - AliAnalysisTaskEmcal::IsTrackInEmcalAcceptance - Geometry is not available!", GetName()));
1777 if (part->Phi() > minPhi && part->Phi() < maxPhi) {
1787 axis->SetBinLabel(1,
"NullObject");
1788 axis->SetBinLabel(2,
"Pt");
1789 axis->SetBinLabel(3,
"Acceptance");
1790 axis->SetBinLabel(4,
"MCLabel");
1791 axis->SetBinLabel(5,
"BitMap");
1792 axis->SetBinLabel(6,
"HF cut");
1793 axis->SetBinLabel(7,
"Bit6");
1794 axis->SetBinLabel(8,
"NotHybridTrack");
1795 axis->SetBinLabel(9,
"MCFlag");
1796 axis->SetBinLabel(10,
"MCGenerator");
1797 axis->SetBinLabel(11,
"ChargeCut");
1798 axis->SetBinLabel(12,
"MinDistanceTPCSectorEdge");
1799 axis->SetBinLabel(13,
"Bit12");
1800 axis->SetBinLabel(14,
"IsEMCal");
1801 axis->SetBinLabel(15,
"Time");
1802 axis->SetBinLabel(16,
"Energy");
1803 axis->SetBinLabel(17,
"ExoticCut");
1804 axis->SetBinLabel(18,
"Bit17");
1805 axis->SetBinLabel(19,
"Area");
1806 axis->SetBinLabel(20,
"AreaEmc");
1807 axis->SetBinLabel(21,
"ZLeadingCh");
1808 axis->SetBinLabel(22,
"ZLeadingEmc");
1809 axis->SetBinLabel(23,
"NEF");
1810 axis->SetBinLabel(24,
"MinLeadPt");
1811 axis->SetBinLabel(25,
"MaxTrackPt");
1812 axis->SetBinLabel(26,
"MaxClusterPt");
1813 axis->SetBinLabel(27,
"Flavour");
1814 axis->SetBinLabel(28,
"TagStatus");
1815 axis->SetBinLabel(29,
"MinNConstituents");
1816 axis->SetBinLabel(30,
"Bit29");
1817 axis->SetBinLabel(31,
"Bit30");
1818 axis->SetBinLabel(32,
"Bit31");
1823 TVector3 vect1(part1->Px(), part1->Py(), part1->Pz());
1824 TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1825 Double_t z = (vect1 * vect2) / (vect2 * vect2);
1831 TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1832 Double_t z = (vect1 * vect2) / (vect2 * vect2);
1843 Double_t veta = t->GetTrackEtaOnEMCal();
1844 Double_t vphi = t->GetTrackPhiOnEMCal();
1847 v->GetPosition(pos);
1852 phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
1858 if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
1860 else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1862 else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1872 if (aodTrack->TestFilterBit(filterBit1)) {
1875 else if (aodTrack->TestFilterBit(filterBit2)) {
1876 if ((aodTrack->GetStatus()&AliVTrack::kITSrefit)!=0) {
1896 AliStack* stack = mcEvent->Stack();
1898 const Int_t nprim = stack->GetNprimary();
1900 if (nprim < 8)
return;
1902 TParticle *part6 = stack->Particle(6);
1903 TParticle *part7 = stack->Particle(7);
1911 AliGenPythiaEventHeader *pythiaGenHeader =
dynamic_cast<AliGenPythiaEventHeader*
>(mcEvent->GenEventHeader());
1912 if(pythiaGenHeader){
1921 ::Error(
"AddAODHandler",
"No analysis manager to connect to.");
1925 AliAODInputHandler* aodHandler =
new AliAODInputHandler();
1927 AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
1928 if (inputHandler && (inputHandler->IsA() == AliMultiInputEventHandler::Class())) {
1929 AliMultiInputEventHandler *multiInputHandler=(AliMultiInputEventHandler*)inputHandler;
1930 multiInputHandler->AddInputEventHandler(aodHandler);
1933 if (!inputHandler) {
1934 mgr->SetInputEventHandler(aodHandler);
1937 ::Error(
"AddAODHandler",
"inputHandler is NOT null. AOD handler was NOT added !!!");
1949 ::Error(
"AddESDHandler",
"No analysis manager to connect to.");
1953 AliESDInputHandler *esdHandler =
new AliESDInputHandler();
1955 AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
1956 if (inputHandler && (inputHandler->IsA() == AliMultiInputEventHandler::Class())) {
1957 AliMultiInputEventHandler *multiInputHandler=(AliMultiInputEventHandler*)inputHandler;
1958 multiInputHandler->AddInputEventHandler(esdHandler);
1961 if (!inputHandler) {
1962 mgr->SetInputEventHandler(esdHandler);
1965 ::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
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
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.
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 SetRun(int runnumber)
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
TList * list
TDirectory file where lists per trigger are stored in train ouput.
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
Cluster selection.
virtual void UserExecOnce()
Task initializations handled in user tasks.
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)
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.
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)
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.
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.
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.
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
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
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
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)
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.
void SetPartonFlag6(Int_t flag6)
AliVCaloCells * fCaloCells
!cells
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
ClassImp(AliAnalysisTaskDeltaPt) AliAnalysisTaskDeltaPt
virtual Bool_t IsEventSelected()
Performing event selection.
Float_t fPtHard
!event -hard
TH1 * fHistPtHard
! -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)
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.
Handler for downscale factors for various triggers obtained from the OCDB.
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
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.
AliEMCALTriggerPatchInfo * GetMainTriggerPatch(TriggerCategory triggersel=kTriggerLevel1Jet, Bool_t doOfflinSimple=kFALSE)
Get main trigger match.
Level1 gamma trigger patch.
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal