diff --git a/PWGJE/TableProducer/derivedDataSelector.cxx b/PWGJE/TableProducer/derivedDataSelector.cxx index 5fae719fe60..371dbc73f34 100644 --- a/PWGJE/TableProducer/derivedDataSelector.cxx +++ b/PWGJE/TableProducer/derivedDataSelector.cxx @@ -50,8 +50,6 @@ struct JetDerivedDataSelector { Configurable thresholdChargedJetPtMin{"thresholdChargedJetPtMin", 0.0, "Minimum charged jet pt to accept event"}; Configurable thresholdChargedEventWiseSubtractedJetPtMin{"thresholdChargedEventWiseSubtractedJetPtMin", 0.0, "Minimum charged event-wise subtracted jet pt to accept event"}; Configurable thresholdChargedMCPJetPtMin{"thresholdChargedMCPJetPtMin", 0.0, "Minimum charged mcp jet pt to accept event"}; - Configurable thresholdNeutralJetPtMin{"thresholdNeutralJetPtMin", 0.0, "Minimum neutral jet pt to accept event"}; - Configurable thresholdNeutralMCPJetPtMin{"thresholdNeutralMCPJetPtMin", 0.0, "Minimum neutal mcp jet pt to accept event"}; Configurable thresholdFullJetPtMin{"thresholdFullJetPtMin", 0.0, "Minimum full jet pt to accept event"}; Configurable thresholdFullMCPJetPtMin{"thresholdFullMCPJetPtMin", 0.0, "Minimum full mcp jet pt to accept event"}; Configurable thresholdD0PtMin{"thresholdD0PtMin", 0.0, "Minimum D0 pt to accept event"}; @@ -100,7 +98,9 @@ struct JetDerivedDataSelector { Configurable thresholdChargedEventWiseSubtractedDielectronJetPtMin{"thresholdChargedEventWiseSubtractedDielectronJetPtMin", 0.0, "Minimum charged event-wise subtracted Dielectron jet pt to accept event"}; Configurable thresholdChargedDielectronMCPJetPtMin{"thresholdChargedDielectronMCPJetPtMin", 0.0, "Minimum charged Dielectron mcp jet pt to accept event"}; Configurable thresholdTriggerTrackPtMin{"thresholdTriggerTrackPtMin", 0.0, "Minimum trigger track pt to accept event"}; + Configurable thresholdTriggerTrackReferencePtMin{"thresholdTriggerTrackReferencePtMin", 0.0, "Minimum trigger track reference pt to accept event"}; Configurable thresholdTriggerParticlePtMin{"thresholdTriggerParticlePtMin", 0.0, "Minimum trigger particle pt to accept event"}; + Configurable thresholdTriggerParticleReferencePtMin{"thresholdTriggerParticleReferencePtMin", 0.0, "Minimum trigger particle reference pt to accept event"}; Configurable thresholdClusterEnergyMin{"thresholdClusterEnergyMin", 0.0, "Minimum cluster energy to accept event"}; Configurable downscaleFactor{"downscaleFactor", 1, "random downscale of selected events"}; @@ -116,12 +116,15 @@ struct JetDerivedDataSelector { Configurable performTrackSelection{"performTrackSelection", true, "only save tracks that pass one of the track selections"}; Configurable trackPtSelectionMin{"trackPtSelectionMin", 0.15, "only save tracks that have a pT larger than this pT"}; Configurable trackEtaSelectionMax{"trackEtaSelectionMax", 0.9, "only save tracks that have an eta smaller than this eta"}; + Configurable triggerTrackSignalFraction{"triggerTrackSignalFraction", 0.95, "fraction of events to scan for signal trigger track class"}; Configurable triggerMasks{"triggerMasks", "", "possible JE Trigger masks: fJetChLowPt,fJetChHighPt,fTrackLowPt,fTrackHighPt,fJetD0ChLowPt,fJetD0ChHighPt,fJetLcChLowPt,fJetLcChHighPt,fEMCALReadout,fJetFullHighPt,fJetFullLowPt,fJetNeutralHighPt,fJetNeutralLowPt,fGammaVeryHighPtEMCAL,fGammaVeryHighPtDCAL,fGammaHighPtEMCAL,fGammaHighPtDCAL,fGammaLowPtEMCAL,fGammaLowPtDCAL,fGammaVeryLowPtEMCAL,fGammaVeryLowPtDCAL"}; } config; std::vector collisionFlag; - std::vector McCollisionFlag; + std::vector mcCollisionFlag; + std::vector collisionSplitFlag; + std::vector mcCollisionSplitFlag; TRandom3 randomNumber; @@ -146,8 +149,8 @@ struct JetDerivedDataSelector { void processSetupMcCollisions(aod::JMcCollisions const& mcCollisions) { - McCollisionFlag.clear(); - McCollisionFlag.resize(mcCollisions.size(), false); + mcCollisionFlag.clear(); + mcCollisionFlag.resize(mcCollisions.size(), false); } void processSelectMcCollisionsPerCollision(aod::JMcCollisions const& mcCollisions, soa::Join const& collisions) @@ -156,7 +159,7 @@ struct JetDerivedDataSelector { const auto collisionsPerMcCollision = collisions.sliceBy(CollisionsPerMcCollision, mcCollision.globalIndex()); for (auto collision : collisionsPerMcCollision) { if (collisionFlag[collision.globalIndex()]) { - McCollisionFlag[mcCollision.globalIndex()] = true; + mcCollisionFlag[mcCollision.globalIndex()] = true; } } } @@ -165,7 +168,7 @@ struct JetDerivedDataSelector { void processSelectCollisionsPerMcCollision(soa::Join::iterator const& collision) { if (collision.has_mcCollision()) { - if (McCollisionFlag[collision.mcCollisionId()]) { + if (mcCollisionFlag[collision.mcCollisionId()]) { collisionFlag[collision.globalIndex()] = true; } } @@ -184,11 +187,11 @@ struct JetDerivedDataSelector { void processSetupAllMcCollisionsWithDownscaling(aod::JMcCollisions const& mcCollisions) { - McCollisionFlag.clear(); - McCollisionFlag.resize(mcCollisions.size(), false); + mcCollisionFlag.clear(); + mcCollisionFlag.resize(mcCollisions.size(), false); for (const auto& mcCollision : mcCollisions) { if (randomNumber.Integer(config.downscaleFactor) == 0) { - McCollisionFlag[mcCollision.globalIndex()] = true; + mcCollisionFlag[mcCollision.globalIndex()] = true; } } } @@ -203,8 +206,8 @@ struct JetDerivedDataSelector { } } if constexpr (std::is_same_v, aod::JMcCollisions>) { - if (McCollisionFlag[collision.globalIndex()] && randomNumber.Integer(config.downscaleFactor) != 0) { - McCollisionFlag[collision.globalIndex()] = false; + if (mcCollisionFlag[collision.globalIndex()] && randomNumber.Integer(config.downscaleFactor) != 0) { + mcCollisionFlag[collision.globalIndex()] = false; } } } @@ -227,7 +230,7 @@ struct JetDerivedDataSelector { if (jetderiveddatautilities::selectCollision(collision, eventSelectionBitsCharged, config.skipMBGapEvents, config.applyRCTSelectionsCharged)) { barrelRCTFlagSelection = true; } - if (doprocessSelectingNeutralJets || doprocessSelectingNeutralMCDJets || doprocessSelectingNeutralMCPJets || doprocessSelectingFullJets || doprocessSelectingFullMCDJets || doprocessSelectingFullMCPJets || doprocessSelectingClusters) { + if (doprocessSelectingFullJets || doprocessSelectingFullMCDJets || doprocessSelectingFullMCPJets || doprocessSelectingClusters) { if (jetderiveddatautilities::selectCollision(collision, eventSelectionBitsFull, config.skipMBGapEvents, config.applyRCTSelectionsFull, "CBT_calo")) { emcalRCTFlagSelection = true; } @@ -237,6 +240,33 @@ struct JetDerivedDataSelector { } } + void processCollisionSplitting(aod::JCollisions const& collisions) + { + collisionSplitFlag.clear(); + collisionSplitFlag.resize(collisions.size(), true); + for (auto const& collision : collisions) { + if (randomNumber.Rndm() > config.triggerTrackSignalFraction) { + collisionSplitFlag[collision.globalIndex()] = false; + } + } + } + + void processCollisionSplittingMC(aod::JMcCollisions const& mcCollisions, soa::Join const& collisions) + { + mcCollisionSplitFlag.clear(); + mcCollisionSplitFlag.resize(mcCollisions.size(), true); + collisionSplitFlag.clear(); + collisionSplitFlag.resize(collisions.size(), true); + for (auto const& mcCollision : mcCollisions) { + if (randomNumber.Rndm() > config.triggerTrackSignalFraction) { + mcCollisionSplitFlag[mcCollision.globalIndex()] = false; + for (auto const& collision : collisions.sliceBy(CollisionsPerMcCollision, mcCollision.globalIndex())) { + collisionSplitFlag[collision.globalIndex()] = false; + } + } + } + } + template void processSelectionObjects(T const& selectionObjects) { @@ -247,10 +277,6 @@ struct JetDerivedDataSelector { selectionObjectPtMin = config.thresholdChargedEventWiseSubtractedJetPtMin; } else if constexpr (std::is_same_v, aod::ChargedMCParticleLevelJets>) { selectionObjectPtMin = config.thresholdChargedMCPJetPtMin; - } else if constexpr (std::is_same_v, aod::NeutralJets> || std::is_same_v, aod::NeutralMCDetectorLevelJets>) { - selectionObjectPtMin = config.thresholdNeutralJetPtMin; - } else if constexpr (std::is_same_v, aod::NeutralMCParticleLevelJets>) { - selectionObjectPtMin = config.thresholdNeutralMCPJetPtMin; } else if constexpr (std::is_same_v, aod::FullJets> || std::is_same_v, aod::FullMCDetectorLevelJets>) { selectionObjectPtMin = config.thresholdFullJetPtMin; } else if constexpr (std::is_same_v, aod::FullMCParticleLevelJets>) { @@ -368,6 +394,13 @@ struct JetDerivedDataSelector { if (selectionObject.pt() < config.trackPtSelectionMin || std::abs(selectionObject.eta()) > config.trackEtaSelectionMax) { continue; } + if (doprocessCollisionSplitting || doprocessCollisionSplittingMC) { + if (collisionSplitFlag[selectionObject.collisionId()]) { + selectionObjectPtMin = config.thresholdTriggerTrackPtMin; + } else { + selectionObjectPtMin = config.thresholdTriggerTrackReferencePtMin; + } + } } if constexpr (std::is_same_v, aod::JMcParticles>) { if (!selectionObject.isPhysicalPrimary()) { @@ -376,15 +409,22 @@ struct JetDerivedDataSelector { if (selectionObject.pt() < config.trackPtSelectionMin || std::abs(selectionObject.eta()) > config.trackEtaSelectionMax) { continue; } + if (doprocessCollisionSplittingMC) { + if (mcCollisionSplitFlag[selectionObject.mcCollisionId()]) { + selectionObjectPtMin = config.thresholdTriggerParticlePtMin; + } else { + selectionObjectPtMin = config.thresholdTriggerParticleReferencePtMin; + } + } } if (selectionObject.pt() >= selectionObjectPtMin) { isTriggerObject = true; } } if (isTriggerObject) { - if constexpr (std::is_same_v, aod::ChargedMCParticleLevelJets> || std::is_same_v, aod::NeutralMCParticleLevelJets> || std::is_same_v, aod::FullMCParticleLevelJets> || std::is_same_v, aod::CandidatesD0MCP> || std::is_same_v, aod::D0ChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesDplusMCP> || std::is_same_v, aod::DplusChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesDsMCP> || std::is_same_v, aod::DsChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesDstarMCP> || std::is_same_v, aod::DstarChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesLcMCP> || std::is_same_v, aod::LcChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesB0MCP> || std::is_same_v, aod::B0ChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesBplusMCP> || std::is_same_v, aod::BplusChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesXicToXiPiPiMCP> || std::is_same_v, aod::XicToXiPiPiChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesDielectronMCP> || std::is_same_v, aod::DielectronChargedMCParticleLevelJets> || std::is_same_v, aod::JMcParticles>) { + if constexpr (std::is_same_v, aod::ChargedMCParticleLevelJets> || std::is_same_v, aod::FullMCParticleLevelJets> || std::is_same_v, aod::CandidatesD0MCP> || std::is_same_v, aod::D0ChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesDplusMCP> || std::is_same_v, aod::DplusChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesDsMCP> || std::is_same_v, aod::DsChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesDstarMCP> || std::is_same_v, aod::DstarChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesLcMCP> || std::is_same_v, aod::LcChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesB0MCP> || std::is_same_v, aod::B0ChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesBplusMCP> || std::is_same_v, aod::BplusChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesXicToXiPiPiMCP> || std::is_same_v, aod::XicToXiPiPiChargedMCParticleLevelJets> || std::is_same_v, aod::CandidatesDielectronMCP> || std::is_same_v, aod::DielectronChargedMCParticleLevelJets> || std::is_same_v, aod::JMcParticles>) { if (selectionObject.mcCollisionId() >= 0) { - McCollisionFlag[selectionObject.mcCollisionId()] = true; + mcCollisionFlag[selectionObject.mcCollisionId()] = true; } } else { if (selectionObject.collisionId() >= 0) { @@ -400,14 +440,13 @@ struct JetDerivedDataSelector { PROCESS_SWITCH(JetDerivedDataSelector, processSetupAllCollisionsWithDownscaling, "setup the writing of untriggered collisions with downscaling", false); PROCESS_SWITCH(JetDerivedDataSelector, processSetupAllMcCollisionsWithDownscaling, "setup the writing of untriggered mccollisions with downscaling", false); PROCESS_SWITCH(JetDerivedDataSelector, processSetupEventTriggering, "process software triggers", false); + PROCESS_SWITCH(JetDerivedDataSelector, processCollisionSplitting, "process collision splitting for trigger tracks", false); + PROCESS_SWITCH(JetDerivedDataSelector, processCollisionSplittingMC, "process mcCollision and collision splitting for trigger tracks", false); PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingChargedJets, "process charged jets", false); PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingChargedEventWiseSubtractedJets, "process charged event-wise subtracted jets", false); PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingChargedMCDJets, "process charged mcd jets", false); PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingChargedMCDetectorLevelEventWiseSubtractedJets, "process charged event-wise subtracted mcd jets", false); PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingChargedMCPJets, "process charged mcp jets", false); - PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingNeutralJets, "process neutral jets", false); - PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingNeutralMCDJets, "process neutral mcd jets", false); - PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingNeutralMCPJets, "process neutral mcp jets", false); PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingFullJets, "process full jets", false); PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingFullMCDJets, "process full mcd jets", false); PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingFullMCPJets, "process full mcp jets", false); @@ -460,8 +499,8 @@ struct JetDerivedDataSelector { PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingBplusChargedMCDJets, "process Bplus charged mcd jets", false); PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingBplusChargedMCDetectorLevelEventWiseSubtractedJets, "process Bplus event-wise subtracted charged mcd jets", false); PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingBplusChargedMCPJets, "process Bplus charged mcp jets", false); - PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingXicToXiPiPiCandidates, "process XicToXiPiPi candidates", false); - PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingXicToXiPiPiCandidatesMCP, "process XicToXiPiPi particles", false); + // PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingXicToXiPiPiCandidates, "process XicToXiPiPi candidates", false); + // PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingXicToXiPiPiCandidatesMCP, "process XicToXiPiPi particles", false); PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingXicToXiPiPiChargedJets, "process XicToXiPiPi charged jets", false); PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingXicToXiPiPiChargedEventWiseSubtractedJets, "process XicToXiPiPi event-wise subtracted charged jets", false); PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects, processSelectingXicToXiPiPiChargedMCDJets, "process XicToXiPiPi charged mcd jets", false); @@ -495,7 +534,7 @@ struct JetDerivedDataSelector { void processStoreMcCollisionDecision(aod::JMcCollision const& mcCollision) { - if (McCollisionFlag[mcCollision.globalIndex()]) { + if (mcCollisionFlag[mcCollision.globalIndex()]) { mcCollisionSelectionsTable(true); } else { mcCollisionSelectionsTable(false);