@@ -68,7 +68,8 @@ using namespace o2::framework::expressions;
6868#define BIT_CHECK (var, nbit ) ((var) & (static_cast <uint32_t >(1 ) << (nbit)))
6969#define GET_HIST (type, name ) std::get<std::shared_ptr<type>>(histPointers[name])
7070
71- using Alice3Tracks = soa::Join<aod::Tracks, aod::TracksCov, aod::Alice3DecayMaps, aod::McTrackLabels, aod::TracksDCA, aod::TracksExtraA3, aod::UpgradeTofs, aod::UpgradeTofExpectedTimes, aod::UpgradeRichs, aod::UpgradeRichSignals, aod::OTFLUTConfigId>;
71+ using Alice3Tracks = soa::Join<aod::Tracks, aod::TracksCov, aod::Alice3DecayMaps, aod::McTrackLabels, aod::TracksDCA, aod::TracksExtraA3, aod::UpgradeTofs, aod::UpgradeTofExpectedTimes, aod::UpgradeRichs, aod::UpgradeRichSignals>;
72+ using Alice3Collision = soa::Join<aod::Collisions, aod::OTFLUTConfigId>;
7273
7374struct Alice3MulticharmFinder {
7475 SliceCache cache;
@@ -388,12 +389,6 @@ struct Alice3MulticharmFinder {
388389 return returnValue;
389390 }
390391
391- template <typename TTrackType>
392- bool checkSameLUTConf (TTrackType const & track1, const int track2)
393- {
394- return track1.lutConfigId () == track2;
395- }
396-
397392 void init (InitContext&)
398393 {
399394 // initialize O2 2-prong fitter (only once)
@@ -489,7 +484,7 @@ struct Alice3MulticharmFinder {
489484 }
490485 }
491486
492- void initConf (const int icfg)
487+ void initDetectorConfiguration (const int icfg)
493488 {
494489 if (std::find (savedConfigs.begin (), savedConfigs.end (), icfg) != savedConfigs.end ()) {
495490 return ;
@@ -498,7 +493,7 @@ struct Alice3MulticharmFinder {
498493 savedConfigs.push_back (icfg);
499494
500495 // do more plots
501- std::string histPath = " Configuration_" + std::to_string (icfg) + " /" ;
496+ const std::string histPath = " Configuration_" + std::to_string (icfg) + " /" ;
502497 histPointers.insert ({histPath + " hMassXiCC" , histos.add ((histPath + " hMassXiCC" ).c_str (), " hMassXiCC" , {kTH1D , {{axisXiCCMass}}})});
503498 histPointers.insert ({histPath + " hNCollisions" , histos.add ((histPath + " hNCollisions" ).c_str (), " hNCollisions" , {kTH1D , {{2 , 0.5 , 2.5 }}})});
504499 histPointers.insert ({histPath + " hNTracks" , histos.add ((histPath + " hNTracks" ).c_str (), " hNTracks" , {kTH1D , {{20000 , 0 , 20000 }}})});
@@ -519,19 +514,24 @@ struct Alice3MulticharmFinder {
519514 }
520515
521516 // *+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*
522- void processFindXiCC (aod::Collision const & collision, Alice3Tracks const & tracks, aod::McParticles const &, aod::UpgradeCascades const & cascades)
517+ void processFindXiCC (Alice3Collision::iterator const & collision, Alice3Tracks const & tracks, aod::McParticles const &, aod::UpgradeCascades const & cascades)
523518 {
519+ const std::string histPath = " Configuration_" + std::to_string (collision.lutConfigId ()) + " /" ;
520+ initDetectorConfiguration (collision.lutConfigId ());
521+
522+ GET_HIST (TH1, histPath + " hNCollisions" )->Fill (1 );
523+ GET_HIST (TH1, histPath + " hNTracks" )->Fill (tracks.size ());
524+ if (tracks.size () < minNTracks.value [collision.lutConfigId ()]) {
525+ return ;
526+ }
527+ GET_HIST (TH1, histPath + " hNCollisions" )->Fill (2 );
528+
524529 // group with this collision
525530 // n.b. cascades do not need to be grouped, being used directly in iterator-grouping
526531 auto picTracksGrouped = picTracks->sliceByCached (aod::track::collisionId, collision.globalIndex (), cache);
527532 auto piccTracksGrouped = piccTracks->sliceByCached (aod::track::collisionId, collision.globalIndex (), cache);
528533
529- static constexpr int MaxLUTConfigs = 20 ;
530- std::vector<int > nTracks (MaxLUTConfigs);
531534 for (auto const & track : tracks) {
532- int lutConfigId = track.lutConfigId ();
533- nTracks[lutConfigId]++;
534-
535535 if (BIT_CHECK (track.decayMap (), kTruePiFromXiC )) {
536536 histos.fill (HIST (" h2dDCAxyVsPtPiFromXiC" ), track.pt (), track.dcaXY () * 1e+4 );
537537 }
@@ -542,19 +542,6 @@ struct Alice3MulticharmFinder {
542542
543543 for (auto const & xiCand : cascades) {
544544 auto xi = xiCand.cascadeTrack_as <Alice3Tracks>(); // de-reference cascade track
545- int lutConfigId = xi.lutConfigId ();
546- initConf (lutConfigId);
547- if (minNTracks.value .size () < static_cast <size_t >(lutConfigId)) {
548- if (nTracks[lutConfigId] < minNTracks.value .front ()) {
549- continue ; // fallback to first
550- }
551- } else {
552- if (nTracks[lutConfigId] < minNTracks.value [lutConfigId]) {
553- continue ;
554- }
555- }
556-
557- std::string histPath = " Configuration_" + std::to_string (lutConfigId) + " /" ;
558545 histos.fill (HIST (" hMassXi" ), xiCand.mXi ());
559546 histos.fill (HIST (" h2dDCAxyVsPtXiFromXiC" ), xi.pt (), xi.dcaXY () * 1e+4 );
560547 if (std::fabs (xiCand.mXi () - o2::constants::physics::MassXiMinus) > xiMassWindow) {
@@ -583,10 +570,6 @@ struct Alice3MulticharmFinder {
583570
584571 histos.fill (HIST (" hMinXiDecayRadius" ), xiCand.cascRadius ());
585572 for (auto const & pi1c : picTracksGrouped) {
586- if (!checkSameLUTConf (pi1c, lutConfigId)) {
587- continue ;
588- }
589-
590573 if (mcSameMotherCheck && !checkSameMother (xi, pi1c)) {
591574 continue ;
592575 }
@@ -609,10 +592,6 @@ struct Alice3MulticharmFinder {
609592 histos.fill (HIST (" hInnerTOFTrackTimeRecoPi1c" ), pi1cTOFDiffInner);
610593 // second pion from XiC decay for starts here
611594 for (auto const & pi2c : picTracksGrouped) {
612- if (!checkSameLUTConf (pi2c, lutConfigId)) {
613- continue ;
614- }
615-
616595 if (mcSameMotherCheck && !checkSameMother (xi, pi2c)) {
617596 continue ; // keep only if same mother
618597 }
@@ -691,10 +670,6 @@ struct Alice3MulticharmFinder {
691670 // attempt XiCC finding
692671 uint32_t nCombinationsCC = 0 ;
693672 for (auto const & picc : piccTracksGrouped) {
694- if (!checkSameLUTConf (picc, lutConfigId)) {
695- continue ;
696- }
697-
698673 if (mcSameMotherCheck && !checkSameMotherExtra (xi, picc)) {
699674 continue ;
700675 }
@@ -823,7 +798,7 @@ struct Alice3MulticharmFinder {
823798 xicDecayDistanceFromPV,
824799 xiccProperLength,
825800 pi1c.pt (), pi2c.pt (), picc.pt (),
826- lutConfigId);
801+ collision. lutConfigId () );
827802
828803 multiCharmPID (
829804 pi1cTOFDiffInner, pi1c.nSigmaPionInnerTOF (),
0 commit comments