@@ -128,6 +128,7 @@ struct hstrangecorrelationfilter {
128128 using V0LinkedTagged = soa::Join<aod::V0sLinked, aod::V0Tags>;
129129 using CascadesLinkedTagged = soa::Join<aod::CascadesLinked, aod::CascTags>;
130130 using DauTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::TracksDCA>;
131+ using DauTracksMC = soa::Join<aod::Tracks, aod::TracksExtra, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::TracksDCA, aod::McTrackLabels>;
131132 // using IDTracks= soa::Join<aod::Tracks, aod::TracksExtra, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidBayesPi, aod::pidBayesKa, aod::pidBayesPr, aod::TOFSignal>; // prepared for Bayesian PID
132133 using IDTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::TOFSignal, aod::TracksDCA>;
133134 using V0DatasWithoutTrackX = soa::Join<aod::V0Indices, aod::V0Cores>;
@@ -166,6 +167,33 @@ struct hstrangecorrelationfilter {
166167 histos.add (" h3dMassOmegaPlus" , " h3dMassOmegaPlus" , kTH3F , {axisPtQA, axisOmegaMass, axisMult});
167168 }
168169
170+ // reco-level trigger quality checks (N.B.: DCA is filtered, not selected)
171+ template <class TTrack >
172+ bool isValidTrigger (TTrack track)
173+ {
174+ if (track.eta () > triggerEtaMax || track.eta () < triggerEtaMin) {
175+ return false ;
176+ }
177+ // if (track.sign()= 1 ) {continue;}
178+ if (track.pt () > triggerPtCutMax || track.pt () < triggerPtCutMin) {
179+ return false ;
180+ }
181+ if (track.tpcNClsCrossedRows () < minTPCNCrossedRows) {
182+ return false ; // crossed rows
183+ }
184+ if (!track.hasITS () && triggerRequireITS) {
185+ return false ; // skip, doesn't have ITS signal (skips lots of TPC-only!)
186+ }
187+ if (track.tpcNClsShared () > triggerMaxTPCSharedClusters) {
188+ return false ; // skip, has shared clusters
189+ }
190+ if (!(bitcheck (track.itsClusterMap (), 0 )) && triggerRequireL0) {
191+ return false ; // skip, doesn't have cluster in ITS L0
192+ }
193+ return true ;
194+ }
195+
196+ // for real data processing
169197 void processTriggers (soa::Join<aod::Collisions, aod::EvSels>::iterator const & collision, soa::Filtered<DauTracks> const & tracks)
170198 {
171199 // Perform basic event selection
@@ -180,30 +208,44 @@ struct hstrangecorrelationfilter {
180208 // / _________________________________________________
181209 // / Step 1: Populate table with trigger tracks
182210 for (auto const & track : tracks) {
183- if (track. eta () > triggerEtaMax || track. eta () < triggerEtaMin) {
211+ if (! isValidTrigger ( track))
184212 continue ;
185- }
186- // if (track.sign()= 1 ) {continue;}
187- if (track.pt () > triggerPtCutMax || track.pt () < triggerPtCutMin) {
213+ triggerTrack (
214+ track.collisionId (),
215+ false , // if you decide to check real data for primaries, you'll have a hard time
216+ track.globalIndex ());
217+ }
218+ }
219+
220+ // for MC processing
221+ void processTriggersMC (soa::Join<aod::Collisions, aod::EvSels>::iterator const & collision, soa::Filtered<DauTracksMC> const & tracks, aod::McParticles const &)
222+ {
223+ // Perform basic event selection
224+ if (!collision.sel8 ()) {
225+ return ;
226+ }
227+ // No need to correlate stuff that's in far collisions
228+ if (TMath::Abs (collision.posZ ()) > 10.0 ) {
229+ return ;
230+ }
231+
232+ // / _________________________________________________
233+ // / Step 1: Populate table with trigger tracks
234+ for (auto const & track : tracks) {
235+ if (!isValidTrigger (track))
188236 continue ;
189- }
190- if (track.tpcNClsCrossedRows () < minTPCNCrossedRows) {
191- continue ; // crossed rows
192- }
193- if (!track.hasITS () && triggerRequireITS) {
194- continue ; // skip, doesn't have ITS signal (skips lots of TPC-only!)
195- }
196- if (track.tpcNClsShared () > triggerMaxTPCSharedClusters) {
197- continue ; // skip, has shared clusters
198- }
199- if (!(bitcheck (track.itsClusterMap (), 0 )) && triggerRequireL0) {
200- continue ; // skip, doesn't have cluster in ITS L0
237+ bool physicalPrimary = false ;
238+ if (track.has_mcParticle ()) {
239+ auto mcParticle = track.mcParticle ();
240+ physicalPrimary = mcParticle.isPhysicalPrimary ();
201241 }
202242 triggerTrack (
203243 track.collisionId (),
244+ physicalPrimary,
204245 track.globalIndex ());
205246 }
206247 }
248+
207249 void processAssocPions (soa::Join<aod::Collisions, aod::EvSels>::iterator const & collision, soa::Filtered<IDTracks> const & tracks)
208250 {
209251 // Perform basic event selection
@@ -380,7 +422,7 @@ struct hstrangecorrelationfilter {
380422 ) {
381423 assocV0 (v0.collisionId (), v0.globalIndex (),
382424 compatibleK0Short, compatibleLambda, compatibleAntiLambda,
383- origV0entry.isTrueK0Short (), origV0entry.isTrueLambda (), origV0entry.isTrueAntiLambda (),
425+ origV0entry.isTrueK0Short (), origV0entry.isTrueLambda (), origV0entry.isTrueAntiLambda (), origV0entry. isPhysicalPrimary (),
384426 massRegK0Short, massRegLambda, massRegAntiLambda);
385427 }
386428 }
@@ -482,6 +524,7 @@ struct hstrangecorrelationfilter {
482524 compatibleXiMinus, compatibleXiPlus, compatibleOmegaMinus, compatibleOmegaPlus,
483525 origCascadeEntry.isTrueXiMinus (), origCascadeEntry.isTrueXiPlus (),
484526 origCascadeEntry.isTrueOmegaMinus (), origCascadeEntry.isTrueOmegaPlus (),
527+ origCascadeEntry.isPhysicalPrimary (),
485528 massRegXi, massRegOmega);
486529 }
487530 }
0 commit comments