12#ifndef O2_TOF_DCSCONFIGPROCESSOR_H
13#define O2_TOF_DCSCONFIGPROCESSOR_H
44 mVerbose = ic.options().get<
bool>(
"use-verbose-mode");
45 LOG(info) <<
" ************************* Verbose?" << mVerbose;
52 auto configBuff = pc.inputs().get<gsl::span<char>>(
"inputConfig");
53 auto configFileName = pc.inputs().get<std::string>(
"inputConfigFileName");
54 LOG(info) <<
"got input file " << configFileName <<
" of size " << configBuff.size();
57 sendOutput(pc.outputs(), configFileName);
75 std::map<std::string, std::string> md;
76 md.emplace(
"created_by",
"dpl");
79 int n = fileName.length();
80 char fileName_char[
n + 1];
81 strcpy(fileName_char, fileName.c_str());
82 std::vector<std::string> tokens;
83 const char* delimiters =
".";
84 const char* token = strtok(fileName_char, delimiters);
85 std::string startOfValidityStr =
"";
86 std::string runNumberStr =
"";
87 bool foundSOV =
false;
88 bool foundRUN =
false;
89 std::string timeStampLabel =
"sov";
90 std::string runNumberLabel =
"run";
93 std::string stoken(token);
94 auto idxInStringSOV = stoken.find(timeStampLabel);
95 auto idxInStringRUN = stoken.find(runNumberLabel);
96 if (idxInStringSOV != std::string::npos) {
98 stoken.erase(idxInStringSOV, timeStampLabel.length());
99 startOfValidityStr = stoken;
101 if (idxInStringRUN != std::string::npos) {
103 stoken.erase(idxInStringRUN, runNumberLabel.length());
104 runNumberStr = stoken;
106 token = std::strtok(
nullptr, delimiters);
109 LOG(fatal) <<
"SOV not found but needed!";
113 LOG(warning) <<
"RUN not found, will be left empty!";
115 LOG(
debug) <<
"startOfValidityStr = " << startOfValidityStr <<
", run = " << runNumberStr;
116 long tf = std::stol(startOfValidityStr) * 1E3;
117 md.emplace(
"runNumberFromTOF", runNumberStr);
122 LOG(info) <<
"Sending object " <<
info.getPath() <<
"/" <<
info.getFileName() <<
" of size " <<
image->size()
123 <<
" bytes, valid for " <<
info.getStartValidityTimestamp() <<
" : " <<
info.getEndValidityTimestamp();
130 bool mVerbose =
false;
141 std::vector<OutputSpec> outputs;
146 "tof-dcs-config-processor",
150 AlgorithmSpec{adaptFromTask<o2::tof::TOFDCSConfigProcessor>()},
Utils and constants for calibration and related workflows.
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
static std::string generateFileName(const std::string &inp)
static std::unique_ptr< std::vector< char > > createObjectImage(const T *obj, CcdbObjectInfo *info=nullptr)
static constexpr long MONTH
void run(o2::framework::ProcessingContext &pc) final
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void init(o2::framework::InitContext &ic) final
TOFFEElightInfo & getTOFFEElightInfo()
void loadFEElightConfig(const char *fileName)
int parseFEElightConfig(bool verbose=false)
constexpr o2::header::DataOrigin gDataOriginTOF
Defining ITS Vertex explicitly as messageable.
std::vector< InputSpec > Inputs
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::unique_ptr< GPUReconstructionTimeframe > tf
static constexpr o2::header::DataOrigin gDataOriginCDBWrapper
static constexpr o2::header::DataOrigin gDataOriginCDBPayload
static std::string getClassName(const T &obj)
get the class name of the object
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"