Skip to content

Add CNN calo vertex implementation - #1

Merged
danjlis merged 1 commit into
danjlis:calozvertexfrom
nk7252:calozvertex-cnn
Jul 12, 2026
Merged

Add CNN calo vertex implementation#1
danjlis merged 1 commit into
danjlis:calozvertexfrom
nk7252:calozvertex-cnn

Conversation

@nk7252

@nk7252 nk7252 commented Jul 11, 2026

Copy link
Copy Markdown

For now I am only supplying z. I can add z_err (per event sigma) in another PR if desired.

For now I am only supplying z. I can add z_err (per event sigma) in another PR.
Copilot AI review requested due to automatic review settings July 11, 2026 09:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CaloVtxAlgoCNN implementation (tower-image creation + EMCal retowering + onnxruntime inference) and link calovtxreco against 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;
@danjlis
danjlis merged commit 9911048 into danjlis:calozvertex Jul 12, 2026
1 check passed
@nk7252
nk7252 deleted the calozvertex-cnn branch July 13, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants