Manual:Reading Raw Data

From Daya Bay
Jump to navigation Jump to search

Readout data is the raw, uncalibrated data produced by the experiment. Each readout corresponds to the data caused by one trigger of one detector.

This topic covered the original ReadoutEvent package. The newer, more efficient, DaqEvent package is now available as a faster replacement for this code.

Quick Reference

Detailed description

Readout Header

Class Description

This class is a simple container for detector readout data. It contains one readout, and the context for that readout.

 Python: readoutHdr = evt["/Event/Readout/ReadoutHeader"]
 C++:    DayaBay::ReadoutHeader* readoutHdr = get<DayaBay::ReadoutHeader>("/Event/Readout/ReadoutHeader");


Class Description

The context for data is a combination of the site, detector, time, and real/simulation marker. The context is used to look up data that is associated with this event from the Database. See the page describing Context.

   Python: readoutHdr.context()
   C++:    readoutHdr->context();


Class Description

The readout is the raw data produced by one trigger of one detector. See the full description below.

   Python: readout = readoutHdr.readout()
   C++:    DayaBay::Readout* readout = readoutHdr->readout();


Class Description

A readout is the raw data produced by one trigger of one detector in the experiment. It contains information about the trigger that generated the data, as well as a collection of the raw data from each electronics channel in the detector.

A readout can be one of two types: a readout from a detector of PMTs (AD, Water veto), or a readout of a detector of RPCs.

A readout contains the following data:


Class Description

The ID of the detector that produced this readout. See the page describing Detector ID.

   Python: readout.detector()
   C++:    readout->detector();

Trigger Type

Class Description

A number which describes the type of trigger that caused the detector to record this data. See the page describing Trigger Type.

   Python: readout.triggerType()
   C++:    readout->triggerType();

Trigger Number

The current trigger number as defined by the data acquisition system.

   Python: readout.triggerNumber()
   C++:    readout->triggerNumber();

Trigger Time

Class Description

The absolute time that the trigger was issued. See the page describing TimeStamp.

   Python: readout.triggerTime()
   C++:    readout->triggerTime();

PMT Detector Readout

Class Description

A PMT crate readout is a specific type of readout for PMT detectors. This can be either an Anti-neutrino detector, an Inner Water Veto detector, or an Outer Water Veto detector.

 Python: readout = readoutHdr.readout()
 C++:    DayaBay::Readout* readout = readoutHdr->readout();
         DayaBay::ReadoutPmtCrate* pmtReadout = dynamic_cast<DayaBay::ReadoutPmtCrate*>(readout);

A readout of a PMT detector, it will contain the following additional data:

PMT Channel Data

Class Description

A PMT readout contains a list of the PMT channel data produced by the one trigger.

 Python: for channelPair in readout.channelReadout():
                   channel = channelPair.second
 C++:    DayaBay::ReadoutPmtCrate::PmtChannelReadouts channelMap = readoutCrate->channelReadout();
         DayaBay::ReadoutPmtCrate::PmtChannelReadouts::const_iterator pcrIter = channelMap.begin();
         for(; pcrIter!=channelMap.end(); ++pcrIter) {
             const DayaBay::ReadoutPmtChannel& channel = pcrIter->second;
             /* Do Something */

See the full details in the next section.

PMT Channel Data

Class Description

A readout will contain a collection of data with one entry from each front-end electronics (FEE) channel that generated data in the trigger. Each channel receives signals from one PMT.

The channel data contains the following:

FEE Channel ID

Class Description

This integer ID number contains the site, detector, board, and connector number needed to uniquely identify each channel in the entire experiment. See the page which discusses Electronics Channel ID.

   Python: channel.channelId()
   C++:    channel.channelId();

Channel Mode

The front-end electronics can be configured to generate different data. The mode field records which type of data was generated. The default is peak-finding. See the page on the PMT Electronics for more details.

  • PeakFinding = 0x1
  • Waveform = 0x2
  • FADC = 0x4
   Python: channel.mode()
   C++:    channel.mode();

Number of Channel hits

A single FEE channel can record multiple PMT hits in a single triggered readout. The number of recorded hits is given by this variable. The FEE can record hits as close at 25ns. The DAQ can set a maximum number of hits for the channel to record (default is ???).

   Python: channel.size()
   C++:    channel.size();


The TDC is an integer count of the time between the time the PMT pulse arrived at the channel, and the time the trigger reads out the data. Therefore, a larger TDC = earlier time. The TDC counter operates at 640 MHz, therefore one TDC count ~= 1.5625 nanoseconds.

   Python: channel.tdc( hitIdx )
   C++:    channel.tdc( hitIdx );


The ADC is an integer count of the charge of the PMT pulse. It is 12 bits (0 to 4095). There are two ADC circuits for every PMT channel; these are referred to as Fine Range and Coarse Range. Only the Fine Range ADC is recorded by default. If the Fine Range ADC is saturated by a large PMT signal (near 4095), then the Coarse Range ADC is recorded instead.

For the current configuration of the PMTs and electronics, one PMT photoelectron makes about 20 high gain ADC counts and about 1 low gain ADC count. There is an offset (Pedestal) for each ADC of ~70 ADC counts (ie. no charge signal = ~70 ADC, 1 photoelectron = ~90 ADC, 2 p.e. = ~110 ADC, etc.)

TDC and ADC values are recorded in pairs. The ADC value is sampled every 25 ns (40 MHz), but not recorded. When a TDC value is recorded, the maximum ADC value in the following ~350 ns is recorded with this TDC value. If two TDC values occur within ~350 ns of each other, the second TDC value is assigned an ADC value of 0.

   Python: channel.adc( hitIdx )
   C++:    channel.adc( hitIdx );

ADC Range

This records whether the ADC value was produced by the Fine or Coarse range ADC.

  • Unknown = 0
  • Fine = 1
  • Coarse = 2
   Python: channel.adcRange( hitIdx )
   C++:    channel.adcRange( hitIdx );

ADC Cycle

The ADC value is measured every 25 ns (40 MHz). The ADC cycle is the time between the recorded TDC value and ADC value in 25 ns units.

   Python: channel.adcCycle( hitIdx )
   C++:    channel.adcCycle( hitIdx );

RPC Detector Readout

To Do...

Python Cheat Sheet

        evt = self.evtSvc()
        readoutHdr = evt["/Event/Readout/ReadoutHeader"]
        readout = readoutHdr.readout()

	if (readout.detector().isAd() 
	    or readout.detector().isWaterPool()):
            for channelPair in readout.channelReadout():
                channel = channelPair.second
                for hitIdx in range( channel.size() ):
                    tdc = channel.tdc( hitIdx )
                    adc = channel.adc( hitIdx )
                    adcRange = channel.adcRange( hitIdx )
                    adcCycle = channel.adcCycle( hitIdx )

        if readout.detector().isRpc():
            # No idea...

C++ Cheat Sheet

To do...