2020#include " CCDB/BasicCCDBManager.h"
2121#include " Common/DataModel/Centrality.h"
2222#include " Common/DataModel/PIDResponse.h"
23+ #include " DataFormatsParameters/GRPMagField.h"
2324#include " PWGLF/DataModel/LFStrangenessTables.h"
2425
25- #include " TPDGCode.h"
2626#include " RecoDecay.h"
27+ #include " TPDGCode.h"
2728
2829using namespace o2 ;
2930using namespace o2 ::framework;
@@ -36,6 +37,7 @@ struct ThreeParticleCorrelations {
3637 HistogramRegistry rMECorrRegistry{" MECorrRegistry" , {}, OutputObjHandlingPolicy::AnalysisObject, false , true };
3738 HistogramRegistry rSECorrRegistry{" SECorrRegistry" , {}, OutputObjHandlingPolicy::AnalysisObject, false , true };
3839 HistogramRegistry rMCRegistry{" MCRegistry" , {}, OutputObjHandlingPolicy::AnalysisObject, false , true };
40+ HistogramRegistry rPhiStarRegistry{" PhiStarRegistry" , {}, OutputObjHandlingPolicy::AnalysisObject, false , true };
3941 HistogramRegistry rQARegistry{" QARegistry" , {}, OutputObjHandlingPolicy::AnalysisObject, false , true };
4042
4143 // Collision & Event filters
@@ -134,13 +136,26 @@ struct ThreeParticleCorrelations {
134136 rQARegistry.add (" hNSigmaKaon" , " hNSigmaKaon" , {HistType::kTH2D , {{201 , -5.025 , 5.025 }, {201 , -5.025 , 5.025 }}});
135137 rQARegistry.add (" hNSigmaProton" , " hNSigmaProton" , {HistType::kTH2D , {{201 , -5.025 , 5.025 }, {201 , -5.025 , 5.025 }}});
136138
139+ rQARegistry.add (" hTPCPion" , " hTPCPion" , {HistType::kTH2D , {{trackPtAxis}, {241 , -6 , 6 }}});
140+ rQARegistry.add (" hTPCKaon" , " hTPCKaon" , {HistType::kTH2D , {{trackPtAxis}, {241 , -6 , 6 }}});
141+ rQARegistry.add (" hTPCProton" , " hTPCProton" , {HistType::kTH2D , {{trackPtAxis}, {241 , -6 , 6 }}});
137142 rQARegistry.add (" hTOFPion" , " hTOFPion" , {HistType::kTH2D , {{trackPtAxis}, {1000 , -50 , 50 }}});
138143 rQARegistry.add (" hTOFKaon" , " hTOFKaon" , {HistType::kTH2D , {{trackPtAxis}, {1000 , -50 , 50 }}});
139144 rQARegistry.add (" hTOFProton" , " hTOFProton" , {HistType::kTH2D , {{trackPtAxis}, {1000 , -50 , 50 }}});
140145
141146 rQARegistry.add (" hInvMassLambda" , " hInvMassLambda" , {HistType::kTH3D , {{lambdaInvMassAxis}, {v0PtAxis}, {centralityAxis}}});
142147 rQARegistry.add (" hInvMassAntiLambda" , " hInvMassAntiLambda" , {HistType::kTH3D , {{lambdaInvMassAxis}, {v0PtAxis}, {centralityAxis}}});
143148
149+ // PhiStar
150+ rPhiStarRegistry.add (" hSEProtonPreCut" , " hSEProtonPreCut" , {HistType::kTH2D , {{80 , -0.2 , 0.2 }, {40 , -0.1 , 0.1 }}});
151+ rPhiStarRegistry.add (" hSEProtonPostCut" , " hSEProtonPostCut" , {HistType::kTH2D , {{80 , -0.2 , 0.2 }, {40 , -0.1 , 0.1 }}});
152+ rPhiStarRegistry.add (" hSEPionPreCut" , " hSEPionPreCut" , {HistType::kTH2D , {{80 , -0.2 , 0.2 }, {40 , -0.1 , 0.1 }}});
153+ rPhiStarRegistry.add (" hSEPionPostCut" , " hSEPionPostCut" , {HistType::kTH2D , {{80 , -0.2 , 0.2 }, {40 , -0.1 , 0.1 }}});
154+ rPhiStarRegistry.add (" hMEProtonPreCut" , " hMEProtonPreCut" , {HistType::kTH2D , {{80 , -0.2 , 0.2 }, {40 , -0.1 , 0.1 }}});
155+ rPhiStarRegistry.add (" hMEProtonPostCut" , " hMEProtonPostCut" , {HistType::kTH2D , {{80 , -0.2 , 0.2 }, {40 , -0.1 , 0.1 }}});
156+ rPhiStarRegistry.add (" hMEPionPreCut" , " hMEPionPreCut" , {HistType::kTH2D , {{80 , -0.2 , 0.2 }, {40 , -0.1 , 0.1 }}});
157+ rPhiStarRegistry.add (" hMEPionPostCut" , " hMEPionPostCut" , {HistType::kTH2D , {{80 , -0.2 , 0.2 }, {40 , -0.1 , 0.1 }}});
158+
144159 // Efficiency
145160 rMCRegistry.add (" hGenerated" , " hGenerated" , {HistType::kTH1D , {trackPtAxis}});
146161 rMCRegistry.add (" hGenPionP" , " hGenPionP" , {HistType::kTH1D , {trackPtAxis}});
@@ -199,14 +214,19 @@ struct ThreeParticleCorrelations {
199214
200215 // ================================================================================================================================================================================================================
201216
202- void processSame (MyFilteredCollision const & collision, MyFilteredV0s const & v0s, MyFilteredTracks const & tracks)
217+ void processSame (MyFilteredCollision const & collision, MyFilteredV0s const & v0s, MyFilteredTracks const & tracks, aod::BCsWithTimestamps const & )
203218 {
204219
220+ auto bc = collision.bc_as <aod::BCsWithTimestamps>();
221+ auto bField = getMagneticField (bc.timestamp ());
205222 rQARegistry.fill (HIST (" hEventCentrality" ), collision.centFT0C ());
206223 rQARegistry.fill (HIST (" hEventZvtx" ), collision.posZ ());
207224
208225 // Start of the Track QA
209226 for (const auto & track : tracks) {
227+ rQARegistry.fill (HIST (" hTPCPion" ), track.pt (), track.tpcNSigmaPi ());
228+ rQARegistry.fill (HIST (" hTPCKaon" ), track.pt (), track.tpcNSigmaKa ());
229+ rQARegistry.fill (HIST (" hTPCProton" ), track.pt (), track.tpcNSigmaPr ());
210230 if (track.hasTOF ()) {
211231 rQARegistry.fill (HIST (" hTOFPion" ), track.pt (), track.tofNSigmaPi ());
212232 rQARegistry.fill (HIST (" hTOFKaon" ), track.pt (), track.tofNSigmaKa ());
@@ -252,7 +272,7 @@ struct ThreeParticleCorrelations {
252272
253273 for (const auto & associate : tracks) {
254274 if (trackFilters (associate)) {
255- if (correlationFilters (trigger, associate) && fakeV0Filter (trigger, associate)) {
275+ if (correlationFilters (trigger, associate) && radialDistanceFilter (trigger, associate, bField, false ) && fakeV0Filter (trigger, associate)) {
256276
257277 assocPID = trackPID (associate);
258278 deltaPhi = RecoDecay::constrainAngle (trigger.phi () - associate.phi (), -constants::math::PIHalf);
@@ -283,14 +303,17 @@ struct ThreeParticleCorrelations {
283303 // End of the V0-Track Correlations
284304 }
285305
286- void processMixed (MyFilteredCollisions const &, MyFilteredV0s const &, MyFilteredTracks const &)
306+ void processMixed (MyFilteredCollisions const &, MyFilteredV0s const &, MyFilteredTracks const &, aod::BCsWithTimestamps const & )
287307 {
288308
289309 // Start of the Mixed-events Correlations
290310 for (const auto & [coll_1, v0_1, coll_2, track_2] : pair) {
311+
312+ auto bc = coll_1.bc_as <aod::BCsWithTimestamps>();
313+ auto bField = getMagneticField (bc.timestamp ());
291314 for (const auto & [trigger, associate] : soa::combinations (soa::CombinationsFullIndexPolicy (v0_1, track_2))) {
292315 if (v0Filters (trigger) && trackFilters (associate)) {
293- if (correlationFilters (trigger, associate) && fakeV0Filter (trigger, associate)) {
316+ if (radialDistanceFilter (trigger, associate, bField, true ) && fakeV0Filter (trigger, associate)) {
294317
295318 triggSign = v0Sign (trigger);
296319 if (triggSign == 1 ) {
@@ -438,6 +461,21 @@ struct ThreeParticleCorrelations {
438461
439462 // ================================================================================================================================================================================================================
440463
464+ double getMagneticField (uint64_t timestamp)
465+ {
466+ static parameters::GRPMagField* grpo = nullptr ;
467+ if (grpo == nullptr ) {
468+ grpo = ccdb->getForTimeStamp <parameters::GRPMagField>(" GLO/Config/GRPMagField" , timestamp);
469+ if (grpo == nullptr ) {
470+ LOGF (fatal, " GRP object not found for timestamp %llu" , timestamp);
471+ return 0 ;
472+ }
473+ LOGF (info, " Retrieved GRP for timestamp %llu with magnetic field of %d kG" , timestamp, grpo->getNominalL3Field ());
474+ }
475+
476+ return 0.1 * (grpo->getNominalL3Field ()); // 1 T = 10 kG
477+ }
478+
441479 double trackEff (TH1D** efficiencies, int sign, double pT)
442480 {
443481
@@ -530,11 +568,11 @@ struct ThreeParticleCorrelations {
530568 if (track.pt () < 0.3 ) {
531569 return kFALSE ;
532570 } else if (track.pt () > 0.3 && track.pt () < 1.5 ) {
533- if (std::abs (trackPID ( track)[ 1 ] ) > 4.0 ) {
571+ if (std::abs (track. tofNSigmaPi () ) > 4.0 ) {
534572 return kFALSE ;
535573 }
536574 } else if (track.pt () > 1.5 && track.pt () < 2.3 ) {
537- if (trackPID ( track)[ 1 ] < -4.0 || trackPID ( track)[ 1 ] > 0.0 ) {
575+ if (track. tofNSigmaPi () < -4.0 || track. tofNSigmaPi () > 0.0 ) {
538576 return kFALSE ;
539577 }
540578 } else if (track.pt () > 2.3 ) {
@@ -548,15 +586,15 @@ struct ThreeParticleCorrelations {
548586 if (track.pt () < 0.5 ) {
549587 return kFALSE ;
550588 } else if (track.pt () > 0.5 && track.pt () < 1.5 ) {
551- if (std::abs (trackPID ( track)[ 1 ] ) > 4.0 ) {
589+ if (std::abs (track. tofNSigmaKa () ) > 4.0 ) {
552590 return kFALSE ;
553591 }
554592 } else if (track.pt () > 1.5 && track.pt () < 2.0 ) {
555- if (trackPID ( track)[ 1 ] < -2.0 || trackPID ( track)[ 1 ] > 4.0 ) {
593+ if (track. tofNSigmaKa () < -2.0 || track. tofNSigmaKa () > 4.0 ) {
556594 return kFALSE ;
557595 }
558596 } else if (track.pt () > 2.0 && track.pt () < 2.5 ) {
559- if (trackPID ( track)[ 1 ] < 0.0 || trackPID ( track)[ 1 ] > 4.0 ) {
597+ if (track. tofNSigmaKa () < 0.0 || track. tofNSigmaKa () > 4.0 ) {
560598 return kFALSE ;
561599 }
562600 } else if (track.pt () > 2.5 ) {
@@ -570,15 +608,15 @@ struct ThreeParticleCorrelations {
570608 if (track.pt () < 0.5 ) {
571609 return kFALSE ;
572610 } else if (track.pt () > 0.5 && track.pt () < 0.7 ) {
573- if (trackPID ( track)[ 1 ] < -2.0 || trackPID ( track)[ 1 ] > 4.0 ) {
611+ if (track. tofNSigmaPr () < -2.0 || track. tofNSigmaPr () > 4.0 ) {
574612 return kFALSE ;
575613 }
576614 } else if (track.pt () > 0.7 && track.pt () < 2.5 ) {
577- if (std::abs (trackPID ( track)[ 1 ] ) > 4.0 ) {
615+ if (std::abs (track. tofNSigmaPr () ) > 4.0 ) {
578616 return kFALSE ;
579617 }
580618 } else if (track.pt () > 2.5 ) {
581- if (trackPID ( track)[ 1 ] < -2.0 || trackPID ( track)[ 1 ] > 4.0 ) {
619+ if (track. tofNSigmaPr () < -2.0 || track. tofNSigmaPr () > 4.0 ) {
582620 return kFALSE ;
583621 }
584622 }
@@ -641,6 +679,62 @@ struct ThreeParticleCorrelations {
641679
642680 return kTRUE ;
643681 }
682+
683+ template <class V0Cand , class TrackCand >
684+ bool radialDistanceFilter (const V0Cand& v0, const TrackCand& track, double B, bool Mix)
685+ {
686+
687+ auto dProton = v0.template posTrack_as <MyFilteredTracks>();
688+ auto dPion = v0.template negTrack_as <MyFilteredTracks>();
689+ if (v0Sign (v0) == -1 ) {
690+ dProton = v0.template negTrack_as <MyFilteredTracks>();
691+ dPion = v0.template posTrack_as <MyFilteredTracks>();
692+ }
693+
694+ double dEtaProton = dProton.eta () - track.eta ();
695+ double dEtaPion = dPion.eta () - track.eta ();
696+ if (std::abs (dEtaProton) > 0.02 && std::abs (dEtaPion) > 0.02 ) {
697+ return kTRUE ;
698+ }
699+
700+ double phiStarProton, phiStarPion;
701+ double dPhiProton = dProton.phi () - track.phi ();
702+ double dPhiPion = dPion.phi () - track.phi ();
703+ double phaseProton = (-0.3 * B * dProton.sign ()) / (2 * dProton.pt ());
704+ double phasePion = (-0.3 * B * dPion.sign ()) / (2 * dPion.pt ());
705+ double phaseTrack = (-0.3 * B * track.sign ()) / (2 * track.pt ());
706+
707+ for (double r = 0.8 ; r <= 2.5 ; r += 0.01 ) {
708+ phiStarProton = RecoDecay::constrainAngle (dPhiProton + std::asin (phaseProton * r) - std::asin (phaseTrack * r), -constants::math::PIHalf);
709+ phiStarPion = RecoDecay::constrainAngle (dPhiPion + std::asin (phasePion * r) - std::asin (phaseTrack * r), -constants::math::PIHalf);
710+
711+ if (r == 0.8 ) {
712+ if (!Mix) {
713+ rPhiStarRegistry.fill (HIST (" hSEProtonPreCut" ), phiStarProton, dEtaProton);
714+ rPhiStarRegistry.fill (HIST (" hSEPionPreCut" ), phiStarPion, dEtaPion);
715+ } else {
716+ rPhiStarRegistry.fill (HIST (" hMEProtonPreCut" ), phiStarProton, dEtaProton);
717+ rPhiStarRegistry.fill (HIST (" hMEPionPreCut" ), phiStarPion, dEtaPion);
718+ }
719+ }
720+
721+ if ((std::abs (dEtaProton) <= 0.02 && std::abs (phiStarProton) <= 0.045 ) || (std::abs (dEtaPion) <= 0.02 && std::abs (phiStarPion) <= 0.045 )) {
722+ return kFALSE ;
723+ }
724+
725+ if (r == 0.8 ) {
726+ if (!Mix) {
727+ rPhiStarRegistry.fill (HIST (" hSEProtonPostCut" ), phiStarProton, dEtaProton);
728+ rPhiStarRegistry.fill (HIST (" hSEPionPostCut" ), phiStarPion, dEtaPion);
729+ } else {
730+ rPhiStarRegistry.fill (HIST (" hMEProtonPostCut" ), phiStarProton, dEtaProton);
731+ rPhiStarRegistry.fill (HIST (" hMEPionPostCut" ), phiStarPion, dEtaPion);
732+ }
733+ }
734+ }
735+
736+ return kTRUE ;
737+ }
644738};
645739
646740// ==================================================================================================================================================================================================================
0 commit comments