SLAC PEP-II
BABAR
SLAC<->RAL
Babar logo
HEPIC E,S & H Databases PDG HEP preprints
Organization Detector Computing Physics Documentation
Personnel Glossary Sitemap Search Hypernews
Unwrap page!
Simulation Home
Sim Codes
Event Generators
Bogus/BgsApp
SimApp
Bear
Moose
Fast Simulation
Geant4 Home
Subsystems
PEP
SVT
DCH
DRC
EMC
IFR
Mixing/Trigger
Backgrounds
Mixing
Trigger Simulation
MC Truth/QA
MC Truth
Micro/Mini
QA Histograms
Sim Error Reports
REMEDY
MC Production
Production Home
Test Production
Tools
Database
CERNLIB
CLHEP
Event display
RandControl
Scripts
Check this page for HTML 4.01 Transitional compliance with the
W3C Validator
(More checks...)

Recipe for generating Monte Carlo events and producing Beta candidates with the Fast Simulation models


Introduction:

For detector design studies or other work requiring a high event production rate, detailed
simulations such as BgsApp are too slow. Typical rates for B0B0bar using BgsApp are
around 5 seconds per event. The aim of a fast simulation is to increase this rate by a factor
of ~100 to 1000. In general, such an increase in speed comes at the expense of detector detail
or the amount of information collected and stored for hits and tracks. Where the balance
between speed and detail is struck will be determined by the use to which the code is put.
In order to avoid the need for several different fast simulation executables.

Prerequisite for running the fast simulation program:

To use the "Bogus" fast simulation, you need to make a test release based on
release 14.0.3 or higher. Basic information for making a new release can be found here.
Then, add the following pakages with release 14.0.3:

BgsApp             V00-02-55
Bogus                V00-07-27

BgsCEPack        V00-03-08 
BgsDchSim        V00-02-24
BgsPepSim        V00-02-46
BgsSvtSim         V00-04-52
TrkBgsModules  V00-05-07
BgsEmcSim        V00-03-31  
work under progress
EmcBgsModules  V00-03-00   work under progress
EmcPid              V00-04-22
BgsFwkModule     (default)

A description of the design of the Emc for the fast simulation can be found here.

Other Useful Packages


After having created, compiled and linked the release, don't forget to initialise objectivity
with simdevboot or setboot even if you don't intend to write to the database as the simulation
program relies on the database to access many quantities related to the various subdetectors.
(An extensive description on how to run the Monte Carlo simulation in the general case can
be found here.
)

Before trying to run the program, you have to set several variables required to run Bogus
(Monte Carlo simulation in general can be found here)
in BgsApp/fastbgs.env . This is conveniently achieved by doing:

  source ../BgsApp/fastbgs.env (assuming you are in workdir)

BgsApp/fastbgs.env also enables the access to the fast simulation by setting the variable FASTMC to
"fast-param" to run the parameterized model or "fast-model"  for the so called fast-model which is a
less detailed version of the detector simulation.
Not setting FASTMC (unsetenv FASTMC) or setting it to "bogus" will run the
standard simulation program.

To run whichever simulation model just type from workdir directory

  BgsApp ../BgsApp/BgsUserExampleEvtGen.tcl

This will generate generic B events with EvtGen generator. Other Monte Carlo generator (as usual)
can be accessed by the other BgsUserExampleXXXX.tcl or by simply setting UDECAY to the appropriate
generator (not setting UDECAY generates BBbar event with EvtGen).


Parameters related to the fast-simulation module by module:

As working example one should look at the settings of the Fast Simulation in BgsApp/BgsFastSim.tcl.
Here I will mainly talk about the various setting used in BgsApp/BgsFastSim.tcl as they are the ones
you are likely to modify.

Parameters in Bogus module:

  • To interact with Bogus module

module talk Bogus                        talkto Bogus {   
parameter set "value"         or                     parameter set "value"
exit                                     }

    

  • For the bogus fast simulation (called fast-sim):
So far only Pep (ie: beam pipe and support tube surrounding the SVT),
SVT and DCH have fast simulation modules.
Therefore for fast-simulation the following bogus option should be set:

talkto Bogus {
  pepModel set "fast-model"  choose the model coresponding to the Bogus fast simulation for Pep
  svtModel set "fast-model"  "                                                                                " for SVT
  dchModel set "fast-model"  "                                                                                " for DCH
  emcModel set "none"        turn off the simulation of the Emc
  drcModel set "none"        turn off the simulation of the Dirc
  ifrModel set "none"        turn off the simulation of the Ifr
  rangeCut set 10000         limit secondary production, main speed improvement
}

  •   For the parametrized model (called fast-param)
This model is the fatest, few explanations about it can be found here (1).


Similarly to fast model, we ask bogus to use and activate parameters specific to the parametrize model:

