Other trigger/main

Table Of Contents

Previous topic

Electronics Simulation

Next topic


This Page

Daya Bay Links

Content Skeleton

Trigger Simulation


The Trigger Simulation is implemented in the TrigSim package. TrigSim takes an ElecHeader as input and produces a SimTrigHeader. See Figure fig::simtrigheader.



SimTrigHeader contains a single SimTrigCommandHeader which in turn potentially contains a SimTrigCommandCollection for each detector. Each SimTrigCommandCollection contains SimTrigCommands which correspond to an actual trigger.


The main algorithm in TrigSim, TsTriggerAlg has 3 properties which can be specified by the user.

Default:“TsMultTriggerTool” List of Tools to run.
Default:“TriggerAlg” Name of the main trigger algorithm for bookkeeping.
Default: “/Event/Electroincs/ElecHeader” Path of ElecSimHeader in the TES, currently the default is picked up from ElecSimHeader.h

The user can change the properties through the TrigSimConf module as follows:

import TrigSim
trigsim = TrigSim.Configure()
import TrigSim.TrigSimConf as TsConf
TsConf.TsTriggerAlg().TrigTools = [ "TsExternalTriggerTool" ]

The TrigTools property takes a list as an argument allowing multiple triggers to be specified. The user can apply multiple triggers as follows:

import TrigSim
trigsim = TrigSim.Configure()
import TrigSim.TrigSimConf as TsConf
TsConf.TsTriggerAlg().TrigTools = [ "TsMultTriggerTool" ,
                                    "TsEsumTriggerTool" ,
                                    "TsCrossTriggerTool" ]

The mutate method within each tool will be called once per event in the order in which they are listed.

Current Triggers

This section will describe specific trigger implementations. Most implementations will have properties which can be set like this:



A Multiplicity Trigger implementation. This will issue a local trigger when a specified number of channels are go over threshold within a given time window. This tool has two properties:

is a list of detectors for this trigger to work on. The default value for this property is a list containing all pmt based detectors. This tool loops over all detectors within the ElecHeader and checks it against those in the list. If the detector is in the list the tool issues all applicable triggers for that detector. If the detector is not found in the DetectorsToProcess list the detector is ignored.
sets the number of nhit clock cycles to wait after a trigger is issued before potentially issuing another trigger. The default value is 24 which corresponds to 300ns for the 80MHz clock.


An External Trigger implementation. This will issue a local triggers at a specified frequency. Currently used with the dark rate module for the MDC08. The properties are:

Same as TsMultTriggerTool in section TsMultTriggerTool.

TriggerOffset Frequency AutoSet

Adding a new Trigger

To add a new trigger type, create a new class which inherets from GaudiTool and ITsTriggerTool as shown here:

class TsMyTriggerTool : public GaudiTool,
                              virtual public ITsTriggerTool

  TsMyTriggerTool(const std::string& type,
                  const std::string& name,
                  const IInterface* parent);
  virtual ~TsMyTriggerTool();

  virtual StatusCode mutate(DayaBay::SimTrigHeader* trigHeader,
                            const DayaBay::ElecHeader& elecHeader);
  virtual StatusCode initialize();
  virtual StatusCode finalize();

  std::vector<std::string> m_detectorsToProcess;