Truth digitization using art Filter and Producer

This section is intended to prepare the user on how to run the truth digitization step.

Calorimeter truth digitization chain

Please refer to a previous collaboration talk on the overview of the calorimeter truth digitization chain:

Quick start guide

You can run the digitization chain using the gm2 releases in cvmfs. Go to the gm2analyses (develop branch) folder for this talk at


and run the digitization step using the following command:

source /cvmfs/
setup gm2 v7_06_06 -q prof
gm2 -c ./caloDigitization.fcl -S data.list -n 8000

The first two are just to select the proper gm2 release and can be skipped if you have done it.

1. Fill Building

The fill builder's main function is to convert an art single-muon event to a Muon g-2 fill event (typically 16,000 stored muons per fill). It is simply an accumulator for all the ArtRecords stored in each event. LookupArtRecords is the one relevant for the calorimeter truth digitization chain. It is a list of arrival times of detected photons at the calorimeter SiPMs.

Location in the repository:


Set the number of muon events to be stored in a fill event, N_{store}
Create a counter to count number of muon events 
Create pointers for new truth containers

For each event

        Get the handles to the original truth containers
        Append the original truth containers to the new truth containers
        Increment the counter

        If the counter is equal to N_{store}

                Store the new truth containers
                Reset the counter
                Clear the new truth containers
                Create this event as the new fill event

Example Configuration

       filler: {
         MaxEventsPerFile: -1
         StoredMuons: 8000
         StoredMuonsSigma: 500
         module_type: "FillBuilder" 
         KeepKillTracks : false
         KeepTrajectories : false
parameters of interest:
  • MaxEventsPerFile: Number of events you want to process from each single muon event file.
  • StoredMuons: Number of stored muons per fill event.
  • StoredMuonsSigma: Introduce some statistical fluctuation for number of stored muons per fill event.
  • KeepKillTracks: Turn off the storage of KillTracksArtRecord to improve speed and to reduce memory usage.
  • KeepKillTrajectories: Same as above.

2. Waveform Building

The waveform builder takes LookupArtRecords and produces 24 CaloRiderArtRecord. Each photon will generate a tiny pulse based on the measured (close to) single pixel response of a silicon photomultiplier (SiPM). A realistic model of the waveform digitizer is implemented to include the noise and the jittering of the clock.

Location of the code in repository:


Set the pedestal level, noise level, max time to digitize, etc
Create pointers for new full waveform containers (for each calorimeter)

For each fill event

        Get the handle to the detected photon container
        Store the photon arrival times as vector for each SiPM
        Initialize empty waveform for each SiPM
        Add a SiPM single pixel response to the waveform for each photon
        Apply digitizer behavior to the waveform of each SiPM
        Store the full waveforms

Example configuration

       waveformBuilder: {
         caloInstanceLabel: "caloFill" 
         caloModuleLabel: "filler" 
         hitCollectionLabel: "LookupHit" 
         maxTime: 700000
         module_type: "WaveformBuilder" 
         pedestalLevel: 1750
         riderInstanceLabel: "pulseBuilder" 
         usePositivePolarity: false
parameters of interest:
  • hitCollectionLabel: By default we use the fast Cherenkov lookup hits. Can be switched to use PhotodetectorPhotons from full optical photon tracking.
  • maxTime: The maximum time in ns for the waveform digitization. Use a smaller value for quick test.
  • pedestalLevel: Digitizer pedestal level. It is being set to as close as possible to the value of the real digitizers.
  • usePositivePolarity: Set to false to use negative polarity so that it is the same as the real digitizers.

3. Island Chopping

The island chopper takes 24 CaloRiderArtRecord and produces CaloIslandArtRecords. This step is to mimic the GPU island chopping algorithm implemented in the DAQ frontend to reduce the data throughput. A full waveform of 700 us is chopped, whenever there is an over-threshold ADC sample in any of the 54 SiPM arrays, into islands of about 40 samples each and are stored.

Location in the repository:


Set the trigger method, trigger level, number of pre-trigger samples, number of post-trigger samples, etc

For each fill event

        For each calorimeter

                Get the handle to the full waveforms
                Check if any of the ADC sample in any 54 waveforms is over threshold

                If not go to the next calorimeter

                If yes, get a vector of triggered indices regardless of which waveform they come from

                Define start index as triggered index - number of pre-trigger samples
                Define end index as triggered index + number of post-trigger samples
                Get a vector of (start index, end index) from the vector of triggered indices

                For each vector of (start index, end index) 
                         Chop out the all the samples from start index to end index from 54 waveforms <-- chopped islands
                         Store each 54-short-waveforms (islands) as a MatrixIsland

                Store all MatrixIslands as CaloIsland

Store all CaloIslands into the event

Example configuration

islandChopper: {
         islandInstanceLabel: "chopper" 
         module_type: "IslandChopper" 
         waveformInstanceLabel: "pulseBuilder" 
         waveformModuleLabel: "waveformBuilder" 
         triggerMethod: "pulseShape" 
         preSamples: 8
         postSamples: 24
         threshold: 50
parameters of interest:
  • triggerMethod: By default it is pulseShape method. It is demonstrated that it has a higher signal-over-noise ratio than the runningSum method which is also available in this module.
  • preSamples: Number of sample to be chopped before the trigger index.
  • postSamples: Number of sample to be chopped after the trigger index.
  • threshold: Not an actual ADC - pedestal threshold. Actual value is recalculated depending on the triggerMethod.