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};
66 fDoEventMixing(kFALSE),
67 fNMixingTracks(50000), fMinNTracksMixedEvents(5000), fMinNEventsMixedEvents(5), fNCentBinsMixedEvent(10),
69 fTriggerType(AliVEvent::kEMCEJE), fMixingEventType(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral),
70 fDisableFastPartition(kFALSE),
72 fArtificialTrackInefficiency(1.0),
73 fNoMixedEventJESCorrection(kFALSE),
75 fDoLessSparseAxes(kFALSE), fDoWiderTrackBin(kFALSE),
76 fRequireMatchedJetWhenEmbedding(kTRUE),
77 fMinSharedMomentumFraction(0.),
78 fRequireMatchedPartLevelJet(false),
79 fMaxMatchedJetDistance(-1),
149 fHistTrackPt =
new TH1F(
"fHistTrackPt",
"P_{T} distribution", 1000, 0.0, 100.0);
151 fHistJetHEtaPhi =
new TH2F(
"fHistJetHEtaPhi",
"Jet-Hadron deta-dphi",900,-1.8,1.8,720,-1.6,4.8);
159 name = Form(
"fHistTrackEtaPhi_%i", trackPtBin);
165 name = Form(
"fHistJetPt_%i",centralityBin);
166 fHistJetPt[centralityBin] =
new TH1F(name,name,200,0,200);
169 name = Form(
"fHistJetPtBias_%i",centralityBin);
175 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"sharedMomentumFraction",
"partLevelMatchedJet",
"jetDistance",
"passedAllCuts"};
176 for (
auto histName : std::vector<std::string>({
"SameEvent",
"MixedEvent"})) {
177 name = std::string(
"fHistJetMatching") + histName.c_str() +
"Cuts";
178 std::string
title = std::string(
"Jets which passed matching jet cuts for ") + histName;
179 auto histMatchedJetCuts =
fHistManager.
CreateTH1(name, title.c_str(), binLabels.size(), 0, binLabels.size());
181 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
182 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
184 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
189 cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<9;
191 cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<7 | 1<<9;
202 cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<9;
204 cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<7 | 1<<9;
212 cifras = 1<<0 | 1<<1 | 1<<9;
220 while ((obj = next())) {
229 Int_t nZVertexBins = 10;
232 Int_t nEventActivityBins = 8;
245 eventActivityBins = multiplicityBins;
248 fPoolMgr =
new AliEventPoolManager(poolSize,
fNMixingTracks, nEventActivityBins, eventActivityBins, nZVertexBins, zVertexBins);
271 if (pt < 0.5) ptBin = 0;
272 else if (pt < 1 ) ptBin = 1;
273 else if (pt < 2 ) ptBin = 2;
274 else if (pt < 3 ) ptBin = 3;
275 else if (pt < 5 ) ptBin = 4;
276 else if (pt < 8 ) ptBin = 5;
277 else if (pt < 20 ) ptBin = 6;
292 if (embeddingHelper) {
293 auto aodHeader =
dynamic_cast<AliVAODHeader *
>(embeddingHelper->GetEventHeader());
295 AliDebugStream(5) <<
"Retrieving trigger mask from embedded event\n";
296 eventTrigger = aodHeader->GetOfflineTrigger();
299 AliErrorStream() <<
"Failed to retrieve requested AOD header from embedding helper\n";
303 AliErrorStream() <<
"Failed to retrieve requested embedding helper\n";
307 AliDebugStream(5) <<
"Retrieving trigger mask from internal event\n";
308 eventTrigger = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
323 AliError(Form(
"%s: Unable to retrieve tracks!", GetName()));
330 AliError(Form(
"%s: Unable to retrieve jets!", GetName()));
335 std::vector<unsigned int> rejectedTrackIndices;
336 bool useListOfRejectedIndices =
false;
341 Bool_t biasedJet = kFALSE;
360 AliDebugStream(5) <<
"Beginning main processing. Number of jets: " << jets->
GetNJets() <<
", accepted jets: " << jets->
GetNAcceptedJets() <<
"\n";
364 AliDebugStream(4) << GetName() <<
": Fast partition disabled\n";
375 if (eventTrigger == fTriggerType && eventTrigger == 0) {
376 AliDebugStream(5) <<
"Event accepted because the physics selection is \"0\".\n";
379 AliDebugStream(5) <<
"Rejected jets due to physics selection. Phys sel: " << std::bitset<32>(eventTrigger) <<
", requested triggers: " << std::bitset<32>(fTriggerType) <<
" \n";
385 AliDebugStream(5) <<
"Jet passed event selection!\nJet: " << jet->toString().Data() <<
"\n";
390 bool foundMatchedJet =
CheckForMatchedJet(jets, jet,
"fHistJetMatchingSameEventCuts");
391 if (foundMatchedJet ==
false) {
398 eventActivity =
fCent;
407 if (jet == leadingJet) leadJet = kTRUE;
414 if (biasedJet == kTRUE) {
417 const double triggerInfo[] = {eventActivity, jet->Pt(), epAngle};
422 if (jet->Pt() > 15) {
424 AliDebugStream(4) <<
"Passed min jet pt cut of 15. Jet: " << jet->toString().Data() <<
"\n";
427 for (
auto trackIter = tracksIter.begin(); trackIter != tracksIter.end(); trackIter++ ) {
430 track = trackIter->first;
435 if (rejectParticle) {
436 AliDebugStream(4) <<
"Track rejected in signal correlation loop.\n";
449 AliDebugStream(6) <<
"track eta: " << track.Eta() <<
", track pt: " << track.Pt() <<
", efficiency: " << efficiency <<
"\n";
451 if (biasedJet == kTRUE) {
453 double triggerEntries[] = {eventActivity, jet->Pt(), track.Pt(), deltaEta, deltaPhi,
static_cast<Double_t>(leadJet), epAngle};
456 double triggerEntries[] = {eventActivity, jet->Pt(), track.Pt(), deltaEta, deltaPhi,
static_cast<Double_t>(leadJet), deltaR, epAngle};
465 AliDebugStream(4) <<
"Switching to list of rejected track indices. Number of indices: " << rejectedTrackIndices.size() <<
"\n";
466 useListOfRejectedIndices =
true;
496 AliEventPool *pool = 0;
506 else if (
fBeamType ==
kpp) AliFatal(Form(
"No pool found for ntracks_pp = %d, zVertex = %f", tracks->
GetNTracks(), zVertex));
511 Int_t nMix = pool->GetCurrentNEvents();
514 if((eventTrigger & fTriggerType) || eventTrigger == fTriggerType) {
522 bool foundMatchedJet =
CheckForMatchedJet(jets, jet,
"fHistJetMatchingMixedEventCuts");
523 if (foundMatchedJet ==
false) {
529 eventActivity =
fCent;
538 if (jet == leadingJet) { leadJet = kTRUE; }
543 if (jet->Pt() < 15 || biasedJet == kFALSE)
continue;
546 for (
Int_t jMix=0; jMix < nMix; jMix++) {
547 TObjArray* bgTracks = pool->GetEvent(jMix);
549 for (
Int_t ibg=0; ibg < bgTracks->GetEntries(); ibg++){
552 AliError(Form(
"%s:Failed to retrieve tracks from mixed events", GetName()));
560 track.SetPtEtaPhiE(bgTrack->
Pt(), bgTrack->
Eta(), bgTrack->
Phi(), 0);
569 double triggerEntries[] = {eventActivity, jet->Pt(), track.Pt(), deltaEta, deltaPhi,
static_cast<Double_t>(leadJet), epAngle};
572 double triggerEntries[] = {eventActivity, jet->Pt(), track.Pt(), deltaEta, deltaPhi,
static_cast<Double_t>(leadJet), deltaR, epAngle};
582 if ((eventTrigger &
fMixingEventType) || eventTrigger == fMixingEventType) {
586 pool->UpdatePool(tracksClone);
622 deltaPhi =
DeltaPhi(particleOne.Phi(), particleTwo->Phi(), -1.0*TMath::Pi(), TMath::Pi());
623 deltaEta = particleTwo->Eta() - particleOne.Eta();
624 deltaR = TMath::Sqrt(deltaPhi*deltaPhi + deltaEta*deltaEta);
627 deltaPhi =
DeltaPhi(particleTwo->Phi(), particleOne.Phi(), -0.5*TMath::Pi(), 3*TMath::Pi()/2.);
640 bool returnValue =
false;
642 if (useRejectedList) {
643 if (std::find(rejectedTrackIndices.begin(), rejectedTrackIndices.end(), trackIndex) != rejectedTrackIndices.end()) {
644 AliDebugStream(4) <<
"Track " << trackIndex <<
" rejected due to artificial tracking inefficiency (from list)\n";
653 rejectedTrackIndices.push_back(trackIndex);
654 AliDebugStream(4) <<
"Track " << trackIndex <<
" rejected due to artificial tracking inefficiency (from random)\n";
683 bool returnValue =
false;
688 AliDebugStream(4) <<
"Jet is matched!\nJet: " << jet->
toString() <<
"\n";
693 AliDebugStream(4) <<
"Jet rejected due to shared momentum fraction of " << sharedFraction <<
", which is smaller than the min momentum fraction of " <<
fMinSharedMomentumFraction <<
"\n";
697 AliDebugStream(4) <<
"Passed shared momentum fraction with value of " << sharedFraction <<
"\n";
705 AliDebugStream(4) <<
"Jet rejected due to no matching part level jet.\n";
709 AliDebugStream(4) <<
"Det level jet has a required match to a part level jet.\n" <<
"Part level jet: " << partLevelJet->
toString() <<
"\n";
718 AliDebugStream(4) <<
"Jet rejected due to matching distance of " << matchedJetDistance <<
", which is larger than the max distance of " <<
fMaxMatchedJetDistance <<
"\n";
722 AliDebugStream(4) <<
"Jet passed distance cut with distance of " << matchedJetDistance <<
"\n";
728 if (returnValue ==
true) {
733 AliDebugStream(5) <<
"Rejected jet because it was not matched to a external event jet.\n";
758 const Int_t dim = count;
765 while(c<dim && i<32){
770 hnTitle += Form(
";%s",label.Data());
778 return new THnSparseF(name, hnTitle.Data(), dim,
nbins, xmin, xmax);
797 label =
"V0 centrality (%)";
812 label =
"Track p_{T}";
817 label =
"Track p_{T}";
825 label =
"#delta#eta";
832 label =
"#delta#phi";
839 label =
"Leading Jet";
846 label =
"Trigger track";
860 label =
"Leading track";
867 label =
"Event plane angle";
870 xmax = TMath::Pi()/2.;
886 tracksClone->SetOwner(kTRUE);
889 AliVParticle * particle = 0;
894 for (
auto particleIter = particlesIter.begin(); particleIter != particlesIter.end(); particleIter++)
897 particle = particleIter->second;
901 if (rejectParticle) {
902 AliDebugStream(4) <<
"Track rejected in CloneAndReduceTrackList()\n";
908 if(trackPtBin > -1)
fHistTrackEtaPhi[trackPtBin]->Fill(particle->Eta(),particle->Phi());
911 clone =
new AliBasicParticle(particle->Eta(), particle->Phi(), particle->Pt(), particle->Charge());
913 clone->SetUniqueID(particle->GetUniqueID());
915 tracksClone->Add(clone);
960 double TRefficiency = -1;
968 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;
971 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;
976 if (runQuality != -1) {
977 effSwitch = 2 + runQuality*4 +
fCentBin;
982 AliErrorStream() <<
"Single track efficiency for pA is not available.\n";
990 AliErrorStream() <<
"Beam type " <<
fBeamType <<
" is not defined\n";
1006 AliDebugStream(5) <<
"Using efficiency switch value of " << effSwitch <<
"\n";
1019 TRefficiency = ptaxis*etaaxis;
1026 TRefficiency = ptaxis*etaaxis;
1033 TRefficiency = ptaxis*etaaxis;
1040 TRefficiency = ptaxis*etaaxis;
1047 TRefficiency = ptaxis*etaaxis;
1054 TRefficiency = ptaxis*etaaxis;
1061 TRefficiency = ptaxis*etaaxis;
1068 TRefficiency = ptaxis*etaaxis;
1078 coefficient = (1 + -0.442232 * trackPT
1079 + 0.501831 * std::pow(trackPT, 2)
1080 + -0.252024 * std::pow(trackPT, 3)
1081 + 0.062964 * std::pow(trackPT, 4)
1082 + -0.007681 * std::pow(trackPT, 5)
1083 + 0.000365 * std::pow(trackPT, 6));
1087 TRefficiency = coefficient * (1 + 0.402825 * std::abs(trackETA)
1088 + -2.213152 * std::pow(trackETA, 2)
1089 + 4.311098 * std::abs(std::pow(trackETA, 3))
1090 + -2.778200 * std::pow(trackETA, 4));
1097 AliErrorStream() <<
"No single track efficiency setting selected! Please select one.\n";
1101 return TRefficiency;
1117 AliDebugStream(3) << GetName() <<
":" << hist->GetName() <<
": " << std::boolalpha <<
"Using normal weights: JESHist: " << (
fJESCorrectionHist ?
fJESCorrectionHist->GetName() :
"Null") <<
", noCorrection: " << noCorrection << std::endl;
1118 hist->Fill(fillValue, weight);
1125 std::vector <Double_t> yBinsContent;
1126 AliDebug(3, TString::Format(
"%s: Attempt to access weights from JES correction hist %s with jet pt %f!", GetName(), hist->GetName(), fillValue));
1128 AliDebug(3, TString::Format(
"weights size: %zd", yBinsContent.size()));
1135 if (yBinsContent.at(index-1) > 0) {
1139 AliDebug(4, TString::Format(
"fillLocation: %f, weight: %f", fillLocation, yBinsContent.at(index-1)));
1141 hist->Fill(fillLocation, weight*yBinsContent.at(index-1));
1165 AliDebugStream(3) << GetName() <<
":" << hist->GetName() <<
": " << std::boolalpha <<
"Using normal weights: JESHist: " << (
fJESCorrectionHist ?
fJESCorrectionHist->GetName() :
"Null") <<
", noCorrection: " << noCorrection << std::endl;
1166 hist->Fill(fillValue, weight);
1176 std::vector <Double_t> yBinsContent;
1177 AliDebug(3, TString::Format(
"%s: Attempt to access weights from JES correction hist %s with jet pt %f!", GetName(), hist->GetName(), jetPt));
1179 AliDebug(3, TString::Format(
"weights size: %zd", yBinsContent.size()));
1186 if (yBinsContent.at(index-1) > 0) {
1190 AliDebug(4,TString::Format(
"fillValue[1]: %f, weight: %f", fillValue[1], yBinsContent.at(index-1)));
1192 hist->Fill(fillValue, weight*yBinsContent.at(index-1));
1209 for (
Int_t index = 1; index <= hist->GetYaxis()->GetNbins(); index++)
1212 yBinsContent.push_back(hist->GetBinContent(hist->GetBin(xBin,index)));
1214 if (scaleFactor >= 0)
1217 hist->SetBinContent(hist->GetBin(xBin,index), yBinsContent.at(index-1)/scaleFactor);
1241 if (filename.Contains(
"alien://") && !gGrid) {
1242 TGrid::Connect(
"alien://");
1252 TString histBaseName = histName;
1254 histName = TString::Format(
"%s_Track%.2f", histName.Data(), trackBias);
1257 histName = TString::Format(
"%s_Clus%.2f", histName.Data(), clusterBias);
1261 TFile * jesCorrectionFile = TFile::Open(filename);
1262 if (!jesCorrectionFile || jesCorrectionFile->IsZombie()) {
1263 AliError(TString::Format(
"%s: Could not open JES correction file %s", GetName(), filename.Data()));
1268 TH2D * JESCorrectionHist =
dynamic_cast<TH2D*
>(jesCorrectionFile->Get(histName.Data()));
1269 if (JESCorrectionHist) {
1270 AliInfo(TString::Format(
"%s: JES correction hist name \"%s\" loaded from file %s.", GetName(), histName.Data(), filename.Data()));
1273 AliError(TString::Format(
"%s: JES correction hist name \"%s\" not found in file %s.", GetName(), histName.Data(), filename.Data()));
1276 JESCorrectionHist =
dynamic_cast<TH2D*
>(jesCorrectionFile->Get(histBaseName.Data()));
1277 if (JESCorrectionHist) {
1278 AliInfo(TString::Format(
"%s: JES correction hist name \"%s\" loaded from file %s.", GetName(), histBaseName.Data(), filename.Data()));
1279 histName = histBaseName;
1283 AliError(TString::Format(
"%s: JES correction with base hist name %s not found in file %s.", GetName(), histBaseName.Data(), filename.Data()));
1289 TH2D * tempHist =
static_cast<TH2D *
>(JESCorrectionHist->Clone());
1290 tempHist->SetDirectory(0);
1294 jesCorrectionFile->Close();
1303 if (tempName.Index(tag) == -1) {
1305 Ssiz_t suffixLocation = tempName.Last(
'_');
1306 tempName.Insert(suffixLocation, tag.Data());
1309 AliDebug(3, TString::Format(
"%s: Setting task name to %s", GetName(), tempName.Data()));
1310 SetName(tempName.Data());
1322 const char *nTracks,
1323 const char *nCaloClusters,
1328 const Int_t nTracksMixedEvent,
1329 const Int_t minNTracksMixedEvent,
1330 const Int_t minNEventsMixedEvent,
1331 const UInt_t nCentBinsMixedEvent,
1336 const Bool_t lessSparseAxes,
1337 const Bool_t widerTrackBin,
1340 const Bool_t JESCorrection,
1341 const char * JESCorrectionFilename,
1342 const char * JESCorrectionHistName,
1351 AliErrorClass(
"No analysis manager to connect to.");
1361 TString clusName(nCaloClusters);
1363 if (trackName ==
"usedefault") {
1367 if (clusName ==
"usedefault") {
1371 TString name(
"AliAnalysisTaskJetH");
1372 if (!trackName.IsNull()) {
1373 name += TString::Format(
"_%s", trackName.Data());
1375 if (!clusName.IsNull()) {
1376 name += TString::Format(
"_%s", clusName.Data());
1378 if (strcmp(suffix,
"") != 0) {
1379 name += TString::Format(
"_%s", suffix);
1384 correlationTask->SetTrackBias(trackBias);
1385 correlationTask->SetClusterBias(clusterBias);
1387 correlationTask->SetEventMixing(static_cast<Bool_t>(nTracksMixedEvent));
1388 correlationTask->SetNumberOfMixingTracks(nTracksMixedEvent);
1389 correlationTask->SetMinNTracksForMixedEvents(minNTracksMixedEvent);
1390 correlationTask->SetMinNEventsForMixedEvents(minNEventsMixedEvent);
1391 correlationTask->SetNCentBinsMixedEvent(nCentBinsMixedEvent);
1393 correlationTask->SetTriggerType(trigEvent);
1394 correlationTask->SetMixedEventTriggerType(mixEvent);
1396 correlationTask->SetNCentBins(5);
1397 correlationTask->SetVzRange(-10,10);
1398 correlationTask->SetDoLessSparseAxes(lessSparseAxes);
1399 correlationTask->SetDoWiderTrackBin(widerTrackBin);
1401 correlationTask->SetSingleTrackEfficiencyType(singleTrackEfficiency);
1402 if (JESCorrection == kTRUE)
1404 Bool_t result = correlationTask->RetrieveAndInitializeJESCorrectionHist(JESCorrectionFilename, JESCorrectionHistName, correlationTask->GetTrackBias(), correlationTask->GetClusterBias());
1406 AliErrorClass(
"Failed to successfully retrieve and initialize the JES correction! Task initialization continuing without JES correction (can be set manually later).");
1414 mgr->AddTask(correlationTask);
1417 mgr->ConnectInput (correlationTask, 0, mgr->GetCommonInputContainer() );
1418 AliAnalysisDataContainer * cojeth = mgr->CreateContainer(correlationTask->GetName(),
1420 AliAnalysisManager::kOutputContainer,
1421 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
1422 mgr->ConnectOutput(correlationTask, 1, cojeth);
1424 return correlationTask;
1433 std::string clusName,
1434 const double jetConstituentPtCut,
1435 const double trackEta,
1436 const double jetRadius)
1438 bool returnValue =
false;
1439 AliInfoStream() <<
"Configuring Jet-H Correlations task for a standard analysis.\n";
1443 if (clusName ==
"usedefault") {
1448 clustersForJets->SetName(
"clustersForJets");
1449 clustersForJets->SetMinE(jetConstituentPtCut);
1453 if (trackName ==
"usedefault") {
1457 particlesForJets->SetName(
"particlesForJets");
1458 particlesForJets->SetMinPt(jetConstituentPtCut);
1459 particlesForJets->SetEtaLimits(-1.0*trackEta, trackEta);
1463 if (particlesForCorrelations)
1465 particlesForCorrelations->SetName(
"tracksForCorrelations");
1466 particlesForCorrelations->SetMinPt(0.15);
1467 particlesForCorrelations->SetEtaLimits(-1.0*trackEta, trackEta);
1472 AliWarningStream() <<
"No particle container was successfully created!\n";
1484 jetContainer->
SetJetAreaCut(jetRadius * jetRadius * TMath::Pi() * 0.6);
1500 std::string clusName,
1501 const double jetConstituentPtCut,
1502 const double trackEta,
1503 const double jetRadius,
1504 const std::string & jetTag,
1505 const std::string & correlationsTracksCutsPeriod)
1507 bool returnValue =
false;
1508 AliInfoStream() <<
"Configuring Jet-H Correlations task for an embedding analysis.\n";
1515 if (clusName ==
"usedefault") {
1520 clustersForJets->SetName(
"clustersForJets");
1521 clustersForJets->SetMinE(jetConstituentPtCut);
1533 if (trackName ==
"usedefault") {
1537 particlesForJets->SetName(
"particlesForJets");
1538 particlesForJets->SetMinPt(jetConstituentPtCut);
1539 particlesForJets->SetEtaLimits(-1.0*trackEta, trackEta);
1544 if (particlesForCorrelations)
1546 particlesForCorrelations->SetName(
"tracksForCorrelations");
1547 particlesForCorrelations->SetMinPt(0.15);
1548 particlesForCorrelations->SetEtaLimits(-1.0*trackEta, trackEta);
1549 particlesForCorrelations->SetIsEmbedding(
true);
1559 AliWarningStream() <<
"No particle container was successfully created!\n";
1573 jetContainer->
SetJetAreaCut(jetRadius * jetRadius * TMath::Pi() * 0.6);
1595 partCont = trackCont;
1597 else if (collectionName !=
"") {
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
Int_t fNMixingTracks
size of track buffer for event mixing
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
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.
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)
Int_t fCentBin
!event centrality bin
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 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.
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
BeamType
Switch for the beam type.
TH1 * fHistTrackPt
! Track pt spectrum
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
AliEmcalJet * GetLeadingJet(const char *opt="")
static Double_t p30_50G[17]
30-50% centrality good runs
virtual THnSparse * NewTHnSparseF(const char *name, UInt_t entries)
void SetJetPtCut(Float_t cut)
THashList * GetListOfHistograms() const
Get the list of histograms.
static Double_t p10_30G[17]
10-30% centrality good runs
! 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
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
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.
static double RelativeEPAngle(double jetAngle, double epAngle)
Double_t fMinSharedMomentumFraction
Minimum shared momentum with matched jet.
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
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)
TH2 * fHistTrackEtaPhi[7]
! Track eta-phi distribution (the array corresponds to track pt)
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.
void ExecOnce()
Perform steps needed to initialize the analysis.
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
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
Jet-hadron correlations analysis task for central Pb-Pb and pp.
AliEventPoolManager * fPoolMgr
! Event pool manager
void SetMaxTrackPt(Float_t b)
! Number of elements in mixed event multiplicity binned arrays
virtual Double_t Phi() const
Container structure for EMCAL clusters.
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.
Double_t fArtificialTrackInefficiency
Artificial track inefficiency. Enabled if < 1.0.
void SetJetAreaCut(Float_t cut)
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()