Enable magnetic field in Sim 11 & correctly access DD4hep conditions

Michal Mazurek requested to merge mimazure-Sim11-magnetic-field into Futurev5

@gcorti @kreps @adavis @clemenci

This activates the magnetic field for Sim11 for both DetDesc and DD4hep at initialize time. This has been done be setting fieldVector callbacks in magnetic field factories of Gaussino. In DD4hep case, the access to DeMagnet's `fieldVector is done by getting an IOV slice with the same run number that is set for ODIN in GenRndINit.

I also had to revisit the way we configure and access DD4hep conditions because DD4hep options are set at the same time in Gauss, LHCbApp and DDDBConf, where the last two depend on the global variable UseDD4hep, which no longer works as it is supposed to (in Gauss on the standard platform the choice of DetDesc/DD4hep happens at runtime and is steered from GaussGeometry() configurable).

I prepared a few manual tests using the G4 visuaulization tools in Gaussino. In each test we get just the magnet with a changing polarity. I'm shooting one 1 GeV electron to see if its trajectory is bent inside the magnet. The vector field is also visible. You can see the pictures below.

Manual Tests


In this case, we do not have the simulation database yet, so there's no magnetic field for the default RunNumber=1. I looked up 2 runs from rundb: one with mag up (256293) and one with mag down (256175)

Mag UP





In DetDesc, RunNumber=1 works, so the polarity can be checked using different versions of SIMCOND database. I used: sim-20220509-vc-md100 for mag down and sim-20220509-vc-mu100 for mag up. Btw the difference geometry-wise is that in DetDesc we also have part of BCM.

Mag UP




Merge request reports