Other detector/quickstart

Table Of Contents

Previous topic

Kinematic Generators

Next topic

Electronics Simulation

This Page

Daya Bay Links

Content Skeleton

Detector Simulation

Quick Start with Truth Information

Besides hits, DetSim, through the Historian package can provide detailed truth information in the form of particle histories and unobservable statistics. These are briefly described next and in detail later in this chapter.

Particle History

As particles are tracked through the simulation information on where they traveled and what they encountered can be recorded. The particle history is constructed with tracks (SimTrack objects) and vertices (SimVertex objects). Conceptually, these may mean slightly different things than what one may expect. A vertex is a 4-location when something “interesting” happened. This could be an interaction, a scatter or a boundary crossing. Tracks are then the connection between two vertices.

Because saving all particle history would often produce unmanageably large results rules are applied by the user to specify some fraction of the total to save. This means the track/vertex hierarchy is, in general, truncated.

Unobservable Statistics

One can also collect statistics on unobservable values such as number of photons created, number of photon backscatters, and energy deposited in different ADs. The sum, the square of the sum and the number of times the value is recorded are stored to allow mean and RMS to be calculated. The same type of rules that limit the particle histories can be used to control how these statistics are collected.

Configuring Truth Information

The rules that govern how the particle histories and unobservable statistics are collected are simple logical statements using a C++ like operators and some predefined variables.

Configuring Particle Histories

The hierarchy of the history is built by specifying selection rules for the tracks and the vertices. Only those that pass the rules will be included. By default, only primary tracks are saved. Here are some examples of a track selection:

# Make tracks for everything that's not an optical photon:
trackSelection = "pdg != 20022"
# Or, make tracks only for things that start
# in the GD scintillator and have an energy > 1Mev
trackSelection =
  "(MaterialName == '/dd/Materials/GdDopedLS') and (E > 1 MeV)"

And, here are some examples of a vertex selection:

# Make all vertices.. one vertex per Step.
vertexSelection = "any"
# Make vertices only when a particle crosses a volume boundary:
vertexSelection = "VolumeChanged == 1"

As an aside, one particular application of the Particle Histories is to draw a graphical representation of the particles using a package called GraphViz [1]. To do this, put the DrawHistoryAlg algorithm in your sequence. This will generate files in your current directory named tracks_N.dot and tracks_and_vertices_N.dot, where N is the event number. These files can be converted to displayable files with GraphViz’s dot program.

Configuring Unobservable Statistics

What statistics are collected and when they are collected is controlled by a collection of triples:

  1. A name for the statistics for later reference.
  2. An algebraic formula of predefined variables defining the value to collect.
  3. A rule stating what conditions must be true to allow the collection.

An example of some statistic definitions:

stats = [
    ["PhotonsCreated" , "E" , "StepNumber==1 and pdg==20022" ]
   ,["Photon_bounce_radius" , "r" , "pdg==20022 and dAngle > 90" ]
   ,["edep-ad1"  ,"dE"  ,"pdg!=20022 and
      ((MaterialName == '/dd/Materials/LiquidScintillator' or
        MaterialName == '/dd/Materials/GdDopedLS') and AD==1)"  ]

Accessing the resulting truth information

The resulting Truth information is stored in the SimHeader object which is typically found at /Event/Sim/SimHeader in the event store. It can be retrieved by your algorithm like so:

DayaBay::SimHeader* header = 0;
if (exist<DayaBay::SimHeader>(evtSvc(),m_location)) {
   header = get<DayaBay::SimHeader>(m_location);
const SimParticleHistory* h = header->particleHistory();
const SimUnobservableStatisticsHeader* h = header->unobservableStatistics();