Closed tomeichlersmith closed 4 years ago
How do you plan to extract the detector versions?
On Thu, Mar 26, 2020, 11:36 AM Tom Eichlersmith notifications@github.com wrote:
Pretty self explanatory. This would be nice so that users don't have to soft link the detector description if they are using a standard one that is installed with ldmx-sw.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/LDMX-Software/ldmx-sw/issues/663, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4JMXHCTUWXAKHSOYUS23LRJOOBVANCNFSM4LUOMNTA .
For a first pass, I was planning on hard-coding a map that goes from the version to the detector name (name of the directory). I can have cmake save the install path to Version.h
and then use the install path and some hard-coded knowledge of the installation tree to get the gdml file.
Hard coding is something I would like to avoid. This solution is prone to becoming a mess.
If anything, we can use a database to keep track of it. However, this is not something we should plan to do in the short term.
On Thu, Mar 26, 2020, 12:24 PM Tom Eichlersmith notifications@github.com wrote:
For a first pass, I was planning on hard-coding a map that goes from the version to the detector name (name of the directory). I can have cmake save the install path to Version.h and then use the install path and some hard-coded knowledge of the installation tree to get the gdml file.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LDMX-Software/ldmx-sw/issues/663#issuecomment-604635311, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4JMXBL3NNJDFOG55APCQ3RJOTWDANCNFSM4LUOMNTA .
Makes sense. Then I will plan on saving the path to the data directory into a python function. Then people at least don't need to soft link the gdml and the dat? They would just call something like:
sim.parameters[ "detector" ] = pathToDataInstall() + 'ldmx-det-full-v12-magnet-fieldmap/detector.gdml'
Or even better:
sim.parameters[ "detector" ] = makeDetectorPath( 'ldmx-det-full-v12-magnet-fieldmap')
where
def makeDetectorPath( detName ) :
return '@CMAKE_INSTALL_PREFIX@' + detName + '/detector.gdml'
What do you think?
This is much better. Go for it.
On Thu, Mar 26, 2020, 12:38 PM Tom Eichlersmith notifications@github.com wrote:
Makes sense. Then I will plan on saving the path to the data directory into a python function. Then people at least don't need to soft link the gdml and the dat? They would just call something like:
sim.parameters[ "detector" ] = pathToDataInstall() + 'ldmx-det-full-v12-magnet-fieldmap/detector.gdml'
Or even better:
sim.parameters[ "detector" ] = makeDetectorPath( 'ldmx-det-full-v12-magnet-fieldmap')
where
def makeDetectorPath( detName ) : return '@CMAKE_INSTALL_PREFIX@' + detName + '/detector.gdml'
What do you think?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LDMX-Software/ldmx-sw/issues/663#issuecomment-604643260, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4JMXEOACQ4BPX7EKBUZ6DRJOVMZANCNFSM4LUOMNTA .
Pretty self explanatory. This would be nice so that users don't have to soft link the detector description if they are using a standard one that is installed with ldmx-sw.