I am currently trying to simplify my geometry by replacing several complex magnet cryostats with a single prototype using a lattice. The cryostat contains two individually powered quadrupoles each.
I would have assumed replacing them with a lattice would work straight forward, since the concept of a lattice is to transfer particles into the prototype and track them there. However, while the geometry and materials are applied nicely to the replicas, the magnetic fields defined in the prototype are not.
Unlike tracking inside prototype geometry using local coordinates, tracking in magnetic fields is performed in the global coordinate system of FLUKA. In addition, the definition of magnetic fields directly in prototype regions would limit your simulation flexibility, since every replica will require its own prototype with unique field configuration.
Instead you may configure your geometry in a way that prototypes of cryostat and quadrupoles are independent. Their replicas instead should be placed altogether and separated by vacuum buffer regions.
Here is a simplified example of such configuration: