Skip to content

Commit 6fa38c3

Browse files
add ptHatMaxFraction cut
1 parent 717f9fb commit 6fa38c3

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

PWGJE/Tasks/trackEfficiency.cxx

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ struct TrackEfficiency {
8282
Configurable<float> ptHatMin{"ptHatMin", 5, "min pT hat of collisions"};
8383
Configurable<float> ptHatMax{"ptHatMax", 300, "max pT hat of collisions"};
8484
Configurable<float> pTHatExponent{"pTHatExponent", 6.0, "exponent of the event weight for the calculation of pTHat"};
85+
Configurable<float> pTHatMaxFractionMCD{"pTHatMaxFractionMCD", 999.0, "maximum fraction of hard scattering for reconstructed track acceptance in MC"};
8586

8687
Configurable<int> useTrueTrackWeight{"useTrueTrackWeight", 1, "test configurable, to be removed"};
8788

@@ -112,6 +113,13 @@ struct TrackEfficiency {
112113
if (!(jetderiveddatautilities::selectTrack(track, trackSelection) && jetderiveddatautilities::selectTrackDcaZ(track, trackDcaZmax))) {
113114
continue;
114115
}
116+
117+
float simPtRef = 10.;
118+
float pTHat = simPtRef / (std::pow(weight, 1.0 / pTHatExponent));
119+
if (track.pt() > pTHatMaxFractionMCD * pTHat) {
120+
continue;
121+
}
122+
115123
registry.fill(HIST("h2_centrality_track_pt"), collision.centrality(), track.pt(), weight);
116124
registry.fill(HIST("h2_centrality_track_eta"), collision.centrality(), track.eta(), weight);
117125
registry.fill(HIST("h2_centrality_track_phi"), collision.centrality(), track.phi(), weight);
@@ -166,8 +174,17 @@ struct TrackEfficiency {
166174
registry.get<TH1>(HIST("hTrackCutsCounts"))->GetXaxis()->SetBinLabel(1, "allTracksInSelColl");
167175
registry.get<TH1>(HIST("hTrackCutsCounts"))->GetXaxis()->SetBinLabel(2, "trackSel");
168176
registry.get<TH1>(HIST("hTrackCutsCounts"))->GetXaxis()->SetBinLabel(3, "hasMcParticle");
169-
registry.get<TH1>(HIST("hTrackCutsCounts"))->GetXaxis()->SetBinLabel(4, "mcPartIsPrimary");
170-
registry.get<TH1>(HIST("hTrackCutsCounts"))->GetXaxis()->SetBinLabel(5, "etaAcc"); // not actually applied here but it will give an idea of what will be done in the post processing
177+
178+
if (doprocessEFficiencyPurity) {
179+
registry.get<TH1>(HIST("hTrackCutsCounts"))->GetXaxis()->SetBinLabel(4, "mcPartIsPrimary");
180+
registry.get<TH1>(HIST("hTrackCutsCounts"))->GetXaxis()->SetBinLabel(5, "etaAcc"); // not actually applied here but it will give an idea of what will be done in the post processing
181+
}
182+
if (doprocessEFficiencyPurityWeighted) {
183+
registry.get<TH1>(HIST("hTrackCutsCounts"))->GetXaxis()->SetBinLabel(4, "ptHatMaxFraction");
184+
registry.get<TH1>(HIST("hTrackCutsCounts"))->GetXaxis()->SetBinLabel(5, "mcPartIsPrimary");
185+
registry.get<TH1>(HIST("hTrackCutsCounts"))->GetXaxis()->SetBinLabel(6, "etaAcc"); // not actually applied here but it will give an idea of what will be done in the post processing
186+
187+
}
171188

172189
AxisSpec ptAxisEff = {nBinsLowPt, 0., 10., "#it{p}_{T} (GeV/#it{c})"};
173190
AxisSpec ptAxisHighEff = {18, 10., 100., "#it{p}_{T} (GeV/#it{c})"};
@@ -480,8 +497,9 @@ struct TrackEfficiency {
480497
}
481498
registry.fill(HIST("hMcCollCutsCounts"), 5.5); // at least one of the reconstructed collisions associated with this mcCollision is selected with regard to centrality
482499

500+
float simPtRef = 10.;
483501
float mcCollEventWeight = mcCollision.weight();
484-
float pTHat = 10. / (std::pow(mcCollEventWeight, 1.0 / pTHatExponent));
502+
float pTHat = simPtRef / (std::pow(mcCollEventWeight, 1.0 / pTHatExponent));
485503
if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max
486504
return;
487505
}
@@ -541,6 +559,12 @@ struct TrackEfficiency {
541559
}
542560
registry.fill(HIST("hTrackCutsCounts"), 2.5);
543561

562+
float pTHat = 10. / (std::pow(weight, 1.0 / pTHatExponent));
563+
if (jet.pt() > pTHatMaxMCD * pTHat || pTHat < pTHatAbsoluteMin) {
564+
continue;
565+
}
566+
registry.fill(HIST("hTrackCutsCounts"), 3.5);
567+
544568
auto mcParticle = track.mcParticle_as<JetParticlesWithOriginal>();
545569
auto trueTrackMcCollision = mcParticle.mcCollision_as<aod::JetMcCollisions>();
546570
float trueTrackCollEventWeight = useTrueTrackWeight ? trueTrackMcCollision.weight() : mcCollEventWeight; // test1
@@ -566,7 +590,7 @@ struct TrackEfficiency {
566590
continue;
567591
}
568592

569-
registry.fill(HIST("hTrackCutsCounts"), 3.5);
593+
registry.fill(HIST("hTrackCutsCounts"), 4.5);
570594

571595
registry.fill(HIST("h3_track_pt_track_eta_track_phi_associatedtrack_primary"), track.pt(), track.eta(), track.phi(), trueTrackCollEventWeight);
572596
registry.fill(HIST("h3_particle_pt_particle_eta_particle_phi_associatedtrack_primary"), jMcParticleFromTrack.pt(), jMcParticleFromTrack.eta(), jMcParticleFromTrack.phi(), trueTrackCollEventWeight);
@@ -587,7 +611,7 @@ struct TrackEfficiency {
587611
}
588612

589613
if (std::abs(jMcParticleFromTrack.eta()) < trackEtaAcceptanceCountQA) { // not actually applied here but it will give an idea of what will be done in the post processing
590-
registry.fill(HIST("hTrackCutsCounts"), 4.5);
614+
registry.fill(HIST("hTrackCutsCounts"), 5.5);
591615
}
592616
}
593617
}

0 commit comments

Comments
 (0)