LDMX-Software / ldmx-sw

The Light Dark Matter eXperiment simulation and reconstruction framework.
https://ldmx-software.github.io
GNU General Public License v3.0
22 stars 21 forks source link

Put BField into Conditions #1329

Open tomeichlersmith opened 1 year ago

tomeichlersmith commented 1 year ago

Similar to other geometry things, a BField only needs to be created once and then a single object can be passed between the processors who need it to (for example) propagate or fit tracks.

Currently, the different processors are just loading their own copies of the magnetic field. For example,

https://github.com/LDMX-Software/ldmx-sw/blob/69f01ee406fa60518c9d0cf1e2ba551040aace8c/Tracking/src/Tracking/Reco/VertexProcessor.cxx#L35-L39

The utility functions in the global namespace can probably be isolated into this condition as well

https://github.com/LDMX-Software/ldmx-sw/blob/69f01ee406fa60518c9d0cf1e2ba551040aace8c/Tracking/include/Tracking/Sim/BFieldXYZUtils.h#L277-L294

https://github.com/LDMX-Software/ldmx-sw/blob/69f01ee406fa60518c9d0cf1e2ba551040aace8c/Tracking/include/Tracking/Sim/BFieldXYZUtils.h#L218-L255

pbutti commented 10 months ago

@tomeichlersmith Still planning to fix this? For some systematic studies we still want to have local copies of the magnetic field map.

tomeichlersmith commented 10 months ago

It's still on my to-do list, but if its not a big performance hit I can take it off.

(I would still leave this issue open for future developers to know that there is this area of improvement available.)