Electronics Simulation Port

From Daya Bay
Jump to navigation Jump to search


As of the April 2008 Workshop the simulation of Daya Bay's electronics was in a stand-alone set of classes. The purpose of this topic is to help coordinate the port of those classes in to ones that can operate in the dybgaudi context.

Initial Structure

The existing code for the whole electronics simulation can be found in the found packages of the dybgaudi project:


with the following python script being used to exercise the simulation:


More complete details can be found in Dan's and Brandon's presentations at the workshop.

The basic script chains six modules together to take one or more Geant4 input files and produce a ROOT output file. The six modules are:

  1. DSMCReader- This reads the Geant4 input files and creates a ESHitCollection containing ESPmtHits.
  2. ESPMTHitTool - This takes the existing ESHitColleciton and modifies it to allow for noise, etc., to create signal hits
  3. ESIdealFEETool - This takes the signal hits and processes them to generate ESFEECrate objects.
  4. DSSimpleTriggerTool - This takes the ESFEECrate objects and determines the trigger decision.
  5. DSSimpleFPGATool - This takes the trigger decision and based on that creates the readout data structures.
  6. DSFEEReadoutWriter - This stores the resulting readouts to a file.

The basic data types need to be outlined here

The Plan

At the top level we want to do the following:

  • Migrate all the code into Gaudi and make it work (this is currently in progress).
  • Factor out functionality of the code into a Gaudi Tool so that it can be used both in this standalone configuration and also in the 'pull' model.

Fill in the rest of the plan here

Migration to GaudiAlgorithms

At first cut, there is a one-to-one mapping between the original modules and a GaudiAlgorithm. The following table shows that mapping as well as showing who is responsible for porting the existing version of the code. (Note: Name in parenthesis are just the names of the skeleton classes and may not be the final names.)

Module to Algorithm mapping
Existing GaudiAlgorithm Assigned to
DSMCReader TBD Simon
ESPMTHitTool ESCreateSignalHits Simon
ESIdealFEETool TBD (ESIdealFEE) Dan
DSSimpleTriggerTool TBD (SimpleTrigger) Brandon
DSSimpleFPGATool TBD (SimpleFPGA) Brandon
DSFEEReadoutWriter TBD Simon

Migrating the Data Structures

Only the input and output data structures of any module need be migrated to a Gaudi Event Store. Thus looking at the modules we see the following structures need to be migrated.

See note structure output from input to Assigned to
1 list of PMT hits ESPMTHitTool Simon
2 map of PMT properties ESPMTHitTool & (ESIdealFEE) Simon
3 detector's list of PMT hits ESPMTHitTool (ESIdealFEE) Simon
4 map of Channel properties (ESIdealFEE) Simon
5 an FEE crate state (ESIdealFEE) (ESSimpleTrigger) & (ESSimpleFPGA) Brandon
6 an trigger (ESSimpleTrigger) (ESSimpleFPGA) Brandon
7 a completed Readout (ESSimpleFPGA) Brandon


  1. This is a ObjectVector of PMT hits - thus a PMT hit must be be a ContainedObject.
  2. This is a KeyedContainer of PMT props - thus a PMT props must be a KeyEdObject.
  3. This is a container derived from ObjectVector to add a detector attribute.
  4. To be documented.
  5. To be documented.
  6. This is a ObjectVector of TriggerCommands - thus a Trigger Command must be a ContainedObject .
  7. To be documented.

Factoring out a Gaudi Tool

This stage is waiting for the module migration to be completed.


The development project can currently be found at the following location:


Currently this contains:

  • The complete implementation for the following modules:
    • ESCreateSignalHits (in the ElecSim package)
  • Skeletons for the remaining three main processing modules (i.e. not the input and output ones)
    • ESIdealFEE (in the ElecSim package)
    • ESSimpleTrigger (currently in the ElecSim package)
    • ESSimpleFPGA (currently in the ElecSim package)
  • The following data definitions are in the ElectronicsEvent package:
    • ESHit
    • ESPMTHit
    • ESPMTProps
    • ESFEEChannelProps
    • ESDetectorPMTHits
  • A Helper module, ESSetupMock that initializes the data structures.
  • A script, RunESPort.py, that runs the processing chain using the skeleton implementations.