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);
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);
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;
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
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.