@@ -59,7 +59,7 @@ struct hadronnucleicorrelation {
5959 static constexpr int pdgProton = 2212 ;
6060 static constexpr int pdgDeuteron = 1000010020 ;
6161
62- Configurable<int > mode{" mode" , 0 , " 0: antid-antip, 1: d-p, 2: antid-p, 3: d-antip, 4: antip-p, 5: antip-antip, 6: p-p" };
62+ Configurable<int > mode{" mode" , 0 , " 0: antid-antip, 1: d-p, 2: antid-p, 3: d-antip, 4: antip-p, 5: antip-antip, 6: p-p, 7: p-antip " };
6363
6464 Configurable<bool > dorapidity{" dorapidity" , false , " do rapidity dependent analysis" };
6565 Configurable<bool > doQA{" doQA" , true , " save QA histograms" };
@@ -222,6 +222,8 @@ struct hadronnucleicorrelation {
222222 registry.get <TH1>(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (6 , " events with #bar{p}" );
223223 registry.get <TH1>(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (7 , " events with p" );
224224
225+ registry.add (" hNtrig_total" , " hNtrig_total" , {HistType::kTH1D , {ptBinnedAxis}});
226+
225227 nBinspT = pTBins.value .size () - 1 ;
226228
227229 if (isMCGen) {
@@ -363,6 +365,9 @@ struct hadronnucleicorrelation {
363365 case 6 :
364366 name = " PrPr" ;
365367 break ;
368+ case 7 :
369+ name = " PrAntiPr" ;
370+ break ;
366371 }
367372
368373 if (!isMC) {
@@ -379,7 +384,6 @@ struct hadronnucleicorrelation {
379384 auto hCorrtempME_AntiDeAntiPr = registry.add <TH3>(Form (" hCorrEtaPhi_%s_ME_pt%02.0f%02.0f" , name.Data (), pTBins.value .at (i) * 10 , pTBins.value .at (i + 1 ) * 10 ), Form (" #Delta y #Delta#phi (%.1f<p_{T}^{assoc} <%.1f GeV/c)" , pTBins.value .at (i), pTBins.value .at (i + 1 )), {HistType::kTH3F , {DeltaRapAxis, DeltaPhiAxis, ptBinnedAxis}});
380385 hCorrEtaPhi_SE.push_back (std::move (hCorrtempSE_AntiDeAntiPr));
381386 hCorrEtaPhi_ME.push_back (std::move (hCorrtempME_AntiDeAntiPr));
382-
383387 } else {
384388
385389 auto htempSE_AntiDeAntiPr = registry.add <TH3>(Form (" hEtaPhi_%s_SE_pt%02.0f%02.0f" , name.Data (), pTBins.value .at (i) * 10 , pTBins.value .at (i + 1 ) * 10 ), Form (" Raw #Delta#eta#Delta#phi (%.1f<p_{T}^{assoc} <%.1f GeV/c)" , pTBins.value .at (i), pTBins.value .at (i + 1 )), {HistType::kTH3F , {DeltaEtaAxis, DeltaPhiAxis, ptBinnedAxis}});
@@ -690,13 +694,25 @@ struct hadronnucleicorrelation {
690694 continue ;
691695 }
692696
697+ float mass1 = 0 .f , mass2 = 0 .f ;
698+
699+ if (mode < 4 ) {
700+ // Deuteron-Proton combinations
701+ mass1 = o2::constants::physics::MassDeuteron;
702+ mass2 = o2::constants::physics::MassProton;
703+ } else {
704+ // Proton-Proton combinations
705+ mass1 = o2::constants::physics::MassProton;
706+ mass2 = o2::constants::physics::MassProton;
707+ }
708+
693709 // Calculate Delta-eta Delta-phi (reco)
694- float deltaEta = it2 ->eta () - it1 ->eta ();
695- float deltaRap = it2 ->rapidity () - it1 ->rapidity ();
710+ float deltaEta = it1 ->eta () - it2 ->eta ();
711+ float deltaRap = it1 ->rapidity (mass1 ) - it2 ->rapidity (mass2 );
696712 if (dorapidity) {
697713 deltaEta = deltaRap;
698714 }
699- float deltaPhi = it2 ->phi () - it1 ->phi ();
715+ float deltaPhi = it1 ->phi () - it2 ->phi ();
700716 deltaPhi = RecoDecay::constrainAngle (deltaPhi, -1 * o2::constants::math::PIHalf);
701717
702718 for (int k = 0 ; k < nBinspT; k++) {
@@ -735,6 +751,10 @@ struct hadronnucleicorrelation {
735751 corr1 = hEffpTEta_proton->Interpolate (it1->pt (), it1->eta ());
736752 corr2 = hEffpTEta_proton->Interpolate (it2->pt (), it2->eta ());
737753 break ;
754+ case 7 :
755+ corr1 = hEffpTEta_proton->Interpolate (it1->pt (), it1->eta ());
756+ corr2 = hEffpTEta_antiproton->Interpolate (it2->pt (), it2->eta ());
757+ break ;
738758 }
739759 }
740760
@@ -760,9 +780,9 @@ struct hadronnucleicorrelation {
760780 for (auto const & it1 : particles1) {
761781 for (auto const & it2 : particles2) {
762782 // Calculate Delta-eta Delta-phi (gen)
763- float deltaEtaGen = it2 ->eta () - it1 ->eta ();
764- float deltaPhiGen = RecoDecay::constrainAngle (it2 ->phi () - it1 ->phi (), -1 * o2::constants::math::PIHalf);
765- float deltaRapGen = it2 ->y () - it1 ->y ();
783+ float deltaEtaGen = it1 ->eta () - it2 ->eta ();
784+ float deltaPhiGen = RecoDecay::constrainAngle (it1 ->phi () - it2 ->phi (), -1 * o2::constants::math::PIHalf);
785+ float deltaRapGen = it1 ->y () - it2 ->y ();
766786 if (dorapidity) {
767787 deltaEtaGen = deltaRapGen;
768788 }
@@ -806,9 +826,9 @@ struct hadronnucleicorrelation {
806826 for (auto const & it1 : particles1) {
807827 for (auto const & it2 : particles2) {
808828 // Calculate Delta-eta Delta-phi (gen)
809- float deltaEtaGen = it2 ->eta () - it1 ->eta ();
810- float deltaPhiGen = RecoDecay::constrainAngle (it2 ->phi () - it1 ->phi (), -1 * o2::constants::math::PIHalf);
811- float deltaRapGen = it2 ->y () - it1 ->y ();
829+ float deltaEtaGen = it1 ->eta () - it2 ->eta ();
830+ float deltaPhiGen = RecoDecay::constrainAngle (it1 ->phi () - it2 ->phi (), -1 * o2::constants::math::PIHalf);
831+ float deltaRapGen = it1 ->y () - it2 ->y ();
812832 if (dorapidity) {
813833 deltaEtaGen = deltaRapGen;
814834 }
@@ -933,6 +953,9 @@ struct hadronnucleicorrelation {
933953 // Deuterons Fill & QA
934954 if (isAntiDe) {
935955 selectedtracks_antid[track.singleCollSelId ()].push_back (std::make_shared<decltype (track)>(track));
956+ if (mode == 0 || mode == 2 ) {
957+ registry.fill (HIST (" hNtrig_total" ), track.pt ());
958+ }
936959
937960 if (doQA) {
938961 QA.fill (HIST (" QA/hEtaAntiDe" ), track.eta ());
@@ -944,6 +967,10 @@ struct hadronnucleicorrelation {
944967 if (isDe) {
945968 selectedtracks_d[track.singleCollSelId ()].push_back (std::make_shared<decltype (track)>(track));
946969
970+ if (mode == 1 || mode == 3 ) {
971+ registry.fill (HIST (" hNtrig_total" ), track.pt ());
972+ }
973+
947974 if (doQA) {
948975 QA.fill (HIST (" QA/hEtaDe" ), track.eta ());
949976 QA.fill (HIST (" QA/hPhiDe" ), track.phi ());
@@ -956,6 +983,10 @@ struct hadronnucleicorrelation {
956983 if (isPr) {
957984 selectedtracks_p[track.singleCollSelId ()].push_back (std::make_shared<decltype (track)>(track));
958985
986+ if (mode == 6 || mode == 7 ) {
987+ registry.fill (HIST (" hNtrig_total" ), track.pt ());
988+ }
989+
959990 if (doQA) {
960991 QA.fill (HIST (" QA/hEtaPr" ), track.eta ());
961992 QA.fill (HIST (" QA/hPhiPr" ), track.phi ());
@@ -965,6 +996,10 @@ struct hadronnucleicorrelation {
965996 } else if (isAntiPr) {
966997 selectedtracks_antip[track.singleCollSelId ()].push_back (std::make_shared<decltype (track)>(track));
967998
999+ if (mode == 4 || mode == 5 ) {
1000+ registry.fill (HIST (" hNtrig_total" ), track.pt ());
1001+ }
1002+
9681003 if (doQA) {
9691004 QA.fill (HIST (" QA/hEtaAntiPr" ), track.eta ());
9701005 QA.fill (HIST (" QA/hPhiAntiPr" ), track.phi ());
@@ -1233,6 +1268,37 @@ struct hadronnucleicorrelation {
12331268 }
12341269 }
12351270
1271+ if (mode == 7 && !mixbins_p.empty ()) {
1272+
1273+ for (auto i = mixbins_p.begin (); i != mixbins_p.end (); i++) { // iterating over all vertex&mult bins
1274+
1275+ std::vector<colType> value = i->second ;
1276+ int EvPerBin = value.size (); // number of collisions in each vertex&mult bin
1277+
1278+ for (int indx1 = 0 ; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin
1279+
1280+ auto col1 = value[indx1];
1281+
1282+ if (selectedtracks_antip.find (col1->index ()) != selectedtracks_antip.end ()) {
1283+ mixTracks<0 >(selectedtracks_p[col1->index ()], selectedtracks_antip[col1->index ()], 0 , dorapidity); // mixing SE
1284+ }
1285+
1286+ for (int indx2 = 0 ; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin
1287+
1288+ auto col2 = value[indx2];
1289+
1290+ if (col1 == col2) {
1291+ continue ;
1292+ }
1293+
1294+ if (selectedtracks_antip.find (col2->index ()) != selectedtracks_antip.end ()) {
1295+ mixTracks<1 >(selectedtracks_p[col1->index ()], selectedtracks_antip[col2->index ()], 0 , dorapidity); // mixing ME
1296+ }
1297+ }
1298+ }
1299+ }
1300+ }
1301+
12361302 // clearing up
12371303 for (auto i = selectedtracks_antid.begin (); i != selectedtracks_antid.end (); i++)
12381304 (i->second ).clear ();
0 commit comments