@@ -262,6 +262,11 @@ struct kstarInOO {
262262 histos.add (" hUSS_TrueRec" , " hUSS_TrueRec" , kTHnSparseF , {cfgCentAxis, ptAxis, minvAxis});
263263 histos.add (" hUSS_TrueRec_INSIDE" , " hUSS_TrueRec_INSIDE" , kTHnSparseF , {cfgCentAxis, dRAxis, ptAxis, minvAxis});
264264
265+ histos.add (" hGen_pT_Raw" , " Gen_pT_Raw (GeV/c)" , kTH1F , {{800 , 0 ., 40 .}});
266+ histos.add (" hGen_pT_GoodEv" , " Gen_pT_GoodTrig (GeV/c)" , kTH1F , {{800 , 0 ., 40 .}});
267+ histos.add (" hGen_pT_GoodTrig" , " Gen_pT_GoodTrig (GeV/c)" , kTH1F , {{800 , 0 ., 40 .}});
268+ histos.add (" hGen_pT_GoodEvTrig" , " Gen_pT_GoodEvTrig (GeV/c)" , kTH1F , {{800 , 0 ., 40 .}});
269+
265270 histos.add (" hEffRec_pT" , " EffRec_pT (GeV/c)" , kTH1F , {{1600 , 0 ., 80 .}});
266271 histos.add (" hEffRecTest1_pT" , " EffRecTest1_pT (GeV/c)" , kTH1F , {{800 , 0 ., 40 .}});
267272 histos.add (" hEffRecTest2_pT" , " EffRecTest2_pT (GeV/c)" , kTH1F , {{800 , 0 ., 40 .}});
@@ -271,10 +276,8 @@ struct kstarInOO {
271276 histos.add (" hEffRecTest6_pT" , " EffRecTest6_pT (GeV/c)" , kTH1F , {{800 , 0 ., 40 .}});
272277 histos.add (" hEffRecTest7_pT" , " EffRecTest7_pT (GeV/c)" , kTH1F , {{800 , 0 ., 40 .}});
273278 histos.add (" hEffRecTest8_pT" , " EffRecTest8_pT (GeV/c)" , kTH1F , {{800 , 0 ., 40 .}});
274-
275- histos.add (" hEffGen_pT_Raw" , " EffGen_pT_Raw (GeV/c)" , kTH1F , {{800 , 0 ., 40 .}});
276279 histos.add (" hEffGen_pT" , " EffGen_pT (GeV/c)" , kTH1F , {{800 , 0 ., 40 .}});
277-
280+
278281 histos.add (" hMotherPdg1" , " hMotherPdg1" , kTH1F , {{5000 , 0 ., 5000 .}});
279282 histos.add (" hMotherPdg2" , " hMotherPdg2" , kTH1F , {{5000 , 0 ., 5000 .}});
280283 }
@@ -1507,27 +1510,63 @@ struct kstarInOO {
15071510 std::cout << " Processed MC (GEN) Events: " << nprocessEffEvents << std::endl;
15081511 }
15091512 }
1510-
1511- if (fabs (collision.posZ ()) > cfgEventVtxCut)
1512- return ;
1513- if (recocolls.size () <= 0 ) { // not reconstructed
1514- return ;
1513+ if (cfgJetMCHistos){
1514+ histos.fill (HIST (" nEvents_Gen" ), 0.5 );
15151515 }
1516-
1516+
15171517 for (auto & particle : mcParticles) {
1518- if (cfgJetMCHistos) {
1519- histos.fill (HIST (" hEffGen_pT_Raw" ), particle.pt ());
1518+ if (particle.pdgCode () != 313 )
1519+ continue ;
1520+ if (std::fabs (particle.eta ()) > cfgTrackMaxEta)
1521+ continue ;
1522+ if (fabs (collision.posZ ()) > cfgEventVtxCut)
1523+ break ;
1524+
1525+ if (cfgJetMCHistos){
1526+ histos.fill (HIST (" hGen_pT_Raw" ), particle.pt ());
15201527 }
1528+ }// Unreconstructed collisions(=Raw coll) for correction
1529+
1530+ if (recocolls.size () <= 0 ) { // not reconstructed
1531+ return ;
15211532 }
15221533
1534+ for (auto & recocoll : recocolls) { // poorly reconstructed
1535+ if (recocoll.posZ () > cfgEventVtxCut)
1536+ continue ;
1537+ auto goodEv = jetderiveddatautilities::selectCollision (recocoll, eventSelectionBits);
1538+ auto goodTrig = jetderiveddatautilities::selectTrigger (recocoll, RealTriggerMaskBits);
1539+ for (auto & particle : mcParticles) {
1540+ if (particle.pdgCode () != 313 )
1541+ continue ;
1542+ if (std::fabs (particle.eta ()) > cfgTrackMaxEta)
1543+ continue ;
1544+ if (cfgJetMCHistos) {
1545+ // check K* PID
1546+ if (goodEv) {
1547+ histos.fill (HIST (" hGen_pT_GoodEv" ), particle.pt ());
1548+ }
1549+ if (goodTrig){
1550+ histos.fill (HIST (" hGen_pT_GoodTrig" ), particle.pt ());
1551+ }
1552+ if (goodEv && goodTrig) {
1553+ histos.fill (HIST (" hGen_pT_GoodEvTrig" ), particle.pt ());
1554+ }
1555+ }// cfgJetMCHistos
1556+ }// mcParticles
1557+ }// recocolls (=reconstructed collisions)
1558+
1559+ // =================
1560+ // || Efficiency
1561+ // =================
1562+ if (fabs (collision.posZ ()) > cfgEventVtxCut)
1563+ return ;
1564+
15231565 for (auto & recocoll : recocolls) { // poorly reconstructed
15241566 auto goodEv = jetderiveddatautilities::selectCollision (recocoll, eventSelectionBits);
15251567 if (goodEv) {
15261568 goodEv = jetderiveddatautilities::selectTrigger (recocoll, RealTriggerMaskBits);
15271569 }
1528- if (cfgJetMCHistos) {
1529- histos.fill (HIST (" nEvents_Gen" ), 0.5 );
1530- }
15311570 if (!goodEv)
15321571 return ;
15331572 }
@@ -1541,24 +1580,24 @@ struct kstarInOO {
15411580 continue ;
15421581
15431582 /* // Not Yet
1544- if (cfg_Force_BR) {
1545- bool baddecay = false;
1546- for (auto& phidaughter : particle.daughters_as<aod::McParticles>()) {
1547- if (std::fabs(phidaughter.pdgCode()) != 321) {
1548- baddecay = true;
1549- break;
1550- }
1551- if (cfg_Force_Kaon_Acceptence) {
1552- if (std::fabs(phidaughter.eta()) > cfg_Track_MaxEta) {
1553- baddecay = true;
1554- break;
1555- }
1556- }
1557- } // loop over daughters
1558-
1559- if (baddecay)
1560- continue;
1561- } // enforce BR restriction
1583+ if (cfg_Force_BR) {
1584+ bool baddecay = false;
1585+ for (auto& phidaughter : particle.daughters_as<aod::McParticles>()) {
1586+ if (std::fabs(phidaughter.pdgCode()) != 321) {
1587+ baddecay = true;
1588+ break;
1589+ }
1590+ if (cfg_Force_Kaon_Acceptence) {
1591+ if (std::fabs(phidaughter.eta()) > cfg_Track_MaxEta) {
1592+ baddecay = true;
1593+ break;
1594+ }
1595+ }
1596+ } // loop over daughters
1597+
1598+ if (baddecay)
1599+ continue;
1600+ } // enforce BR restriction
15621601 */
15631602
15641603 if (cfgJetMCHistos) {
0 commit comments