Skip to content
Snippets Groups Projects

Draft: Add PP2MCP table for redoing neutral associatio

Open Yingrui Hou requested to merge add_table_to_CaloFuture2MCTool into master

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.image

These photons are mainly mismatched to B0/B*/b. After checking the NeutralPP2MCPtable, 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 image image
!redo_neutral_assoc image image

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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();
  • 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 );
  • Yingrui Hou added 1 commit

    added 1 commit

    • c7fea5ef - use gaudi::accumulator for the warnings

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading