@@ -210,6 +210,7 @@ struct PiKpRAA {
210210 Configurable<bool > isNoCollInTimeRangeNarrow{" isNoCollInTimeRangeNarrow" , false , " use isNoCollInTimeRangeNarrow?" };
211211 Configurable<bool > isOccupancyCut{" isOccupancyCut" , true , " Occupancy cut?" };
212212 Configurable<bool > isCentSel{" isCentSel" , true , " Centrality selection?" };
213+ Configurable<bool > selHasBC{" selHasBC" , true , " Has BC?" };
213214 Configurable<bool > selHasFT0{" selHasFT0" , true , " Has FT0?" };
214215 Configurable<bool > isT0Ccent{" isT0Ccent" , true , " Use T0C-based centrality?" };
215216
@@ -275,6 +276,7 @@ struct PiKpRAA {
275276
276277 enum EvCutLabel {
277278 All = 1 ,
279+ HasBC,
278280 HasFT0,
279281 SelEigth,
280282 SelTriggerTVX,
@@ -398,11 +400,12 @@ struct PiKpRAA {
398400 const char * latexEta[kNEtaHists ] = {" -0.8<#eta<-0.6" , " -0.6<#eta<-0.4" , " -0.4<#eta<-0.2" , " -0.2<#eta<0" , " 0<#eta<0.2" , " 0.2<#eta<0.4" , " 0.4<#eta<0.6" , " 0.6<#eta<0.8" };
399401
400402 registry.add (" EventCounter" , " ;;Events" , kTH1F , {axisEvent});
401- registry.add (" HasFT0AndTVX " , " AllEvents =1 | HasFT0 =2 | HasFT0&TVX=3 ;;" , kTH1F , {{3 , 0.5 , 3 .5 }});
403+ registry.add (" HasBCVsFT0VsTVXVsEvSel " , " Alls =1 | BC =2 | FT0=3 | TVX=4 | EvSel=5 ;;" , kTH1F , {{5 , 0.5 , 5 .5 }});
402404 registry.add (" zPos" , " With Event Selection;;Entries;" , kTH1F , {axisZpos});
403405 registry.add (" T0Ccent" , " ;;Entries" , kTH1F , {axisCent});
404406 registry.add (" T0CcentVsFoundFT0" , " Found(=1.5) NOT Found(=0.5);;Status;" , kTH2F , {{{axisCent}, {2 , 0 , 2 }}});
405- registry.add (" T0CcentVsFoundFT0AndTVX" , " Found(=1.5) NOT Found(=0.5);;Status;" , kTH2F , {{{axisCent}, {2 , 0 , 2 }}});
407+ registry.add (" T0CcentVsBCVsFT0VsTVXVsEvSel" , " All=1 | BC=2 | FT0=3 | TVX=4 | EvSel=5;;Status;" , kTH2F , {{axisCent}, {5 , 0.5 , 5.5 }});
408+ // registry.add("T0CcentVsFoundFT0AndTVX", "Found(=1.5) NOT Found(=0.5);;Status;", kTH2F, {{{axisCent}, {2, 0, 2}}});
406409 registry.add (" NchVsCent" , " Measured Nch v.s. Centrality (At least Once Rec. Coll. + Sel. criteria);;Nch" , kTH2F , {{axisCent, {nBinsNch, minNch, maxNch}}});
407410 registry.add (" NclVsEtaPID" , " ;#eta;Ncl used for PID" , kTH2F , {{{axisEta}, {161 , -0.5 , 160.5 }}});
408411 registry.add (" NclVsEtaPIDp" , " ;#eta;#LTNcl#GT used for PID" , kTProfile , {axisEta});
@@ -412,24 +415,25 @@ struct PiKpRAA {
412415 auto hstat = registry.get <TH1>(HIST (" EventCounter" ));
413416 auto * x = hstat->GetXaxis ();
414417 x->SetBinLabel (1 , " All" );
415- x->SetBinLabel (2 , " Has FT0?" );
416- x->SetBinLabel (3 , " SelEigth" );
417- x->SetBinLabel (4 , " SelTriggerTVX" );
418- x->SetBinLabel (5 , " SelNoITSROFrameBorder" );
419- x->SetBinLabel (6 , " SelNoTimeFrameBorder" );
420- x->SetBinLabel (7 , " VtxZ Sel." );
421- x->SetBinLabel (8 , " GoodZvtxFT0vsPV" );
422- x->SetBinLabel (9 , " NoSameBunchPileup" );
423- x->SetBinLabel (10 , " NoCollInTimeRangeStrict" );
424- x->SetBinLabel (11 , " NoCollInTimeRangeStandard" );
425- x->SetBinLabel (12 , " NoCollInRofStrict" );
426- x->SetBinLabel (13 , " NoCollInRofStandard" );
427- x->SetBinLabel (14 , " NoHighMultCollInPrevRof" );
428- x->SetBinLabel (15 , " NoCollInTimeRangeNarrow" );
429- x->SetBinLabel (16 , " Occupancy Cut" );
430- x->SetBinLabel (17 , " Cent. Sel." );
431- x->SetBinLabel (18 , " Nch Sel." );
432- x->SetBinLabel (19 , " INEL > 0" );
418+ x->SetBinLabel (2 , " Has BC?" );
419+ x->SetBinLabel (3 , " Has FT0?" );
420+ x->SetBinLabel (4 , " SelEigth" );
421+ x->SetBinLabel (5 , " SelTriggerTVX" );
422+ x->SetBinLabel (6 , " SelNoITSROFrameBorder" );
423+ x->SetBinLabel (7 , " SelNoTimeFrameBorder" );
424+ x->SetBinLabel (8 , " VtxZ Sel." );
425+ x->SetBinLabel (9 , " GoodZvtxFT0vsPV" );
426+ x->SetBinLabel (10 , " NoSameBunchPileup" );
427+ x->SetBinLabel (11 , " NoCollInTimeRangeStrict" );
428+ x->SetBinLabel (12 , " NoCollInTimeRangeStandard" );
429+ x->SetBinLabel (13 , " NoCollInRofStrict" );
430+ x->SetBinLabel (14 , " NoCollInRofStandard" );
431+ x->SetBinLabel (15 , " NoHighMultCollInPrevRof" );
432+ x->SetBinLabel (16 , " NoCollInTimeRangeNarrow" );
433+ x->SetBinLabel (17 , " Occupancy Cut" );
434+ x->SetBinLabel (18 , " Cent. Sel." );
435+ x->SetBinLabel (19 , " Nch Sel." );
436+ x->SetBinLabel (20 , " INEL > 0" );
433437
434438 if (doprocessCalibrationAndV0s) {
435439 registry.add (" T0CcentVsRCTSel" , " Bad RCT(=0.5) Good RCT(=1.5) Good RCT & Good PID RCT(=2.5);;RCT Status;" , kTH2F , {{{axisCent}, {3 , 0 , 3 }}});
@@ -1232,12 +1236,65 @@ struct PiKpRAA {
12321236 }
12331237 }
12341238
1235- const auto & nRecColls{collisions.size ()};
1236- registry.fill (HIST (" NumberOfRecoCollisions" ), nRecColls);
1239+ // ---------------------------
1240+ // All Generated events irrespective of whether there is an associated reconstructed collision
1241+ // Consequently, the centrality being a reconstructed quantity, might not always be available
1242+ // Therefore it is expressed as a function of the generated pT and the generated Nch in ∣eta∣ < 0.8
1243+ // This is used for the denominator of the signal loss correction
1244+ // Also for MC closure: True Pt vs Generated Nch
1245+ // ---------------------------
1246+ for (const auto & particle : mcParticles) {
1247+ if (particle.eta () < v0Selections.minEtaDaughter || particle.eta () > v0Selections.maxEtaDaughter )
1248+ continue ;
1249+
1250+ if (particle.pt () < v0Selections.minPt || particle.pt () > v0Selections.maxPt )
1251+ continue ;
1252+
1253+ auto charge{0 .};
1254+ // Get the MC particle
1255+ auto * pdgParticle = pdg->GetParticle (particle.pdgCode ());
1256+ if (pdgParticle != nullptr ) {
1257+ charge = pdgParticle->Charge ();
1258+ } else {
1259+ continue ;
1260+ }
1261+
1262+ // Is it a charged particle?
1263+ if (std::abs (charge) < kMinCharge )
1264+ continue ;
1265+
1266+ // Is it a primary particle?
1267+ bool isPrimary{true };
1268+ if (!particle.isPhysicalPrimary ())
1269+ isPrimary = false ;
1270+
1271+ if (isPrimary) {
1272+ if (particle.pdgCode () == PDG_t::kPiPlus || particle.pdgCode () == PDG_t::kPiMinus ) {
1273+ registry.fill (HIST (" PtPiVsNchMC_AllGen" ), particle.pt (), nChMCEta08);
1274+ registry.fill (HIST (" MCclosure_PtMCPiVsNchMC" ), particle.pt (), nChMCEta08);
1275+ } else if (particle.pdgCode () == PDG_t::kKPlus || particle.pdgCode () == PDG_t::kKMinus ) {
1276+ registry.fill (HIST (" PtKaVsNchMC_AllGen" ), particle.pt (), nChMCEta08);
1277+ registry.fill (HIST (" MCclosure_PtMCKaVsNchMC" ), particle.pt (), nChMCEta08);
1278+ } else if (particle.pdgCode () == PDG_t::kProton || particle.pdgCode () == PDG_t::kProtonBar ) {
1279+ registry.fill (HIST (" PtPrVsNchMC_AllGen" ), particle.pt (), nChMCEta08);
1280+ registry.fill (HIST (" MCclosure_PtMCPrVsNchMC" ), particle.pt (), nChMCEta08);
1281+ } else {
1282+ continue ;
1283+ }
1284+ }
1285+ } // Loop over Generated Particles
1286+
1287+ // ---------------------------
1288+ // This is used for the denominator of the event loss correction
1289+ // ---------------------------
1290+ registry.fill (HIST (" NchMC_AllGen" ), nChMCEta08);
12371291
12381292 // ---------------------------
12391293 // Only Generated evets with at least one reconstrued collision
12401294 // ---------------------------
1295+ const auto & nRecColls{collisions.size ()};
1296+ registry.fill (HIST (" NumberOfRecoCollisions" ), nRecColls);
1297+
12411298 if (nRecColls > kZeroInt ) {
12421299
12431300 // Finds the collisions with the largest number of contributors
@@ -1256,6 +1313,9 @@ struct PiKpRAA {
12561313 bestCollisionIndex = collision.globalIndex ();
12571314 }
12581315
1316+ if (selHasBC && !collision.has_foundBC ())
1317+ continue ;
1318+
12591319 if (selHasFT0 && !collision.has_foundFT0 ())
12601320 continue ;
12611321
@@ -1299,9 +1359,8 @@ struct PiKpRAA {
12991359 // ---------------------------
13001360 // Pick the collisions with the largest number of contributors
13011361 // ---------------------------
1302- if (bestCollisionIndex != collision.globalIndex ()) {
1362+ if (bestCollisionIndex != collision.globalIndex ())
13031363 continue ;
1304- }
13051364
13061365 // Needed to load the Phi selection from the CCDB
13071366 const auto & foundBC = collision.foundBC_as <BCsRun3>();
@@ -1327,13 +1386,29 @@ struct PiKpRAA {
13271386 registry.fill (HIST (" Centrality_WRecoEvt" ), centrality);
13281387 registry.fill (HIST (" zPosMC" ), mccollision.posZ ());
13291388
1389+ registry.fill (HIST (" T0CcentVsBCVsFT0VsTVXVsEvSel" ), centrality, 1.0 );
1390+ registry.fill (HIST (" HasBCVsFT0VsTVXVsEvSel" ), 1.0 );
1391+
1392+ if (collision.has_foundBC ()) {
1393+ registry.fill (HIST (" T0CcentVsBCVsFT0VsTVXVsEvSel" ), centrality, 2.0 );
1394+ registry.fill (HIST (" HasBCVsFT0VsTVXVsEvSel" ), 2.0 );
1395+ }
1396+
1397+ if (collision.has_foundBC () && collision.has_foundFT0 ()) {
1398+ registry.fill (HIST (" T0CcentVsBCVsFT0VsTVXVsEvSel" ), centrality, 3.0 );
1399+ registry.fill (HIST (" HasBCVsFT0VsTVXVsEvSel" ), 3.0 );
1400+ }
1401+
1402+ if (collision.has_foundBC () && collision.has_foundFT0 () && collision.selection_bit (o2::aod::evsel::kIsTriggerTVX )) {
1403+ registry.fill (HIST (" T0CcentVsBCVsFT0VsTVXVsEvSel" ), centrality, 4.0 );
1404+ registry.fill (HIST (" HasBCVsFT0VsTVXVsEvSel" ), 4.0 );
1405+ }
1406+
13301407 // ---------------------------
1331- // Event selection
1332- // for reconstructed collisions
1408+ // Event Selection
13331409 // ---------------------------
1334- if (!isEventSelected (collision)) {
1335- continue ;
1336- }
1410+ if (!isEventSelected (collision))
1411+ return ;
13371412
13381413 registry.fill (HIST (" Centrality_WRecoEvtWSelCri" ), centrality);
13391414 registry.fill (HIST (" NchMCVsCent" ), centrality, nChMCEta08);
@@ -1344,18 +1419,16 @@ struct PiKpRAA {
13441419 // ---------------------------
13451420 // has_foundFT0() ?
13461421 // ---------------------------
1347- if (collision.has_foundFT0 ()) {
1348- registry.fill (HIST (" HasFT0AndTVX" ), 2.0 );
1422+
1423+ if (collision.has_foundBC () && collision.has_foundFT0 () && collision.selection_bit (o2::aod::evsel::kIsTriggerTVX )) {
1424+ registry.fill (HIST (" T0CcentVsBCVsFT0VsTVXVsEvSel" ), centrality, 5.0 );
1425+ registry.fill (HIST (" HasBCVsFT0VsTVXVsEvSel" ), 5.0 );
1426+ }
1427+
1428+ if (collision.has_foundFT0 ())
13491429 registry.fill (HIST (" T0CcentVsFoundFT0" ), centrality, 1.5 );
1350- } else {
1430+ else
13511431 registry.fill (HIST (" T0CcentVsFoundFT0" ), centrality, 0.5 );
1352- }
1353- if (collision.has_foundFT0 () && collision.selection_bit (o2::aod::evsel::kIsTriggerTVX )) {
1354- registry.fill (HIST (" HasFT0AndTVX" ), 3.0 );
1355- registry.fill (HIST (" T0CcentVsFoundFT0AndTVX" ), centrality, 1.5 );
1356- } else {
1357- registry.fill (HIST (" T0CcentVsFoundFT0AndTVX" ), centrality, 0.5 );
1358- }
13591432
13601433 // ---------------------------
13611434 // All Generated events with at least one associated reconstructed collision
@@ -1644,59 +1717,6 @@ struct PiKpRAA {
16441717 registry.fill (HIST (" NchVsCent" ), centrality, nCh);
16451718 } // Loop over Reco. Collisions: Only the collisions with the largest number of contributors
16461719 } // If condition: Only simulated evets with at least one reconstrued collision
1647-
1648- // ---------------------------
1649- // All Generated events irrespective of whether there is an associated reconstructed collision
1650- // Consequently, the centrality being a reconstructed quantity, might not always be available
1651- // Therefore it is expressed as a function of the generated pT and the generated Nch in ∣eta∣ < 0.8
1652- // This is used for the denominator of the signal loss correction
1653- // Also for MC closure: True Pt vs Generated Nch
1654- // ---------------------------
1655- for (const auto & particle : mcParticles) {
1656- if (particle.eta () < v0Selections.minEtaDaughter || particle.eta () > v0Selections.maxEtaDaughter )
1657- continue ;
1658-
1659- if (particle.pt () < v0Selections.minPt || particle.pt () > v0Selections.maxPt )
1660- continue ;
1661-
1662- auto charge{0 .};
1663- // Get the MC particle
1664- auto * pdgParticle = pdg->GetParticle (particle.pdgCode ());
1665- if (pdgParticle != nullptr ) {
1666- charge = pdgParticle->Charge ();
1667- } else {
1668- continue ;
1669- }
1670-
1671- // Is it a charged particle?
1672- if (std::abs (charge) < kMinCharge )
1673- continue ;
1674-
1675- // Is it a primary particle?
1676- bool isPrimary{true };
1677- if (!particle.isPhysicalPrimary ())
1678- isPrimary = false ;
1679-
1680- if (isPrimary) {
1681- if (particle.pdgCode () == PDG_t::kPiPlus || particle.pdgCode () == PDG_t::kPiMinus ) {
1682- registry.fill (HIST (" PtPiVsNchMC_AllGen" ), particle.pt (), nChMCEta08);
1683- registry.fill (HIST (" MCclosure_PtMCPiVsNchMC" ), particle.pt (), nChMCEta08);
1684- } else if (particle.pdgCode () == PDG_t::kKPlus || particle.pdgCode () == PDG_t::kKMinus ) {
1685- registry.fill (HIST (" PtKaVsNchMC_AllGen" ), particle.pt (), nChMCEta08);
1686- registry.fill (HIST (" MCclosure_PtMCKaVsNchMC" ), particle.pt (), nChMCEta08);
1687- } else if (particle.pdgCode () == PDG_t::kProton || particle.pdgCode () == PDG_t::kProtonBar ) {
1688- registry.fill (HIST (" PtPrVsNchMC_AllGen" ), particle.pt (), nChMCEta08);
1689- registry.fill (HIST (" MCclosure_PtMCPrVsNchMC" ), particle.pt (), nChMCEta08);
1690- } else {
1691- continue ;
1692- }
1693- }
1694- } // Loop over Generated Particles
1695-
1696- // ---------------------------
1697- // This is used for the denominator of the event loss correction
1698- // ---------------------------
1699- registry.fill (HIST (" NchMC_AllGen" ), nChMCEta08);
17001720 }
17011721 PROCESS_SWITCH (PiKpRAA, processSim, " Process Sim" , false );
17021722
@@ -2069,7 +2089,14 @@ struct PiKpRAA {
20692089 bool isEventSelected (CheckCol const & col)
20702090 {
20712091 registry.fill (HIST (" EventCounter" ), EvCutLabel::All);
2072- registry.fill (HIST (" HasFT0AndTVX" ), EvCutLabel::All);
2092+
2093+ // Has BC?
2094+ if (selHasBC) {
2095+ if (!col.has_foundBC ()) {
2096+ return false ;
2097+ }
2098+ registry.fill (HIST (" EventCounter" ), EvCutLabel::HasBC);
2099+ }
20732100
20742101 // Has FT0 information?
20752102 if (selHasFT0) {
0 commit comments