![]() |
Project
|
Raw data creator for EMCAL raw data based on EMCAL digits. More...
#include <RawWriter.h>
Public Types | |
enum class | FileFor_t { kFullDet , kSubDet , kCRORC , kLink } |
Definition of the granularity of the raw files. More... | |
Public Member Functions | |
RawWriter ()=default | |
Dummy constructor. | |
RawWriter (const char *outputdir) | |
Constructor, defining output location. | |
~RawWriter ()=default | |
Destructor. | |
o2::raw::RawFileWriter & | getWriter () const |
Get access to underlying RawFileWriter. | |
void | setOutputLocation (const char *outputdir) |
void | setDigits (gsl::span< o2::emcal::Digit > digits) |
void | setFileFor (FileFor_t filefor) |
Set the granularity of the output file. | |
void | setNumberOfADCSamples (int nsamples) |
Set the number of ADC samples in the readout window. | |
void | setMinADCSamplesBunch (int nsamples) |
Set min. ADC samples expected in a calo bunch. | |
void | setPedestal (int pedestal) |
Set pedestal threshold used to accept ADC values when creating the bunches. | |
void | setGeometry (o2::emcal::Geometry *geo) |
Set the geometry parameters. | |
void | init () |
void | digitsToRaw (gsl::span< o2::emcal::Digit > digits, gsl::span< o2::emcal::TriggerRecord > triggers) |
Converting digits from a full timeframe to raw pages. | |
bool | processTrigger (const o2::emcal::TriggerRecord &trg) |
Processing digits to raw conversion for the digits from the current event. | |
int | carryOverMethod (const header::RDHAny *rdh, const gsl::span< char > data, const char *ptr, int maxSize, int splitID, std::vector< char > &trailer, std::vector< char > &header) const |
Protected Member Functions | |
void | createPayload (o2::emcal::ChannelData channel, o2::emcal::ChannelType_t chanType, int ddlID, std::vector< char > &payload, bool &saturatedBunch) |
std::vector< AltroBunch > | findBunches (const std::vector< o2::emcal::Digit * > &channelDigits, ChannelType_t channelType) |
Parse digits vector in channel and create ALTRO bunches. | |
ChannelHeader | createChannelHeader (int hardwareAddress, int payloadSize, bool isBadChannel) |
Create channel header. | |
std::vector< char > | createRCUTrailer (int payloadsize, double timesample, uint64_t triggertime, int feeID) |
Creating RCU trailer. | |
std::vector< int > | encodeBunchData (const std::vector< int > &data) |
Encoding words of the ALTRO bunch into 32-bit words. | |
int | getBranchIndexFromHwAddress (int hwaddress) |
Extracting branch index from the hardware address. | |
int | getFecIndexFromHwAddress (int hwaddress) |
Extracting FEC index in branch from the hardware address. | |
int | getChannelIndexFromHwAddress (int hwaddress) |
Extracting Channel index in FEC from the hardware address. | |
Raw data creator for EMCAL raw data based on EMCAL digits.
Definition at line 72 of file RawWriter.h.
|
strong |
Definition of the granularity of the raw files.
Enumerator | |
---|---|
kFullDet | Full detector (EMCAL + DCAL) |
kSubDet | Subdetector (EMCAL/DCAL separate) |
kCRORC | C-RORC card. |
kLink | Per link. |
Definition at line 77 of file RawWriter.h.
|
default |
Dummy constructor.
|
inline |
Constructor, defining output location.
outputdir | Output directiory |
Initializing the output directory. The output files can be found in the output directory with the granularity defined via setFileFor
Definition at line 93 of file RawWriter.h.
|
default |
Destructor.
int RawWriter::carryOverMethod | ( | const header::RDHAny * | rdh, |
const gsl::span< char > | data, | ||
const char * | ptr, | ||
int | maxSize, | ||
int | splitID, | ||
std::vector< char > & | trailer, | ||
std::vector< char > & | header | ||
) | const |
Definition at line 379 of file RawWriter.cxx.
|
protected |
Create channel header.
hardwareAddress | Hardware address |
payloadSize | Size of the payload of the channel in 10-bit ALTRO words |
isBadChannel | If true the channel is a bad channel at hardware level |
Definition at line 336 of file RawWriter.cxx.
|
protected |
bad channel status eventually to be added later
Definition at line 191 of file RawWriter.cxx.
|
protected |
Creating RCU trailer.
payloadsize | Size of the payload as 32bit word |
timesampe | Length of the time sample (for L1 phase calculation) |
triggertime | Time of the trigger (for L1 phase calculation) |
feeID | Link ID |
Creating RCU trailer. Also setting the values of the ALTRO Config registers based on the settings in the raw writer. The RCU trailer is then encoded and converted to 8-bit words.
Definition at line 346 of file RawWriter.cxx.
void RawWriter::digitsToRaw | ( | gsl::span< o2::emcal::Digit > | digits, |
gsl::span< o2::emcal::TriggerRecord > | triggers | ||
) |
Converting digits from a full timeframe to raw pages.
digits | Vector of digits belonging to the same timeframe |
triggers | trigger records with ranges in digits container of data for the various events in the timeframe |
Processing all events from within a timeframe. See processTrigger for more information about the digit to raw converion of a single event.
Definition at line 77 of file RawWriter.cxx.
Encoding words of the ALTRO bunch into 32-bit words.
data | ALTRO bunch information |
Converting ALTRO bunch into ALTRO words. For the ALTRO bunch the following structure is expected:
Definition at line 301 of file RawWriter.cxx.
|
protected |
Parse digits vector in channel and create ALTRO bunches.
channelDigits | Vector with digits in the channel for the current event |
Channels are parsed in a time-reversed order. Bunches are selected for ranges of digits where the ADC value is consecutively above the pedestal. Only bunches having a min. amount of ADC samples are selected.
Definition at line 248 of file RawWriter.cxx.
Extracting branch index from the hardware address.
hwaddress | Hardware address of the channel |
Definition at line 196 of file RawWriter.h.
Extracting Channel index in FEC from the hardware address.
hwaddress | Hardware address of the channel |
Definition at line 204 of file RawWriter.h.
Extracting FEC index in branch from the hardware address.
hwaddress | Hardware address of the channel |
Definition at line 200 of file RawWriter.h.
|
inline |
Get access to underlying RawFileWriter.
Definition at line 100 of file RawWriter.h.
void RawWriter::init | ( | ) |
Definition at line 27 of file RawWriter.cxx.
bool RawWriter::processTrigger | ( | const o2::emcal::TriggerRecord & | trg | ) |
Processing digits to raw conversion for the digits from the current event.
trg | Trigger record providing collision information and data range for the current event |
Digits are first sorted according to SRUs and within their channels and time samples. For each SRU and channel within the SRU calo bunches are created. In case at least one valid calo bunch is found channels are created, and they data words are organized in a raw stream, which is closed by the RCU trailer of the given stream. The content of the stream is then passed to the RawFileWriter for page splitting and output streaming.
Definition at line 85 of file RawWriter.cxx.
|
inline |
Definition at line 103 of file RawWriter.h.
Set the granularity of the output file.
filefor | Output granularity |
Output files can be created for
Definition at line 112 of file RawWriter.h.
|
inline |
Set the geometry parameters.
geo | EMCAL geometry |
Definition at line 128 of file RawWriter.h.
Set min. ADC samples expected in a calo bunch.
nsamples | Minimum number of ADC samples |
Definition at line 120 of file RawWriter.h.
Set the number of ADC samples in the readout window.
nsapmles | Number of time samples |
Definition at line 116 of file RawWriter.h.
Definition at line 102 of file RawWriter.h.
Set pedestal threshold used to accept ADC values when creating the bunches.
pedestal | Pedestal value |
Definition at line 124 of file RawWriter.h.