20. Simulation#

The (detector) simulation package simulates how MC events appear in the detector (e.g. which tracks they leave). MC with detector simulation can then be processed in the same way as raw data, allowing for an accurate comparison that takes detector effects into account as well.

The core of the simulation library is Geant4, which is an external library. A simulation library module, FullSim, was created as a wrapper for the basf2 - Geant4 interface. The default input parameters for FullSim are stored in two places,

20.1. Geant4 version in the externals library#

The Geant4 version information is stored in the variable G4Version in the Geant4 source code global/management/include/G4Version.hh.

The history of Geant4 version information in the basf2 external library is as follows:

externals version

Geant4 version

v01-09-00 and later

10.6.1

v01-01-01 to v01-08-00

10.1.2

v00-04-00 to v01-00-00

9.6.2

v00-02-02 to v00-03-04

9.5.1

v00-02-00 to v00-02-01

9.5.0

v00-00-05 to v00-01-05

9.4.1

v00-00-01 to v00-00-04

9.3.0

To check the externals version of your current basf2 setup, use:

echo $BELLE2_EXTERNALS_VERSION

20.2. Physics list for Geant4#

PhysicsList collects information on all the particles, physics processes and production thresholds to be used in the detector simulation. This class is passed to the Geant4 run manager as the “physics configuration” of the application. basf2 has two options for the input physics list for Geant4.

20.2.1. The default physics list#

Until November 29, 2013, the default physics list parameter for FullSim was set as QGSP_VERT. After this day, the parameter was changed to FTFP_BERT, the popular physics list for high energy physics.

20.2.2. Belle2PhysicsList#

The second one is Belle2PhysicsList, optimized for the Belle II needs by the Geant4 experts. The details on the Belle2PhysicsList are explained below.

Note

The Belle2PhysicsList option became the default option with basf2 release 05-00-00.

20.3. Secondary particles#

20.4. FullSim#

20.5. Functions in simulation.py#

simulation.add_PXDDataReduction(path, components, pxd_unfiltered_digits='pxd_unfiltered_digits', doCleanup=True, overrideDB=False, usePXDDataReduction=True, save_slow_pions_in_mc=False)[source]#

This function adds the standard simulation modules to a path.

Parameters:
  • pxd_unfiltered_digits – the name of the StoreArray containing the input PXDDigits

  • overrideDB – override settings from the DB with the value set in ‘usePXDDataReduction’

  • usePXDDataReduction – if ‘overrideDB==True’, override settings from the DB

  • doCleanup – if ‘doCleanup=True’ temporary datastore objects are emptied

  • save_slow_pions_in_mc – if True, additional Regions of Interest on the PXD are created to save the PXDDigits of slow pions from D* -> D pi^{pm} decays using the MCSlowPionPXDROICreator based on MC truth information

simulation.add_simulation(path, components=None, bkgfiles=None, bkgOverlay=True, forceSetPXDDataReduction=False, usePXDDataReduction=True, cleanupPXDDataReduction=True, generate_2nd_cdc_hits=False, simulateT0jitter=True, isCosmics=False, FilterEvents=False, usePXDGatedMode=False, skipExperimentCheckForBG=False, save_slow_pions_in_mc=False)[source]#

This function adds the standard simulation modules to a path.

Parameters:
  • forceSetPXDDataReduction – override settings from the DB with the value set in ‘usePXDDataReduction’

  • usePXDDataReduction – if ‘forceSetPXDDataReduction==True’, override settings from the DB

  • cleanupPXDDataReduction – if True the datastore objects used by PXDDataReduction are emptied

  • simulateT0jitter – if True simulate L1 trigger jitter

  • isCosmics – if True the filling pattern is removed from L1 jitter simulation

  • FilterEvents – if True only the events that pass the L1 trigger will survive simulation, the other are discarded. Make sure you do need to filter events before you set the value to True.

  • skipExperimentCheckForBG – If True, skip the check on the experiment number consistency between the basf2 process and the beam background files. Note that this check should be skipped only by experts.

  • save_slow_pions_in_mc – if True, additional Regions of Interest on the PXD are created to save the PXDDigits of slow pions from D* -> D pi^{pm} decays using the MCSlowPionPXDROICreator based on MC truth information

simulation.check_simulation(path)[source]#

Check if the minimum number of modules required for simulation are in the path and in the correct order