@@ -50,8 +50,6 @@ struct JetDerivedDataSelector {
5050 Configurable<float > thresholdChargedJetPtMin{" thresholdChargedJetPtMin" , 0.0 , " Minimum charged jet pt to accept event" };
5151 Configurable<float > thresholdChargedEventWiseSubtractedJetPtMin{" thresholdChargedEventWiseSubtractedJetPtMin" , 0.0 , " Minimum charged event-wise subtracted jet pt to accept event" };
5252 Configurable<float > thresholdChargedMCPJetPtMin{" thresholdChargedMCPJetPtMin" , 0.0 , " Minimum charged mcp jet pt to accept event" };
53- Configurable<float > thresholdNeutralJetPtMin{" thresholdNeutralJetPtMin" , 0.0 , " Minimum neutral jet pt to accept event" };
54- Configurable<float > thresholdNeutralMCPJetPtMin{" thresholdNeutralMCPJetPtMin" , 0.0 , " Minimum neutal mcp jet pt to accept event" };
5553 Configurable<float > thresholdFullJetPtMin{" thresholdFullJetPtMin" , 0.0 , " Minimum full jet pt to accept event" };
5654 Configurable<float > thresholdFullMCPJetPtMin{" thresholdFullMCPJetPtMin" , 0.0 , " Minimum full mcp jet pt to accept event" };
5755 Configurable<float > thresholdD0PtMin{" thresholdD0PtMin" , 0.0 , " Minimum D0 pt to accept event" };
@@ -100,7 +98,9 @@ struct JetDerivedDataSelector {
10098 Configurable<float > thresholdChargedEventWiseSubtractedDielectronJetPtMin{" thresholdChargedEventWiseSubtractedDielectronJetPtMin" , 0.0 , " Minimum charged event-wise subtracted Dielectron jet pt to accept event" };
10199 Configurable<float > thresholdChargedDielectronMCPJetPtMin{" thresholdChargedDielectronMCPJetPtMin" , 0.0 , " Minimum charged Dielectron mcp jet pt to accept event" };
102100 Configurable<float > thresholdTriggerTrackPtMin{" thresholdTriggerTrackPtMin" , 0.0 , " Minimum trigger track pt to accept event" };
101+ Configurable<float > thresholdTriggerTrackReferencePtMin{" thresholdTriggerTrackReferencePtMin" , 0.0 , " Minimum trigger track reference pt to accept event" };
103102 Configurable<float > thresholdTriggerParticlePtMin{" thresholdTriggerParticlePtMin" , 0.0 , " Minimum trigger particle pt to accept event" };
103+ Configurable<float > thresholdTriggerParticleReferencePtMin{" thresholdTriggerParticleReferencePtMin" , 0.0 , " Minimum trigger particle reference pt to accept event" };
104104 Configurable<float > thresholdClusterEnergyMin{" thresholdClusterEnergyMin" , 0.0 , " Minimum cluster energy to accept event" };
105105 Configurable<int > downscaleFactor{" downscaleFactor" , 1 , " random downscale of selected events" };
106106
@@ -116,12 +116,15 @@ struct JetDerivedDataSelector {
116116 Configurable<bool > performTrackSelection{" performTrackSelection" , true , " only save tracks that pass one of the track selections" };
117117 Configurable<float > trackPtSelectionMin{" trackPtSelectionMin" , 0.15 , " only save tracks that have a pT larger than this pT" };
118118 Configurable<float > trackEtaSelectionMax{" trackEtaSelectionMax" , 0.9 , " only save tracks that have an eta smaller than this eta" };
119+ Configurable<float > triggerTrackSignalFraction{" triggerTrackSignalFraction" , 0.95 , " fraction of events to scan for signal trigger track class" };
119120
120121 Configurable<std::string> 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" };
121122 } config;
122123
123124 std::vector<bool > collisionFlag;
124- std::vector<bool > McCollisionFlag;
125+ std::vector<bool > mcCollisionFlag;
126+ std::vector<bool > collisionSplitFlag;
127+ std::vector<bool > mcCollisionSplitFlag;
125128
126129 TRandom3 randomNumber;
127130
@@ -146,8 +149,8 @@ struct JetDerivedDataSelector {
146149
147150 void processSetupMcCollisions (aod::JMcCollisions const & mcCollisions)
148151 {
149- McCollisionFlag .clear ();
150- McCollisionFlag .resize (mcCollisions.size (), false );
152+ mcCollisionFlag .clear ();
153+ mcCollisionFlag .resize (mcCollisions.size (), false );
151154 }
152155
153156 void processSelectMcCollisionsPerCollision (aod::JMcCollisions const & mcCollisions, soa::Join<aod::JCollisions, aod::JMcCollisionLbs> const & collisions)
@@ -156,7 +159,7 @@ struct JetDerivedDataSelector {
156159 const auto collisionsPerMcCollision = collisions.sliceBy (CollisionsPerMcCollision, mcCollision.globalIndex ());
157160 for (auto collision : collisionsPerMcCollision) {
158161 if (collisionFlag[collision.globalIndex ()]) {
159- McCollisionFlag [mcCollision.globalIndex ()] = true ;
162+ mcCollisionFlag [mcCollision.globalIndex ()] = true ;
160163 }
161164 }
162165 }
@@ -165,7 +168,7 @@ struct JetDerivedDataSelector {
165168 void processSelectCollisionsPerMcCollision (soa::Join<aod::JCollisions, aod::JMcCollisionLbs>::iterator const & collision)
166169 {
167170 if (collision.has_mcCollision ()) {
168- if (McCollisionFlag [collision.mcCollisionId ()]) {
171+ if (mcCollisionFlag [collision.mcCollisionId ()]) {
169172 collisionFlag[collision.globalIndex ()] = true ;
170173 }
171174 }
@@ -184,11 +187,11 @@ struct JetDerivedDataSelector {
184187
185188 void processSetupAllMcCollisionsWithDownscaling (aod::JMcCollisions const & mcCollisions)
186189 {
187- McCollisionFlag .clear ();
188- McCollisionFlag .resize (mcCollisions.size (), false );
190+ mcCollisionFlag .clear ();
191+ mcCollisionFlag .resize (mcCollisions.size (), false );
189192 for (const auto & mcCollision : mcCollisions) {
190193 if (randomNumber.Integer (config.downscaleFactor ) == 0 ) {
191- McCollisionFlag [mcCollision.globalIndex ()] = true ;
194+ mcCollisionFlag [mcCollision.globalIndex ()] = true ;
192195 }
193196 }
194197 }
@@ -203,8 +206,8 @@ struct JetDerivedDataSelector {
203206 }
204207 }
205208 if constexpr (std::is_same_v<std::decay_t <T>, aod::JMcCollisions>) {
206- if (McCollisionFlag [collision.globalIndex ()] && randomNumber.Integer (config.downscaleFactor ) != 0 ) {
207- McCollisionFlag [collision.globalIndex ()] = false ;
209+ if (mcCollisionFlag [collision.globalIndex ()] && randomNumber.Integer (config.downscaleFactor ) != 0 ) {
210+ mcCollisionFlag [collision.globalIndex ()] = false ;
208211 }
209212 }
210213 }
@@ -227,7 +230,7 @@ struct JetDerivedDataSelector {
227230 if (jetderiveddatautilities::selectCollision (collision, eventSelectionBitsCharged, config.skipMBGapEvents , config.applyRCTSelectionsCharged )) {
228231 barrelRCTFlagSelection = true ;
229232 }
230- if (doprocessSelectingNeutralJets || doprocessSelectingNeutralMCDJets || doprocessSelectingNeutralMCPJets || doprocessSelectingFullJets || doprocessSelectingFullMCDJets || doprocessSelectingFullMCPJets || doprocessSelectingClusters) {
233+ if (doprocessSelectingFullJets || doprocessSelectingFullMCDJets || doprocessSelectingFullMCPJets || doprocessSelectingClusters) {
231234 if (jetderiveddatautilities::selectCollision (collision, eventSelectionBitsFull, config.skipMBGapEvents , config.applyRCTSelectionsFull , " CBT_calo" )) {
232235 emcalRCTFlagSelection = true ;
233236 }
@@ -237,6 +240,33 @@ struct JetDerivedDataSelector {
237240 }
238241 }
239242
243+ void processCollisionSplitting (aod::JCollisions const & collisions)
244+ {
245+ collisionSplitFlag.clear ();
246+ collisionSplitFlag.resize (collisions.size (), true );
247+ for (auto const & collision : collisions) {
248+ if (randomNumber.Rndm () > config.triggerTrackSignalFraction ) {
249+ collisionSplitFlag[collision.globalIndex ()] = false ;
250+ }
251+ }
252+ }
253+
254+ void processCollisionSplittingMC (aod::JMcCollisions const & mcCollisions, soa::Join<aod::JCollisions, aod::JMcCollisionLbs> const & collisions)
255+ {
256+ mcCollisionSplitFlag.clear ();
257+ mcCollisionSplitFlag.resize (mcCollisions.size (), true );
258+ collisionSplitFlag.clear ();
259+ collisionSplitFlag.resize (collisions.size (), true );
260+ for (auto const & mcCollision : mcCollisions) {
261+ if (randomNumber.Rndm () > config.triggerTrackSignalFraction ) {
262+ mcCollisionSplitFlag[mcCollision.globalIndex ()] = false ;
263+ for (auto const & collision : collisions.sliceBy (CollisionsPerMcCollision, mcCollision.globalIndex ())) {
264+ collisionSplitFlag[collision.globalIndex ()] = false ;
265+ }
266+ }
267+ }
268+ }
269+
240270 template <typename T>
241271 void processSelectionObjects (T const & selectionObjects)
242272 {
@@ -247,10 +277,6 @@ struct JetDerivedDataSelector {
247277 selectionObjectPtMin = config.thresholdChargedEventWiseSubtractedJetPtMin ;
248278 } else if constexpr (std::is_same_v<std::decay_t <T>, aod::ChargedMCParticleLevelJets>) {
249279 selectionObjectPtMin = config.thresholdChargedMCPJetPtMin ;
250- } else if constexpr (std::is_same_v<std::decay_t <T>, aod::NeutralJets> || std::is_same_v<std::decay_t <T>, aod::NeutralMCDetectorLevelJets>) {
251- selectionObjectPtMin = config.thresholdNeutralJetPtMin ;
252- } else if constexpr (std::is_same_v<std::decay_t <T>, aod::NeutralMCParticleLevelJets>) {
253- selectionObjectPtMin = config.thresholdNeutralMCPJetPtMin ;
254280 } else if constexpr (std::is_same_v<std::decay_t <T>, aod::FullJets> || std::is_same_v<std::decay_t <T>, aod::FullMCDetectorLevelJets>) {
255281 selectionObjectPtMin = config.thresholdFullJetPtMin ;
256282 } else if constexpr (std::is_same_v<std::decay_t <T>, aod::FullMCParticleLevelJets>) {
@@ -368,6 +394,13 @@ struct JetDerivedDataSelector {
368394 if (selectionObject.pt () < config.trackPtSelectionMin || std::abs (selectionObject.eta ()) > config.trackEtaSelectionMax ) {
369395 continue ;
370396 }
397+ if (doprocessCollisionSplitting || doprocessCollisionSplittingMC) {
398+ if (collisionSplitFlag[selectionObject.collisionId ()]) {
399+ selectionObjectPtMin = config.thresholdTriggerTrackPtMin ;
400+ } else {
401+ selectionObjectPtMin = config.thresholdTriggerTrackReferencePtMin ;
402+ }
403+ }
371404 }
372405 if constexpr (std::is_same_v<std::decay_t <T>, aod::JMcParticles>) {
373406 if (!selectionObject.isPhysicalPrimary ()) {
@@ -376,15 +409,22 @@ struct JetDerivedDataSelector {
376409 if (selectionObject.pt () < config.trackPtSelectionMin || std::abs (selectionObject.eta ()) > config.trackEtaSelectionMax ) {
377410 continue ;
378411 }
412+ if (doprocessCollisionSplittingMC) {
413+ if (mcCollisionSplitFlag[selectionObject.mcCollisionId ()]) {
414+ selectionObjectPtMin = config.thresholdTriggerParticlePtMin ;
415+ } else {
416+ selectionObjectPtMin = config.thresholdTriggerParticleReferencePtMin ;
417+ }
418+ }
379419 }
380420 if (selectionObject.pt () >= selectionObjectPtMin) {
381421 isTriggerObject = true ;
382422 }
383423 }
384424 if (isTriggerObject) {
385- if constexpr (std::is_same_v<std::decay_t<T>, aod::ChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::NeutralMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::FullMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesD0MCP> || std::is_same_v<std::decay_t<T>, aod::D0ChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesDplusMCP> || std::is_same_v<std::decay_t<T>, aod::DplusChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesDsMCP> || std::is_same_v<std::decay_t<T>, aod::DsChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesDstarMCP> || std::is_same_v<std::decay_t<T>, aod::DstarChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesLcMCP> || std::is_same_v<std::decay_t<T>, aod::LcChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesB0MCP> || std::is_same_v<std::decay_t<T>, aod::B0ChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesBplusMCP> || std::is_same_v<std::decay_t<T>, aod::BplusChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesXicToXiPiPiMCP> || std::is_same_v<std::decay_t<T>, aod::XicToXiPiPiChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesDielectronMCP> || std::is_same_v<std::decay_t<T>, aod::DielectronChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::JMcParticles>) {
425+ if constexpr (std::is_same_v<std::decay_t<T>, aod::ChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::FullMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesD0MCP> || std::is_same_v<std::decay_t<T>, aod::D0ChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesDplusMCP> || std::is_same_v<std::decay_t<T>, aod::DplusChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesDsMCP> || std::is_same_v<std::decay_t<T>, aod::DsChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesDstarMCP> || std::is_same_v<std::decay_t<T>, aod::DstarChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesLcMCP> || std::is_same_v<std::decay_t<T>, aod::LcChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesB0MCP> || std::is_same_v<std::decay_t<T>, aod::B0ChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesBplusMCP> || std::is_same_v<std::decay_t<T>, aod::BplusChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesXicToXiPiPiMCP> || std::is_same_v<std::decay_t<T>, aod::XicToXiPiPiChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::CandidatesDielectronMCP> || std::is_same_v<std::decay_t<T>, aod::DielectronChargedMCParticleLevelJets> || std::is_same_v<std::decay_t<T>, aod::JMcParticles>) {
386426 if (selectionObject.mcCollisionId () >= 0 ) {
387- McCollisionFlag [selectionObject.mcCollisionId ()] = true ;
427+ mcCollisionFlag [selectionObject.mcCollisionId ()] = true ;
388428 }
389429 } else {
390430 if (selectionObject.collisionId () >= 0 ) {
@@ -400,14 +440,13 @@ struct JetDerivedDataSelector {
400440 PROCESS_SWITCH (JetDerivedDataSelector, processSetupAllCollisionsWithDownscaling, " setup the writing of untriggered collisions with downscaling" , false );
401441 PROCESS_SWITCH (JetDerivedDataSelector, processSetupAllMcCollisionsWithDownscaling, " setup the writing of untriggered mccollisions with downscaling" , false );
402442 PROCESS_SWITCH (JetDerivedDataSelector, processSetupEventTriggering, " process software triggers" , false );
443+ PROCESS_SWITCH (JetDerivedDataSelector, processCollisionSplitting, " process collision splitting for trigger tracks" , false );
444+ PROCESS_SWITCH (JetDerivedDataSelector, processCollisionSplittingMC, " process mcCollision and collision splitting for trigger tracks" , false );
403445 PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::ChargedJets>, processSelectingChargedJets, " process charged jets" , false );
404446 PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::ChargedEventWiseSubtractedJets>, processSelectingChargedEventWiseSubtractedJets, " process charged event-wise subtracted jets" , false );
405447 PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::ChargedMCDetectorLevelJets>, processSelectingChargedMCDJets, " process charged mcd jets" , false );
406448 PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::ChargedMCDetectorLevelEventWiseSubtractedJets>, processSelectingChargedMCDetectorLevelEventWiseSubtractedJets, " process charged event-wise subtracted mcd jets" , false );
407449 PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::ChargedMCParticleLevelJets>, processSelectingChargedMCPJets, " process charged mcp jets" , false );
408- PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::NeutralJets>, processSelectingNeutralJets, " process neutral jets" , false );
409- PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::NeutralMCDetectorLevelJets>, processSelectingNeutralMCDJets, " process neutral mcd jets" , false );
410- PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::NeutralMCParticleLevelJets>, processSelectingNeutralMCPJets, " process neutral mcp jets" , false );
411450 PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::FullJets>, processSelectingFullJets, " process full jets" , false );
412451 PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::FullMCDetectorLevelJets>, processSelectingFullMCDJets, " process full mcd jets" , false );
413452 PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::FullMCParticleLevelJets>, processSelectingFullMCPJets, " process full mcp jets" , false );
@@ -460,8 +499,8 @@ struct JetDerivedDataSelector {
460499 PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::BplusChargedMCDetectorLevelJets>, processSelectingBplusChargedMCDJets, " process Bplus charged mcd jets" , false );
461500 PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::BplusChargedMCDetectorLevelEventWiseSubtractedJets>, processSelectingBplusChargedMCDetectorLevelEventWiseSubtractedJets, " process Bplus event-wise subtracted charged mcd jets" , false );
462501 PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::BplusChargedMCParticleLevelJets>, processSelectingBplusChargedMCPJets, " process Bplus charged mcp jets" , false );
463- PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::CandidatesXicToXiPiPiData>, processSelectingXicToXiPiPiCandidates, " process XicToXiPiPi candidates" , false );
464- PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::CandidatesXicToXiPiPiMCP>, processSelectingXicToXiPiPiCandidatesMCP, " process XicToXiPiPi particles" , false );
502+ // PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects<aod::CandidatesXicToXiPiPiData>, processSelectingXicToXiPiPiCandidates, "process XicToXiPiPi candidates", false);
503+ // PROCESS_SWITCH_FULL(JetDerivedDataSelector, processSelectionObjects<aod::CandidatesXicToXiPiPiMCP>, processSelectingXicToXiPiPiCandidatesMCP, "process XicToXiPiPi particles", false);
465504 PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::XicToXiPiPiChargedJets>, processSelectingXicToXiPiPiChargedJets, " process XicToXiPiPi charged jets" , false );
466505 PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::XicToXiPiPiChargedEventWiseSubtractedJets>, processSelectingXicToXiPiPiChargedEventWiseSubtractedJets, " process XicToXiPiPi event-wise subtracted charged jets" , false );
467506 PROCESS_SWITCH_FULL (JetDerivedDataSelector, processSelectionObjects<aod::XicToXiPiPiChargedMCDetectorLevelJets>, processSelectingXicToXiPiPiChargedMCDJets, " process XicToXiPiPi charged mcd jets" , false );
@@ -495,7 +534,7 @@ struct JetDerivedDataSelector {
495534
496535 void processStoreMcCollisionDecision (aod::JMcCollision const & mcCollision)
497536 {
498- if (McCollisionFlag [mcCollision.globalIndex ()]) {
537+ if (mcCollisionFlag [mcCollision.globalIndex ()]) {
499538 mcCollisionSelectionsTable (true );
500539 } else {
501540 mcCollisionSelectionsTable (false );
0 commit comments