How is the geometry simulated in Gauss
Gauss and DetDesc, DDDB and CondDB
Gauss uses the geometry provided from the standard DetDesc and, starting from v30r3, DDDB and CondDB (the DC06 versions, v25rX, use instead XmlDDDB and XmlConditions). Gauss converts the geometry it is configured to simulate to the Geant4 description with a one-to-one mapping.
In the main options of Gauss the database to be used are specifying through the inclusion of the file
#include "$DDDBROOT/options/DC06.opts"
where the tags of the databases are speficied.
How the geometry to be simulated is passed to Geant4
The geometry to be simulated has to be passed in Gauss via options as
StreamItems of the
GiGaInputStream/Geo algorithm. The geometry used in a standard production is given in the file
SimGeometry.opts
that is available in
$GAUSSOPTS
When the execute method of the
Geo algorithm is called the first time, it triggers the convertion of the
DetectorElements in the list and all underlying Logical and Physical Volume structure in the corresponding equivalent structure of Geant4, as schematically described in the figure below.
Diagram of the convertion mechanism from LHCb geometry to Geant4 in Gauss
In the
SimGeometry.opts
file the geometry to be simulated is given at the level of detectors,
but you can also do it at the level of regions as indicated in the file itself.
For example simulating the VELO geometry is switched on by having the following line:
Geo.StreamItems += { "/dd/Structure/LHCb/BeforeMagnetRegion/Velo";
so that the Velo detector element and the whole geometry (LVolumes and PVolumes) belonging to it are simulated.
Since the regions are not given in the
StreamItems
list they are not known by Geant4, but the Detector elements given are positioned in the G4 World volume, that defines the (0,0,0) reference system and coincides with the LHCb one.
Modifying which geometry is to be simulated
Adding a new detector to simulate
If you want to add somethings else, for example in the "BeforeMagnetRegion", the following line
has to be added:
Geo.StreamItems += { "/dd/Structure/LHCb/BeforeMagnetRegion/NewDetector" };
provided that the
NewDetector
is available in the DDDB and correctly described in XML. Refer to the
Detector Description
and the
LHCb Conditions Database How-To for how to describe geometry and enter it in the DDDB.
How to remove a piece of apparatus
Since the geometry is listed as the
StreamItems
properties of the
Geo
algorithm, most detectors can be removed from the simulation by just removing them from the list. This can be done without modifying the default
SimGeometry.opts
by removing the specific detector in a steering option file with the following directive
Geo.StreamItems -= {....};
For an example you can look at the options
GaussVis.opts
available in the release (as usual all your modifing options should be after including the standard ones).
How to simulate a completely different geometry
It is also possible to simulate a completely different geometry in Gauss, for example a full VELO test beam setup,
by appropriately writing the
Geo.StreamItems
, provided the DetectorElements can be found in the Transient Detector Store.
Geometry and misalignement
The misalignment information is available in the LHCb geometry at the level of a DetectorElement and
by default Gauss uses information from the CondDB only for a DetectorElement passed as a
StreamItems
.
This can be quite cumbersome, since it can require quite a number of
StreamItems
to be specified and does not allow to apply misalignment to parents and children at the same time.
The way the information for the structure and geometry tree are used is schematically shown in the following figure
LHCb geometry structure and correspondence to that of Geant4
In Gauss v30r4 options are available to modify this behaviour: the misalignment is automatically taken into account by internally accessing the information of DetectorElements when necessary/possible and it is not necessary to specify the whole list of detector elements to misalign in the
StreamItems
. The misalignment is applied to parents and children in the geometry tree provided the children belong to a unique parent logical volume. When that is not the case a warning is printed and the default ideal geometry is used.
To enable this behaviour the following options of the GiGaGeo service need to be set:
GiGaGeo.UseAlignment = true;
GiGaGeo.AlignAllDetectors = true;
This will activate the use of CondDB values for all subdetectors.
Example options for simulating the open VELO is provided in
v200601-OpenVelo-BOff.opts
where the Conditions are overwritten in the options. The resulting geometry is shown in the following figure:
The Velo Open geometry when using the information from the conditions
It is possible to apply the misalignment to all dubdetectors or to access the information from the
CondDB only for some of them selectively, for example to only switch on the use of the misalignment information in CondDB for the VELO right half the options to use are:
GiGaGeo.UseAlignment = true;
GiGaGeo.AlignAllDetectors = false; // this is the default!!
GiGaGeo.AlignDetectors = {"/dd/Structure/LHCb/BeforeMagnetRegion/Velo/VeloRight"};
that will simulate the following geometry:
Velo geometry when applying misalignment only to the right half
--
GloriaCorti - 30 Oct 2007