@@ -376,6 +376,9 @@ struct ExclusiveRhoTo4Pi {
376376 int numPiPlus = 2 ;
377377 int numPiMinus = 2 ;
378378 float zeroPointEight = 0.8 ;
379+ // Run Numbers
380+ static int runNos[113 ];
381+ static int numRunNums;
379382 // Derived Data
380383 Produces<aod::SignalData> sigFromData;
381384 Produces<aod::BkgroundData> bkgFromData;
@@ -404,7 +407,7 @@ struct ExclusiveRhoTo4Pi {
404407 Configurable<bool > useTPCtracksOnly{" useTPCtracksOnly" , true , " only use tracks with hit in TPC" };
405408 Configurable<float > itsChi2NClsCut{" itsChi2NClsCut" , 36 , " ITS Chi2NCls" };
406409 Configurable<float > tpcChi2NClsCut{" tpcChi2NClsCut" , 4.0 , " TPC Chi2NCls" };
407- Configurable<float > tpcNClsFindableCut{" tpcNClsFindableCut" , 70 , " Min TPC Findable Clusters" };
410+ Configurable<int > tpcNClsFindableCut{" tpcNClsFindableCut" , 70 , " Min TPC Findable Clusters" };
408411 // Configurable PID parameters
409412 Configurable<bool > useTOF{" useTOF" , true , " if track has TOF use TOF" };
410413 Configurable<float > nSigmaTPCcut{" nSigmaTPCcut" , 3 , " TPC cut" };
@@ -425,8 +428,14 @@ struct ExclusiveRhoTo4Pi {
425428 void init (InitContext const &)
426429 {
427430 // QA plots: Event and Track Counter
428- histosCounter.add (" EventsCounts_vs_runNo" , " Number of Selected 4-Pion Events per Run; Run Number; Number of Events" , kTH2F , {{1355 , 544013 , 545367 }, {20 , 0 , 20 }});
429- histosCounter.add (" TracksCounts_vs_runNo" , " Number of Selected Tracks per Run; Run Number; Number of Tracks" , kTH2F , {{1355 , 544013 , 545367 }, {20 , 0 , 20 }});
431+ histosCounter.add (" EventsCounts_vs_runNo" , " Number of Selected 4-Pion Events per Run; Run Number; Number of Events" , kTH2F , {{113 , 0 , 113 }, {20 , 0 , 20 }});
432+ histosCounter.add (" TracksCounts_vs_runNo" , " Number of Selected Tracks per Run; Run Number; Number of Tracks" , kTH2F , {{113 , 0 , 113 }, {20 , 0 , 20 }});
433+ histosCounter.add (" fourPionCounts_0c" , " Four Pion Counts; Run Number; Events" , kTH1F , {{113 , 0 , 113 }});
434+ histosCounter.add (" fourPionCounts_0c_within_rap" , " Four Pion Counts; Run Number; Events" , kTH1F , {{113 , 0 , 113 }});
435+ histosCounter.add (" fourPionCounts_0c_selected" , " Four Pion Counts; Run Number; Events" , kTH1F , {{113 , 0 , 113 }});
436+ histosCounter.add (" fourPionCounts_n0c" , " Four Pion Counts; Run Number; Events" , kTH1F , {{113 , 0 , 113 }});
437+ histosCounter.add (" fourPionCounts_n0c_within_rap" , " Four Pion Counts; Run Number; Events" , kTH1F , {{113 , 0 , 113 }});
438+ histosCounter.add (" fourPionCounts_n0c_selected" , " Four Pion Counts; Run Number; Events" , kTH1F , {{113 , 0 , 113 }});
430439 // QA plots: event selection
431440 histosData.add (" UPCmode" , " UPC mode; Events" , kTH1F , {{5 , 0 , 5 }});
432441 histosData.add (" FT0A" , " T0A amplitude" , kTH1F , {{500 , 0.0 , 500.0 }});
@@ -535,6 +544,7 @@ struct ExclusiveRhoTo4Pi {
535544 histosData.add (" collin_soper_costheta_large_mass" , " #theta Distribution;cos(#theta); Counts" , kTH1F , {cosThetaAxis});
536545 histosData.add (" phi_vs_costheta_small_mass" , " Phi vs cosTheta for small mass; #phi; cos(#theta)" , kTH2F , {phiAxis, cosThetaAxis});
537546 histosData.add (" phi_vs_costheta_large_mass" , " Phi vs cosTheta for large mass; #phi; cos(#theta)" , kTH2F , {phiAxis, cosThetaAxis});
547+ setHistBinLabels ();
538548 } // End of init function
539549
540550 // ---------------------------------------------------------------------------------------------------------------------------------------------
@@ -546,13 +556,19 @@ struct ExclusiveRhoTo4Pi {
546556 Filter bcSelectionCuts = (o2::aod::udcollision::sbp == sbpCut) && (o2::aod::udcollision::itsROFb == itsROFbCut) && (o2::aod::udcollision::vtxITSTPC == vtxITSTPCcut) && (o2::aod::udcollision::tfb == tfbCut);
547557 // Track Cuts
548558 Filter onlyPVtracks = o2::aod::udtrack::isPVContributor == useOnlyPVtracks;
559+ Filter tpcchi2nclsFilter = o2::aod::track::tpcChi2NCl <= tpcChi2NClsCut;
560+ Filter itschi2nclsFilter = o2::aod::track::itsChi2NCl <= itsChi2NClsCut;
561+ Filter tpcCuts = (nabs(o2::aod::pidtpc::tpcNSigmaPi) <= nSigmaTPCcut);
549562 // ---------------------------------------------------------------------------------------------------------------------------------------------
550563
551564 using UDtracks = soa::Join<aod::UDTracks, aod::UDTracksPID, aod::UDTracksExtra, aod::UDTracksFlags, aod::UDTracksDCA>;
552565 using UDCollisions = soa::Join<aod::UDCollisions, aod::SGCollisions, aod::UDCollisionSelExtras, aod::UDCollisionsSels, aod::UDZdcsReduced>;
553566
554567 void processData (soa::Filtered<UDCollisions>::iterator const & collision, soa::Filtered<UDtracks> const & tracks)
555568 {
569+
570+ int runIndex = getRunNumberIndex (collision.runNumber ());
571+
556572 // Check if the Event is reconstructed in UPC mode
557573 if (ifCheckUPCmode && (collision.flags () != 1 )) {
558574 return ;
@@ -769,13 +785,18 @@ struct ExclusiveRhoTo4Pi {
769785 // Four Collins Soper Phi and CosTheta
770786 fourPiPhiPair1, fourPiPhiPair2, fourPiCosThetaPair1, fourPiCosThetaPair2);
771787
788+ histosCounter.fill (HIST (" fourPionCounts_0c" ), runIndex);
789+
772790 if (std::fabs (p1234.Rapidity ()) < rhoRapCut) {
773791 histosData.fill (HIST (" fourpion_pT_0_charge_within_rap" ), p1234.Pt ());
774792 histosData.fill (HIST (" fourpion_eta_0_charge_within_rap" ), p1234.Eta ());
775793 histosData.fill (HIST (" fourpion_phi_0_charge_within_rap" ), p1234.Phi ());
776794 histosData.fill (HIST (" fourpion_rap_0_charge_within_rap" ), p1234.Rapidity ());
777795 histosData.fill (HIST (" fourpion_mass_0_charge_within_rap" ), p1234.M ());
796+ histosCounter.fill (HIST (" fourPionCounts_0c_within_rap" ), runIndex);
778797 if (p1234.Pt () < rhoPtCut) {
798+ // Selected Four Pion Events
799+ histosCounter.fill (HIST (" fourPionCounts_0c_selected" ), runIndex);
779800 // Fill the Invariant Mass Histogram
780801 histosData.fill (HIST (" fourpion_mass_0_charge_domA" ), p1234.M ());
781802 // Two Pion Masses
@@ -884,14 +905,18 @@ struct ExclusiveRhoTo4Pi {
884905 // Four Mass
885906 p1234.M ());
886907
908+ histosCounter.fill (HIST (" fourPionCounts_n0c" ), runIndex);
909+
887910 if (std::fabs (p1234.Rapidity ()) < rhoRapCut) {
888911 histosData.fill (HIST (" fourpion_pT_non_0_charge_within_rap" ), p1234.Pt ());
889912 histosData.fill (HIST (" fourpion_eta_non_0_charge_within_rap" ), p1234.Eta ());
890913 histosData.fill (HIST (" fourpion_phi_non_0_charge_within_rap" ), p1234.Phi ());
891914 histosData.fill (HIST (" fourpion_rap_non_0_charge_within_rap" ), p1234.Rapidity ());
892915 histosData.fill (HIST (" fourpion_mass_non_0_charge_within_rap" ), p1234.M ());
916+ histosCounter.fill (HIST (" fourPionCounts_n0c_within_rap" ), runIndex);
893917 if (p1234.Pt () < rhoPtCut) {
894918 histosData.fill (HIST (" fourpion_mass_non_0_charge_domA" ), p1234.M ());
919+ histosCounter.fill (HIST (" fourPionCounts_n0c_selected" ), runIndex);
895920 }
896921 if (p1234.Pt () > rhoPtCut && p1234.Pt () < zeroPointEight) {
897922 histosData.fill (HIST (" fourpion_mass_non_0_charge_domB" ), p1234.M ());
@@ -903,124 +928,74 @@ struct ExclusiveRhoTo4Pi {
903928 } // End of Analysis for non 0 charge events
904929 } // End of 4 Pion Analysis Process function for Pass5 Data
905930
906- void processEventCounter (UDCollisions::iterator const & collision, soa::Filtered<UDtracks> const & tracks )
931+ void processEventCounter (UDCollisions::iterator const & collision)
907932 {
908933
909- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 0 );
934+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex ( collision.runNumber () ), 0 );
910935
911936 // UPC mode
912937 if (ifCheckUPCmode && collision.flags () != 1 ) {
913938 return ;
914939 }
915- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 1 );
940+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex ( collision.runNumber () ), 1 );
916941
917942 // vtxITSTPC
918943 if (collision.vtxITSTPC () != vtxITSTPCcut) {
919944 return ;
920945 }
921- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 2 );
946+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex ( collision.runNumber () ), 2 );
922947
923948 // sbp
924949 if (collision.sbp () != sbpCut) {
925950 return ;
926951 }
927- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 3 );
952+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex ( collision.runNumber () ), 3 );
928953
929954 // itsROFb
930955 if (collision.itsROFb () != itsROFbCut) {
931956 return ;
932957 }
933- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 4 );
958+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex ( collision.runNumber () ), 4 );
934959
935960 // tfb
936961 if (collision.tfb () != tfbCut) {
937962 return ;
938963 }
939- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 5 );
964+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex ( collision.runNumber () ), 5 );
940965
941966 // FT0A
942967 if (collision.totalFT0AmplitudeA () > ft0aCut) {
943968 return ;
944969 }
945- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 6 );
970+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex ( collision.runNumber () ), 6 );
946971 // FT0C
947972 if (collision.totalFT0AmplitudeC () > ft0cCut) {
948973 return ;
949974 }
950- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 7 );
975+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex ( collision.runNumber () ), 7 );
951976 // FV0A
952977 if (collision.totalFV0AmplitudeA () > fv0Cut) {
953978 return ;
954979 }
955- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 8 );
980+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex ( collision.runNumber () ), 8 );
956981
957982 // ZDC
958983 if (collision.energyCommonZNA () > zdcCut || collision.energyCommonZNC () > zdcCut) {
959984 return ;
960985 }
961- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 9 );
986+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex ( collision.runNumber () ), 9 );
962987
963988 // numContributors
964989 if (collision.numContrib () != numPVContrib) {
965990 return ;
966991 }
967- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 10 );
992+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex ( collision.runNumber () ), 10 );
968993
969994 // vertexZ
970995 if (std::abs (collision.posZ ()) > vZCut) {
971996 return ;
972997 }
973- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 11 );
974-
975- std::vector<decltype (tracks.begin ())> selectedPionTracks;
976- std::vector<decltype (tracks.begin ())> selectedPionPlusTracks;
977- std::vector<decltype (tracks.begin ())> selectedPionMinusTracks;
978-
979- for (const auto & t0 : tracks) {
980- if (!isSelectedTrack (t0, pTcut, etaCut, dcaXYcut, dcaZcut, useITStracksOnly, useTPCtracksOnly, itsChi2NClsCut, tpcChi2NClsCut, tpcNClsFindableCut)) {
981- continue ;
982- }
983- if (selectionPIDPion (t0, useTOF, nSigmaTPCcut, nSigmaTOFcut)) {
984- selectedPionTracks.push_back (t0);
985- if (t0.sign () == 1 ) {
986- selectedPionPlusTracks.push_back (t0);
987- }
988- if (t0.sign () == -1 ) {
989- selectedPionMinusTracks.push_back (t0);
990- }
991- } // End of Selection PID Pion
992- } // End of loop over tracks
993-
994- int numSelectedPionTracks = static_cast <int >(selectedPionTracks.size ());
995- int numPiPlusTracks = static_cast <int >(selectedPionPlusTracks.size ());
996- int numPionMinusTracks = static_cast <int >(selectedPionMinusTracks.size ());
997- // Events with 4 pions
998- if (numSelectedPionTracks != numFourPionTracks) {
999- return ;
1000- }
1001- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 12 );
1002-
1003- // Selecting Events with net charge = 0
1004- if (numPionMinusTracks == numPiMinus && numPiPlusTracks == numPiPlus) {
1005- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 13 );
1006- ROOT::Math::PxPyPzMVector p1 (selectedPionPlusTracks[0 ].px (), selectedPionPlusTracks[0 ].py (), selectedPionPlusTracks[0 ].pz (), o2::constants::physics::MassPionCharged);
1007- ROOT::Math::PxPyPzMVector p2 (selectedPionPlusTracks[1 ].px (), selectedPionPlusTracks[1 ].py (), selectedPionPlusTracks[1 ].pz (), o2::constants::physics::MassPionCharged);
1008- ROOT::Math::PxPyPzMVector p3 (selectedPionMinusTracks[0 ].px (), selectedPionMinusTracks[0 ].py (), selectedPionMinusTracks[0 ].pz (), o2::constants::physics::MassPionCharged);
1009- ROOT::Math::PxPyPzMVector p4 (selectedPionMinusTracks[1 ].px (), selectedPionMinusTracks[1 ].py (), selectedPionMinusTracks[1 ].pz (), o2::constants::physics::MassPionCharged);
1010- ROOT::Math::PxPyPzMVector p1234 = p1 + p2 + p3 + p4;
1011-
1012- if ((p1234.Pt () < rhoPtCut) && (std::abs (p1234.Rapidity ()) < rhoRapCut)) {
1013- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 14 );
1014- if ((rhoMassMin < p1234.M ()) && (p1234.M () < rhoMassMax)) {
1015- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 15 );
1016- }
1017- }
1018- } // End of Zero Charge Events
1019-
1020- if (numPionMinusTracks != numPiMinus && numPiPlusTracks != numPiPlus) {
1021- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), collision.runNumber (), 16 );
1022- } // End of Non Zero Charge Events
1023-
998+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 11 );
1024999 } // End of processCounter function
10251000
10261001 void processTrackCounter (soa::Filtered<UDCollisions>::iterator const & collision, UDtracks const & tracks)
@@ -1206,8 +1181,56 @@ struct ExclusiveRhoTo4Pi {
12061181 return true ;
12071182 } // End of Track Selection function
12081183
1184+ int getRunNumberIndex (int runNumber)
1185+ {
1186+ for (int i = 0 ; i < numRunNums; ++i) {
1187+ if (runNos[i] == runNumber) {
1188+ return i;
1189+ }
1190+ }
1191+ return -1 ; // Not found
1192+ } // End of getRunNumberIndex function
1193+
1194+ void setHistBinLabels ()
1195+ {
1196+ auto h1 = histosCounter.get <TH2>(HIST (" EventsCounts_vs_runNo" ));
1197+ auto h2 = histosCounter.get <TH2>(HIST (" TracksCounts_vs_runNo" ));
1198+ auto h3 = histosCounter.get <TH1>(HIST (" fourPionCounts_0c" ));
1199+ auto h4 = histosCounter.get <TH1>(HIST (" fourPionCounts_0c_within_rap" ));
1200+ auto h5 = histosCounter.get <TH1>(HIST (" fourPionCounts_0c_selected" ));
1201+ auto h6 = histosCounter.get <TH1>(HIST (" fourPionCounts_n0c" ));
1202+ auto h7 = histosCounter.get <TH1>(HIST (" fourPionCounts_n0c_within_rap" ));
1203+ auto h8 = histosCounter.get <TH1>(HIST (" fourPionCounts_n0c_selected" ));
1204+
1205+ for (int i = 0 ; i < numRunNums; ++i) {
1206+ h1->GetXaxis ()->SetBinLabel (i + 1 , std::to_string (runNos[i]).c_str ());
1207+ h2->GetXaxis ()->SetBinLabel (i + 1 , std::to_string (runNos[i]).c_str ());
1208+ h3->GetXaxis ()->SetBinLabel (i + 1 , std::to_string (runNos[i]).c_str ());
1209+ h4->GetXaxis ()->SetBinLabel (i + 1 , std::to_string (runNos[i]).c_str ());
1210+ h5->GetXaxis ()->SetBinLabel (i + 1 , std::to_string (runNos[i]).c_str ());
1211+ h6->GetXaxis ()->SetBinLabel (i + 1 , std::to_string (runNos[i]).c_str ());
1212+ h7->GetXaxis ()->SetBinLabel (i + 1 , std::to_string (runNos[i]).c_str ());
1213+ h8->GetXaxis ()->SetBinLabel (i + 1 , std::to_string (runNos[i]).c_str ());
1214+ }
1215+ } // end of setHistBinLabels function
1216+
12091217}; // End of Struct exclusiveRhoTo4Pi
12101218
1219+ int ExclusiveRhoTo4Pi::runNos[113 ] = {
1220+ 544013 , 544028 , 544032 , 544091 , 544095 , 544098 , 544116 , 544121 , 544122 , 544123 ,
1221+ 544124 , 544184 , 544185 , 544389 , 544390 , 544391 , 544392 , 544451 , 544454 , 544474 ,
1222+ 544475 , 544476 , 544477 , 544490 , 544491 , 544492 , 544508 , 544510 , 544511 , 544512 ,
1223+ 544514 , 544515 , 544518 , 544548 , 544549 , 544550 , 544551 , 544564 , 544565 , 544567 ,
1224+ 544568 , 544580 , 544582 , 544583 , 544585 , 544614 , 544640 , 544652 , 544653 , 544672 ,
1225+ 544674 , 544692 , 544693 , 544694 , 544696 , 544739 , 544742 , 544754 , 544767 , 544794 ,
1226+ 544795 , 544797 , 544813 , 544868 , 544886 , 544887 , 544896 , 544911 , 544913 , 544914 ,
1227+ 544917 , 544931 , 544947 , 544961 , 544963 , 544964 , 544968 , 544991 , 544992 , 545004 ,
1228+ 545008 , 545009 , 545041 , 545042 , 545044 , 545047 , 545060 , 545062 , 545063 , 545064 ,
1229+ 545066 , 545086 , 545103 , 545117 , 545171 , 545184 , 545185 , 545210 , 545222 , 545223 ,
1230+ 545246 , 545249 , 545262 , 545289 , 545291 , 545294 , 545295 , 545296 , 545311 , 545312 ,
1231+ 545332 , 545345 , 545367 };
1232+ int ExclusiveRhoTo4Pi::numRunNums = 113 ;
1233+
12111234WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
12121235{
12131236 return WorkflowSpec{
0 commit comments