21#include <fairlogger/Logger.h>
27 LOG(
debug) <<
"[EMCALRawToCellConverter - init] Initialize converter ";
32 LOG(error) <<
"Failure accessing geometry";
39 LOG(error) <<
"Failed to initialize mapper";
48 mPedestalData.
reset();
87 auto feeID = raw::RDHUtils::getFEEID(header);
88 auto triggerbits = raw::RDHUtils::getTriggerType(header);
109 const auto& map = mMapper->getMappingForDDL(feeID);
110 uint16_t iSM = feeID / 2;
113 int nBunchesNotOK = 0;
118 iRow = map.getRow(chan.getHardwareAddress());
119 iCol = map.getColumn(chan.getHardwareAddress());
120 chantype = map.getChannelType(chan.getHardwareAddress());
131 bool isLowGain =
false;
139 isLowGain = iRow == 0;
141 }
catch (ModuleIndexException& e) {
142 LOG(error) << e.what();
147 for (
auto& bunch : chan.getBunches()) {
148 for (
auto e : bunch.getADC()) {
167 if (cellID > 17664 || cellID < 0) {
168 throw ModuleIndexException(cellID, column,
row, etashift, phishift);
176 throw ModuleIndexException(moduleID);
188 static size_t contDeadBeef = 0;
190 const auto dh = o2::framework::DataRefUtils::getHeader<o2::header::DataHeader*>(
ref);
192 if (payloadSize == 0) {
194 if (++contDeadBeef <= maxWarn) {
195 LOGP(alarm,
"Found input [{}/{}/{:#x}] TF#{} 1st_orbit:{} Payload {} : assuming no payload for all links in this TF{}",
196 dh->dataOrigin.str, dh->dataDescription.str, dh->subSpecification, dh->tfCounter, dh->firstTForbit, payloadSize,
197 contDeadBeef == maxWarn ? fmt::format(
". {} such inputs in row received, stopping reporting", contDeadBeef) :
"");
216 std::vector<o2::framework::OutputSpec> outputs;
217 outputs.emplace_back(originEMC,
"PEDDATA", 0, o2::framework::Lifetime::Timeframe);
219 inputs.emplace_back(
"stdDist",
"FLP",
"DISTSUBTIMEFRAME", 0, o2::framework::Lifetime::Timeframe);
static const VerbosityConfig & Instance()
Error handling of the ALTRO Decoder.
Decoder of the ALTRO data in the raw page.
void decode()
Decode the ALTRO stream.
const std::vector< Channel > & getChannels() const
Get the reference to the channel container.
const std::vector< MinorAltroDecodingError > & getMinorDecodingErrors() const
Get list of minor decoding errors.
static Geometry * GetInstanceFromRunNumber(Int_t runNumber, const std::string_view="", const std::string_view mcname="TGeant3", const std::string_view mctitle="")
Instanciate geometry depending on the run number. Mostly used in analysis and MC anchors.
std::tuple< int, int > ShiftOnlineToOfflineCellIndexes(Int_t supermoduleID, Int_t iphi, Int_t ieta) const
Adapt cell indices in supermodule to online indexing.
Int_t GetAbsCellIdFromCellIndexes(Int_t nSupMod, Int_t iphi, Int_t ieta) const
Transition from super module number (nSupMod) and cell indexes (ieta,iphi) to cell absolute ID number...
Error handling requests for unknown hardware addresses.
const char * what() const noexcept override
Access to error message.
Error handling for invalid DDL IDs (not in range for EMCAL)
const char * what() const noexcept final
Access to the error message of the exception.
Handler providing the correct mapping for the given DDL.
Exchange container between PedestalProcessorDevice and PedestalAggregatorDevice.
void reset()
Reset object.
void fillADC(unsigned short adc, unsigned short tower, bool lowGain, bool LEDMON)
Fill ADC value for certain channel.
int getCellAbsID(int supermoduleID, int column, int row) const
bool isLostTimeframe(framework::ProcessingContext &ctx) const
void init(framework::InitContext &ctx) final
void run(framework::ProcessingContext &ctx) final
int geLEDMONAbsID(int supermoduleID, int moduleID) const
void sendData(framework::ProcessingContext &ctx, const PedestalProcessorData &data) const
Error handling of the raw reader.
const char * what() const noexcept override
Providing error message of the exception.
static const char * getErrorCodeTitles(ErrorType_t errortype)
Get title of error type.
@ HEADER_DECODING
Header cannot be decoded (format incorrect)
@ HEADER_INVALID
Header in memory not belonging to requested superpage.
static int ErrorTypeToInt(RawDecodingError::ErrorType_t errortype)
Convert error type to error code number.
ErrorType_t getErrorType() const
Get the type identifier of the error handled with this exception.
Reader for raw data produced by the Readout application in in-memory format.
bool hasNext() const
check if more pages are available in the raw file
const o2::header::RDHAny & getRawHeader() const
access to the raw header of the current page
void setRangeSRUDDLs(uint16_t minDDL, uint16_t maxDDL)
Set range for DDLs from SRU (for RCU trailer merging)
void next()
Read next payload from the stream.
gsl::span< const MinorError > getMinorErrors() const
Get minor (non-crashing) raw decoding errors.
void snapshot(const Output &spec, T const &object)
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
constexpr o2::header::DataDescription gDataDescriptionRawData
constexpr o2::header::DataOrigin gDataOriginEMC
@ EMCAL_LEDREFS
Number of LEDs (reference/monitors) per module for EMCAL; one per StripModule.
ChannelType_t
Type of a raw data channel.
@ HIGH_GAIN
High gain channel.
@ LOW_GAIN
Low gain channel.
@ LEDMON
LED monitor channel.
framework::DataProcessorSpec getPedestalProcessorDevice(bool askDistSTF)
std::vector< ConfigParamSpec > Options
static o2::header::DataHeader::PayloadSizeType getPayloadSize(const DataRef &ref)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"