Add CNN calo vertex implementation - #1
Merged
Conversation
For now I am only supplying z. I can add z_err (per event sigma) in another PR.
There was a problem hiding this comment.
Pull request overview
Adds a new calorimeter-based vertexing option backed by an ONNX CNN model, and wires it into the existing calo/global vertex algorithm plumbing so the result can be stored and retrieved like other calo vertex algorithms.
Changes:
- Extend calo-vertex algorithm/type enums to include a new CNN option.
- Teach global-vertex reconstruction and position accessors to recognize/store/use the CNN calo vertex type.
- Add a new
CaloVtxAlgoCNNimplementation (tower-image creation + EMCal retowering + onnxruntime inference) and linkcalovtxrecoagainst onnxruntime.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| offline/packages/globalvertex/VertexDefs.h | Adds VertexDefs::CALOALGO::CNN enum value. |
| offline/packages/globalvertex/GlobalVertexv4.cc | Updates get_position() calo fallback order to include CALO_JETMLP and CALO_CNN. |
| offline/packages/globalvertex/GlobalVertexReco.cc | Inserts CNN calo vertex into GlobalVertexv4 when calo algo is CNN. |
| offline/packages/globalvertex/GlobalVertex.h | Adds GlobalVertex::VTXTYPE::CALO_CNN. |
| offline/packages/calovtxreco/Makefile.am | Builds/installs CNN algo and links -lonnxruntime. |
| offline/packages/calovtxreco/CaloVtxAlgoCNN.h | Declares new CNN-based calo vertex algorithm and configuration knobs. |
| offline/packages/calovtxreco/CaloVtxAlgoCNN.cc | Implements tower-image filling, EMCal retowering map, and ONNX inference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+103
to
+108
| Ort::Value input = Ort::Value::CreateTensor<float>(m_onnx->memInfo, &m_image[0][0][0], static_cast<size_t>(kNLayer) * kNEtaImg * kNPhiImg, shape, 4); | ||
| const char *inNames[] = {"raw_image"}; | ||
| const char *outNames[] = {"z_cal_cm"}; | ||
| auto outs = m_onnx->session->Run(Ort::RunOptions{nullptr}, inNames, &input, 1, outNames, 1); | ||
| z = outs[0].GetTensorData<float>()[0]; | ||
| return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For now I am only supplying z. I can add z_err (per event sigma) in another PR if desired.