gemc / source

gemc website:
gemc.jlab.org
14 stars 72 forks source link

possible bug with multiple FIELD_PROPERTIES #226

Closed zhaozhiwen closed 1 year ago

zhaozhiwen commented 1 year ago

There may be a bug when possible bug with multiple FIELD_PROPERTIES options with two field map are used.

solenoid_CLEOv8 is 1.4T hall soldnoid field along z axis, oxford_ptarget is 5T local solenoid field along x axis near z=-350cm I shoot e+ along -z direction and it should be bent by oxford_ptarget field toward toward phi=-90 direction. but the onscreen output as follows shows it goes along -z without changing direction

+++++here is how to repeat it ++++++++++++++++++++++++++++++++++++++++++++ source /site/env/syscshrc module load singularity/3.9.5 singularity shell -s /bin/tcsh /group/solid/apps/jeffersonlab_jlabce_tag2.5_digest:sha256:9b9a9ec8c793035d5bfe6651150b54ac298f5ad17dca490a8039c530d0302008_20220413_s3.9.5.sif cd /group/solid/solid_github/JeffersonLab/solid_gemc_test/analysis/field_test gemc beam.gcard -BEAM_P="e+,11*GeV,180*deg,0*deg" -BEAM_V="(0,0,0)cm" -FIELD_PROPERTIES="solenoid_CLEOv8, 10mm, G4ClassicalRK4,linear" -FIELD_PROPERTIES="oxford_ptarget, 1mm, G4ClassicalRK4,linear" -FIELD_VERBOSITY=10

+++++onscreen output +++++++++++++++++++++++++++++++++++++++++++++

Track position in magnetic field map, with displacement and rotations (x,y,z)/cm:(1.74438e-14, -4.38781e-16, -142.5) cm,
Cylindrical: loc. pos. = (1.74438e-14, -4.38781e-16, -142.5) cm, tr=1.74493e-14cm, long=-142.5cm, phi=-1.44091, IT=0 IL=457, B = (-3.99927e-13, 1.00597e-14, 11058) gauss Track position in magnetic field map, with displacement and rotations (x,y,z)/cm:(2.61594e-14, -8.43766e-16, -213.75) cm,
Cylindrical: loc. pos. = (2.61594e-14, -8.43766e-16, -213.75) cm, tr=2.6173e-14cm, long=-213.75cm, phi=-1.84742, IT=0 IL=386, B = (-1.42277e-12, 4.58912e-14, 5359) gauss Track position in magnetic field map, with displacement and rotations (x,y,z)/cm:(2.61521e-14, -9.75583e-16, -213.75) cm,
Cylindrical: loc. pos. = (2.61521e-14, -9.75583e-16, -213.75) cm, tr=2.61703e-14cm, long=-213.75cm, phi=-2.13638, IT=0 IL=386, B = (-1.42238e-12, 5.30605e-14, 5359) gauss Track position in magnetic field map, with displacement and rotations (x,y,z)/cm:(3.48766e-14, -1.0363e-15, -285) cm,
Cylindrical: loc. pos. = (3.48766e-14, -1.0363e-15, -285) cm, tr=3.4892e-14cm, long=-285cm, phi=-1.70194, IT=0 IL=315, B = (-3.96296e-13, 1.17752e-14, 402.68) gauss Track position in magnetic field map, with displacement and rotations (x,y,z)/cm:(1.74512e-14, 0, -142.5) cm,
Cylindrical: loc. pos. = (1.74512e-14, 0, -142.5) cm, tr=1.74512e-14cm, long=-142.5cm, phi=0, IT=0 IL=457, B = (-4.00096e-13, -0, 11058) gauss Track position in magnetic field map, with displacement and rotations (x,y,z)/cm:(1.74512e-14, -9.32856e-16, -142.5) cm,
Cylindrical: loc. pos. = (1.74512e-14, -9.32856e-16, -142.5) cm, tr=1.74761e-14cm, long=-142.5cm, phi=-3.05984, IT=0 IL=457, B = (-4.00096e-13, 2.13872e-14, 11058) gauss Track position in magnetic field map, with displacement and rotations (x,y,z)/cm:(3.48223e-14, -1.05607e-15, -285) cm,
Cylindrical: loc. pos. = (3.48223e-14, -1.05607e-15, -285) cm, tr=3.48383e-14cm, long=-285cm, phi=-1.73709, IT=0 IL=315, B = (-3.9568e-13, 1.19999e-14, 402.68) gauss Track position in magnetic field map, with displacement and rotations (x,y,z)/cm:(6.73254e-14, -1.0287e-13, -550) cm,
Cylindrical: loc. pos. = (6.73254e-14, -1.0287e-13, -550) cm, tr=1.22943e-13cm, long=-550cm, phi=-56.7965, IT=0 IL=50, B = (-1.56784e-15, 2.3956e-15, 2.23268) gauss Track position in magnetic field map, with displacement and rotations (x,y,z)/cm:(6.73254e-14, -1.0287e-13, -550) cm,
Cylindrical: loc. pos. = (6.73254e-14, -1.0287e-13, -550) cm, tr=1.22943e-13cm, long=-550cm, phi=-56.7965, IT=0 IL=50, B = (-1.56784e-15, 2.3956e-15, 2.23268) gauss

zhaozhiwen commented 1 year ago

latest gemc treat coordinate of local field map as absolute coordinate in root volume. old gemc 2.3 treat as local coordinate in its mother volume. So latest gemc need to use DISPLACE_FIELDMAP option to load oxford_ptarget at correct location