Project
Loading...
Searching...
No Matches
o2::emcal::RawWriter Class Reference

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::RawFileWritergetWriter () 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< AltroBunchfindBunches (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< charcreateRCUTrailer (int payloadsize, double timesample, uint64_t triggertime, int feeID)
 Creating RCU trailer.
 
std::vector< intencodeBunchData (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.
 

Detailed Description

Raw data creator for EMCAL raw data based on EMCAL digits.

Author
Markus Fasel marku.nosp@m.s.fa.nosp@m.sel@c.nosp@m.ern..nosp@m.ch, Oak Ridge National Laboratory
Hadi Hassan, Oak Ridge National Laboratory
Since
Jan 24, 2020

Definition at line 72 of file RawWriter.h.

Member Enumeration Documentation

◆ FileFor_t

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.

Constructor & Destructor Documentation

◆ RawWriter() [1/2]

o2::emcal::RawWriter::RawWriter ( )
default

Dummy constructor.

◆ RawWriter() [2/2]

o2::emcal::RawWriter::RawWriter ( const char outputdir)
inline

Constructor, defining output location.

Parameters
outputdirOutput 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.

◆ ~RawWriter()

o2::emcal::RawWriter::~RawWriter ( )
default

Destructor.

Member Function Documentation

◆ carryOverMethod()

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.

◆ createChannelHeader()

ChannelHeader RawWriter::createChannelHeader ( int  hardwareAddress,
int  payloadSize,
bool  isBadChannel 
)
protected

Create channel header.

Parameters
hardwareAddressHardware address
payloadSizeSize of the payload of the channel in 10-bit ALTRO words
isBadChannelIf true the channel is a bad channel at hardware level

Definition at line 336 of file RawWriter.cxx.

◆ createPayload()

void RawWriter::createPayload ( o2::emcal::ChannelData  channel,
o2::emcal::ChannelType_t  chanType,
int  ddlID,
std::vector< char > &  payload,
bool &  saturatedBunch 
)
protected

bad channel status eventually to be added later

Definition at line 191 of file RawWriter.cxx.

◆ createRCUTrailer()

std::vector< char > RawWriter::createRCUTrailer ( int  payloadsize,
double  timesample,
uint64_t  triggertime,
int  feeID 
)
protected

Creating RCU trailer.

Parameters
payloadsizeSize of the payload as 32bit word
timesampeLength of the time sample (for L1 phase calculation)
triggertimeTime of the trigger (for L1 phase calculation)
feeIDLink 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.

◆ digitsToRaw()

void RawWriter::digitsToRaw ( gsl::span< o2::emcal::Digit digits,
gsl::span< o2::emcal::TriggerRecord triggers 
)

Converting digits from a full timeframe to raw pages.

Parameters
digitsVector of digits belonging to the same timeframe
triggerstrigger 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.

◆ encodeBunchData()

std::vector< int > RawWriter::encodeBunchData ( const std::vector< int > &  data)
protected

Encoding words of the ALTRO bunch into 32-bit words.

Parameters
dataALTRO bunch information
Returns
Encoded ALTRO words

Converting ALTRO bunch into ALTRO words. For the ALTRO bunch the following structure is expected:

  • bunch size including bunch header size (2)
  • start time
  • ADC samples The input data is converted to 10 but ALTRO words and put on the stream.

Definition at line 301 of file RawWriter.cxx.

◆ findBunches()

std::vector< AltroBunch > RawWriter::findBunches ( const std::vector< o2::emcal::Digit * > &  channelDigits,
ChannelType_t  channelType 
)
protected

Parse digits vector in channel and create ALTRO bunches.

Parameters
channelDigitsVector 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.

◆ getBranchIndexFromHwAddress()

int o2::emcal::RawWriter::getBranchIndexFromHwAddress ( int  hwaddress)
inlineprotected

Extracting branch index from the hardware address.

Parameters
hwaddressHardware address of the channel

Definition at line 196 of file RawWriter.h.

◆ getChannelIndexFromHwAddress()

int o2::emcal::RawWriter::getChannelIndexFromHwAddress ( int  hwaddress)
inlineprotected

Extracting Channel index in FEC from the hardware address.

Parameters
hwaddressHardware address of the channel

Definition at line 204 of file RawWriter.h.

◆ getFecIndexFromHwAddress()

int o2::emcal::RawWriter::getFecIndexFromHwAddress ( int  hwaddress)
inlineprotected

Extracting FEC index in branch from the hardware address.

Parameters
hwaddressHardware address of the channel

Definition at line 200 of file RawWriter.h.

◆ getWriter()

o2::raw::RawFileWriter & o2::emcal::RawWriter::getWriter ( ) const
inline

Get access to underlying RawFileWriter.

Returns
RawFileWriter

Definition at line 100 of file RawWriter.h.

◆ init()

void RawWriter::init ( )

Definition at line 27 of file RawWriter.cxx.

◆ processTrigger()

bool RawWriter::processTrigger ( const o2::emcal::TriggerRecord trg)

Processing digits to raw conversion for the digits from the current event.

Parameters
trgTrigger 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.

◆ setDigits()

void o2::emcal::RawWriter::setDigits ( gsl::span< o2::emcal::Digit digits)
inline

Definition at line 103 of file RawWriter.h.

◆ setFileFor()

void o2::emcal::RawWriter::setFileFor ( FileFor_t  filefor)
inline

Set the granularity of the output file.

Parameters
fileforOutput granularity

Output files can be created for

  • Whole EMCAL
  • Subdetector (EMCAL or DCAL)
  • Link

Definition at line 112 of file RawWriter.h.

◆ setGeometry()

void o2::emcal::RawWriter::setGeometry ( o2::emcal::Geometry geo)
inline

Set the geometry parameters.

Parameters
geoEMCAL geometry

Definition at line 128 of file RawWriter.h.

◆ setMinADCSamplesBunch()

void o2::emcal::RawWriter::setMinADCSamplesBunch ( int  nsamples)
inline

Set min. ADC samples expected in a calo bunch.

Parameters
nsamplesMinimum number of ADC samples

Definition at line 120 of file RawWriter.h.

◆ setNumberOfADCSamples()

void o2::emcal::RawWriter::setNumberOfADCSamples ( int  nsamples)
inline

Set the number of ADC samples in the readout window.

Parameters
nsapmlesNumber of time samples

Definition at line 116 of file RawWriter.h.

◆ setOutputLocation()

void o2::emcal::RawWriter::setOutputLocation ( const char outputdir)
inline

Definition at line 102 of file RawWriter.h.

◆ setPedestal()

void o2::emcal::RawWriter::setPedestal ( int  pedestal)
inline

Set pedestal threshold used to accept ADC values when creating the bunches.

Parameters
pedestalPedestal value

Definition at line 124 of file RawWriter.h.


The documentation for this class was generated from the following files: