1717
1818#include " PWGCF/Core/CorrelationContainer.h"
1919#include " PWGCF/Core/PairCuts.h"
20- #include " PWGCF/TwoParticleCorrelations/DataModel/longrangeDerived .h"
20+ #include " PWGCF/TwoParticleCorrelations/DataModel/LongRangeDerived .h"
2121#include " PWGLF/DataModel/LFStrangenessTables.h"
2222#include " PWGMM/Mult/DataModel/bestCollisionTable.h"
2323
@@ -67,7 +67,10 @@ using namespace o2::aod::fwdtrack;
6767using namespace o2 ::aod::evsel;
6868using namespace o2 ::constants::math;
6969
70- auto static constexpr kMinFt0cCell = 96 ;
70+ auto static constexpr KminFt0cCell = 96 ;
71+ auto static constexpr PionTrackN = 1 ;
72+ auto static constexpr KaonTrackN = 2 ;
73+ auto static constexpr ProtonTrackN = 3 ;
7174AxisSpec axisEvent{15 , 0.5 , 15.5 , " #Event" , " EventAxis" };
7275
7376enum KindOfParticles {
@@ -157,7 +160,6 @@ struct LongrangeMaker {
157160 Configurable<float > cfgTofPidPtCut{" cfgTofPidPtCut" , 0 .3f , " Minimum pt to use TOF N-sigma" };
158161 Configurable<bool > isUseItsPid{" isUseItsPid" , false , " Use ITS PID for particle identification" };
159162
160- SliceCache cache;
161163 Service<o2::ccdb::BasicCCDBManager> ccdb;
162164 Service<o2::framework::O2DatabasePDG> pdg;
163165 o2::ccdb::CcdbApi ccdbApi;
@@ -197,6 +199,8 @@ struct LongrangeMaker {
197199 x->SetBinLabel (9 , " ApplyNoHighMultCollInPrevRof" );
198200
199201 myTrackFilter = getGlobalTrackSelectionRun3ITSMatch (TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny, TrackSelection::GlobalTrackRun3DCAxyCut::Default);
202+ myTrackFilter.SetPtRange (cfgtrksel.cfgPtCutMin , cfgtrksel.cfgPtCutMax );
203+ myTrackFilter.SetEtaRange (-cfgtrksel.cfgEtaCut , cfgtrksel.cfgEtaCut );
200204 myTrackFilter.SetMinNCrossedRowsTPC (cfgtrksel.minNCrossedRowsTPC );
201205 myTrackFilter.SetMinNClustersTPC (cfgtrksel.minTPCNClsFound );
202206 myTrackFilter.SetMaxDcaZ (cfgtrksel.maxDcaZ );
@@ -213,46 +217,41 @@ struct LongrangeMaker {
213217 Produces<aod::Ft0aLRTable> ft0aLRTable;
214218 Produces<aod::Ft0cLRTable> ft0cLRTable;
215219 Produces<aod::MftTrkLRTable> mftLRTable;
220+ Produces<aod::MftBestTrkLRTable> mftbestLRTable;
216221 Produces<aod::V0TrkLRTable> v0LRTable;
217222
218223 Filter fTracksEta = nabs(aod::track::eta) < cfgtrksel.cfgEtaCut;
219224 Filter fTracksPt = (aod::track::pt > cfgtrksel.cfgPtCutMin) && (aod::track::pt < cfgtrksel.cfgPtCutMax);
220- Filter fMftTrackColID = (aod::fwdtrack::bestCollisionId >= 0 );
221- Filter fMftTrackDca = (nabs(aod::fwdtrack::bestDCAXY) < cfgmfttrksel.cfigMftDcaxy);
222225
223226 using CollTable = soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Cs, aod::CentFV0As, aod::CentFT0Ms>;
224227 using TrksTable = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTOFbeta, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>>;
225- using MftTrkTable = soa::Filtered< aod::MFTTracks> ;
228+ using MftTrkTable = aod::MFTTracks;
226229
227- Preslice<TrksTable> perColGlobal = aod::track::collisionId;
228- Preslice<MftTrkTable> perColMft = aod::fwdtrack::collisionId;
229- Preslice<aod::V0Datas> perColV0 = aod::v0data::collisionId;
230-
231- void process (CollTable::iterator const & col, TrksTable const & tracks, aod::FT0s const &, MftTrkTable const & mfttracks, aod::V0Datas const & V0s)
230+ void process (CollTable::iterator const & col, TrksTable const & tracks, aod::FT0s const &, MftTrkTable const & mfttracks, soa::SmallGroups<aod::BestCollisionsFwd> const & retracks, aod::V0Datas const & V0s, aod::BCsWithTimestamps const &)
232231 {
233232 if (!isEventSelected (col)) {
234233 return ;
235234 }
236- auto tracksInCollision = tracks. sliceBy (perColGlobal, col. globalIndex ());
237- auto multiplicity = countNTracks (tracksInCollision );
235+
236+ auto multiplicity = countNTracks (tracks );
238237 auto centrality = selColCent (col);
239238 auto bc = col.bc_as <aod::BCsWithTimestamps>();
240239
241240 collisionLRTable (bc.runNumber (), col.posZ (), multiplicity, centrality, bc.timestamp ());
242241
243242 // track loop
244- for (const auto & track : tracksInCollision ) {
243+ for (const auto & track : tracks ) {
245244 if (!track.isGlobalTrack ())
246245 continue ;
247246 if (!myTrackFilter.IsSelected (track))
248247 continue ;
249- tracksLRTable (collisionLRTable.lastIndex (), track.pt (), track.eta (), track.phi (), aod::LRCorrTrkTable ::kSpCharge );
250- if (getTrackPID (track) == 1 )
251- tracksLRTable (collisionLRTable.lastIndex (), track.pt (), track.eta (), track.phi (), aod::LRCorrTrkTable ::kSpPion );
252- if (getTrackPID (track) == 2 )
253- tracksLRTable (collisionLRTable.lastIndex (), track.pt (), track.eta (), track.phi (), aod::LRCorrTrkTable ::kSpKaon );
254- if (getTrackPID (track) == 3 )
255- tracksLRTable (collisionLRTable.lastIndex (), track.pt (), track.eta (), track.phi (), aod::LRCorrTrkTable ::kSpProton );
248+ tracksLRTable (collisionLRTable.lastIndex (), track.pt (), track.eta (), track.phi (), aod::lrcorrtrktable ::kSpCharge );
249+ if (getTrackPID (track) == PionTrackN )
250+ tracksLRTable (collisionLRTable.lastIndex (), track.pt (), track.eta (), track.phi (), aod::lrcorrtrktable ::kSpPion );
251+ if (getTrackPID (track) == KaonTrackN )
252+ tracksLRTable (collisionLRTable.lastIndex (), track.pt (), track.eta (), track.phi (), aod::lrcorrtrktable ::kSpKaon );
253+ if (getTrackPID (track) == ProtonTrackN )
254+ tracksLRTable (collisionLRTable.lastIndex (), track.pt (), track.eta (), track.phi (), aod::lrcorrtrktable ::kSpProton );
256255 }
257256
258257 // ft0 loop
@@ -275,18 +274,31 @@ struct LongrangeMaker {
275274 }
276275
277276 // mft loop
278- auto mfttracksInCollision = mfttracks.sliceBy (perColMft, col.globalIndex ());
279- for (const auto & track : mfttracksInCollision) {
277+ for (const auto & track : mfttracks) {
280278 if (!isMftTrackSelected (track))
281279 continue ;
282280 auto phi = track.phi ();
283281 o2::math_utils::bringTo02Pi (phi);
284282 mftLRTable (collisionLRTable.lastIndex (), track.pt (), track.eta (), phi);
285283 }
286284
285+ if (retracks.size () > 0 ) {
286+ for (const auto & retrack : retracks) {
287+ if (std::abs (retrack.bestDCAXY ()) > cfgmfttrksel.cfigMftDcaxy ) {
288+ continue ; // does not point to PV properly
289+ }
290+ auto track = retrack.mfttrack ();
291+ if (!isMftTrackSelected (track)) {
292+ continue ;
293+ }
294+ auto phi = track.phi ();
295+ o2::math_utils::bringTo02Pi (phi);
296+ mftbestLRTable (collisionLRTable.lastIndex (), track.pt (), track.eta (), phi);
297+ }
298+ }
299+
287300 // v0 loop
288- auto v0tracksInCollision = V0s.sliceBy (perColV0, col.globalIndex ());
289- for (const auto & v0 : v0tracksInCollision) {
301+ for (const auto & v0 : V0s) {
290302 if (!isSelectV0Track (v0)) { // Quality selection for V0 prongs
291303 continue ;
292304 }
@@ -297,23 +309,23 @@ struct LongrangeMaker {
297309 // K0short
298310 if (isSelectK0s (col, v0)) { // candidate is K0s
299311 v0LRTable (collisionLRTable.lastIndex (), posTrack.globalIndex (), negTrack.globalIndex (),
300- v0.pt (), v0.eta (), v0.phi (), v0.mK0Short (), aod::LRCorrTrkTable ::kSpK0short );
312+ v0.pt (), v0.eta (), v0.phi (), v0.mK0Short (), aod::lrcorrtrktable ::kSpK0short );
301313 }
302314
303315 // Lambda and Anti-Lambda
304- bool LambdaTag = isSelectLambda<KindOfV0::kLambda >(col, v0);
305- bool ALambdaTag = isSelectLambda<KindOfV0::kAntiLambda >(col, v0);
316+ bool lambdaTag = isSelectLambda<KindOfV0::kLambda >(col, v0);
317+ bool antilambdaTag = isSelectLambda<KindOfV0::kAntiLambda >(col, v0);
306318
307319 // Note: candidate compatible with Lambda and Anti-Lambda hypothesis are counted twice (once for each hypothesis)
308- if (LambdaTag ) { // candidate is Lambda
320+ if (lambdaTag ) { // candidate is Lambda
309321 massV0 = v0.mLambda ();
310322 v0LRTable (collisionLRTable.lastIndex (), posTrack.globalIndex (), negTrack.globalIndex (),
311- v0.pt (), v0.eta (), v0.phi (), massV0, aod::LRCorrTrkTable ::kSpLambda );
323+ v0.pt (), v0.eta (), v0.phi (), massV0, aod::lrcorrtrktable ::kSpLambda );
312324 }
313- if (ALambdaTag ) { // candidate is Anti-lambda
325+ if (antilambdaTag ) { // candidate is Anti-lambda
314326 massV0 = v0.mAntiLambda ();
315327 v0LRTable (collisionLRTable.lastIndex (), posTrack.globalIndex (), negTrack.globalIndex (),
316- v0.pt (), v0.eta (), v0.phi (), massV0, aod::LRCorrTrkTable ::kSpALambda );
328+ v0.pt (), v0.eta (), v0.phi (), massV0, aod::lrcorrtrktable ::kSpALambda );
317329 } // end of Lambda and Anti-Lambda processing
318330 }
319331 } // process function
@@ -452,7 +464,7 @@ struct LongrangeMaker {
452464 auto x = chPos.X () + (*offsetFT0)[i].getX ();
453465 auto y = chPos.Y () + (*offsetFT0)[i].getY ();
454466 auto z = chPos.Z () + (*offsetFT0)[i].getZ ();
455- if (chno >= kMinFt0cCell )
467+ if (chno >= KminFt0cCell )
456468 z = -z;
457469 auto r = std::sqrt (x * x + y * y);
458470 auto theta = std::atan2 (r, z);
@@ -504,7 +516,7 @@ struct LongrangeMaker {
504516 const auto & posTrack = v0.template posTrack_as <TrksTable>();
505517 const auto & negTrack = v0.template negTrack_as <TrksTable>();
506518
507- float CtauK0s = v0.distovertotmom (col.posX (), col.posY (), col.posZ ()) * o2::constants::physics::MassK0;
519+ float ctauK0s = v0.distovertotmom (col.posX (), col.posY (), col.posZ ()) * o2::constants::physics::MassK0;
508520
509521 if (v0.mK0Short () < cfgv0trksel.minK0sMass || v0.mK0Short () > cfgv0trksel.maxK0sMass ) {
510522 return false ;
@@ -521,13 +533,13 @@ struct LongrangeMaker {
521533 if (v0.dcaV0daughters () > cfgv0trksel.maxDcaV0DauK0s ) {
522534 return false ;
523535 }
524- if (std::abs (CtauK0s ) > cfgv0trksel.maxK0sLifeTime ) {
536+ if (std::abs (ctauK0s ) > cfgv0trksel.maxK0sLifeTime ) {
525537 return false ;
526538 }
527539 if (((std::abs (posTrack.tpcNSigmaPi ()) > cfgv0trksel.daughPIDCuts ) || (std::abs (negTrack.tpcNSigmaPi ()) > cfgv0trksel.daughPIDCuts ))) {
528540 return false ;
529541 }
530- if ((TMath::Abs (v0.dcapostopv ()) < cfgv0trksel.minV0DcaPiK0s || TMath::Abs (v0.dcanegtopv ()) < cfgv0trksel.minV0DcaPiK0s )) {
542+ if ((std::abs (v0.dcapostopv ()) < cfgv0trksel.minV0DcaPiK0s || std::abs (v0.dcanegtopv ()) < cfgv0trksel.minV0DcaPiK0s )) {
531543 return false ;
532544 }
533545 return true ;
@@ -538,7 +550,7 @@ struct LongrangeMaker {
538550 {
539551 const auto & posTrack = v0.template posTrack_as <TrksTable>();
540552 const auto & negTrack = v0.template negTrack_as <TrksTable>();
541- float CtauLambda = v0.distovertotmom (col.posX (), col.posY (), col.posZ ()) * o2::constants::physics::MassLambda;
553+ float ctauLambda = v0.distovertotmom (col.posX (), col.posY (), col.posZ ()) * o2::constants::physics::MassLambda;
542554 if ((v0.mLambda () < cfgv0trksel.minLambdaMass || v0.mLambda () > cfgv0trksel.maxLambdaMass ) &&
543555 (v0.mAntiLambda () < cfgv0trksel.minLambdaMass || v0.mAntiLambda () > cfgv0trksel.maxLambdaMass )) {
544556 return false ;
@@ -552,10 +564,10 @@ struct LongrangeMaker {
552564 if (v0.dcaV0daughters () > cfgv0trksel.maxDcaV0DauLambda ) {
553565 return false ;
554566 }
555- if (pid == KindOfV0::kLambda && (TMath::Abs (v0.dcapostopv ()) < cfgv0trksel.minV0DcaPr || TMath::Abs (v0.dcanegtopv ()) < cfgv0trksel.minV0DcaPiLambda )) {
567+ if (pid == KindOfV0::kLambda && (std::abs (v0.dcapostopv ()) < cfgv0trksel.minV0DcaPr || std::abs (v0.dcanegtopv ()) < cfgv0trksel.minV0DcaPiLambda )) {
556568 return false ;
557569 }
558- if (pid == KindOfV0::kAntiLambda && (TMath::Abs (v0.dcapostopv ()) < cfgv0trksel.minV0DcaPiLambda || TMath::Abs (v0.dcanegtopv ()) < cfgv0trksel.minV0DcaPr )) {
570+ if (pid == KindOfV0::kAntiLambda && (std::abs (v0.dcapostopv ()) < cfgv0trksel.minV0DcaPiLambda || std::abs (v0.dcanegtopv ()) < cfgv0trksel.minV0DcaPr )) {
559571 return false ;
560572 }
561573 if (pid == KindOfV0::kLambda && ((std::abs (posTrack.tpcNSigmaPr ()) > cfgv0trksel.daughPIDCuts ) || (std::abs (negTrack.tpcNSigmaPi ()) > cfgv0trksel.daughPIDCuts ))) {
@@ -564,7 +576,7 @@ struct LongrangeMaker {
564576 if (pid == KindOfV0::kAntiLambda && ((std::abs (posTrack.tpcNSigmaPi ()) > cfgv0trksel.daughPIDCuts ) || (std::abs (negTrack.tpcNSigmaPr ()) > cfgv0trksel.daughPIDCuts ))) {
565577 return false ;
566578 }
567- if (std::abs (CtauLambda ) > cfgv0trksel.maxLambdaLifeTime ) {
579+ if (std::abs (ctauLambda ) > cfgv0trksel.maxLambdaLifeTime ) {
568580 return false ;
569581 }
570582 return true ;
0 commit comments