[WIP] Prototype TruthInfo graph for truth history navigation and association studies#50913
[WIP] Prototype TruthInfo graph for truth history navigation and association studies#50913felicepantaleo wants to merge 53 commits into
Conversation
|
cms-bot internal usage |
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-50913/49282 |
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-50913/49283 |
|
Pull request #50913 was updated. |
|
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-50913/49286
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-50913/49287 |
|
Pull request #50913 was updated. |
code format
make code check happy format
…ch SimVertex dumps Vertex time normalization (cm, ns): - SimVertex position().t() is stored in seconds and HepMC GenVertex time is c*t in mm; previously only x/y/z were converted (mm->cm) while t was left raw, so GEN and SIM times were incomparable (and SimVertex t printed as 0). - TruthLogicalGraphProducer now converts GEN t (mm/c -> ns) and SIM t (s -> ns) so VertexData.position is consistently (cm, ns). - Re-enable the t term in compatibleVertexPositions; GEN/SIM primary vertices now agree to ~1e-5 ns and merge correctly. Raw SimVertex -> GenVertex provenance connection: - New TruthGraph::simVtxToGen association (SimVertex node -> GenVertex node), derived from primary SimTracks (production SimVertex <-> GenParticle production GenVertex). Conflicts are logged. Emitted as SimToGen edges. - TruthGraphProducer fills it and reports simVtxToGenVertexLinks. Dumper enrichment: - TruthGraphDumper now fetches the SimVertexContainer and annotates SimVertex nodes with position (cm,ns), vertexId, processType, parentTrackId, noParent, eventId (bx/evtInBx) and the associated GenVertex_nodeId. - TruthLogicalGraphDumper vertex labels use a 4D (x,y,z,t) formatter. Also fix a stale GEN/SIM vertex-merge debug print that used px()/py()/pz() and a misleading message. format
…ch tracker simhits to particles New NanoAOD flat tables: - PFRecHitFlatTableProducer: barrel/forward calorimeter PFRecHits (ECAL/HBHE/HF/HO). Positions are recomputed from CaloGeometry via the detId because PFRecHit::position()/positionREP() read a non-persisted CaloCellGeometry and segfault on rechits read back from a file. The offline (RECO) PFRecHit collections are empty in the test sample, so the HLT-tier collections are used. - TrackerSimHitFlatTableProducer: tracker PSimHits with global positions from the TrackerGeometry, plus trackId/pdgId/energyLoss/tof/pabs/processType. Tracker simhits in the truth matching: - LogicalGraphHitIndex/Builder gain a separate tracker-hit channel (direct and subgraph), filled from PSimHit::trackId() in TruthLogicalGraphHitIndexProducer. - TruthLogicalGraphDumper reports per-particle tracker simhit counts and energy. Test config wires both tables into the path and uses the ideal tracker geometry (applyAlignment=False) so no alignment conditions are needed standalone.
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-50913/49758
|
|
Pull request #50913 was updated. |
…odes, pile-up provenance, heavy-flavor seeding and jet-origin navigation
…ssociation Per reco track, match to a Branch via shared tracker hits (PSimHit-based hit index) and to a TrackingParticle via ClusterTPAssociation, and check both point to the same truth particle. Agreement 96-100% across ZMM/TTbar/SingleE. Adds a tracker-channel unit test for BranchHitAssociator.
Prepend an 'Original author: Felice Pantaleo (CERN) <felice.pantaleo@cern.ch>' header to every source file created for the MC-truth-graph prototype, and add a prominent under-heavy-development / not-open-to-external-contributions notice (Phase-2 only) at the top of the README. Also fix two latent warnings surfaced by the full recompile: a dangling reference to the temporary Particle from Branch::root() in BranchSelector, and a memcpy into the non-trivial EncodedEventId in Branch::decodeEventId.
Diagnostic EDAnalyzer auditing the raw TruthGraph and logical truth::Graph for strange topologies: many-particle vertices, particles with multiple parents or multiple production vertices, cycles (the graphs must be DAGs), and disconnected components. Aggregates per job with worst-case examples carrying pdgId/status. Used to characterize and regression-test graph-construction changes.
…ertex merge A merged GEN+SIM particle now takes its production vertex from the GEN side (the immediate GenParticle's production GenVertex, via the faithful genpartIndex link), dropping the redundant SimTrack production edge to the shared Geant4 beam vertex. This replaces mergeGenSimVerticesByPosition, which collapsed the spatially coincident GEN/SIM vertex cluster at the primary into one mega-vertex and induced DAG cycles. Removes that postprocessor step and its two config parameters. Verified with the topology checker on all 8 library samples: cycles 5->0, multi-production particles ->0, logical vertex out-degree from ~600-900 down to the physical hadronization scale, no orphan fragments; raw graph unchanged. All cppunit tests pass; code-format and code-checks clean.
|
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-50913/49760
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
This draft PR collects the ongoing TruthInfo graph developments being worked on during the 20th Patatrack hackathon.
The goal is to prototype a common truth-history representation in CMSSW, combining generator-level and simulation-level information into graph-based data structures that can be navigated through a physics-oriented API.
This PR is intentionally opened as a draft so that the working group can collaborate in a single place during the hackathon.
This development explores two related layers:
TruthGraph, built from existing CMS truth products such as HepMC,SimTrack, andSimVertex;truth::Graph, exposing particles, vertices, payload, and navigation methods.The long-term goal is to provide a stable abstraction for truth navigation and truth-reco association, avoiding the need for downstream reconstruction and validation code to directly depend on the internal structure of several low-level truth collections.
Hackathon work area
This PR is meant as the shared development branch for the working group at the ongoing 20th Patatrack hackathon.
Status
This is a prototype and not yet intended as a final interface.
The main purpose of this draft PR is to collect ideas, code, tests, and validation feedback in a common place during the hackathon. The implementation and API are expected to evolve substantially before this can become a stable CMSSW interface.