@@ -87,6 +87,9 @@ struct createTTP {
8787 ConfigurableAxis ConfDCABins{" ConfDCABins" , {200 , -1000 , +1000 }, " DCA bins for output histograms" };
8888 ConfigurableAxis ConfDCASigmaBins{" ConfDCASigmaBins" , {200 , -10 , +10 }, " DCA in sigma bins for output histograms" };
8989
90+ o2::framework::ConfigurableAxis ConfMllBins{" ConfMllBins" , {400 , 0 , 4 }, " mll bins for output histograms" };
91+ o2::framework::ConfigurableAxis ConfPtllBins{" ConfPtllBins" , {o2::framework::VARIABLE_WIDTH , 0.00 , 0.10 , 0.20 , 0.30 , 0.40 , 0.50 , 0.60 , 0.70 , 0.80 , 0.90 , 1.00 , 1.10 , 1.20 , 1.30 , 1.40 , 1.50 , 1.60 , 1.70 , 1.80 , 1.90 , 2.00 , 2.50 , 3.00 , 3.50 , 4.00 , 4.50 , 5.00 , 6.00 , 7.00 , 8.00 , 9.00 , 10.00 }, " pTll bins for output histograms" };
92+
9093 struct : ConfigurableGroup {
9194 std::string prefix = " eventCut" ;
9295 Configurable<float > cfgZvtxMin{" cfgZvtxMin" , -10 , " min. Zvtx" };
@@ -165,12 +168,17 @@ struct createTTP {
165168
166169 struct : ConfigurableGroup {
167170 std::string prefix = " pairCut" ;
168- Configurable<float > minMee{" minMee" , 0.00 , " min mee for pi0 -> ee" };
169- Configurable<float > maxMee{" maxMee" , 0.01 , " max mee for pi0 -> ee" };
170- Configurable<float > minPhiV{" minPhiV" , 0 .f , " min phiv for pi0 -> ee" };
171- Configurable<float > maxPhiV{" maxPhiV" , M_PI / 2 , " max phiv for pi0 -> ee" };
171+ Configurable<float > minMee{" minMee" , 0.00 , " min mee of pi0 -> ee" };
172+ Configurable<float > maxMee{" maxMee" , 0.01 , " max mee of pi0 -> ee" };
173+ Configurable<float > minPhiV{" minPhiV" , 0 .f , " min phiv of pi0 -> ee" };
174+ Configurable<float > maxPhiV{" maxPhiV" , M_PI / 2 , " max phiv of pi0 -> ee" };
172175 } pairCut;
173176
177+ struct : ConfigurableGroup {
178+ std::string prefix = " pfGroup" ;
179+ Configurable<float > maxMee{" maxMee" , 0.06 , " max mee of pi0 -> ee for prefilter to improve S/B for peak extraction of VMs" };
180+ } pfGroup;
181+
174182 o2::aod::rctsel::RCTFlagsChecker rctChecker;
175183
176184 int mRunNumber {0 };
@@ -247,17 +255,20 @@ struct createTTP {
247255 const AxisSpec axis_eta{cfgNbinsEta, -1 , +1 , " #eta" };
248256 const AxisSpec axis_phi{cfgNbinsPhi, 0.0 , 2 * M_PI , " #varphi (rad.)" };
249257 const AxisSpec axis_sign{3 , -1.5 , +1.5 , " sign" };
250- const AxisSpec axis_mass{400 , 0 , 4 , " m_{ee} (GeV/c^{2})" };
251- const AxisSpec axis_ptee{100 , 0 , 10 , " p_{T,ee} (GeV/c)" };
258+ const AxisSpec axis_mass{ConfMllBins , " m_{ee} (GeV/c^{2})" };
259+ const AxisSpec axis_ptee{ConfPtllBins , " p_{T,ee} (GeV/c)" };
252260
253261 const AxisSpec axis_mean_dcaXY{ConfDCABins, " DCA_{xy} (#mum)" };
254262 const AxisSpec axis_mean_dcaZ{ConfDCABins, " DCA_{z} (#mum)" };
255263 const AxisSpec axis_pull_dcaXY{ConfDCASigmaBins, " DCA_{xy}/#sigma_{xy}^{DCA}" };
256264 const AxisSpec axis_pull_dcaZ{ConfDCASigmaBins, " DCA_{z}/#sigma_{z}^{DCA}" };
257265
258- fRegistry .add (" Track/hs" , " electron" , kTHnSparseD , {axis_pt, axis_eta, axis_phi, axis_sign, axis_mean_dcaXY, axis_mean_dcaZ, axis_pull_dcaXY, axis_pull_dcaZ}, false );
266+ fRegistry .add (" Track/hs" , " probe electron" , kTHnSparseD , {axis_pt, axis_eta, axis_phi, axis_sign, axis_mean_dcaXY, axis_mean_dcaZ, axis_pull_dcaXY, axis_pull_dcaZ}, false );
259267 fRegistry .add (" Track/hTPCNsigmaEl" , " TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}" , kTH2F , {{1000 , 0 , 10 }, {100 , -5 .f , +5 .f }}, false );
260- fRegistry .add (" Pair/hMvsPhiV" , " m_{ee} vs. #varphi_{V} ULS;#varphi_{V} (rad.);m_{ee} (GeV/c^{2})" , kTH2F , {{90 , 0 .f , M_PI }, {100 , 0 , 0.1 }});
268+ fRegistry .add (" Pair/uls/hMvsPt" , " dielectron" , kTH2D , {axis_mass, axis_ptee}, false );
269+ fRegistry .addClone (" Pair/uls/" , " Pair/lspp/" );
270+ fRegistry .addClone (" Pair/uls/" , " Pair/lsmm/" );
271+ fRegistry .add (" TAP/hMvsPhiV" , " m_{ee} vs. #varphi_{V} ULS;#varphi_{V} (rad.);m_{ee} (GeV/c^{2})" , kTH2F , {{90 , 0 .f , M_PI }, {100 , 0 , 0.1 }});
261272
262273 if (doprocessMC) {
263274 fRegistry .add (" Pair/hMvsPt_omega" , " #omega->ee" , kTH2D , {axis_mass, axis_ptee}, false );
@@ -273,10 +284,6 @@ struct createTTP {
273284 return false ;
274285 }
275286
276- if (!isTagElectron (track)) {
277- return false ;
278- }
279-
280287 if (pt < tagCut.min_pt_track || tagCut.max_pt_track < pt) {
281288 return false ;
282289 }
@@ -333,10 +340,6 @@ struct createTTP {
333340 return false ;
334341 }
335342
336- if (!isProbeElectron (track)) {
337- return false ;
338- }
339-
340343 if (pt < probeCut.min_pt_track || probeCut.max_pt_track < pt) {
341344 return false ;
342345 }
@@ -464,13 +467,19 @@ struct createTTP {
464467 }
465468 }
466469
467- using MyBCs = soa::Join<aod::BCsWithTimestamps, aod::BcSels>;
470+ struct lepton {
471+ float pt{0 };
472+ float eta{0 };
473+ float phi{0 };
474+ int globalIndex{-1 };
475+ int mcParticleId{-1 };
476+ };
468477
478+ using MyBCs = soa::Join<aod::BCsWithTimestamps, aod::BcSels>;
469479 using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs>;
470-
471480 using MyTracks = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU,
472- aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr,
473- aod::pidTOFFullEl, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr, aod::pidTOFbeta>;
481+ aod::pidTPCFullEl, /* aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr,*/
482+ aod::pidTOFFullEl /* , aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr, aod::pidTOFbeta*/ >;
474483
475484 Filter collisionFilter_zvtx = eventCut.cfgZvtxMin < o2::aod::collision::posZ && o2::aod::collision::posZ < eventCut.cfgZvtxMax;
476485 Filter collisionFilter_centrality = (eventCut.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventCut.cfgCentMax) || (eventCut.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventCut.cfgCentMax) || (eventCut.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventCut.cfgCentMax);
@@ -513,6 +522,7 @@ struct createTTP {
513522
514523 auto posTracks_per_coll = posTracks->sliceByCached (o2::aod::track::collisionId, collision.globalIndex (), cache);
515524 auto negTracks_per_coll = negTracks->sliceByCached (o2::aod::track::collisionId, collision.globalIndex (), cache);
525+ // LOGF(info, "posTracks_per_coll.size() = %d, negTracks_per_coll.size() = %d", posTracks_per_coll.size(), negTracks_per_coll.size());
516526
517527 o2::dataformats::DCA mDcaInfoCov ;
518528 for (const auto & tag : posTracks_per_coll) { // positron is tag
@@ -523,7 +533,7 @@ struct createTTP {
523533 if (!isPropOK) {
524534 continue ;
525535 }
526- if (!isTag (tag, tagParCov.getPt (), tagParCov.getEta (), mDcaInfoCov .getY (), mDcaInfoCov .getZ (), tagParCov.getSigmaY2 (), tagParCov.getSigmaZ2 (), tagParCov.getSigmaZY ())) {
536+ if (!isTag (tag, tagParCov.getPt (), tagParCov.getEta (), mDcaInfoCov .getY (), mDcaInfoCov .getZ (), tagParCov.getSigmaY2 (), tagParCov.getSigmaZ2 (), tagParCov.getSigmaZY ()) || ! isTagElectron (tag) ) {
527537 continue ;
528538 }
529539
@@ -535,7 +545,7 @@ struct createTTP {
535545 if (!isPropOK) {
536546 continue ;
537547 }
538- if (!isProbe (probe, probeParCov.getPt (), probeParCov.getEta (), mDcaInfoCov .getY (), mDcaInfoCov .getZ ())) {
548+ if (!isProbe (probe, probeParCov.getPt (), probeParCov.getEta (), mDcaInfoCov .getY (), mDcaInfoCov .getZ ()) || ! isProbeElectron (probe) ) {
539549 continue ;
540550 }
541551
@@ -544,7 +554,7 @@ struct createTTP {
544554 ROOT ::Math::PtEtaPhiMVector v12 = v1 + v2;
545555 float mee = v12.M ();
546556 float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair (v1.Px (), v1.Py (), v1.Pz (), v2.Px (), v2.Py (), v2.Pz (), tag.sign (), probe.sign (), d_bz);
547- fRegistry .fill (HIST (" Pair /hMvsPhiV" ), phiv, mee);
557+ fRegistry .fill (HIST (" TAP /hMvsPhiV" ), phiv, mee);
548558
549559 if ((pairCut.minMee < mee && mee < pairCut.maxMee ) && (pairCut.minPhiV < phiv && phiv < pairCut.maxPhiV )) {
550560 fRegistry .fill (HIST (" Track/hs" ), probeParCov.getPt (), probeParCov.getEta (), RecoDecay::constrainAngle (probeParCov.getPhi (), 0 , 1U ), probe.sign (), mDcaInfoCov .getY () * 1e+4 , mDcaInfoCov .getZ () * 1e+4 , mDcaInfoCov .getY () / std::sqrt (probeParCov.getSigmaY2 ()), mDcaInfoCov .getZ () / std::sqrt (probeParCov.getSigmaZ2 ()));
@@ -562,7 +572,7 @@ struct createTTP {
562572 if (!isPropOK) {
563573 continue ;
564574 }
565- if (!isTag (tag, tagParCov.getPt (), tagParCov.getEta (), mDcaInfoCov .getY (), mDcaInfoCov .getZ (), tagParCov.getSigmaY2 (), tagParCov.getSigmaZ2 (), tagParCov.getSigmaZY ())) {
575+ if (!isTag (tag, tagParCov.getPt (), tagParCov.getEta (), mDcaInfoCov .getY (), mDcaInfoCov .getZ (), tagParCov.getSigmaY2 (), tagParCov.getSigmaZ2 (), tagParCov.getSigmaZY ()) || ! isTagElectron (tag) ) {
566576 continue ;
567577 }
568578
@@ -574,7 +584,7 @@ struct createTTP {
574584 if (!isPropOK) {
575585 continue ;
576586 }
577- if (!isProbe (probe, probeParCov.getPt (), probeParCov.getEta (), mDcaInfoCov .getY (), mDcaInfoCov .getZ ())) {
587+ if (!isProbe (probe, probeParCov.getPt (), probeParCov.getEta (), mDcaInfoCov .getY (), mDcaInfoCov .getZ ()) || ! isProbeElectron (probe) ) {
578588 continue ;
579589 }
580590
@@ -583,7 +593,7 @@ struct createTTP {
583593 ROOT ::Math::PtEtaPhiMVector v12 = v1 + v2;
584594 float mee = v12.M ();
585595 float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair (v1.Px (), v1.Py (), v1.Pz (), v2.Px (), v2.Py (), v2.Pz (), tag.sign (), probe.sign (), d_bz);
586- fRegistry .fill (HIST (" Pair /hMvsPhiV" ), phiv, mee);
596+ fRegistry .fill (HIST (" TAP /hMvsPhiV" ), phiv, mee);
587597
588598 if ((pairCut.minMee < mee && mee < pairCut.maxMee ) && (pairCut.minPhiV < phiv && phiv < pairCut.maxPhiV )) {
589599 fRegistry .fill (HIST (" Track/hs" ), probeParCov.getPt (), probeParCov.getEta (), RecoDecay::constrainAngle (probeParCov.getPhi (), 0 , 1U ), probe.sign (), mDcaInfoCov .getY () * 1e+4 , mDcaInfoCov .getZ () * 1e+4 , mDcaInfoCov .getY () / std::sqrt (probeParCov.getSigmaY2 ()), mDcaInfoCov .getZ () / std::sqrt (probeParCov.getSigmaZ2 ()));
@@ -593,6 +603,109 @@ struct createTTP {
593603 } // end of positron loop
594604 } // end of electron loop
595605
606+ // for VM peak analyses
607+ std::vector<lepton> posLeptons;
608+ std::vector<lepton> negLeptons;
609+ posLeptons.reserve (posTracks_per_coll.size ());
610+ negLeptons.reserve (negTracks_per_coll.size ());
611+
612+ for (const auto & track : posTracks_per_coll) {
613+ mDcaInfoCov .set (999 , 999 , 999 , 999 , 999 );
614+ auto trackParCov = getTrackParCov (track);
615+ trackParCov.setPID (o2::track::PID ::Electron);
616+ bool isPropOK = o2::base::Propagator::Instance ()->propagateToDCABxByBz (mVtx , trackParCov, 2 .f , matCorr, &mDcaInfoCov );
617+ if (!isPropOK) {
618+ continue ;
619+ }
620+ if (isProbe (track, trackParCov.getPt (), trackParCov.getEta (), mDcaInfoCov .getY (), mDcaInfoCov .getZ ()) && isTagElectron (track)) {
621+ lepton tmp;
622+ tmp.pt = trackParCov.getPt ();
623+ tmp.eta = trackParCov.getEta ();
624+ tmp.phi = RecoDecay::constrainAngle (trackParCov.getPhi (), 0 , 1U );
625+ tmp.globalIndex = track.globalIndex ();
626+ tmp.mcParticleId = -1 ;
627+ posLeptons.emplace_back (tmp);
628+ }
629+ } // end of positron loop
630+
631+ for (const auto & track : negTracks_per_coll) {
632+ mDcaInfoCov .set (999 , 999 , 999 , 999 , 999 );
633+ auto trackParCov = getTrackParCov (track);
634+ trackParCov.setPID (o2::track::PID ::Electron);
635+ bool isPropOK = o2::base::Propagator::Instance ()->propagateToDCABxByBz (mVtx , trackParCov, 2 .f , matCorr, &mDcaInfoCov );
636+ if (!isPropOK) {
637+ continue ;
638+ }
639+ if (isProbe (track, trackParCov.getPt (), trackParCov.getEta (), mDcaInfoCov .getY (), mDcaInfoCov .getZ ()) && isTagElectron (track)) {
640+ lepton tmp;
641+ tmp.pt = trackParCov.getPt ();
642+ tmp.eta = trackParCov.getEta ();
643+ tmp.phi = RecoDecay::constrainAngle (trackParCov.getPhi (), 0 , 1U );
644+ tmp.globalIndex = track.globalIndex ();
645+ tmp.mcParticleId = -1 ;
646+ negLeptons.emplace_back (tmp);
647+ }
648+ } // end of electron loop
649+
650+ std::vector<int > trackIdsFromPi0;
651+ trackIdsFromPi0.reserve (posLeptons.size () + negLeptons.size ());
652+
653+ for (const auto & t1 : posLeptons) {
654+ for (const auto & t2 : negLeptons) {
655+ ROOT ::Math::PtEtaPhiMVector v1 (t1.pt , t1.eta , t1.phi , o2::constants::physics::MassElectron);
656+ ROOT ::Math::PtEtaPhiMVector v2 (t2.pt , t2.eta , t2.phi , o2::constants::physics::MassElectron);
657+ ROOT ::Math::PtEtaPhiMVector v12 = v1 + v2;
658+ if (v12.M () < pfGroup.maxMee ) {
659+ trackIdsFromPi0.emplace_back (t1.globalIndex );
660+ trackIdsFromPi0.emplace_back (t2.globalIndex );
661+ continue ;
662+ }
663+ fRegistry .fill (HIST (" Pair/uls/hMvsPt" ), v12.M (), v12.Pt ());
664+ } // end of electron loop
665+ } // end of positron loop
666+
667+ for (size_t i = 0 ; i < posLeptons.size (); i++) {
668+ auto t1 = posLeptons[i];
669+ for (size_t j = i + 1 ; j < posLeptons.size (); j++) {
670+ auto t2 = posLeptons[j];
671+ if (std::find (trackIdsFromPi0.begin (), trackIdsFromPi0.end (), t1.globalIndex ) != trackIdsFromPi0.end ()) {
672+ continue ;
673+ }
674+ if (std::find (trackIdsFromPi0.begin (), trackIdsFromPi0.end (), t2.globalIndex ) != trackIdsFromPi0.end ()) {
675+ continue ;
676+ }
677+ ROOT ::Math::PtEtaPhiMVector v1 (t1.pt , t1.eta , t1.phi , o2::constants::physics::MassElectron);
678+ ROOT ::Math::PtEtaPhiMVector v2 (t2.pt , t2.eta , t2.phi , o2::constants::physics::MassElectron);
679+ ROOT ::Math::PtEtaPhiMVector v12 = v1 + v2;
680+ fRegistry .fill (HIST (" Pair/lspp/hMvsPt" ), v12.M (), v12.Pt ());
681+
682+ } // end of positron loop
683+ } // end of positron loop
684+
685+ for (size_t i = 0 ; i < negLeptons.size (); i++) {
686+ auto t1 = negLeptons[i];
687+ for (size_t j = i + 1 ; j < negLeptons.size (); j++) {
688+ auto t2 = negLeptons[j];
689+ if (std::find (trackIdsFromPi0.begin (), trackIdsFromPi0.end (), t1.globalIndex ) != trackIdsFromPi0.end ()) {
690+ continue ;
691+ }
692+ if (std::find (trackIdsFromPi0.begin (), trackIdsFromPi0.end (), t2.globalIndex ) != trackIdsFromPi0.end ()) {
693+ continue ;
694+ }
695+ ROOT ::Math::PtEtaPhiMVector v1 (t1.pt , t1.eta , t1.phi , o2::constants::physics::MassElectron);
696+ ROOT ::Math::PtEtaPhiMVector v2 (t2.pt , t2.eta , t2.phi , o2::constants::physics::MassElectron);
697+ ROOT ::Math::PtEtaPhiMVector v12 = v1 + v2;
698+ fRegistry .fill (HIST (" Pair/lsmm/hMvsPt" ), v12.M (), v12.Pt ());
699+ } // end of electron loop
700+ } // end of electron loop
701+
702+ posLeptons.clear ();
703+ posLeptons.shrink_to_fit ();
704+ negLeptons.clear ();
705+ negLeptons.shrink_to_fit ();
706+ trackIdsFromPi0.clear ();
707+ trackIdsFromPi0.shrink_to_fit ();
708+
596709 } // end of collision loop
597710 } // end of runTAP
598711
@@ -602,13 +715,6 @@ struct createTTP {
602715 }
603716 PROCESS_SWITCH (createTTP, processData, " process data" , true );
604717
605- struct lepton {
606- float pt{0 };
607- float eta{0 };
608- float phi{0 };
609- int mcParticleId{-1 };
610- };
611-
612718 using MyCollisionsMC = soa::Join<MyCollisions, aod::McCollisionLabels>;
613719 using MyTracksMC = soa::Join<MyTracks, aod::McTrackLabels>;
614720
@@ -639,11 +745,13 @@ struct createTTP {
639745 mVtx .setPos ({collision.posX (), collision.posY (), collision.posZ ()});
640746 mVtx .setCov (collision.covXX (), collision.covXY (), collision.covYY (), collision.covXZ (), collision.covYZ (), collision.covZZ ());
641747
748+ auto tracks_per_coll = tracks.sliceBy (perCol, collision.globalIndex ());
642749 std::vector<lepton> posLeptons;
643750 std::vector<lepton> negLeptons;
751+ posLeptons.reserve (tracks_per_coll.size ());
752+ negLeptons.reserve (tracks_per_coll.size ());
644753
645754 o2::dataformats::DCA mDcaInfoCov ;
646- auto tracks_per_coll = tracks.sliceBy (perCol, collision.globalIndex ());
647755 for (const auto & track : tracks_per_coll) {
648756 if (!track.has_mcParticle ()) {
649757 continue ;
@@ -671,7 +779,7 @@ struct createTTP {
671779 if (!isPropOK) {
672780 continue ;
673781 }
674- if (!isProbe (track, trackParCov.getPt (), trackParCov.getEta (), mDcaInfoCov .getY (), mDcaInfoCov .getZ ())) {
782+ if (!isProbe (track, trackParCov.getPt (), trackParCov.getEta (), mDcaInfoCov .getY (), mDcaInfoCov .getZ ())) { // PID cut is not necessary, because this is true electron.
675783 continue ;
676784 }
677785
@@ -681,6 +789,7 @@ struct createTTP {
681789 tmp.pt = trackParCov.getPt ();
682790 tmp.eta = trackParCov.getEta ();
683791 tmp.phi = RecoDecay::constrainAngle (trackParCov.getPhi (), 0 , 1U );
792+ tmp.globalIndex = track.globalIndex ();
684793 tmp.mcParticleId = mcParticle.globalIndex ();
685794
686795 if (track.sign () > 0 ) {
0 commit comments