38 LOG(
debug) <<
"Init CalibInfo reader!";
40 mFile = fopen(fname.c_str(),
"r");
42 LOG(error) <<
"Cannot open the " << fname <<
" file !";
57 if ((mTree && mCurrentEntry < mTree->GetEntries()) || fscanf(mFile,
"%s",
filename) == 1) {
58 if (!mTree || mCurrentEntry >= mTree->GetEntries()) {
60 mTree = (TTree*)fin->Get(
"calibTOF");
62 if (mTree->GetBranch(
"TOFCalibInfo")) {
63 mTree->SetBranchAddress(
"TOFCalibInfo", &mPvect);
65 mTree->SetBranchAddress(
"TOFDiaInfo", &mPdia);
70 for (
unsigned long i = 0;
i < mTree->GetEntries();
i++) {
73 mIndices.push_back(std::make_pair(
i, info.tfCounter));
75 std::sort(mIndices.begin(), mIndices.end(),
76 [&](
const auto&
a,
const auto&
b) {
77 return a.second < b.second;
80 if ((mGlobalEntry % mNinstances) == mInstance) {
81 mTree->GetEvent(mIndices[mCurrentEntry].
first);
86 timingInfo.tfCounter = info.tfCounter;
87 timingInfo.runNumber = info.runNumber;
89 timingInfo.creation = info.creation;
92 LOG(
debug) <<
"Current entry " << mCurrentEntry;
93 LOG(
debug) <<
"Send " << mVect.size() <<
" calib infos";
111 std::vector<OutputSpec> outputs;
114 std::string nameSpec =
"tof-calibinfo-reader";
118 if (ninstances > 1) {
119 nameSpec += fmt::format(
"-{:d}", instance);
129 Options{{
"input-dir", VariantType::String,
"none", {
"Input directory"}}}};
Definition of the Names Generator class.
T get(const char *key) const
void snapshot(const Output &spec, T const &object)
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
ServiceRegistryRef services()
The services registry associated with this processing context.
virtual void endOfStream(EndOfStreamContext &context)
This is invoked whenever we have an EndOfStream event.
void run(ProcessingContext &pc) final
void init(InitContext &ic) final
const o2::dataformats::TFIDInfo & getTFIDInfo() const
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
constexpr o2::header::DataOrigin gDataOriginTOF
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > Inputs
constexpr o2::header::DataDescription ddDia
constexpr o2::header::DataDescription ddCalib
framework::DataProcessorSpec getCalibInfoReaderSpec(int instance, int ninstances, const char *filename, bool toftpc=false)
constexpr o2::header::DataDescription ddCalib_tpc
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
static std::string rectifyDirectory(const std::string_view p)
static std::string concat_string(Ts const &... ts)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"