@@ -91,6 +91,7 @@ struct JetFinderQATask {
9191 Configurable<int > multCutCheck_analyseMBGapEvents{" multCutCheck_analyseMBGapEvents" , 0 , " flag to choose to reject min. bias gap events; -1: MBGap only, 0: skip MBGap events, 1: analyse all events" };
9292 Configurable<bool > doMultCutCheck{" doMultCutCheck" , false , " decide to apply multCutCheck or not" };
9393 Configurable<bool > multCutCheck_applyRCTSelections{" multCutCheck_applyRCTSelections" , true , " decide to apply RCT selections" };
94+ Configurable<bool > multCutCheck_applyWeightCorrection{" multCutCheck_applyWeightCorrection" , true , " decide to apply weight correction" };
9495
9596 std::vector<bool > filledJetR_Both;
9697 std::vector<bool > filledJetR_Low;
@@ -434,12 +435,20 @@ struct JetFinderQATask {
434435 registry.add (" h2_track_pt_track_sigma1overpt" , " #sigma(1/#it{p}_{T}); #it{p}_{T,track} (GeV/#it{c})" , {HistType::kTH2F , {{100 , 0 ., 10 .}, {10000 , 0.0 , 1.0 }}});
435436 registry.add (" h2_track_pt_high_track_sigma1overpt" , " #sigma(1/#it{p}_{T}); #it{p}_{T,track} (GeV/#it{c})" , {HistType::kTH2F , {{90 , 10 ., 100 .}, {10000 , 0.0 , 1.0 }}});
436437
438+ registry.add (" h_mccollision_processid" , " mccollision process id;mccollision process id;entries" , {HistType::kTH1D , {{200 , 0.0 , 200.0 }}});
439+
437440 registry.add (" h_particle_pdgcode" , " particle pdgcode;particle pdgcode;entries" , {HistType::kTH1D , {{3000 , 0.0 , 3000.0 }}});
438- registry.add (" h_particle_genstatuscode" , " particle gen status code;particle gen status code;entries" , {HistType::kTH1D , {{210 , 0 .0 , 210.0 }}});
441+ registry.add (" h_particle_genstatuscode" , " particle gen status code;particle gen status code;entries" , {HistType::kTH1D , {{420 , - 210 .0 , 210.0 }}});
439442 registry.add (" h_particle_hepmcstatuscode" , " particle hep mc status code;particle hep mc status code;entries" , {HistType::kTH1D , {{210 , 0.0 , 210.0 }}});
440443 registry.add (" h_particle_process" , " particle process;particle process;entries" , {HistType::kTH1D , {{50 , 0.0 , 50.0 }}});
441444 registry.add (" h_particle_producedbygenerator" , " particle producedByGenerator status;particle producedByGenerator status;entries" , {HistType::kTH1D , {{2 , 0.0 , 2 }}});
442445
446+ registry.add (" h_particle_primary_pdgcode" , " primary particle pdgcode;primary particle pdgcode;entries" , {HistType::kTH1D , {{3000 , 0.0 , 3000.0 }}});
447+ registry.add (" h_particle_primary_genstatuscode" , " primary particle gen status code;primary particle gen status code;entries" , {HistType::kTH1D , {{420 , -210.0 , 210.0 }}});
448+ registry.add (" h_particle_primary_hepmcstatuscode" , " primary particle hep mc status code;primary particle hep mc status code;entries" , {HistType::kTH1D , {{210 , 0.0 , 210.0 }}});
449+ registry.add (" h_particle_primary_process" , " primary particle process;primary particle process;entries" , {HistType::kTH1D , {{50 , 0.0 , 50.0 }}});
450+ registry.add (" h_particle_primary_producedbygenerator" , " primary particle producedByGenerator status;primary particle producedByGenerator status;entries" , {HistType::kTH1D , {{2 , 0.0 , 2 }}});
451+
443452 registry.add (" h_jet_pt" , " jet pT;#it{p}_{T,jet} (GeV/#it{c}); counts" , {HistType::kTH1F , {jetPtAxis}}, doSumw2);
444453 registry.add (" h_jet_eta" , " jet eta;#eta; counts" , {HistType::kTH1F , {jetEtaAxis}}, doSumw2);
445454 registry.add (" h_jet_phi" , " jet phi;#phi; counts" , {HistType::kTH1F , {phiAxis}}, doSumw2);
@@ -1483,12 +1492,13 @@ struct JetFinderQATask {
14831492 PROCESS_SWITCH (JetFinderQATask, processOccupancyQA, " occupancy QA on jet derived data" , false );
14841493
14851494 void processQcMultCutCheck (soa::Filtered<soa::Join<aod::JetCollisions, aod::BkgChargedRhos, aod::JMcCollisionLbs>>::iterator const & collision,
1486- aod::JetMcCollisions const &,
1495+ soa::Join<aod::JetMcCollisions, aod::JMcCollisionPIs> const &,
1496+ // soa::Join<aod::McCollisions, aod::HepMCXSections> const& aodMcCollisions,
14871497 soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents> const & mcdjets,
14881498 soa::Filtered<soa::Join<aod::JetTracks, aod::JTrackExtras, aod::JTrackPIs>> const & tracks,
14891499 soa::Filtered<aod::JetParticles> const & mcparticles)
14901500 {
1491- float eventWeight = collision.weight ();
1501+ float eventWeight = multCutCheck_applyWeightCorrection ? collision.weight () : 1 ;
14921502
14931503 bool hasJetAboveMultCut = false ;
14941504 for (auto const & mcdjet : mcdjets) {
@@ -1501,15 +1511,19 @@ struct JetFinderQATask {
15011511 }
15021512
15031513 bool fillHistograms = true ;
1504- bool isWeighted = true ;
1514+ bool isWeighted = multCutCheck_applyWeightCorrection ;
15051515 if (!applyCollisionCuts_multCutCheck (collision, fillHistograms, isWeighted, eventWeight)) {
15061516 return ;
15071517 }
15081518 registry.fill (HIST (" h_collisions_zvertex" ), collision.posZ (), eventWeight);
15091519
1510- if (collision.has_mcCollision ()) { // the collision is fake and has no associated mc coll; skip as .mccollision() cannot be called
1511- registry.fill (HIST (" h2_mccollision_pthardfromweight_pthardfromhepmcxsection" ), simPtRef / (std::pow (eventWeight, 1.0 / pTHatExponent)), collision.mcCollision ().ptHard ());
1512- registry.fill (HIST (" h2_mccollision_pthardfromweight_pthardfromhepmcxsection_weighted" ), simPtRef / (std::pow (eventWeight, 1.0 / pTHatExponent)), collision.mcCollision ().ptHard (), eventWeight);
1520+ if (collision.has_mcCollision ()) { // the collision is not fake and has one associated mc coll; .mccollision() can be called
1521+ auto jetMcCollision = collision.mcCollision_as <soa::Join<aod::JetMcCollisions, aod::JMcCollisionPIs>>();
1522+ auto aodMcCollision = jetMcCollision.mcCollision_as <soa::Join<aod::McCollisions, aod::HepMCXSections>>();
1523+
1524+ registry.fill (HIST (" h2_mccollision_pthardfromweight_pthardfromhepmcxsection" ), simPtRef / (std::pow (collision.weight (), 1.0 / pTHatExponent)), jetMcCollision.ptHard ());
1525+ registry.fill (HIST (" h2_mccollision_pthardfromweight_pthardfromhepmcxsection_weighted" ), simPtRef / (std::pow (collision.weight (), 1.0 / pTHatExponent)), jetMcCollision.ptHard (), eventWeight);
1526+ registry.fill (HIST (" h_mccollision_processid" ), aodMcCollision.processId (), eventWeight);
15131527 } else {
15141528 registry.fill (HIST (" h_fakecollisions" ), 0.5 );
15151529 }
@@ -1534,11 +1548,18 @@ struct JetFinderQATask {
15341548 }
15351549
15361550 for (auto const & mcparticle : mcparticles) {
1537- registry.fill (HIST (" h_particle_pdgcode" ), mcparticle.pdgCode ());
1538- registry.fill (HIST (" h_particle_genstatuscode" ), mcparticle.getGenStatusCode ());
1539- registry.fill (HIST (" h_particle_hepmcstatuscode" ), mcparticle.getHepMCStatusCode ());
1540- registry.fill (HIST (" h_particle_process" ), mcparticle.getProcess ());
1541- registry.fill (HIST (" h_particle_producedbygenerator" ), mcparticle.producedByGenerator ());
1551+ registry.fill (HIST (" h_particle_pdgcode" ), mcparticle.pdgCode (), eventWeight);
1552+ registry.fill (HIST (" h_particle_genstatuscode" ), mcparticle.getGenStatusCode (), eventWeight);
1553+ registry.fill (HIST (" h_particle_hepmcstatuscode" ), mcparticle.getHepMCStatusCode (), eventWeight);
1554+ registry.fill (HIST (" h_particle_process" ), mcparticle.getProcess (), eventWeight);
1555+ registry.fill (HIST (" h_particle_producedbygenerator" ), mcparticle.producedByGenerator (), eventWeight);
1556+ if (mcparticle.isPhysicalPrimary ()) {
1557+ registry.fill (HIST (" h_particle_primary_pdgcode" ), mcparticle.pdgCode (), eventWeight);
1558+ registry.fill (HIST (" h_particle_primary_genstatuscode" ), mcparticle.getGenStatusCode (), eventWeight);
1559+ registry.fill (HIST (" h_particle_primary_hepmcstatuscode" ), mcparticle.getHepMCStatusCode (), eventWeight);
1560+ registry.fill (HIST (" h_particle_primary_process" ), mcparticle.getProcess (), eventWeight);
1561+ registry.fill (HIST (" h_particle_primary_producedbygenerator" ), mcparticle.producedByGenerator (), eventWeight);
1562+ }
15421563 }
15431564
15441565 for (auto const & mcdjet : mcdjets) {
0 commit comments