DaqEvent package
Offline Documentation: [Offline Category] [FAQ] [Howto] [Reference] [Manual] |
Offline Documentation |
This article is part of the Offline Documentation |
Other pages... |
Offline Category |
See also... |
Physicists who want to access the raw data of a readout event, i.e. the numbers output by the DAQ without any corrections, should use the DaqEvent
package.
N.B. To make sure the DaqEvent
classes are available, you need to run NuWa.py with the "--daq=on" option.
N.B.2 If you want to output (via the "-o" option) ReadoutHeader objects built from raw data you must run some algorithm that will load the data, such as the DaqBenchmark in the first example below.
Examples:
nuwa.py --daq="on" -n -1 --no-history --random=off \ -m "DaqBenchmark --daq-event" \ daq.NoTag.0004342.ADCalib.SAB-AD1.SFO-1._0001.data \ daq.NoTag.0004342.ADCalib.SAB-AD1.SFO-1._0002.data
export DryDet=${SITEROOT}/dybgaudi/Detector/XmlDetDesc/DDDB/dayabay.xml nuwa.py --daq=on -G $DryDet -n 3 --no-history -R 20000 -m 'SpadeSvc -S ledmu' \ -m 'MDC10b.runLED_Muon.FullChain -s 20000 -E 10.0 -N 10 -I 80000 -l 400 -w 2010-01-03T08:00:00' \ -m 'DaqFormatOutput -b MDCLEDMU_RACF_F400_N10_G080000_D20000' \ -o MDCLEDMU_RACF_F400_N10_G080000_D20000.root
Initial Access
Initial access to the raw data of an event is made via an instance of the ReadoutHeader
class stored in either the TES of the AES. To access this from the TES one of the following statements can be used, depending on the language in use:
Python: readoutHdr = evt["/Event/Readout/ReadoutHeader"] C++: const DayaBay::ReadoutHeader* readoutHdr = get<DayaBay::ReadoutHeader>("/Event/Readout/ReadoutHeader");
The ReadoutHeader
class is a specialization of the HeaderObject
class, providing the Context of the event, which can be used to look up associated data from the Database using DBI, as well as a list off any other HeaderObject
instances, if any, that were used to create the contents of the event.
The ReadoutHeader
class itself provides access to the DaqCrate
instance that contains the raw DAQ data associated with the event.
Python: daqCrate = readoutHdr.daqCrate() C++: const DayaBay::daqCrate* daqCrate = readoutHdr->daqCrate();
DAQ Crate
Each event in the raw data represents the readout of a single DAQ VME crate. Common features of these crates are captured in the DaqCrate
class, while each type of VME is represented by its own subslass of this base class. Currently only the VME crates that readout out PMT are supported, in the form of the DaqPmtCrate
class.
DaqCrate
The DaqCrate
provides access to data that is common to all crates.
Detector
The ID of the detector that produced this readout. See the page describing Detector ID.
Python: detector = daqCrate.detector() C++: const DayaBay::Detector& detector = daqCrate->detector();
Trigger Time
The absolute time that the trigger was issued. See the page describing TimeStamp.
Python: triggerTime = daqCrate.triggerTime() C++: const TimeStamp& triggerTime = daqCrate->triggerTime();
Trigger Type
A number which describes the type of trigger that caused the detector to record this data. See the page describing Trigger Type.
Python: triggerType = daqCrate.triggerType() C++: Trigger::TriggerType_t triggerType = daqCrate->triggerType();
Trigger Number
The trigger number of the event as determined the the trigger board in the crate.
Python: triggerNumber = daqCrate.localTriggerNumber() C++: const unsigned int triggerNumber = daqCrate->localTriggerNumber();
Event Readout
The DAQ formatted raw data object containing all the data readout out by the DAQ for this event.
Python: eventReadout = daqCrate.eventReadout() C++: const DybDaq::EventReadout& eventReadout = daqCrate->eventReadout();
PMT Crate
DaqPmtCrate
The DaqPmtCrate
provides access to PMT channel data and the local trigger board in the crate (and which this event).
It access the PMT data it is necessary to confirm that the DaqCrate
is, indeed, a DaqPmtCrate
instance and if it is then getting that instance.
Python: if None != daqCrate.asPmtCrate(): ....
C++: const DayaBay::DaqPmtCrate* pmtCrate = daqCrate->asPmtCrate(); if (0 != pmtCrate) { .... }
PMT Channels
There are two ways to get channel data depending on whether all or just some channels are required. If all channels are needs then a list of DaqPmtChannel
instances can be retrived as follows:
Python: for channel in daqCrate.pmtChannelReadouts(): .... C++ const DaqPmtCrate::PmtChannelPtrList& channels = pmtCrate.pmtChannelReadouts(); const DaqPmtCrate::PmtChannelPtrList::const_iterator finished = channels.end(); for(DaqPmtCrate::PmtChannelPtrList::const_iterator channel = channels.begin(); finished != channel; ++channel) { const DaqPmtChannel* pmtChannel = *channel; .... }
On the other hand if only a few known channels are needed the following access can be used:
Python: if daqCrate.hasChannel(channelId): channel = pmtCrate.channel(channelId) .... C++: if (pmtCrate->hasChannel(channelId)) { const DaqPmtChannel& channel = pmtCrate->channel(channelId); .... }
Each channel provides indexed access to the following quantities using the usual accessor methods:
peakCycle |
isHighGainAdc |
preAdc |
adc |
tdc |
FADC Channels
As with the PMT channels, the FADC channels can be accessed individually or as a set.
Python: if daqCrate.hasChannel(fadcChannelId): channel = pmtCrate.channel(fadcChannelId) .... C++: if (pmtCrate->hasChannel(fadcChannelId)) { const DaqFadcChannel& fadcChannel = pmtCrate->channel(fadcChannelId); .... }
Python: for channel in daqCrate.fadcChannelReadouts(): .... C++: const DaqPmtCrate::FadcChannelPtrList& channels = pmtCrate.fadcChannelReadouts(); const DaqPmtCrate::FadcChannelPtrList::const_iterator finished = channels.end(); for(DaqPmtCrate::FadcChannelPtrList::const_iterator channel = channels.begin(); finished != channel; ++channel) { const DaqFadcChannel* fadcChannel = *channel; .... }
Each FAC channel has, apart from its channel id, a single attribute, its samples.
samples |
This attribute is returned as a sequence so can be accessed by the usual mechanism.
Python: for sample in fadcChannel.samples: .... C++ const DaqFadcChannel::FadcSamples& samples = channel.samples(); const DaqFadcChannel::FadcSamples::const_iterator finished = samples.end(); for (DaqFadcChannel::FadcSamples::const_iterator sample = samples.begin(); finished != sample; ++sample) { ... }
Local Trigger Board
The local trigger board crates one or more trigger frames per trigger. The following can be used to access all of the frames in a trigger.
Python: triggerBoard = daqCrate.localTriggerBoard() for frame in triggerBoard.frames(): .... C++ const DaqLtb& triggerBoard = pmtCrate.localTriggerBoard(); const DaqLtb::LtbFramePtrList& frames = triggerBoard.frames(); const DaqLtb::LtbFramePtrList::const_iterator finished = frames.end(); for(DaqLtb::LtbFramePtrList::const_iterator frame = frames.begin(); finished != frame; ++frame) { const DaqLtbFrame* ltbFrame = *frame; .... }
Each frame provides access to the following quantities using the usual accessor methods:
triggerType |
triggerTime |
hitSum |
totalEsum |
highEsum |
lowEsum |
energySum |
Offline Software Documentation: [Offline Categories] [FAQ] [Offline Documentation Category] |