-
Notifications
You must be signed in to change notification settings - Fork 37
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
Question about how to obtain radius of innermost hit #383
Comments
We had quite a bit of discussion about this when we implemented the conversion from EDM4hep to LCIO for this particular piece of information in the corresponding PR: key4hep/k4EDM4hep2LcioConv#72 You can see some links in there to places where this is filled, and as you can also see, it's unfortunately not done consistently. Some places use a 2D distance, while others use a 3D distance. So depending on where this information is filled it is not easily possible to predict which distance was used in the end. Typically it is the 2D version IIRC. Now in your code specifically, you do something like x_closest = refX[ihit] + d0[ihit] * math.cos(phi[ihit])
y_closest = refY[ihit] + d0[ihit] * math.sin(phi[ihit]) whereas what we typically use is the x & y coordinate of the reference point directly, i.e. x_closest = refX[ihit]
y_closest = refY[ihit] |
One should also only look at the track state if (state.location == edm4hep::TrackState::AtFirstHit) {
const auto refP = state.referencePoint;
return std::sqrt(refP.x * refP.x + refP.y * refP.y + use3D * refP.z * refP.z);
}
} (The looping in the screenshot goes over track states, so calling the loop counter |
Thanks for the feedback! If I do
I am still not recovering the values that I find in Is there something wrong in what I am looping over? Is there a mistake in the branch names? |
You will have to first figure out which track state to use as simply looping over So you will also need to load the |
Gotcha! So I would pick the track state based on the location that coincides with If yes, where do I find |
It is the
|
Yes, exactly. But there is no computing involved any longer at that point, I think.
This is a constant value (effectively an enum). It's defined here Line 220 in fe5a540
|
Great! Thank you! Now the values match!! |
Hi, I was looking into computing the radiusOfInnerMostHit because I need to use this variable for particle flow reconstruction. Since I have access to events generated with a previous software build that still has access to
SiTracks_Refitted/SiTracks_Refitted.radiusOfInnermostHit
, I was trying to confirm my piece of code below:which prints out:
Unfortunately, it seems that my piece of code is not correct because it does not match the value directly obtained from the branch
SiTracks_Refitted/SiTracks_Refitted.radiusOfInnermostHit
Could you perhaps share how to build this variable from the other branches? Thanks!
Originally posted by @farakiko in #319 (comment)
The text was updated successfully, but these errors were encountered: