16#include "fmt/format.h"
50 mBlocking = ic.options().get<
bool>(
"blocking");
51 const int maxTimeBins = ic.options().get<
int>(
"max-time-bins");
58 const auto pedestalFile = ic.options().get<std::string>(
"pedestal-file");
59 if (pedestalFile.length()) {
60 LOGP(info,
"Setting pedestal file: {}", pedestalFile);
66 const int timeBins = mDigitDump.
update(padROCPos, cru,
data);
71 mRawReader.
setLinkZSCallback([
this](
int cru,
int rowInSector,
int padInRow,
int timeBin,
float adcValue) ->
bool {
86 auto finishFunction = [
this]() {
91 ic.services().get<
CallbackService>().set<CallbackService::Id::Stop>(finishFunction);
96 const auto validInputs = pc.inputs().countValidInputs();
100 std::this_thread::sleep_for(std::chrono::milliseconds(1000));
101 LOGP(info,
"wait for next event stop {}", mEventDisplayGUI.
isStopRequested());
105 LOGP(info,
"call end processing");
106 pc.services().get<
ControlService>().readyToQuit(QuitRequest::All);
118 LOGP(info,
"processing tF {}",
tf);
128 std::for_each(mDigits.begin(), mDigits.end(), [](
auto&
vec) { vec.clear(); });
130 copyDigits(pc.inputs());
141 std::unique_ptr<std::thread> mGUIThread;
144 bool mUseDigits{
false};
145 bool mBlocking{
false};
149 std::vector<InputSpec>
filter = {
153 auto const* sectorHeader = DataRefUtils::getHeader<o2::tpc::TPCSectorHeader*>(inputRef);
154 if (sectorHeader ==
nullptr) {
155 LOG(error) <<
"sector header missing on header stack for input on " << inputRef.spec->binding;
158 const int sector = sectorHeader->sector();
159 mDigits[sector] = inputs.
get<std::vector<o2::tpc::Digit>>(inputRef);
166 const bool useDigitsAsInput = inputSpec.find(
"DIGITS") != std::string::npos;
167 std::vector<OutputSpec> outputs;
170 "tpc-monitor-workflow",
173 AlgorithmSpec{adaptFromTask<TPCMonitorDevice>(useDigitsAsInput)},
175 {
"pedestal-file", VariantType::String,
"", {
"file with pedestals and noise for zero suppression"}},
176 {
"max-time-bins", VariantType::Int, 114048, {
"maximum number of time bins to show"}},
177 {
"blocking", VariantType::Bool,
false, {
"block processing until next event is received"}},
Utils and constants for calibration and related workflows.
o2::framework::DataAllocator::SubSpecificationType SubSpecificationType
GUI for raw data event display.
o2::header::DataHeader::SubSpecificationType SubSpecificationType
unsigned char region() const
void setNumberOfProcessedTimeBins(size_t timeBins)
number of processed time bins in last event
Int_t update(const PadROCPos &padROCPos, const CRU &cru, const gsl::span< const uint32_t > data)
void incrementNEvents()
increment number of events
void setDigits(std::array< std::vector< Digit >, Sector::MAXSECTOR > *digits)
set external digits
void setPresentEventNumber(size_t eventNr)
set present event number
size_t getNumberOfProcessedTimeBins() const
number of processed time bins in last event
Pedestal calibration class.
void clearDigits()
clear the digits
void setTimeBinRange(int first, int last)
set the timeBin range
void init()
initialize DigitDump from DigitDumpParam
std::vector< Digit > & getDigits(int sector)
return digits for specific sector
void setPedestalAndNoiseFile(std::string_view fileName)
pedestal file name
void setInMemoryOnly(bool mode=true)
set in memory only mode
Int_t updateCRU(const CRU &cru, const Int_t row, const Int_t pad, const Int_t timeBin, const Float_t signal) final
not used
static Mapper & instance(const std::string mappingDir="")
const PadRegionInfo & getPadRegionInfo(const unsigned char region) const
Pad and row inside a ROC.
unsigned char getGlobalRowOffset() const
static constexpr int MAXSECTOR
bool isProcessingEvent() const
bool isStopRequested() const
void resetUpdatingDigits()
void setDataAvailable(bool available)
void startGUI(int maxTimeBins=114048)
void resetNextEventReqested()
bool isNextEventRequested() const
bool isWaitingForDigitUpdate() const
SimpleEventDisplay & getEventDisplay()
TPCMonitorDevice(bool useDigits)
void init(o2::framework::InitContext &ic) final
void run(o2::framework::ProcessingContext &pc) final
RawReaderCRU & createReader(const std::string_view inputFileName, uint32_t numTimeBins=0, uint32_t link=0, uint32_t stream=0, uint32_t debugLevel=0, uint32_t verbosity=0, const std::string_view outputFilePrefix="")
create a new raw reader
auto & getReaders()
return vector of readers
void setLinkZSCallback(LinkZSCallback function)
set a callback function for decoded LinkZS data
void setADCDataCallback(ADCDataCallback function)
set a callback function
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > select(char const *matcher="")
uint64_t processRawData(o2::framework::InputRecord &inputs, std::unique_ptr< o2::tpc::rawreader::RawReaderCRU > &reader, bool useOldSubspec=false, const std::vector< int > §ors={}, size_t *nerrors=nullptr, uint32_t syncOffsetReference=144, uint32_t decoderType=1, bool useTrigger=true, bool returnOnNoTrigger=false)
Global TPC definitions and constants.
o2::framework::DataProcessorSpec getMonitorWorkflowSpec(std::string inputSpec="tpcraw:TPC/RAWDATA")
std::unique_ptr< GPUReconstructionTimeframe > tf
std::vector< o2::ctf::BufferType > vec
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"