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

MC truth y offset #64

Open
mjkramer opened this issue Apr 28, 2023 · 4 comments
Open

MC truth y offset #64

mjkramer opened this issue Apr 28, 2023 · 4 comments

Comments

@mjkramer
Copy link
Member

tracks_copy[field] = (tracks[field] + 21.8236) #* units.cm
L158 L172

We're adding an offset of 21.8236 cm to the y coordinates in the truth datasets. This looks like a holdover from one of Peter's old analyses. We should probably get rid of it, but maybe I'm missing something.

@mjkramer
Copy link
Member Author

Hijacking this issue as a braindump: We're also swapping x and z (with the goal of achieving "z = beam"), but at this point larnd-sim is already writing all of the truth with "z = beam".

@peter-madigan
Copy link
Member

Yes, all of the funny business here is done to fix the old inconsistent coordinate system from the larnd-sim files (which had different origins / units / coordinate axes between the trajectories and the tracks). These are both safe to remove for the future.

@peter-madigan
Copy link
Member

On the topic of units, I outlined a unit system in util/units.py that could be helpful as long as it is religiously followed when you read in data from "non-ndlar_flow" objects (e.g. config files / larnd-sim files / etc).
E.g. whenever you read in a value from something outside of ndlar_flow, you multiply by the appropriate units:
p_ndlar_flow = p_larnd_sim_file * units.MeV
pixel_x_ndlar_flow = pixel_yaml_value * units.mm
Then it's pretty straightforward to set the global unit system (just update what units.mm is), or to be able to specify units in config files (getattr(units, unit_spec)).

I can't say that I successfully did this in all of my code but always better to try and start off on the right foot.

@cuddandr
Copy link
Contributor

Yeah, that was the plan in a future commit once I got more feedback on what units we wanted (or silent approval). The current state was to get files out now for reco development.

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

No branches or pull requests

3 participants