@@ -402,7 +402,7 @@ struct ExclusiveRhoTo4Pi {
402402 HistogramRegistry histosData{" Data" , {}, OutputObjHandlingPolicy::AnalysisObject, true , true };
403403 HistogramRegistry histosCounter{" counters" , {}, OutputObjHandlingPolicy::AnalysisObject, true , true };
404404 // Configurable Event parameters
405- Configurable<bool > ifCheckUPCmode{ " ifCheckUPCmode " , false , " Enable UPC reconstruction only" };
405+ Configurable<int > ifUPC{ " ifUPC " , 1 , " Enable UPC reconstruction only" };
406406 Configurable<float > vZCut{" vZCut" , 10 ., " Vertex Cut" };
407407 Configurable<float > fv0Cut{" fv0Cut" , 50 ., " FV0A threshold" };
408408 Configurable<float > ft0aCut{" ft0aCut" , 50 ., " FT0A threshold" };
@@ -444,8 +444,8 @@ struct ExclusiveRhoTo4Pi {
444444 void init (InitContext const &)
445445 {
446446 // QA plots: Event and Track Counter
447- histosCounter.add (" EventsCounts_vs_runNo" , " Number of Selected 4-Pion Events per Run; Run Number; Number of Events" , kTH2F , {{113 , 0 , 113 }, {12 , 0 , 12 }});
448- histosCounter.add (" TracksCounts_vs_runNo" , " Number of Selected Tracks per Run; Run Number; Number of Tracks" , kTH2F , {{113 , 0 , 113 }, {14 , 0 , 14 }});
447+ histosCounter.add (" EventsCounts_vs_runNo" , " Event Counter Run by Run; Run Number; Number of Events" , kTH2F , {{113 , 0 , 113 }, {14 , 0 , 14 }});
448+ histosCounter.add (" TracksCounts_vs_runNo" , " Track Counter Run by Run; Run Number; Number of Tracks" , kTH2F , {{113 , 0 , 113 }, {14 , 0 , 14 }});
449449 histosCounter.add (" fourPionCounts_0c" , " Four Pion Counts; Run Number; Events" , kTH1F , {{113 , 0 , 113 }});
450450 histosCounter.add (" fourPionCounts_0c_within_mass" , " Four Pion Counts within mass range; Run Number; Events" , kTH1F , {{113 , 0 , 113 }});
451451 histosCounter.add (" fourPionCounts_0c_within_rap" , " Four Pion Counts; Run Number; Events" , kTH1F , {{113 , 0 , 113 }});
@@ -456,18 +456,22 @@ struct ExclusiveRhoTo4Pi {
456456 histosCounter.add (" fourPionCounts_n0c_selected" , " Four Pion Counts; Run Number; Events" , kTH1F , {{113 , 0 , 113 }});
457457 // QA plots: event selection
458458 histosData.add (" UPCmode" , " UPC mode; Events" , kTH1F , {{5 , 0 , 5 }});
459+ histosData.add (" GapSide" , " Gap Side;Gap Side; Events" , kTH1F , {{4 , 0 , 4 }});
460+ histosData.add (" TrueGapSide" , " True Gap Side; True Gap Side; Events" , kTH1F , {{4 , 0 , 4 }});
461+ histosData.add (" isCBTOk" , " isCBTOk; bool; Events" , kTH1F , {{4 , 0 , 4 }});
462+ histosData.add (" isCBTHadronOk" , " isCBTHadronOk; bool; Events" , kTH1F , {{4 , 0 , 4 }});
463+ histosData.add (" isCBTZdcOk" , " isCBTZdcOk; bool; Events" , kTH1F , {{4 , 0 , 4 }});
464+ histosData.add (" isCBTHadronZdcOk" , " isCBTHadronZdcOk; bool; Events" , kTH1F , {{4 , 0 , 4 }});
459465 histosData.add (" FT0A" , " T0A amplitude" , kTH1F , {{500 , 0.0 , 500.0 }});
460466 histosData.add (" FT0C" , " T0C amplitude" , kTH1F , {{500 , 0.0 , 500.0 }});
461467 histosData.add (" FV0A" , " V0A amplitude" , kTH1F , {{100 , 0.0 , 100 }});
462- histosData.add (" ZDC_A" , " ZDC amplitude" , kTH1F , {{1000 , 0.0 , 15 }});
463- histosData.add (" ZDC_C" , " ZDC amplitude" , kTH1F , {{1000 , 0.0 , 15 }});
464- histosData.add (" FDDA" , " FDD A signal; FDD A signal; Counts" , kTH1F , {{500 , 0.0 , 500 }});
465- histosData.add (" FDDC" , " FDD C signal; FDD C signal; Counts" , kTH1F , {{500 , 0.0 , 500 }});
468+ histosData.add (" ZDC_A" , " ZDC amplitude" , kTH1F , {{10000 , 0.0 , 10000 }});
469+ histosData.add (" ZDC_C" , " ZDC amplitude" , kTH1F , {{10000 , 0.0 , 10000 }});
470+ histosData.add (" FDDA" , " FDD A signal; FDD A signal; Counts" , kTH1F , {{500 , 0.0 , 2000 }});
471+ histosData.add (" FDDC" , " FDD C signal; FDD C signal; Counts" , kTH1F , {{500 , 0.0 , 2000 }});
466472 histosData.add (" vertexX" , " Vertex X; Vertex X [cm]; Counts" , kTH1F , {{2000 , -0.05 , 0.05 }});
467473 histosData.add (" vertexY" , " Vertex Y; Vertex Y [cm]; Counts" , kTH1F , {{2000 , -0.05 , 0.05 }});
468474 histosData.add (" vertexZ" , " Vertex Z; Vertex Z [cm]; Counts" , kTH1F , {{2000 , -15 , 15 }});
469- histosData.add (" GapSide" , " Gap Side;Gap Side; Events" , kTH1F , {{4 , 0 , 4 }});
470- histosData.add (" TrueGapSide" , " True Gap Side; True Gap Side; Events" , kTH1F , {{4 , 0 , 4 }});
471475 histosData.add (" occupancy" , " Occupancy; Occupancy; Counts" , kTH1F , {{20000 , 0 , 20000 }});
472476 // QA plots: tracks
473477 histosData.add (" dcaXY_all" , " dcaXY; dcaXY [cm]; Counts" , kTH1F , {{2000 , -0.1 , 0.1 }});
@@ -573,15 +577,24 @@ struct ExclusiveRhoTo4Pi {
573577 void processData (soa::Filtered<UDCollisions>::iterator const & collision, soa::Filtered<UDtracks> const & tracks)
574578 {
575579
576- int runIndex = getRunNumberIndex (collision.runNumber ());
577-
578580 // Check if the Event is reconstructed in UPC mode
579- if (ifCheckUPCmode && ( collision.flags () != 1 ) ) {
581+ if (collision.flags () != ifUPC ) {
580582 return ;
581583 }
582584
585+ // RCT flag
586+ if (!sgSelector.isCBTHadronZdcOk (collision)) {
587+ return ;
588+ }
589+
590+ int runIndex = getRunNumberIndex (collision.runNumber ());
591+
583592 histosData.fill (HIST (" GapSide" ), collision.gapSide ());
584593 histosData.fill (HIST (" TrueGapSide" ), sgSelector.trueGap (collision, fv0Cut, ft0aCut, ft0cCut, zdcCut));
594+ histosData.fill (HIST (" isCBTOk" ), sgSelector.isCBTOk (collision));
595+ histosData.fill (HIST (" isCBTHadronOk" ), sgSelector.isCBTHadronOk (collision));
596+ histosData.fill (HIST (" isCBTZdcOk" ), sgSelector.isCBTZdcOk (collision));
597+ histosData.fill (HIST (" isCBTHadronZdcOk" ), sgSelector.isCBTHadronZdcOk (collision));
585598 histosData.fill (HIST (" vertexX" ), collision.posX ());
586599 histosData.fill (HIST (" vertexY" ), collision.posY ());
587600 histosData.fill (HIST (" vertexZ" ), collision.posZ ());
@@ -940,79 +953,74 @@ struct ExclusiveRhoTo4Pi {
940953
941954 void processEventCounter (UDCollisions::iterator const & collision)
942955 {
943-
944956 histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 0 );
945-
946- // UPC mode
947- if (ifCheckUPCmode && collision.flags () != 1 ) {
957+ // RCT flag
958+ if (!sgSelector.isCBTHadronZdcOk (collision)) {
948959 return ;
949960 }
950961 histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 1 );
951-
962+ // UPC mode
963+ if (collision.flags () != ifUPC) {
964+ return ;
965+ }
966+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 2 );
952967 // vtxITSTPC
953968 if (collision.vtxITSTPC () != vtxITSTPCcut) {
954969 return ;
955970 }
956- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 2 );
957-
971+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 3 );
958972 // sbp
959973 if (collision.sbp () != sbpCut) {
960974 return ;
961975 }
962- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 3 );
963-
976+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 4 );
964977 // itsROFb
965978 if (collision.itsROFb () != itsROFbCut) {
966979 return ;
967980 }
968- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 4 );
969-
981+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 5 );
970982 // tfb
971983 if (collision.tfb () != tfbCut) {
972984 return ;
973985 }
974- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 5 );
975-
986+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 6 );
976987 // FT0A
977988 if (collision.totalFT0AmplitudeA () > ft0aCut) {
978989 return ;
979990 }
980- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 6 );
991+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 7 );
981992 // FT0C
982993 if (collision.totalFT0AmplitudeC () > ft0cCut) {
983994 return ;
984995 }
985- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 7 );
996+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 8 );
986997 // FV0A
987998 if (collision.totalFV0AmplitudeA () > fv0Cut) {
988999 return ;
9891000 }
990- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 8 );
991-
1001+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 9 );
9921002 // ZDC
9931003 if (collision.energyCommonZNA () > zdcCut || collision.energyCommonZNC () > zdcCut) {
9941004 return ;
9951005 }
996- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 9 );
997-
1006+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 10 );
9981007 // numContributors
9991008 if (collision.numContrib () != numPVContrib) {
10001009 return ;
10011010 }
1002- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 10 );
1003-
1011+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 11 );
10041012 // vertexZ
10051013 if (std::abs (collision.posZ ()) > vZCut) {
10061014 return ;
10071015 }
1008- histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 11 );
1016+ histosCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 12 );
10091017 } // End of processCounter function
10101018
10111019 void processTrackCounter (soa::Filtered<UDCollisions>::iterator const & collision, UDtracks const & tracks)
10121020 {
10131021 int runIndex = getRunNumberIndex (collision.runNumber ());
10141022 // Check if the Event is reconstructed in UPC mode
1015- if (ifCheckUPCmode && ( collision.flags () != 1 ) ) {
1023+ if (collision.flags () != ifUPC ) {
10161024 return ;
10171025 }
10181026 for (const auto & track : tracks) {
@@ -1194,20 +1202,49 @@ struct ExclusiveRhoTo4Pi {
11941202 return -1 ; // Not found
11951203 } // End of getRunNumberIndex function
11961204
1197- void setHistBinLabels ( )
1205+ std::string strFormat ( double value, int precision = 2 )
11981206 {
1207+ std::ostringstream oss;
1208+ oss << std::fixed << std::setprecision (precision) << value;
1209+ return oss.str ();
1210+ }
11991211
1200- std::string eventLabels[12 ] = {
1201- " No Cuts" , " UPC mode" , " vtxITSTPC=1" , " sbp=1" , " itsROFb=1" , " tfb=1" ,
1202- " FT0A <= 50" , " FT0C <= 50" , " FV0A <= 50" , " ZDC <= 0" ,
1203- " n PV Contrib = 4" , " V_{z} < 10cm" };
1212+ void setHistBinLabels ()
1213+ {
12041214
1205- int numEventCuts = 12 ;
1215+ std::string eventLabels[13 ] = {
1216+ " No Cuts" ,
1217+ " isCBTHadronOk" ,
1218+ " UPC or STD" ,
1219+ " vtxITSTPC=" + strFormat (vtxITSTPCcut, 0 ),
1220+ " sbp=" + strFormat (sbpCut, 0 ),
1221+ " itsROFb=" + strFormat (itsROFbCut, 0 ),
1222+ " tfb=" + strFormat (tfbCut, 0 ),
1223+ " FT0A<=" + strFormat (fv0Cut),
1224+ " FT0C<=" + strFormat (ft0cCut),
1225+ " FV0A<=" + strFormat (ft0aCut),
1226+ " ZDC" ,
1227+ " n PV Contrib = 4" ,
1228+ " V_{z} < " + strFormat (vZCut) + " cm" };
1229+
1230+ int numEventCuts = 13 ;
12061231
12071232 std::string trackLabels[14 ] = {
1208- " No Cuts" , " isPVContributor" , " pT > 0.15 GeV/c" , " |#eta| < 0.9" , " DCA Z < 2 cm" ,
1209- " DCA XY cut" , " hasITS" , " hasTPC" , " itsChi2NCl < 36" , " tpcChi2NCl < 4" ,
1210- " tpcNClsFindable < 70" , " #pi tracks" , " #pi^{+} tracks" , " #pi^{-} tracks" };
1233+ " No Cuts" ,
1234+ " isPVContributor" ,
1235+ " pT>" + strFormat (pTcut) + " GeV/c" ,
1236+ " |#eta|<" + strFormat (etaCut),
1237+ " DCA Z<" + strFormat (dcaZcut) + " cm" ,
1238+ " DCA XY cut" ,
1239+ " hasITS" ,
1240+ " hasTPC" ,
1241+ " itsChi2NCl<" + strFormat (itsChi2NClsCut),
1242+ " tpcChi2NCl<" + strFormat (tpcChi2NClsCut),
1243+ " tpcNClsFindable>" + strFormat (tpcNClsFindableCut),
1244+ " #pi tracks" ,
1245+ " #pi^{+} tracks" ,
1246+ " #pi^{-} tracks" };
1247+
12111248 int numTrackCuts = 14 ;
12121249
12131250 auto h1 = histosCounter.get <TH2>(HIST (" EventsCounts_vs_runNo" ));
@@ -1218,6 +1255,8 @@ struct ExclusiveRhoTo4Pi {
12181255 auto h6 = histosCounter.get <TH1>(HIST (" fourPionCounts_n0c" ));
12191256 auto h7 = histosCounter.get <TH1>(HIST (" fourPionCounts_n0c_within_rap" ));
12201257 auto h8 = histosCounter.get <TH1>(HIST (" fourPionCounts_n0c_selected" ));
1258+ auto h9 = histosCounter.get <TH1>(HIST (" fourPionCounts_0c_within_mass" ));
1259+ auto h10 = histosCounter.get <TH1>(HIST (" fourPionCounts_n0c_within_mass" ));
12211260
12221261 for (int i = 0 ; i < numRunNums; ++i) {
12231262 h1->GetXaxis ()->SetBinLabel (i + 1 , std::to_string (runNos[i]).c_str ());
@@ -1228,6 +1267,8 @@ struct ExclusiveRhoTo4Pi {
12281267 h6->GetXaxis ()->SetBinLabel (i + 1 , std::to_string (runNos[i]).c_str ());
12291268 h7->GetXaxis ()->SetBinLabel (i + 1 , std::to_string (runNos[i]).c_str ());
12301269 h8->GetXaxis ()->SetBinLabel (i + 1 , std::to_string (runNos[i]).c_str ());
1270+ h9->GetXaxis ()->SetBinLabel (i + 1 , std::to_string (runNos[i]).c_str ());
1271+ h10->GetXaxis ()->SetBinLabel (i + 1 , std::to_string (runNos[i]).c_str ());
12311272 }
12321273 for (int i = 0 ; i < numEventCuts; ++i) {
12331274 h1->GetYaxis ()->SetBinLabel (i + 1 , eventLabels[i].c_str ());
0 commit comments