Skip to content

Commit 584e1c3

Browse files
PWGJE - jetSpectraCharged.cxx: add checkLeadConstituentMinPtForMcpJets configurable
1 parent 345fcd0 commit 584e1c3

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

PWGJE/Tasks/jetSpectraCharged.cxx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ struct JetSpectraCharged {
8383
Configurable<bool> checkGeoPtMatched{"checkGeoPtMatched", false, "0: turn off geometry and pT matching, 1: do geometry and pT matching"};
8484
Configurable<int> acceptSplitCollisions{"acceptSplitCollisions", 0, "0: only look at mcCollisions that are not split; 1: accept split mcCollisions, 2: accept split mcCollisions but only look at the first reco collision associated with it"};
8585
Configurable<bool> skipMBGapEvents{"skipMBGapEvents", false, "flag to choose to reject min. bias gap events; jet-level rejection can also be applied at the jet finder level for jets only, here rejection is applied for collision and track process functions for the first time, and on jets in case it was set to false at the jet finder level"};
86+
Configurable<bool> checkLeadConstituentMinPtForMcpJets{"checkLeadConstituentMinPtForMcpJets", false, "flag to choose whether particle level jets should have their lead track pt above leadingConstituentPtMin to be accepted; off by default, as leadingConstituentPtMin cut is only applied on MCD jets for the Pb-Pb analysis using pp MC anchored to Pb-Pb for the response matrix"};
8687

8788
std::vector<int> eventSelectionBits;
8889
int trackSelection = -1;
@@ -238,9 +239,8 @@ struct JetSpectraCharged {
238239
Preslice<ChargedMCDMatchedJets> mcdjetsPerJCollision = o2::aod::jet::collisionId;
239240

240241
template <typename TTracks, typename TJets>
241-
bool isAcceptedJet(TJets const& jet)
242+
bool isAcceptedJet(TJets const& jet, bool mcLevelIsParticleLevel = false)
242243
{
243-
244244
if (jetAreaFractionMin > -98.0) {
245245
if (jet.area() < jetAreaFractionMin * o2::constants::math::PI * (jet.r() / 100.0) * (jet.r() / 100.0)) {
246246
return false;
@@ -260,7 +260,7 @@ struct JetSpectraCharged {
260260
for (const auto& constituent : jet.template tracks_as<TTracks>()) {
261261
double pt = constituent.pt();
262262

263-
if (checkConstituentMinPt && pt >= leadingConstituentPtMin) {
263+
if ((!checkLeadConstituentMinPtForMcpJets && mcLevelIsParticleLevel) || (checkConstituentMinPt && pt >= leadingConstituentPtMin)) { // if the jet is mcp level and checkLeadConstituentMinPtForMcpJets is true, then the pt of the leading track of that jet does not need to be below the defined leadingConstituentPtMin cut
264264
isMinLeadingConstituent = true;
265265
}
266266
if (checkConstituentMaxPt && pt > leadingConstituentPtMax) {
@@ -659,6 +659,8 @@ struct JetSpectraCharged {
659659
soa::Join<aod::ChargedMCParticleLevelJets, aod::ChargedMCParticleLevelJetConstituents> const& jets,
660660
aod::JetParticles const&)
661661
{
662+
bool mcLevelIsParticleLevel = true;
663+
662664
registry.fill(HIST("h_mcColl_counts_areasub"), 0.5);
663665
if (std::abs(mccollision.posZ()) > vertexZCut) {
664666
return;
@@ -718,7 +720,7 @@ struct JetSpectraCharged {
718720
if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) {
719721
continue;
720722
}
721-
if (!isAcceptedJet<aod::JetParticles>(jet)) {
723+
if (!isAcceptedJet<aod::JetParticles>(jet, mcLevelIsParticleLevel)) {
722724
continue;
723725
}
724726
fillMCPAreaSubHistograms(jet, mccollision.rho());
@@ -731,6 +733,8 @@ struct JetSpectraCharged {
731733
soa::Join<aod::ChargedMCParticleLevelJets, aod::ChargedMCParticleLevelJetConstituents> const& jets,
732734
aod::JetParticles const&)
733735
{
736+
bool mcLevelIsParticleLevel = true;
737+
734738
registry.fill(HIST("h_mcColl_counts"), 0.5);
735739
if (std::abs(mccollision.posZ()) > vertexZCut) {
736740
return;
@@ -773,7 +777,7 @@ struct JetSpectraCharged {
773777
if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) {
774778
continue;
775779
}
776-
if (!isAcceptedJet<aod::JetParticles>(jet)) {
780+
if (!isAcceptedJet<aod::JetParticles>(jet, mcLevelIsParticleLevel)) {
777781
continue;
778782
}
779783
fillMCPHistograms(jet);
@@ -786,6 +790,8 @@ struct JetSpectraCharged {
786790
soa::Join<aod::ChargedMCParticleLevelJets, aod::ChargedMCParticleLevelJetConstituents, aod::ChargedMCParticleLevelJetEventWeights> const& jets,
787791
aod::JetParticles const&)
788792
{
793+
bool mcLevelIsParticleLevel = true;
794+
789795
registry.fill(HIST("h_mcColl_counts"), 0.5);
790796
if (std::abs(mccollision.posZ()) > vertexZCut) {
791797
return;
@@ -812,7 +818,7 @@ struct JetSpectraCharged {
812818
if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) {
813819
continue;
814820
}
815-
if (!isAcceptedJet<aod::JetParticles>(jet)) {
821+
if (!isAcceptedJet<aod::JetParticles>(jet, mcLevelIsParticleLevel)) {
816822
continue;
817823
}
818824
float jetweight = jet.eventWeight();

0 commit comments

Comments
 (0)