@@ -97,6 +97,7 @@ struct phianalysisrun3_PbPb {
9797 Configurable<float > confMinRot{" confMinRot" , 5.0 * TMath::Pi () / 6.0 , " Minimum of rotation" };
9898 Configurable<float > confMaxRot{" confMaxRot" , 7.0 * TMath::Pi () / 6.0 , " Maximum of rotation" };
9999 Configurable<bool > PDGcheck{" PDGcheck" , true , " PDGcheck" };
100+ Configurable<bool > Reco{" Reco" , true , " Reco" };
100101
101102 Configurable<bool > genacceptancecut{" genacceptancecut" , true , " use acceptance cut for generated" };
102103 // MC
@@ -115,6 +116,12 @@ struct phianalysisrun3_PbPb {
115116 histos.add (" h3PhiInvMassSame" , " Invariant mass of Phi meson same" , kTH3F , {{200 , 0.0 , 200.0 }, {200 , 0 .0f , 20 .0f }, {200 , 0.9 , 1.1 }});
116117 } else if (isMC) {
117118 histos.add (" hMC" , " MC Event statistics" , kTH1F , {{10 , 0 .0f , 10 .0f }});
119+ histos.add (" EL1" , " MC Event statistics" , kTH2F , {{1 , 0 .0f , 1 .0f }, {200 , 0 .0f , 20 .0f }});
120+ histos.add (" EL2" , " MC Event statistics" , kTH2F , {{1 , 0 .0f , 1 .0f }, {200 , 0.0 , 200.0 }});
121+ histos.add (" ES1" , " MC Event statistics" , kTH2F , {{1 , 0 .0f , 1 .0f }, {200 , 0 .0f , 20 .0f }});
122+ histos.add (" ES3" , " MC Event statistics" , kTH2F , {{1 , 0 .0f , 1 .0f }, {200 , 0 .0f , 20 .0f }});
123+ histos.add (" ES2" , " MC Event statistics" , kTH2F , {{1 , 0 .0f , 1 .0f }, {200 , 0.0 , 200.0 }});
124+ histos.add (" ES4" , " MC Event statistics" , kTH2F , {{1 , 0 .0f , 1 .0f }, {200 , 0.0 , 200.0 }});
118125 histos.add (" h1PhiGen" , " Phi meson Gen" , kTH1F , {{200 , 0 .0f , 20 .0f }});
119126 histos.add (" h1PhiGen1" , " Phi meson Gen" , kTH1F , {{200 , 0 .0f , 20 .0f }});
120127 histos.add (" h1PhiRecsplit" , " Phi meson Rec split" , kTH1F , {{200 , 0 .0f , 20 .0f }});
@@ -125,13 +132,22 @@ struct phianalysisrun3_PbPb {
125132 histos.add (" h3Phi1Rec3" , " Phi meson Rec" , kTH3F , {{200 , 0 .0f , 20 .0f }, {200 , 0.0 , 200.0 }, {200 , 0.9 , 1.1 }});
126133 histos.add (" h3PhiGen3" , " Phi meson Gen" , kTH3F , {{200 , 0 .0f , 20 .0f }, {200 , 0.0 , 200.0 }, {200 , 0.9 , 1.1 }});
127134 histos.add (" h3PhiInvMassMixedMC" , " Invariant mass of Phi meson Mixed" , kTH3F , {{200 , 0.0 , 200.0 }, {200 , 0 .0f , 20 .0f }, {200 , 0.9 , 1.1 }});
135+ histos.add (" h3PhiInvMassSameMC" , " Invariant mass of Phi meson same" , kTH3F , {{200 , 0.0 , 200.0 }, {200 , 0 .0f , 20 .0f }, {200 , 0.9 , 1.1 }});
136+ histos.add (" h3PhiInvMassRotMC" , " Invariant mass of Phi meson Rotation" , kTH3F , {{200 , 0.0 , 200.0 }, {200 , 0 .0f , 20 .0f }, {200 , 0.9 , 1.1 }});
128137 histos.add (" h2PhiGen2" , " Phi meson gen" , kTH2F , {{200 , 0 .0f , 20 .0f }, {200 , 0.0 , 200.0 }});
129138 histos.add (" h1PhiRec1" , " Phi meson Rec" , kTH1F , {{200 , 0 .0f , 20 .0f }});
130139 histos.add (" h1Phimassgen" , " Phi meson gen" , kTH1F , {{200 , 0.9 , 1.1 }});
131140 histos.add (" h1Phimassrec" , " Phi meson Rec" , kTH1F , {{200 , 0.9 , 1.1 }});
141+ histos.add (" h1Phimasssame" , " Phi meson Rec" , kTH1F , {{200 , 0.9 , 1.1 }});
142+ histos.add (" h1Phimassmix" , " Phi meson Rec" , kTH1F , {{200 , 0.9 , 1.1 }});
143+ histos.add (" h1Phimassrot" , " Phi meson Rec" , kTH1F , {{200 , 0.9 , 1.1 }});
132144 histos.add (" h1Phi1massrec" , " Phi meson Rec" , kTH1F , {{200 , 0.9 , 1.1 }});
133145 histos.add (" h1Phipt" , " Phi meson Rec" , kTH1F , {{200 , 0 .0f , 20 .0f }});
134146 histos.add (" hOccupancy1" , " Occupancy distribution" , kTH1F , {{500 , 0 , 50000 }});
147+ histos.add (" hImpactParameterGen" , " Impact parameter of generated MC events" , kTH1F , {{200 , 0 .0f , 20 .0f }});
148+ histos.add (" hImpactParameterRec" , " Impact parameter of generated MC events" , kTH1F , {{200 , 0 .0f , 20 .0f }});
149+ histos.add (" hImpactParameterGenCen" , " Impact parameter of generated MC events" , kTH2F , {{200 , 0 .0f , 20 .0f }, {200 , 0.0 , 200.0 }});
150+ histos.add (" hImpactParameterRecCen" , " Impact parameter of generated MC events" , kTH2F , {{200 , 0 .0f , 20 .0f }, {200 , 0.0 , 200.0 }});
135151 histos.add (" TOF_Nsigma_MC" , " TOF NSigma for Kaon;#it{p}_{T} (GeV/#it{c});#sigma_{TOF}^{Kaon};" , {HistType::kTH3D , {{200 , -12 , 12 }, {200 , 0.0 , 200.0 }, {200 , 0 .0f , 20 .0f }}});
136152 histos.add (" TPC_Nsigma_MC" , " TPC NSigma for Kaon;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Kaon};" , {HistType::kTH3D , {{200 , -12 , 12 }, {200 , 0.0 , 200.0 }, {200 , 0 .0f , 20 .0f }}});
137153 }
@@ -498,15 +514,14 @@ struct phianalysisrun3_PbPb {
498514 }
499515 int occupancy = RecCollision.trackOccupancyInTimeRange ();
500516 if (fillOccupancy && !(occupancy > cfgOccupancyCut1 && occupancy < cfgOccupancyCut2)) {
501- return ;
517+ continue ;
502518 }
503519 if (TMath::Abs (RecCollision.posZ ()) > cfgCutVertex) {
504520 histos.fill (HIST (" hMC" ), 6 );
505521 continue ;
506522 }
507523 histos.fill (HIST (" hMC" ), 7 );
508524 auto centrality = RecCollision.centFT0C ();
509- histos.fill (HIST (" Centrec" ), centrality);
510525 auto oldindex = -999 ;
511526 auto Rectrackspart = RecTracks.sliceBy (perCollision, RecCollision.globalIndex ());
512527 // loop over reconstructed particle
@@ -598,6 +613,7 @@ struct phianalysisrun3_PbPb {
598613 histos.fill (HIST (" h2PhiRec2" ), PhiMesonMother.pt (), centrality);
599614 histos.fill (HIST (" h1Phimassrec" ), PhiMesonMother.M ());
600615 histos.fill (HIST (" h3PhiRec3" ), PhiMesonMother.pt (), centrality, PhiMesonMother.M ());
616+ histos.fill (HIST (" Centrec" ), centrality);
601617 }
602618 }
603619 }
@@ -642,6 +658,7 @@ struct phianalysisrun3_PbPb {
642658 PhiMesonMother = KaonPlus + KaonMinus;
643659 histos.fill (HIST (" h1PhiGen" ), PhiMesonMother.pt ());
644660 histos.fill (HIST (" h2PhiGen2" ), PhiMesonMother.pt (), centrality);
661+ histos.fill (HIST (" Centgen" ), centrality);
645662 histos.fill (HIST (" h1Phimassgen" ), PhiMesonMother.M ());
646663 }
647664 }
@@ -651,10 +668,13 @@ struct phianalysisrun3_PbPb {
651668 PROCESS_SWITCH (phianalysisrun3_PbPb, processMC, " Process Reconstructed" , false );
652669 void processGen (aod::McCollision const & mcCollision, aod::McParticles& mcParticles, const soa::SmallGroups<EventCandidatesMC>& collisions)
653670 {
671+
654672 histos.fill (HIST (" hMC" ), 0.5 );
655673 if (std::abs (mcCollision.posZ ()) < cfgCutVertex) {
656674 histos.fill (HIST (" hMC" ), 1.5 );
657675 }
676+ float imp = mcCollision.impactParameter ();
677+ histos.fill (HIST (" hImpactParameterGen" ), imp);
658678 std::vector<int64_t > SelectedEvents (collisions.size ());
659679 int nevts = 0 ;
660680 auto multiplicity = 0 ;
@@ -669,15 +689,21 @@ struct phianalysisrun3_PbPb {
669689 histos.fill (HIST (" hOccupancy1" ), occupancy);
670690 multiplicity = collision.centFT0C ();
671691 histos.fill (HIST (" Centgen" ), multiplicity);
692+ histos.fill (HIST (" hImpactParameterGenCen" ), imp, multiplicity);
693+
672694 SelectedEvents[nevts++] = collision.mcCollision_as <aod::McCollisions>().globalIndex ();
695+ histos.fill (HIST (" hMC" ), 2.5 );
673696 }
674697 SelectedEvents.resize (nevts);
698+
675699 const auto evtReconstructedAndSelected = std::find (SelectedEvents.begin (), SelectedEvents.end (), mcCollision.globalIndex ()) != SelectedEvents.end ();
676- histos.fill (HIST (" hMC" ), 3.5 );
677- if (!evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection
700+ histos.fill (HIST (" EL1" ), 0 , imp);
701+ histos.fill (HIST (" EL2" ), 0 , multiplicity);
702+ if (Reco && !evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection
678703 return ;
679704 }
680- histos.fill (HIST (" hMC" ), 4.5 );
705+ histos.fill (HIST (" ES1" ), 0 , imp);
706+ histos.fill (HIST (" ES2" ), 0 , multiplicity);
681707 for (auto & mcParticle : mcParticles) {
682708 if (std::abs (mcParticle.y ()) >= 0.5 ) {
683709 continue ;
@@ -727,7 +753,11 @@ struct phianalysisrun3_PbPb {
727753 }
728754 auto multiplicity = collision.centFT0C ();
729755 histos.fill (HIST (" Centrec" ), multiplicity);
730- histos.fill (HIST (" hMC" ), 5.5 );
756+ float imp = collision.mcCollision ().impactParameter ();
757+ histos.fill (HIST (" hImpactParameterRec" ), imp);
758+ histos.fill (HIST (" hImpactParameterRecCen" ), imp, multiplicity);
759+ histos.fill (HIST (" ES3" ), 0 , imp);
760+ histos.fill (HIST (" ES4" ), 0 , multiplicity);
731761 auto oldindex = -999 ;
732762 for (auto track1 : tracks) {
733763 if (!selectionTrack (track1)) {
@@ -824,6 +854,80 @@ struct phianalysisrun3_PbPb {
824854 }
825855
826856 PROCESS_SWITCH (phianalysisrun3_PbPb, processRec, " Process Reconstructed" , false );
857+ void processSameEventMC (EventCandidatesMC::iterator const & collision, TrackCandidatesMC const & tracks, aod::McParticles const & /* mcParticles*/ , aod::McCollisions const & /* mcCollisions*/ )
858+ {
859+ if (!collision.sel8 ()) {
860+ return ;
861+ }
862+ if (additionalEvSel2 && (!collision.selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ))) {
863+ return ;
864+ }
865+ if (additionalEvSel3 && (!collision.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard ))) {
866+ return ;
867+ }
868+ int occupancy = collision.trackOccupancyInTimeRange ();
869+ if (fillOccupancy && !(occupancy > cfgOccupancyCut1 && occupancy < cfgOccupancyCut2)) {
870+ return ;
871+ }
872+ float multiplicity{-1 };
873+ multiplicity = collision.centFT0C ();
874+ for (auto track1 : tracks) {
875+ if (!selectionTrack (track1)) {
876+ continue ;
877+ }
878+ auto track1ID = track1.globalIndex ();
879+ for (auto track2 : tracks) {
880+ if (!selectionTrack (track2)) {
881+ continue ;
882+ }
883+ auto track2ID = track2.globalIndex ();
884+ if (track2ID <= track1ID) {
885+ continue ;
886+ }
887+ if (!selectionPair (track1, track2)) {
888+ continue ;
889+ }
890+ if (!ispTdepPID && (!selectionPID (track1) || !selectionPID (track2))) {
891+ continue ;
892+ }
893+ if (ispTdepPID && (!selectionPIDpTdependent (track1) || !selectionPIDpTdependent (track2))) {
894+ continue ;
895+ }
896+ if (track1.sign () * track2.sign () < 0 ) {
897+ KaonPlus = ROOT::Math::PxPyPzMVector (track1.px (), track1.py (), track1.pz (), massKa);
898+ KaonMinus = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massKa);
899+ }
900+ PhiMesonMother = KaonPlus + KaonMinus;
901+ if (TMath::Abs (PhiMesonMother.Rapidity ()) > confRapidity) {
902+ continue ;
903+ }
904+ histos.fill (HIST (" h3PhiInvMassSameMC" ), multiplicity, PhiMesonMother.pt (), PhiMesonMother.M ());
905+ histos.fill (HIST (" h1Phimasssame" ), PhiMesonMother.M ());
906+ if (fillRotation) {
907+ for (int nrotbkg = 0 ; nrotbkg < nBkgRotations; nrotbkg++) {
908+ auto anglestart = confMinRot;
909+ auto angleend = confMaxRot;
910+ auto anglestep = (angleend - anglestart) / (1.0 * (nBkgRotations - 1 ));
911+ auto rotangle = anglestart + nrotbkg * anglestep;
912+ if (track1.sign () * track2.sign () < 0 ) {
913+ auto rotkaonPx = track1.px () * std::cos (rotangle) - track1.py () * std::sin (rotangle);
914+ auto rotkaonPy = track1.px () * std::sin (rotangle) + track1.py () * std::cos (rotangle);
915+ KaonPlus = ROOT::Math::PxPyPzMVector (rotkaonPx, rotkaonPy, track1.pz (), massKa);
916+ KaonMinus = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massKa);
917+ }
918+ PhiMesonMother = KaonPlus + KaonMinus;
919+ if (TMath::Abs (PhiMesonMother.Rapidity ()) > confRapidity) {
920+ continue ;
921+ }
922+ histos.fill (HIST (" h3PhiInvMassRotMC" ), multiplicity, PhiMesonMother.pt (), PhiMesonMother.M ());
923+ histos.fill (HIST (" h1Phimassrot" ), PhiMesonMother.M ());
924+ }
925+ }
926+ }
927+ }
928+ }
929+
930+ PROCESS_SWITCH (phianalysisrun3_PbPb, processSameEventMC, " Process Same event" , false );
827931 void processMixedEventMC (EventCandidatesMC const & recCollisions, TrackCandidatesMC const & RecTracks, aod::McParticles const &)
828932 {
829933
@@ -876,7 +980,6 @@ struct phianalysisrun3_PbPb {
876980 if (ispTdepPID && (!selectionPIDpTdependent (t1) || !selectionPIDpTdependent (t2))) {
877981 continue ;
878982 }
879- histos.fill (HIST (" hMC" ), 7.5 );
880983 if (t1.sign () * t2.sign () < 0 ) {
881984 KaonPlus = ROOT::Math::PxPyPzMVector (t1.px (), t1.py (), t1.pz (), massKa);
882985 KaonMinus = ROOT::Math::PxPyPzMVector (t2.px (), t2.py (), t2.pz (), massKa);
@@ -885,8 +988,8 @@ struct phianalysisrun3_PbPb {
885988 if (TMath::Abs (PhiMesonMother.Rapidity ()) > confRapidity) {
886989 continue ;
887990 }
888- histos.fill (HIST (" hMC" ), 8.5 );
889991 histos.fill (HIST (" h3PhiInvMassMixedMC" ), multiplicity, PhiMesonMother.pt (), PhiMesonMother.M ());
992+ histos.fill (HIST (" h1Phimassmix" ), PhiMesonMother.M ());
890993 }
891994 }
892995 }
0 commit comments