Draft: Add PP2MCP table for redoing neutral associatio
When checking the MC of B0->KstGamma (2024-expected, nu=4.3), a fraction of signal photons are matched to its mother or grand(grand) mother mc particle.
These photons are mainly mismatched to B0/B*/b. After checking the NeutralPP2MCP
table, it's understood that the B0/B*/b can have the largest contribution (raw weight value in NeutralPP2MCP
table) to the Calo Clusters since this is the total contribution of its daughters. A specific weight estimator for neutral particles was implemented since Run1/2, and migrated to the CaloFuture2MCTool
, this tool should work with MCTRUTH = MCTruthAndBkgCat(data, name="MCTruthAndBkgCat_coll", redo_neutral_assoc=True)
. However, when running redo_neutral_assoc
without PP2MCP table, there are warning messages, and photon truth-matching is skipped:
MCTruthAndBkgCat_coll.Background... SUCCESS Exceptions/Errors/Warnings/Infos Statistics : 0/0/4/0
MCTruthAndBkgCat_coll.Background... SUCCESS #WARNINGS = 1 Message = ' ... CaloFutureCluster will be re-processed (require full DST)'
MCTruthAndBkgCat_coll.Background... SUCCESS #WARNINGS = 1 Message = ' ... assume an identical reconstruction version '
MCTruthAndBkgCat_coll.Background... SUCCESS #WARNINGS = 1 Message = ' ... try using Hypo->Cluster reference '
MCTruthAndBkgCat_coll.Background... SUCCESS #WARNINGS = 1 Message = 'No Hypo2MC link at '/Event/HLT2/Rec/Calo/Photons' '
In Run1/2, the link of CaloHyp2 to MCParticles is needed to run this Calo MC tool, while in Run3 this information is saved in the NeutralPP2MCP
table. So the location of NeutralPP2MCP
is added to use the CaloFuture2MCTool to redo the neutral association for better truth-matching results.
A comparison was made to check the effect ofredo_neutral_assoc=True
+PP2MCP table.
w/ PP2MCP (this MR) | w/o PP2MCP (2024-pathces) | |
---|---|---|
redo_neutral_assoc | ![]() |
![]() |
!redo_neutral_assoc | ![]() |
![]() |
Merge request reports
Activity
assigned to @yihou
added RTA label
added 17 commits
- a82c54af...9650f187 - 7 earlier commits
- e0e29870 - simplify prepare_{bind,logical_or}
- 76782c96 - remove the need for boost/mp11 in Function.h
- 3519191f - prefer bind_front over in-situ lambda
- eca91492 - add always_inline to get rid of false positive warning in gcc13-dbg build
- afc4c986 - remove unnecessary use of boost::mp11
- 4a6b3077 - Prepare Rec v36r11
- 0e396558 - add functors to get LHCbIDs and Nhits on VELO sides
- c2071c0c - Prefer LHCb::ProtoParticle::Range over LHCb::ProtoParticles
- c65eb7b0 - Do not overspecify namespaces and template argument
- c18c2a62 - Cleanup MC cloning and simplify MC cloning configuration
Toggle commit listrequested review from @jmarchan
added 20 commits
- bf15393b...6fea111b - 10 earlier commits
- 04a1b19d - prefer static constexpr bool value over template traits specialization
- 2657931a - Have a _single_ place where tuples of inputs to prepared functors are
- 7bd5c867 - make bind_helper redundant
- b0840711 - simplify argument forwarding
- 54fc57b6 - Simplify interplay between optional handling and composition
- 4495ed4d - tweak chain_helper
- e976e3c9 - remove redundant get_value
- bb8a2b42 - Allow helium3 candidates to be created
- 93f20468 - Add UT track info functors
- 136950dd - Adapt decay descriptor tests to new ion names
Toggle commit listadded 4 commits
- 030afa9e - ParticleVertexFitter: Downgrade info message to debug
- d1c5ea54 - Updated selection from (weighted)relation table, improvements to algorithms...
- 71f2cf55 - Include neutrals in overlap and uniqueness checks
- 0c5077f1 - Add decay-tree recombiner, generalise the LHCbIDOverlap functionality and general code refactoring
Toggle commit listadded 63 commits
-
0c5077f1...a4147170 - 62 commits from branch
2024-patches
- 51535f1b - Merge branch '2024-patches' into add_table_to_CaloFuture2MCTool
-
0c5077f1...a4147170 - 62 commits from branch
added 22 commits
-
51535f1b...e543139a - 20 commits from branch
2024-patches
- eea6a011 - Merge branch '2024-patches' into add_table_to_CaloFuture2MCTool
- 7705475b - Merge branch '2024-patches' into add_table_to_CaloFuture2MCTool
-
51535f1b...e543139a - 20 commits from branch
added 122 commits
-
7705475b...db3607a4 - 117 commits from branch
2024-patches
- 3fffeb05 - Merge branch '2024-patches' into add_table_to_CaloFuture2MCTool
- 0138294e - add the loc in property
- beff3127 - Merge branch '2024-patches' into add_table_to_CaloFuture2MCTool
- ab29ccda - Merge branch '2024-patches' into add_table_to_CaloFuture2MCTool
- 660faade - Merge branch '2024-patches' into add_table_to_CaloFuture2MCTool
Toggle commit list-
7705475b...db3607a4 - 117 commits from branch
added 9 commits
-
9807004a...f1483687 - 6 commits from branch
2024-patches
- 345b00ee - pass the pp2mc location to calo2mctool
- a6ad8e51 - Merge branch '2024-patches' into add_table_to_CaloFuture2MCTool
- 089e42df - fix the bkgcat problem, using the correct calo2mctool
Toggle commit list-
9807004a...f1483687 - 6 commits from branch
added 1 commit
- e2177554 - calofuturefragment2mctool -> calofuture2mctool
349 // - built (particle,weight) map with PP2MCP table 350 for ( auto const& rel : table->relations( proto ) ) { 351 verbose() << "related mcp is: " << rel.to()->particleID().pid() << "; related weight is: " << rel.weight() 352 << endmsg; 353 m_mcMap[rel.to()] += rel.weight(); 354 if ( msgLevel( MSG::VERBOSE ) ) 355 verbose() << "In CaloFuture2MCTool with particle " << rel.to()->particleID().pid() << " and it's weight " 356 << rel.weight() << "(from PP2MCP table)" << endmsg; 357 } 358 if ( hypo->hypothesis() == LHCb::CaloHypo::Hypothesis::Pi0Merged ) 359 m_sum += LHCb::Calo::Momentum( hypo ).e(); 360 else 361 m_sum += hypo->e(); 362 ++m_nHypo2MC; 363 } else { 364 Warning( "Unable to add MCAssociation (PP -> MC relation) ", StatusCode::SUCCESS, 1 ).ignore(); Warnings are not thread-safe as far I am aware (@sponce or @graven please correct me), better to use
Gaudi::Accumulators::MsgCounter
.PS: fixed misleading typo.
Edited by Miroslav Saurchanged this line in version 13 of the diff
329 auto links = SmartDataPtr<LHCb::LinksByKey>{evtSvc(), LHCb::LinksByKey::linkerName( loc )}; 337 std::string oldloc = 338 ( hypo->parent() && hypo->parent()->registry() ) ? hypo->parent()->registry()->identifier() : ""; 339 const std::string loc = m_PP2MC; 340 auto links = SmartDataPtr<LHCb::LinksByKey>{evtSvc(), LHCb::LinksByKey::linkerName( oldloc )}; 330 341 if ( !links ) { 331 Warning( "No Hypo2MC link at '" + loc + "' ", StatusCode::SUCCESS, 1 ).ignore(); 332 Warning( " ... try using Hypo->Cluster reference ", StatusCode::SUCCESS, 1 ).ignore(); 333 Warning( " ... CaloFutureCluster will be re-processed (require full DST)", StatusCode::SUCCESS, 1 ).ignore(); 334 Warning( " ... assume an identical reconstruction version ", StatusCode::SUCCESS, 1 ).ignore(); 335 ++m_nHypo2Cluster; 336 m_hypo2Cluster = true; 342 Warning( "No Hypo2MC link at '" + oldloc + "' ", StatusCode::SUCCESS, 1 ).ignore(); 343 Warning( " ... read ProtoParticle->MCParticle relation from PP2MCP RelationTable ", StatusCode::SUCCESS, 1 ) 344 .ignore(); 345 LoKi::Types::TablePP2MC* table = getIfExists<LoKi::Types::TablePP2MC>( loc, false ); Yes, can be, but not sure if we want to drop it @jmarchan
These types are not LoKi-specific -- they are just LoKi-specific aliases for generic relation tables:
Phys/LoKiPhysMC/include/LoKi/PhysMCTypes.h: typedef IRelationWeighted<LHCb::ProtoParticle, LHCb::MCParticle, double> TablePP2MC;
So please, do not use the LoKi alias which obfuscates the underlying type.
changed this line in version 15 of the diff