module talk Bogus
  FastParam set true         Activate the parametrize model (see 1 for detail)
  pepModel set "none"        Turn off the simulation of the pep  (see ##)
  svtModel set "fast-param"  Choose the model coresponding to the parametrized model for the Svt
  dchModel set "fast-param"  Choose the model coresponding to the parametrized model for the Dch
  emcModel set "fast-CE-cylinder"  Choose the CEPack parametrized model for the EMC
  emcEM set 1 (or 0)         If 1 activate only the EM shower parameterization for e+ e- gamma
                                                   
Otherwise simulate also hadron assuming EMC a hadron calorimeter
  drcModel set "none"        Turn off the simulation of the Dirc
  ifrModel set "none"        Turn off the simulation of the Ifr
exit

(##) the simulation of pep is not completely turn off. As it is the case for the
       full simulation, the svt is embedded into pep volume (however here it is an
       empty space filled with vacuum to limit secondary productions)

Another speed inprovement has been found by using a "Barrel" modelisation of the
magnetic field

As we use here G4VFastSimulationModel, the BgsTransportation  does not work
Instead we use G4Transportation.

we also talk to bogus to set those parameters:

module talk Bogus
  BFACField set "barrel"   use barrel modelisation of the magnetic field
  useBgsTran set 0         use G4Transportation instead of BgsTransportation
exit



Parameters in TrkBgsModules:

Several parameter which regulate the use of TrkBgsModules (where the tracks
are reconstructed) are accessible from BgsApp/BgsFastSim.tcl
(it is encouraged to put modification to the default setting in
BgsApp/BgsAppPatches.tcl). To "talk" to the reco modules:


module talk TbmLoadVFTracking                    talkto TbmLoadVFTracking {   
parameter set "value"         or                     parameter set "value"
exit                                     }

 

The paramaters used are:

verbose (boolean)

DoTheFit (boolean)   If set to true, the program use the Billoire method to reconstruct the tracks
                                    from the hits and to determine tracks paramater and error matrix.
                                    otherwise the tracks informations is taken directly from the generator level
                   

makeTuple (boolean)  If set true will save tracks informations such as tracks parameter and their
                                      error, pulls, error matrix. If not set no info written to ntuple.


HitsInfo (boolean)       (required makeTuple set to true to be effective)
                                      If set to true, will fill an ntuple on the hits containing variables
                                      (ie hit position, momentum, Pt, radiation length, path length, and
                                      Id of the track to which it belongs).
                                      It must be noted that it is time consuming, and should not set to true
                                      for other purpose than debugging (it also takes a lots of space...
                                      ie about 40 hits per particles)




svtResScale (real)         Those two parameters are used to rescale the hit resolution (for svt and dch hits
dchResScale
(real)        separately) by a certain amount set through those parameter.
                                       The Default is 1. (no rescaling)

Parameters in EmcBgsModules:

It must be mentionned that all list name can be change.

module talk EmbmLoadVFCluster   (the name of this module is about to change)
parameter set "value"         
exit       

In terms of parameter, only one can be altered for the moment:
DoOnlyNeutral (boolean)   If set to true, the EmcCand list will be filled with neutral candidates only


Comparison between fast simulation models and moose:

In order to compare between the various models, 5000 generic BBbar events have been generated and
reconstructed using moose and both fast simulation models. The same random seeds were used for the 3
models. This way, we insure a proper comparison since the same events are generated for the 3 models
and only the track reconstruction differs. Plots were generated with this kumac file.

In terms of speed the Bogus fast model is relatively slow,  some improvement is achieved by limiting
the production of secondaries (described previously). The maximum speed which can be achieved is
of the order of 3 events per second.
The parametrized model is much faster, in its current tuning it processes about 55 events per second counting
only the tracking and about  25 events per second for producing Beta Candidate with both charged and neutrals.



   Example of BetaCandidate Production with  Parameterized Fast Simulation ( based on 5000 evts)

  Bogus Fast Simulation
                Parameterized Fast Simulation
Tracking (Svt+Dch)
    330 ms/evt (3 evt/s)    
                         18 ms/evt (55 evt/s)
 BgsEmcSim (BgsCEPack)*

      9 ms/evt (e+,e-,gamma)  21ms/evt (EM+all hadron)
        Total Svt+Dch+Emc

  27 ms/evt (only EM shower) 40ms/evt (EM+all hadron)
TrkBgsModules (track reco)

                       5 ms/evt (no ntupling)
EmcBgsModules (Emc reco)*
 0.6 ms/evt (e+,e-,gamma)  0.85 ms/evt (EM+all hadron)
 LoadRecoBtaCandidates*
1.75 ms/evt (e+,e-,gamma) 2.27 ms/evt (EM+all hadron)

             * work under progress
             * standard module

Comparison plots between Bogus fast simulation and moose: 
 
    • the green full circle is the Bogus fast model
    • the purple histo line and full square are for moose
Comparison plots between the parametrized model and moose:

    • the green full circle is for the parametrized model
    • the purple histo line and full square are for moose

Comparison plots between the Bogus fast model and parametrized model:

    • the green full circle is for the Bogus fast model
    • the purple histo line and full square are for the parametrized model




Page author: Dominique J. Mangeol
Last significant update: 24 July 2003