key4hep / k4geo

DD4hep based geometry models for lepton collider detectors (Formerly known as lcgeo)
GNU General Public License v3.0
8 stars 58 forks source link

Fieldmap not correctly imported #384

Closed aciarma closed 1 month ago

aciarma commented 1 month ago

I tried to use a geometry including a magnetic field map but ddsim/dd4hep2root prompt an error during the import. It happens both for fields of types FieldXYZ and FieldsBrBz. This happens also with current releases of ILD which use field maps. The file is correctly read, as the parameters of the map are displayed, but the field type is unknown.

Example:

source /cvmfs/fcc.cern.ch/sw/latest/setup.sh"
cd k4geo/ILD/compact/ILD_l5_v04
dd4hep2root -c ILD_s5_v04.xml -o ILD_s5_v04.root

Output:

...
Ntuple name:   ntuple
rho  Var name: rho_mm
z    Var name: z_mm
Brho Var name: Brho
Bz   Var name: Bz

rScale                  1
zScale                  1
bScale                  1
rhoMin                  0 cm
rhoMax                800 cm
rhoStep                10 cm
nRho                   81
rhoOrdering   low-to-high
zMin                    0 cm
zMax                  700 cm
zStep                  10 cm
nZ                     71
zOrdering     low-to-high
CoorsOrder             RZ
coorUnits             0.1 cm
BfieldUnits             1 tesla
OverlayedField   ERROR add: Attempt to add an unknown field type.
...
andresailer commented 1 month ago

Cannot reproduce

source /cvmfs/fcc.cern.ch/sw/latest/setup.sh
dd4hep2root

Gives

bash: dd4hep2root: command not found
atolosadelgado commented 1 month ago

maybe is this file? https://github.com/key4hep/k4geo/blob/main/utils/dd4hep2root.py

aciarma commented 1 month ago

yes sorry, I forgot it was not automatically in the environment. But it gives the same error also with ddsim