12#ifndef ALICEO2_EMCAL_RAWWRITER_H
13#define ALICEO2_EMCAL_RAWWRITER_H
138 void digitsToRaw(gsl::span<o2::emcal::Digit>
digits, gsl::span<o2::emcal::TriggerRecord> triggers);
151 const char*
ptr,
int maxSize,
int splitID,
152 std::vector<char>& trailer, std::vector<char>& header)
const;
163 std::vector<AltroBunch>
findBunches(
const std::vector<o2::emcal::Digit*>& channelDigits,
ChannelType_t channelType);
180 std::vector<char>
createRCUTrailer(
int payloadsize,
double timesample, uint64_t triggertime,
int feeID);
207 int mNADCSamples = 15;
209 int mMinADCBunch = 3;
212 std::string mOutputLocation;
213 std::unique_ptr<o2::emcal::MappingHandler> mMappingHandler;
214 gsl::span<o2::emcal::Digit> mDigits;
215 std::vector<SRUDigitContainer> mSRUdata;
216 std::unique_ptr<o2::raw::RawFileWriter> mRawWriter;
std::vector< uint16_t > nsamples
Utility class to write detectors data to (multiple) raw data file(s) respecting CRU format.
EMCAL geometry definition.
Raw data creator for EMCAL raw data based on EMCAL digits.
std::vector< char > createRCUTrailer(int payloadsize, double timesample, uint64_t triggertime, int feeID)
Creating RCU trailer.
ChannelHeader createChannelHeader(int hardwareAddress, int payloadSize, bool isBadChannel)
Create channel header.
~RawWriter()=default
Destructor.
bool processTrigger(const o2::emcal::TriggerRecord &trg)
Processing digits to raw conversion for the digits from the current event.
void setNumberOfADCSamples(int nsamples)
Set the number of ADC samples in the readout window.
o2::raw::RawFileWriter & getWriter() const
Get access to underlying RawFileWriter.
FileFor_t
Definition of the granularity of the raw files.
@ kSubDet
Subdetector (EMCAL/DCAL separate)
@ kFullDet
Full detector (EMCAL + DCAL)
int getChannelIndexFromHwAddress(int hwaddress)
Extracting Channel index in FEC from the hardware address.
void setGeometry(o2::emcal::Geometry *geo)
Set the geometry parameters.
RawWriter(const char *outputdir)
Constructor, defining output location.
int getFecIndexFromHwAddress(int hwaddress)
Extracting FEC index in branch from the hardware address.
void setOutputLocation(const char *outputdir)
void setPedestal(int pedestal)
Set pedestal threshold used to accept ADC values when creating the bunches.
void setFileFor(FileFor_t filefor)
Set the granularity of the output file.
int getBranchIndexFromHwAddress(int hwaddress)
Extracting branch index from the hardware address.
std::vector< AltroBunch > findBunches(const std::vector< o2::emcal::Digit * > &channelDigits, ChannelType_t channelType)
Parse digits vector in channel and create ALTRO bunches.
void setMinADCSamplesBunch(int nsamples)
Set min. ADC samples expected in a calo bunch.
void createPayload(o2::emcal::ChannelData channel, o2::emcal::ChannelType_t chanType, int ddlID, std::vector< char > &payload, bool &saturatedBunch)
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
void setDigits(gsl::span< o2::emcal::Digit > digits)
void digitsToRaw(gsl::span< o2::emcal::Digit > digits, gsl::span< o2::emcal::TriggerRecord > triggers)
Converting digits from a full timeframe to raw pages.
RawWriter()=default
Dummy constructor.
std::vector< int > encodeBunchData(const std::vector< int > &data)
Encoding words of the ALTRO bunch into 32-bit words.
Header for data corresponding to the same hardware trigger.
ChannelType_t
Type of a raw data channel.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Structure for mapping digits to Channels within a SRU.
std::vector< Digit > digits
Encoding of ALTRO words (32 bit consisting of 3 10-bit words)
uint32_t mWord2
Bits 0 - 9 : Word 2.
uint32_t mZero
Bits 30 - 31 : zeroed.
uint32_t mWord0
Bits 20 - 29 : Word 0.
uint32_t mDataWord
Full data word representation.
uint32_t mWord1
Bits 10 - 19 : Word 1.