13 #include <THnSparse.h> 19 #include <AliAnalysisManager.h> 20 #include <AliInputEventHandler.h> 21 #include <AliEventPoolManager.h> 23 #include <AliVAODHeader.h> 24 #include <AliVTrack.h> 39 namespace EMCALJetTasks {
42 Double_t AliAnalysisTaskEmcalJetHCorrelations::p0_10SG[17] = {0.906767, 0.0754127, 1.11638, -0.0233078, 0.795454, 0.00935385, -0.000327857, 1.08903, 0.0107272, 0.443252, -0.143411, 0.965822, 0.359156, -0.581221, 1.0739, 0.00632828, 0.706356};
44 Double_t AliAnalysisTaskEmcalJetHCorrelations::p10_30SG[17] = {0.908011, 0.0769254, 1.11912, -0.0249449, 0.741488, 0.0361252, -0.00367954, 1.10424, 0.011472, 0.452059, -0.133282, 0.980633, 0.358222, -0.620256, 1.06871, 0.00564449, 0.753168};
46 Double_t AliAnalysisTaskEmcalJetHCorrelations::p30_50SG[17] = {0.958708, 0.0799197, 1.10817, -0.0357678, 0.75051, 0.0607808, -0.00929713, 0.998801, 0.00692244, 0.615452, -0.0480328, 0.968431, 0.321634, -0.619066, 1.03412, 0.00656201, 0.798666};
48 Double_t AliAnalysisTaskEmcalJetHCorrelations::p50_90SG[17] = {0.944565, 0.0807258, 1.12709, -0.0324746, 0.666452, 0.0842476, -0.00963837, 1.02829, 0.00666852, 0.549625, -0.0603107, 0.981374, 0.309374, -0.619181, 1.05367, 0.005925, 0.744887};
51 Double_t AliAnalysisTaskEmcalJetHCorrelations::p0_10G[17] = {0.971679, 0.0767571, 1.13355, -0.0274484, 0.856652, 0.00536795, 3.90795e-05, 1.06889, 0.011007, 0.447046, -0.146626, 0.919777, 0.192601, -0.268515, 1.00243, 0.00620849, 0.709477};
53 Double_t AliAnalysisTaskEmcalJetHCorrelations::p10_30G[17] = {0.97929, 0.0776039, 1.12213, -0.0300645, 0.844722, 0.0134788, -0.0012333, 1.07955, 0.0116835, 0.456608, -0.132743, 0.930964, 0.174175, -0.267154, 0.993118, 0.00574892, 0.765256};
55 Double_t AliAnalysisTaskEmcalJetHCorrelations::p30_50G[17] = {0.997696, 0.0816769, 1.14341, -0.0353734, 0.752151, 0.0744259, -0.0102926, 1.01561, 0.00713274, 0.57203, -0.0640248, 0.947747, 0.102007, -0.194698, 0.999164, 0.00568476, 0.7237};
57 Double_t AliAnalysisTaskEmcalJetHCorrelations::p50_90G[17] = {0.97041, 0.0813559, 1.12151, -0.0368797, 0.709327, 0.0701501, -0.00784043, 1.06276, 0.00676173, 0.53607, -0.0703117, 0.982534, 0.0947881, -0.18073, 1.03229, 0.00580109, 0.737801};
65 fConfigurationInitialized(false),
67 fUseAliEventCuts(true),
70 fDoEventMixing(kFALSE),
71 fNMixingTracks(50000), fMinNTracksMixedEvents(5000), fMinNEventsMixedEvents(5), fNCentBinsMixedEvent(10),
73 fTriggerType(AliVEvent::kEMCEJE), fMixingEventType(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral),
74 fDisableFastPartition(kFALSE),
77 fArtificialTrackInefficiency(1.0),
78 fNoMixedEventJESCorrection(kFALSE),
80 fDoLessSparseAxes(kFALSE), fDoWiderTrackBin(kFALSE),
81 fRequireMatchedJetWhenEmbedding(kTRUE),
82 fMinSharedMomentumFraction(0.),
83 fRequireMatchedPartLevelJet(false),
84 fMaxMatchedJetDistance(-1),
168 AliDebugStream(2) <<
"Configuring task from the YAML configuration.\n";
170 AliDebugStream(2) <<
"Finished configuring via the YAML configuration.\n";
197 std::string baseName =
"eventCuts";
198 std::vector<std::string> physicsSelection;
199 bool res =
fYAMLConfig.
GetProperty(std::vector<std::string>({
"eventCuts",
"physicsSelection"}), physicsSelection,
false);
207 if (fUseAliEventCuts) {
209 std::string taskName =
"PWGJE::EMCALJetTasks::";
210 taskName += GetName();
215 baseName =
"general";
229 AliFatal(
"Task was not initialized. Please ensure that Initialize() was called!");
237 auto eventCutsList =
new TList();
238 eventCutsList->SetOwner(
true);
239 eventCutsList->SetName(
"EventCuts");
245 fHistJetHTrackPt =
new TH1F(
"fHistJetHTrackPt",
"P_{T} distribution", 1000, 0.0, 100.0);
247 fHistJetHEtaPhi =
new TH2F(
"fHistJetHEtaPhi",
"Jet-Hadron deta-dphi",900,-1.8,1.8,720,-1.6,4.8);
255 name = Form(
"fHistTrackEtaPhi_%i", trackPtBin);
261 name = Form(
"fHistJetPt_%i",centralityBin);
262 fHistJetPt[centralityBin] =
new TH1F(name,name,200,0,200);
265 name = Form(
"fHistJetPtBias_%i",centralityBin);
273 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"sharedMomentumFraction",
"partLevelMatchedJet",
"jetDistance",
"passedAllCuts"};
274 for (
auto histName : std::vector<std::string>({
"SameEvent",
"MixedEvent"})) {
275 name = std::string(
"fHistJetMatching") + histName.c_str() +
"Cuts";
276 std::string
title = std::string(
"Jets which passed matching jet cuts for ") + histName;
277 auto histMatchedJetCuts =
fHistManager.
CreateTH1(name, title.c_str(), binLabels.size(), 0, binLabels.size());
279 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
280 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
282 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
288 cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<9;
290 cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<7 | 1<<9;
301 cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<9;
303 cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<7 | 1<<9;
311 cifras = 1<<0 | 1<<1 | 1<<9;
319 while ((obj = next())) {
328 Int_t nZVertexBins = 10;
331 Int_t nEventActivityBins = 8;
344 eventActivityBins = multiplicityBins;
347 fPoolMgr =
new AliEventPoolManager(poolSize,
fNMixingTracks, nEventActivityBins, eventActivityBins, nZVertexBins, zVertexBins);
392 if (pt < 0.5) ptBin = 0;
393 else if (pt < 1 ) ptBin = 1;
394 else if (pt < 2 ) ptBin = 2;
395 else if (pt < 3 ) ptBin = 3;
396 else if (pt < 5 ) ptBin = 4;
397 else if (pt < 8 ) ptBin = 5;
398 else if (pt < 20 ) ptBin = 6;
413 if (embeddingHelper) {
414 auto aodHeader =
dynamic_cast<AliVAODHeader *
>(embeddingHelper->GetEventHeader());
416 AliDebugStream(5) <<
"Retrieving trigger mask from embedded event\n";
417 eventTrigger = aodHeader->GetOfflineTrigger();
420 AliErrorStream() <<
"Failed to retrieve requested AOD header from embedding helper\n";
424 AliErrorStream() <<
"Failed to retrieve requested embedding helper\n";
428 AliDebugStream(5) <<
"Retrieving trigger mask from internal event\n";
429 eventTrigger = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
444 AliError(Form(
"%s: Unable to retrieve tracks!", GetName()));
451 AliError(Form(
"%s: Unable to retrieve jets!", GetName()));
456 std::vector<unsigned int> rejectedTrackIndices;
457 bool useListOfRejectedIndices =
false;
462 Bool_t biasedJet = kFALSE;
481 AliDebugStream(5) <<
"Beginning main processing. Number of jets: " << jets->
GetNJets() <<
", accepted jets: " << jets->
GetNAcceptedJets() <<
"\n";
485 AliDebugStream(4) << GetName() <<
": Fast partition disabled\n";
496 if (eventTrigger == fTriggerType && eventTrigger == 0) {
497 AliDebugStream(5) <<
"Event accepted because the physics selection is \"0\".\n";
500 AliDebugStream(5) <<
"Rejected jets due to physics selection. Phys sel: " << std::bitset<32>(eventTrigger) <<
", requested triggers: " << std::bitset<32>(fTriggerType) <<
" \n";
506 AliDebugStream(5) <<
"Jet passed event selection!\nJet: " << jet->toString().Data() <<
"\n";
511 bool foundMatchedJet =
CheckForMatchedJet(jets, jet,
"fHistJetMatchingSameEventCuts");
512 if (foundMatchedJet ==
false) {
519 eventActivity =
fCent;
528 if (jet == leadingJet) leadJet = kTRUE;
535 if (biasedJet == kTRUE) {
538 const double triggerInfo[] = {eventActivity, jet->Pt(), epAngle};
543 if (jet->Pt() > 15) {
545 AliDebugStream(4) <<
"Passed min jet pt cut of 15. Jet: " << jet->toString().Data() <<
"\n";
548 for (
auto trackIter = tracksIter.begin(); trackIter != tracksIter.end(); trackIter++ ) {
551 track = trackIter->first;
556 if (rejectParticle) {
557 AliDebugStream(4) <<
"Track rejected in signal correlation loop.\n";
570 AliDebugStream(6) <<
"track eta: " << track.Eta() <<
", track pt: " << track.Pt() <<
", efficiency: " << efficiency <<
"\n";
572 if (biasedJet == kTRUE) {
574 double triggerEntries[] = {eventActivity, jet->Pt(), track.Pt(), deltaEta, deltaPhi,
static_cast<Double_t>(leadJet), epAngle};
577 double triggerEntries[] = {eventActivity, jet->Pt(), track.Pt(), deltaEta, deltaPhi,
static_cast<Double_t>(leadJet), deltaR, epAngle};
586 AliDebugStream(4) <<
"Switching to list of rejected track indices. Number of indices: " << rejectedTrackIndices.size() <<
"\n";
587 useListOfRejectedIndices =
true;
617 AliEventPool *pool = 0;
627 else if (
fBeamType ==
kpp) AliFatal(Form(
"No pool found for ntracks_pp = %d, zVertex = %f", tracks->
GetNTracks(), zVertex));
632 Int_t nMix = pool->GetCurrentNEvents();
635 if((eventTrigger &
fTriggerType) || eventTrigger == fTriggerType) {
643 bool foundMatchedJet =
CheckForMatchedJet(jets, jet,
"fHistJetMatchingMixedEventCuts");
644 if (foundMatchedJet ==
false) {
650 eventActivity =
fCent;
659 if (jet == leadingJet) { leadJet = kTRUE; }
664 if (jet->Pt() < 15 || biasedJet == kFALSE)
continue;
667 for (
Int_t jMix=0; jMix < nMix; jMix++) {
668 TObjArray* bgTracks = pool->GetEvent(jMix);
670 for (
Int_t ibg=0; ibg < bgTracks->GetEntries(); ibg++){
673 AliError(Form(
"%s:Failed to retrieve tracks from mixed events", GetName()));
681 track.SetPtEtaPhiE(bgTrack->
Pt(), bgTrack->
Eta(), bgTrack->
Phi(), 0);
690 double triggerEntries[] = {eventActivity, jet->Pt(), track.Pt(), deltaEta, deltaPhi,
static_cast<Double_t>(leadJet), epAngle};
693 double triggerEntries[] = {eventActivity, jet->Pt(), track.Pt(), deltaEta, deltaPhi,
static_cast<Double_t>(leadJet), deltaR, epAngle};
703 if ((eventTrigger &
fMixingEventType) || eventTrigger == fMixingEventType) {
707 pool->UpdatePool(tracksClone);
743 deltaPhi =
DeltaPhi(particleOne.Phi(), particleTwo->Phi(), -1.0*TMath::Pi(), TMath::Pi());
744 deltaEta = particleTwo->Eta() - particleOne.Eta();
745 deltaR = TMath::Sqrt(deltaPhi*deltaPhi + deltaEta*deltaEta);
748 deltaPhi =
DeltaPhi(particleTwo->Phi(), particleOne.Phi(), -0.5*TMath::Pi(), 3*TMath::Pi()/2.);
761 bool returnValue =
false;
763 if (useRejectedList) {
764 if (std::find(rejectedTrackIndices.begin(), rejectedTrackIndices.end(), trackIndex) != rejectedTrackIndices.end()) {
765 AliDebugStream(4) <<
"Track " << trackIndex <<
" rejected due to artificial tracking inefficiency (from list)\n";
774 rejectedTrackIndices.push_back(trackIndex);
775 AliDebugStream(4) <<
"Track " << trackIndex <<
" rejected due to artificial tracking inefficiency (from random)\n";
804 bool returnValue =
false;
809 AliDebugStream(4) <<
"Jet is matched!\nJet: " << jet->
toString() <<
"\n";
814 AliDebugStream(4) <<
"Jet rejected due to shared momentum fraction of " << sharedFraction <<
", which is smaller than the min momentum fraction of " <<
fMinSharedMomentumFraction <<
"\n";
818 AliDebugStream(4) <<
"Passed shared momentum fraction with value of " << sharedFraction <<
"\n";
826 AliDebugStream(4) <<
"Jet rejected due to no matching part level jet.\n";
830 AliDebugStream(4) <<
"Det level jet has a required match to a part level jet.\n" <<
"Part level jet: " << partLevelJet->
toString() <<
"\n";
839 AliDebugStream(4) <<
"Jet rejected due to matching distance of " << matchedJetDistance <<
", which is larger than the max distance of " <<
fMaxMatchedJetDistance <<
"\n";
843 AliDebugStream(4) <<
"Jet passed distance cut with distance of " << matchedJetDistance <<
"\n";
849 if (returnValue ==
true) {
854 AliDebugStream(5) <<
"Rejected jet because it was not matched to a external event jet.\n";
879 const Int_t dim = count;
886 while(c<dim && i<32){
891 hnTitle += Form(
";%s",label.Data());
899 return new THnSparseF(name, hnTitle.Data(), dim,
nbins, xmin, xmax);
918 label =
"V0 centrality (%)";
924 label =
"Multiplicity";
938 label =
"Track p_{T}";
943 label =
"Track p_{T}";
951 label =
"#Delta#eta";
958 label =
"#Delta#phi";
965 label =
"Leading Jet";
972 label =
"Trigger track";
986 label =
"Leading track";
993 label =
"Event plane angle";
996 xmax = TMath::Pi()/2.;
1012 tracksClone->SetOwner(kTRUE);
1015 AliVParticle * particle = 0;
1020 for (
auto particleIter = particlesIter.begin(); particleIter != particlesIter.end(); particleIter++)
1023 particle = particleIter->second;
1027 if (rejectParticle) {
1028 AliDebugStream(4) <<
"Track rejected in CloneAndReduceTrackList()\n";
1034 if(trackPtBin > -1)
fHistTrackEtaPhi[trackPtBin]->Fill(particle->Eta(),particle->Phi());
1037 clone =
new AliBasicParticle(particle->Eta(), particle->Phi(), particle->Pt(), particle->Charge());
1039 clone->SetUniqueID(particle->GetUniqueID());
1041 tracksClone->Add(clone);
1086 double TRefficiency = -1;
1092 int runQuality = -1;
1094 if (fCurrentRunNumber == 169975 || fCurrentRunNumber == 169981 || fCurrentRunNumber == 170038 || fCurrentRunNumber == 170040 || fCurrentRunNumber == 170083 || fCurrentRunNumber == 170084 || fCurrentRunNumber == 170085 || fCurrentRunNumber == 170088 || fCurrentRunNumber == 170089 || fCurrentRunNumber == 170091 || fCurrentRunNumber == 170152 || fCurrentRunNumber == 170155 || fCurrentRunNumber == 170159 || fCurrentRunNumber == 170163 || fCurrentRunNumber == 170193 || fCurrentRunNumber == 170195 || fCurrentRunNumber == 170203 || fCurrentRunNumber == 170204 || fCurrentRunNumber == 170228 || fCurrentRunNumber == 170230 || fCurrentRunNumber == 170268 || fCurrentRunNumber == 170269 || fCurrentRunNumber == 170270 || fCurrentRunNumber == 170306 || fCurrentRunNumber == 170308 || fCurrentRunNumber == 170309) runQuality = 0;
1097 if (fCurrentRunNumber == 167902 || fCurrentRunNumber == 167903 || fCurrentRunNumber == 167915 || fCurrentRunNumber == 167920 || fCurrentRunNumber == 167987 || fCurrentRunNumber == 167988 || fCurrentRunNumber == 168066 || fCurrentRunNumber == 168068 || fCurrentRunNumber == 168069 || fCurrentRunNumber == 168076 || fCurrentRunNumber == 168104 || fCurrentRunNumber == 168107 || fCurrentRunNumber == 168108 || fCurrentRunNumber == 168115 || fCurrentRunNumber == 168212 || fCurrentRunNumber == 168310 || fCurrentRunNumber == 168311 || fCurrentRunNumber == 168322 || fCurrentRunNumber == 168325 || fCurrentRunNumber == 168341 || fCurrentRunNumber == 168342 || fCurrentRunNumber == 168361 || fCurrentRunNumber == 168362 || fCurrentRunNumber == 168458 || fCurrentRunNumber == 168460 || fCurrentRunNumber == 168461 || fCurrentRunNumber == 168464 || fCurrentRunNumber == 168467 || fCurrentRunNumber == 168511 || fCurrentRunNumber == 168512 || fCurrentRunNumber == 168777 || fCurrentRunNumber == 168826 || fCurrentRunNumber == 168984 || fCurrentRunNumber == 168988 || fCurrentRunNumber == 168992 || fCurrentRunNumber == 169035 || fCurrentRunNumber == 169091 || fCurrentRunNumber == 169094 || fCurrentRunNumber == 169138 || fCurrentRunNumber == 169143 || fCurrentRunNumber == 169144 || fCurrentRunNumber == 169145 || fCurrentRunNumber == 169148 || fCurrentRunNumber == 169156 || fCurrentRunNumber == 169160 || fCurrentRunNumber == 169167 || fCurrentRunNumber == 169238 || fCurrentRunNumber == 169411 || fCurrentRunNumber == 169415 || fCurrentRunNumber == 169417 || fCurrentRunNumber == 169835 || fCurrentRunNumber == 169837 || fCurrentRunNumber == 169838 || fCurrentRunNumber == 169846 || fCurrentRunNumber == 169855 || fCurrentRunNumber == 169858 || fCurrentRunNumber == 169859 || fCurrentRunNumber == 169923 || fCurrentRunNumber == 169956 || fCurrentRunNumber == 170027 || fCurrentRunNumber == 170036 || fCurrentRunNumber == 170081) runQuality = 1;
1102 if (runQuality != -1) {
1103 effSwitch = 2 + runQuality*4 +
fCentBin;
1108 AliErrorStream() <<
"Single track efficiency for pA is not available.\n";
1116 AliErrorStream() <<
"Beam type " <<
fBeamType <<
" is not defined\n";
1132 AliDebugStream(5) <<
"Using efficiency switch value of " << effSwitch <<
"\n";
1145 TRefficiency = ptaxis*etaaxis;
1152 TRefficiency = ptaxis*etaaxis;
1159 TRefficiency = ptaxis*etaaxis;
1166 TRefficiency = ptaxis*etaaxis;
1173 TRefficiency = ptaxis*etaaxis;
1180 TRefficiency = ptaxis*etaaxis;
1187 TRefficiency = ptaxis*etaaxis;
1194 TRefficiency = ptaxis*etaaxis;
1204 coefficient = (1 + -0.442232 * trackPT
1205 + 0.501831 * std::pow(trackPT, 2)
1206 + -0.252024 * std::pow(trackPT, 3)
1207 + 0.062964 * std::pow(trackPT, 4)
1208 + -0.007681 * std::pow(trackPT, 5)
1209 + 0.000365 * std::pow(trackPT, 6));
1213 TRefficiency = coefficient * (1 + 0.402825 * std::abs(trackETA)
1214 + -2.213152 * std::pow(trackETA, 2)
1215 + 4.311098 * std::abs(std::pow(trackETA, 3))
1216 + -2.778200 * std::pow(trackETA, 4));
1223 AliErrorStream() <<
"No single track efficiency setting selected! Please select one.\n";
1227 return TRefficiency;
1243 AliDebugStream(3) << GetName() <<
":" << hist->GetName() <<
": " << std::boolalpha <<
"Using normal weights: JESHist: " << (
fJESCorrectionHist ?
fJESCorrectionHist->GetName() :
"Null") <<
", noCorrection: " << noCorrection << std::endl;
1244 hist->Fill(fillValue, weight);
1251 std::vector <Double_t> yBinsContent;
1252 AliDebug(3, TString::Format(
"%s: Attempt to access weights from JES correction hist %s with jet pt %f!", GetName(), hist->GetName(), fillValue));
1254 AliDebug(3, TString::Format(
"weights size: %zd", yBinsContent.size()));
1261 if (yBinsContent.at(index-1) > 0) {
1265 AliDebug(4, TString::Format(
"fillLocation: %f, weight: %f", fillLocation, yBinsContent.at(index-1)));
1267 hist->Fill(fillLocation, weight*yBinsContent.at(index-1));
1291 AliDebugStream(3) << GetName() <<
":" << hist->GetName() <<
": " << std::boolalpha <<
"Using normal weights: JESHist: " << (
fJESCorrectionHist ?
fJESCorrectionHist->GetName() :
"Null") <<
", noCorrection: " << noCorrection << std::endl;
1292 hist->Fill(fillValue, weight);
1302 std::vector <Double_t> yBinsContent;
1303 AliDebug(3, TString::Format(
"%s: Attempt to access weights from JES correction hist %s with jet pt %f!", GetName(), hist->GetName(), jetPt));
1305 AliDebug(3, TString::Format(
"weights size: %zd", yBinsContent.size()));
1312 if (yBinsContent.at(index-1) > 0) {
1316 AliDebug(4,TString::Format(
"fillValue[1]: %f, weight: %f", fillValue[1], yBinsContent.at(index-1)));
1318 hist->Fill(fillValue, weight*yBinsContent.at(index-1));
1335 for (
Int_t index = 1; index <= hist->GetYaxis()->GetNbins(); index++)
1338 yBinsContent.push_back(hist->GetBinContent(hist->GetBin(xBin,index)));
1340 if (scaleFactor >= 0)
1343 hist->SetBinContent(hist->GetBin(xBin,index), yBinsContent.at(index-1)/scaleFactor);
1367 if (filename.Contains(
"alien://") && !gGrid) {
1368 TGrid::Connect(
"alien://");
1378 TString histBaseName = histName;
1380 histName = TString::Format(
"%s_Track%.2f", histName.Data(), trackBias);
1383 histName = TString::Format(
"%s_Clus%.2f", histName.Data(), clusterBias);
1387 TFile * jesCorrectionFile = TFile::Open(filename);
1388 if (!jesCorrectionFile || jesCorrectionFile->IsZombie()) {
1389 AliError(TString::Format(
"%s: Could not open JES correction file %s", GetName(), filename.Data()));
1394 TH2D * JESCorrectionHist =
dynamic_cast<TH2D*
>(jesCorrectionFile->Get(histName.Data()));
1395 if (JESCorrectionHist) {
1396 AliInfo(TString::Format(
"%s: JES correction hist name \"%s\" loaded from file %s.", GetName(), histName.Data(), filename.Data()));
1399 AliError(TString::Format(
"%s: JES correction hist name \"%s\" not found in file %s.", GetName(), histName.Data(), filename.Data()));
1402 JESCorrectionHist =
dynamic_cast<TH2D*
>(jesCorrectionFile->Get(histBaseName.Data()));
1403 if (JESCorrectionHist) {
1404 AliInfo(TString::Format(
"%s: JES correction hist name \"%s\" loaded from file %s.", GetName(), histBaseName.Data(), filename.Data()));
1405 histName = histBaseName;
1409 AliError(TString::Format(
"%s: JES correction with base hist name %s not found in file %s.", GetName(), histBaseName.Data(), filename.Data()));
1415 TH2D * tempHist =
static_cast<TH2D *
>(JESCorrectionHist->Clone());
1416 tempHist->SetDirectory(0);
1420 jesCorrectionFile->Close();
1429 if (tempName.Index(tag) == -1) {
1431 Ssiz_t suffixLocation = tempName.Last(
'_');
1432 tempName.Insert(suffixLocation, tag.Data());
1435 AliDebug(3, TString::Format(
"%s: Setting task name to %s", GetName(), tempName.Data()));
1436 SetName(tempName.Data());
1448 const char *nTracks,
1449 const char *nCaloClusters,
1454 const Int_t nTracksMixedEvent,
1455 const Int_t minNTracksMixedEvent,
1456 const Int_t minNEventsMixedEvent,
1457 const UInt_t nCentBinsMixedEvent,
1462 const Bool_t lessSparseAxes,
1463 const Bool_t widerTrackBin,
1466 const Bool_t JESCorrection,
1467 const char * JESCorrectionFilename,
1468 const char * JESCorrectionHistName,
1477 AliErrorClass(
"No analysis manager to connect to.");
1487 TString clusName(nCaloClusters);
1489 if (trackName ==
"usedefault") {
1493 if (clusName ==
"usedefault") {
1497 TString name(
"AliAnalysisTaskJetH");
1498 if (!trackName.IsNull()) {
1499 name += TString::Format(
"_%s", trackName.Data());
1501 if (!clusName.IsNull()) {
1502 name += TString::Format(
"_%s", clusName.Data());
1504 if (strcmp(suffix,
"") != 0) {
1505 name += TString::Format(
"_%s", suffix);
1513 correlationTask->
SetEventMixing(static_cast<Bool_t>(nTracksMixedEvent));
1527 if (JESCorrection == kTRUE)
1531 AliErrorClass(
"Failed to successfully retrieve and initialize the JES correction! Task initialization continuing without JES correction (can be set manually later).");
1539 mgr->AddTask(correlationTask);
1542 mgr->ConnectInput (correlationTask, 0, mgr->GetCommonInputContainer() );
1543 AliAnalysisDataContainer * cojeth = mgr->CreateContainer(correlationTask->GetName(),
1545 AliAnalysisManager::kOutputContainer,
1546 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
1547 mgr->ConnectOutput(correlationTask, 1, cojeth);
1549 return correlationTask;
1558 std::string clusName,
1559 const double jetConstituentPtCut,
1560 const double trackEta,
1561 const double jetRadius)
1563 bool returnValue =
false;
1564 AliInfoStream() <<
"Configuring Jet-H Correlations task for a standard analysis.\n";
1568 if (clusName ==
"usedefault") {
1573 clustersForJets->SetName(
"clustersForJets");
1574 clustersForJets->SetMinE(jetConstituentPtCut);
1578 if (trackName ==
"usedefault") {
1582 particlesForJets->SetName(
"particlesForJets");
1583 particlesForJets->SetMinPt(jetConstituentPtCut);
1584 particlesForJets->SetEtaLimits(-1.0*trackEta, trackEta);
1588 if (particlesForCorrelations)
1590 particlesForCorrelations->SetName(
"tracksForCorrelations");
1591 particlesForCorrelations->SetMinPt(0.15);
1592 particlesForCorrelations->SetEtaLimits(-1.0*trackEta, trackEta);
1597 AliWarningStream() <<
"No particle container was successfully created!\n";
1609 jetContainer->
SetJetAreaCut(jetRadius * jetRadius * TMath::Pi() * 0.6);
1625 std::string clusName,
1626 const double jetConstituentPtCut,
1627 const double trackEta,
1628 const double jetRadius,
1629 const std::string & jetTag,
1630 const std::string & correlationsTracksCutsPeriod)
1632 bool returnValue =
false;
1633 AliInfoStream() <<
"Configuring Jet-H Correlations task for an embedding analysis.\n";
1640 if (clusName ==
"usedefault") {
1645 clustersForJets->SetName(
"clustersForJets");
1646 clustersForJets->SetMinE(jetConstituentPtCut);
1658 if (trackName ==
"usedefault") {
1662 particlesForJets->SetName(
"particlesForJets");
1663 particlesForJets->SetMinPt(jetConstituentPtCut);
1664 particlesForJets->SetEtaLimits(-1.0*trackEta, trackEta);
1669 if (particlesForCorrelations)
1671 particlesForCorrelations->SetName(
"tracksForCorrelations");
1672 particlesForCorrelations->SetMinPt(0.15);
1673 particlesForCorrelations->SetEtaLimits(-1.0*trackEta, trackEta);
1674 particlesForCorrelations->SetIsEmbedding(
true);
1684 AliWarningStream() <<
"No particle container was successfully created!\n";
1698 jetContainer->
SetJetAreaCut(jetRadius * jetRadius * TMath::Pi() * 0.6);
1720 partCont = trackCont;
1722 else if (collectionName !=
"") {
1736 std::stringstream tempSS;
1737 tempSS << std::boolalpha;
1739 tempSS <<
"Jet collections:\n";
1742 while ((jetCont = static_cast<AliJetContainer *>(next()))) {
1743 tempSS <<
"\t" << jetCont->GetName() <<
": " << jetCont->GetArrayName() <<
"\n";
1745 tempSS <<
"Event selection\n";
1748 tempSS <<
"\tUse AliAnalysisTaskEmcal event selection (needs to be enabled to use AliEventCuts): " <<
fUseBuiltinEventSelection <<
"\n";
1749 tempSS <<
"\tTrigger event selection: " << std::bitset<32>(
fTriggerType) <<
"\n";
1750 tempSS <<
"\tMixed event selection: " << std::bitset<32>(
fMixingEventType) <<
"\n";
1752 tempSS <<
"Jet settings:\n";
1753 tempSS <<
"\tTrack bias: " <<
fTrackBias <<
"\n";
1755 tempSS <<
"Event mixing:\n";
1761 tempSS <<
"Histogramming options:\n";
1763 tempSS <<
"\tWider associated track pt bins: " <<
fDoWiderTrackBin <<
"\n";
1764 tempSS <<
"Jet matching options for embedding:\n";
1770 return tempSS.str();
1807 std::ostream & result = myTask.
Print(in);
virtual void SetEventMixing(Bool_t enable)
bool CheckArtificialTrackEfficiency(unsigned int trackIndex, std::vector< unsigned int > &rejectedTrackIndices, bool useRejectedList)
Bool_t fNoMixedEventJESCorrection
True if the jet energy scale correction should be applied to mixed event histograms.
void AccessSetOfYBinValues(TH2D *hist, Int_t xBin, std::vector< Double_t > &yBinsContent, Double_t scaleFactor=-1.0)
bool ConfigureForEmbeddingAnalysis(std::string trackName="usedefault", std::string clusName="caloClustersCombined", const double jetConstituentPtCut=3, const double trackEta=0.8, const double jetRadius=0.2, const std::string &jetTag="hybridLevelJets", const std::string &correlationsTracksCutsPeriod="lhc11a")
THnSparse * fhnTrigger
! JetH trigger sparse
void SetTrackCutsPeriod(const char *period)
Int_t fMinNEventsMixedEvents
threshold to use event pool # events
AliEventCuts fEventCuts
AliEventCuts to handle event selection.
void SetDoWiderTrackBin(Bool_t wtrbin)
Int_t fNMixingTracks
size of track buffer for event mixing
virtual void SetMinNTracksForMixedEvents(Int_t nmt)
void SetUseInternalEventSelection(Bool_t doUse)
Use internal (old) event selection.
static Double_t DeltaPhi(Double_t phia, Double_t phib, Double_t rMin=-TMath::Pi()/2, Double_t rMax=3 *TMath::Pi()/2)
UInt_t fMixingEventType
Event selection for mixed events.
bool CheckForMatchedJet(AliJetContainer *jets, AliEmcalJet *jet, const std::string &histName)
AliEmcalJet * ClosestJet() const
AliJetContainer * GetJetContainer(Int_t i=0) const
Double_t ClosestJetDistance() const
static Double_t p10_30SG[17]
10-30% centrality semi-good runs
void AdoptParticleContainer(AliParticleContainer *cont)
Bool_t fDoEventMixing
flag to do event mixing
! Explicitly select pp single track efficiency
virtual void UserCreateOutputObjects()
UInt_t RetrieveTriggerMask() const
Bool_t fRecycleUnusedEmbeddedEventsMode
Allows the recycling of embedded events which fail internal event selection. See the embedding helper...
THnSparse * fhnJH
! JetH THnSparse
TH2D * fJESCorrectionHist
Histogram containing the jet energy scale correction.
THistManager fHistManager
Histogram manager.
Container with name, TClonesArray and cuts for particles.
virtual void SetTrackBias(Double_t b)
Require a track with pt > b in jet.
Declaration of class AliTLorentzVector.
Int_t fMinNTracksMixedEvents
threshold to use event pool # tracks
TH1 * fHistJetPtBias[6]
! Jet pt spectrum of jets which meet the constituent bias criteria (the array corresponds to centrali...
Double_t fEPV0
!event plane V0
Bool_t fGeneralHistograms
whether or not it should fill some general histograms
Declaration of class AliAnalysisTaskEmcalEmbeddingHelper.
Bool_t fDoLessSparseAxes
True if there should be fewer THnSparse axes.
AliJetContainer * AddJetContainer(const char *n, TString defaultCutType, Float_t jetRadius=0.4)
virtual void UserExecOnce()
Task initializations handled in user tasks.
Int_t fCentBin
!event centrality bin
void RetrieveAndSetTaskPropertiesFromYAMLConfig()
bool fUseAliEventCuts
If true, use AliEventCuts.
Double_t fMaxMatchedJetDistance
Maximum distance between two matched jets.
Bool_t fDoWiderTrackBin
True if the track pt bins in the THnSparse should be wider.
AliAnalysisTaskEmcalJetHCorrelations()
Double_t fClusterBias
Jet cluster bias.
virtual Double_t Pt() const
UInt_t fTriggerType
Event selection for jets (ie triggered events).
THnSparse * fhnMixedEvents
! Mixed events THnSparse
Bool_t fUseBuiltinEventSelection
Use builtin event selection of the AliAnalysisTaskEmcal instead of AliEventCuts.
bool ConfigureForStandardAnalysis(std::string trackName="usedefault", std::string clusName="usedefault", const double jetConstituentPtCut=3, const double trackEta=0.8, const double jetRadius=0.2)
virtual Double_t Eta() const
Container for particles within the EMCAL framework.
std::string toString() const
TObjArray * CloneAndReduceTrackList(std::vector< unsigned int > &rejectedTrackIndices, const bool useRejectedList)
Bool_t fIsEmbedded
trigger, embedded signal
AliParticleContainer * CreateParticleOrTrackContainer(const std::string &collectionName) const
Int_t GetTrackPtBin(Double_t pt) const
void SetSingleTrackEfficiencyType(ESingleTrackEfficiency_t trackEffType)
BeamType
Switch for the beam type.
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
virtual void UserExecOnce()
static void ConfigureEventCuts(AliEventCuts &eventCuts, PWG::Tools::AliYAMLConfiguration &yamlConfig, const UInt_t offlineTriggerMask, const std::string &baseName, const std::string &taskName)
virtual void SetNCentBinsMixedEvent(Bool_t centbins)
AliEmcalJet * GetLeadingJet(const char *opt="")
static Double_t p30_50G[17]
30-50% centrality good runs
void Print(Option_t *opt="") const
static UInt_t DeterminePhysicsSelectionFromYAML(const std::vector< std::string > &selections)
virtual THnSparse * NewTHnSparseF(const char *name, UInt_t entries)
virtual void SetClusterBias(Double_t b)
Require a cluster with pt > b in jet.
void SetJetPtCut(Float_t cut)
THashList * GetListOfHistograms() const
Get the list of histograms.
static Double_t p10_30G[17]
10-30% centrality good runs
Double_t GetTrackBias() const
! Disable single track efficiency
static AliAnalysisTaskEmcalJetHCorrelations * AddTaskEmcalJetHCorrelations(const char *nTracks="usedefault", const char *nCaloClusters="usedefault", const Double_t trackBias=5, const Double_t clusterBias=5, const Int_t nTracksMixedEvent=0, const Int_t minNTracksMixedEvent=5000, const Int_t minNEventsMixedEvent=5, const UInt_t nCentBinsMixedEvent=10, UInt_t trigEvent=AliVEvent::kAny, UInt_t mixEvent=AliVEvent::kAny, const Bool_t lessSparseAxes=kFALSE, const Bool_t widerTrackBin=kFALSE, const AliAnalysisTaskEmcalJetHCorrelations::ESingleTrackEfficiency_t singleTrackEfficiency=AliAnalysisTaskEmcalJetHCorrelations::kEffDisable, const Bool_t JESCorrection=kFALSE, const char *JESCorrectionFilename="alien:///alice/cern.ch/user/r/rehlersi/JESCorrection.root", const char *JESCorrectionHistName="JESCorrection", const char *suffix="biased")
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
static Double_t p50_90G[17]
50-90% centrality good runs
Bool_t BiasedJet(AliEmcalJet *jet)
BeamType fForceBeamType
forced beam type
Int_t fNcentBins
how many centrality bins
Double_t MaxTrackPt() const
void FillHist(TH1 *hist, Double_t fillValue, Double_t weight=1.0, Bool_t noCorrection=kFALSE)
BeamType fBeamType
!event beam type
Double_t fCent
!event centrality
static Double_t p50_90SG[17]
50-90% centrality semi-good runs
virtual void SetMixedEventTriggerType(UInt_t me)
Set the mixed event trigger selection.
Bool_t RetrieveAndInitializeJESCorrectionHist(TString filename, TString histName, Double_t trackBias=AliAnalysisTaskEmcalJetHCorrelations::kDisableBias, Double_t clusterBias=AliAnalysisTaskEmcalJetHCorrelations::kDisableBias)
Double_t EffCorrection(Double_t trkETA, Double_t trkPT, AliAnalysisTaskEmcal::BeamType beamType) const
Int_t GetNAcceptedTracks()
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
virtual void SetNumberOfMixingTracks(Int_t tracks)
static double RelativeEPAngle(double jetAngle, double epAngle)
TObjArray fJetCollArray
jet collection array
Double_t fMinSharedMomentumFraction
Minimum shared momentum with matched jet.
virtual void SetNCentBins(Int_t n)
ESingleTrackEfficiency_t
Define the single track efficiency to apply.
! Number of elements in track pt binned arrays
UInt_t fNCentBinsMixedEvent
N cent bins for the event mixing pool.
void SetIsEmbedded(Bool_t i)
! Number of elements in centrality binned arrays
static Double_t p0_10SG[17]
0-10% centrality semi-good runs
! Number of elements in mixed event multiplicity binned arrays
virtual Bool_t IsEventSelected()
Performing event selection.
Bool_t fRequireMatchedJetWhenEmbedding
True if jets are required to be matched (ie. jet->MatchedJet() != nullptr)
static Double_t * GenerateFixedBinArray(Int_t n, Double_t min, Double_t max)
AliEmcalList * fOutput
!output list
void SetJESCorrectionHist(TH2D *hist)
PWG::Tools::AliYAMLConfiguration fYAMLConfig
YAML configuration file.
TH2 * fHistTrackEtaPhi[7]
! Track eta-phi distribution (the array corresponds to track pt)
bool fConfigurationInitialized
True if the task configuration has been successfully initialized.
virtual void SetMinNEventsForMixedEvents(Int_t nme)
TH1 * fHistJetPt[6]
! Jet pt spectrum (the array corresponds to centrality bins)
static Double_t p30_50SG[17]
30-50% centrality semi-good runs
Double_t fVertex[3]
!event vertex
Bool_t fDisableFastPartition
True if task should be disabled for the fast partition, where the EMCal is not included.
void InitializeArraysToZero()
Double_t fTrackBias
Jet track bias.
AliTrackContainer * GetTrackContainer(Int_t i=0) const
TH1 * fHistEventRejection
!book keep reasons for rejecting event
void SetMakeGeneralHistograms(Bool_t g)
Base task in the EMCAL jet framework.
Double_t MaxClusterPt() const
Represent a jet reconstructed using the EMCal jet framework.
static std::string DetermineUseDefaultName(InputObject_t objType)
Double_t GetFractionSharedPt(const AliEmcalJet *jet, AliParticleContainer *cont2=0x0) const
const AliTrackIterableMomentumContainer accepted_momentum() const
TH2 * fHistJetEtaPhi
! Jet eta-phi distribution
Double_t GetClusterBias() const
TH2 * fHistJetHEtaPhi
! Eta-phi distribution of jets which are in jet-hadron correlations
void GetDeltaEtaDeltaPhiDeltaR(AliTLorentzVector &particleOne, AliVParticle *particleTwo, Double_t &deltaEta, Double_t &deltaPhi, Double_t &deltaR)
static Double_t p0_10G[17]
0-10% centrality good runs
! Auto configure the single track efficiency based on the beam type, centrality, and run quality (num...
void UserCreateOutputObjects()
Main initialization function on the worker.
ESingleTrackEfficiency_t fSingleTrackEfficiencyCorrectionType
Control the efficiency correction. See EffCorrection() for meaning of values.
const AliJetIterableContainer accepted() const
friend std::ostream & operator<<(std::ostream &in, const AliAnalysisTaskEmcalJetHCorrelations &myTask)
virtual void SetTriggerType(UInt_t te)
Set the trigger event trigger selection.
AliEventPoolManager * fPoolMgr
! Event pool manager
void SetMaxTrackPt(Float_t b)
virtual Double_t Phi() const
Container structure for EMCAL clusters.
void SetDoLessSparseAxes(Bool_t dlsa)
EMCal fiducial acceptance (each eta, phi edge narrowed by jet R)
! Arbitrarily large value which can be used to disable the constituent bias. Can be used for either t...
virtual void GetDimParams(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)
Container for jet within the EMCAL jet framework.
bool fRequireMatchedPartLevelJet
True if matched jets are required to be matched to a particle level jet.
TH1 * fHistJetHTrackPt
! Track pt spectrum
Double_t fArtificialTrackInefficiency
Artificial track inefficiency. Enabled if < 1.0.
void SetJetAreaCut(Float_t cut)
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()
TRandom3 fRandom
! Random number generator for artificial track inefficiency.