Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDPlanarDigi creates objects with empty 3D covariance matrix #21

Open
1 task
andread3vita opened this issue Mar 8, 2025 · 3 comments
Open
1 task
Labels
enhancement New feature or request

Comments

@andread3vita
Copy link

Check duplicate issues.

  • Checked for duplicates

Goal

Hello,
I am using the digitizer defined in k4Reco/DDPlanarDigi and if I read the results I get that covariance matrix has all null elements.

Here is what I am doing to read the output of the digitizer with IDEA_v3_o1:

import ROOT
from podio import root_io
import dd4hep as dd4hepModule
from ROOT import dd4hep

input_file_path = "output_digi.root"
podio_reader = root_io.Reader(input_file_path)
for i, event in enumerate(podio_reader.get("events")):
    
    digi_vtx = event.get("VertexBarrelCollection_digi")
    
    for digi_hit in digi_vtx:
        
        cov = digi_hit.getCovMatrix()
        print(cov)

Thank you!
Andrea

Operating System and Version

Alma Linux 9.5

compiler

GCC 14.2.0

The version of the key4hep stack

2025-02-12

Package Version

current master

Reproducer

import ROOT
from podio import root_io
import dd4hep as dd4hepModule
from ROOT import dd4hep

input_file_path = "/afs/cern.ch/user/a/adevita/public/workDir/test/tracking_validation/ideav3/output_digi_v3_ddplanar.root"
podio_reader = root_io.Reader(input_file_path)
for i, event in enumerate(podio_reader.get("events")):
    
    digi_vtx = event.get("VertexBarrelCollection_digi")
    
    for digi_hit in digi_vtx:
        
        cov = digi_hit.getCovMatrix()
        print(cov)

Additional context

No response

@andread3vita andread3vita added the bug Something isn't working label Mar 8, 2025
@andresailer andresailer added enhancement New feature or request and removed bug Something isn't working labels Mar 8, 2025
@Zehvogel
Copy link
Contributor

To clarify the switch from "bug" to "enhancement": the 2D covariance matrix does exist; it is just diag(du, dv).
The empty covariance matrix in the TrackerHitPlane is the covariance matrix of the 3D position.
You should be able to convert the 2D to the 3D one with the information from local2global, but I don't know if it is implemented in any conveniently accessible way...

@andread3vita
Copy link
Author

Okay, I understand it. So you suggest retrieving the 2D covariance matrix and converting it to 3D covariance matrix using localToGlobal.

Since getCovMatrix returns the 3D covariance matrix, shouldn't the conversion take place within DDPlanarDigi?

@Zehvogel
Copy link
Contributor

Since getCovMatrix returns the 3D covariance matrix, shouldn't the conversion take place within DDPlanarDigi?

Yes that would be ideal, but never really needed in the past. You could give it a try and make a pull request once it works :)

@andread3vita andread3vita changed the title DDPlanarDigi creates objects with empty covariance matrix DDPlanarDigi creates objects with empty 3D covariance matrix Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants