20#include "FairLogger.h"
28 mCalibrator->setUpdateAtTheEndOfRunOnly();
36 if (mRunStartTime == 0 || crTime < mRunStartTime) {
37 mRunStartTime = crTime;
39 auto tfcounter = o2::header::get<o2::header::DataHeader*>(pc.
inputs().
get(
"cells").header)->tfCounter;
41 auto cellTR = pc.
inputs().
get<gsl::span<TriggerRecord>>(
"cellTR");
42 LOG(detail) <<
"Processing TF with " <<
cells.size() <<
" cells and " << cellTR.size() <<
" TrigRecords";
43 mCalibrator->process(tfcounter,
cells, cellTR);
49 if (mNprocessed % minStatisticsForCalib == 0) {
50 minStatisticsForCalib *= 2;
52 mCalibrator->endOfStream();
53 if (mPrevCalibration != mCalibrator->getCalibration()) {
54 mPrevCalibration = mCalibrator->getCalibration();
64 mCalibrator->endOfStream();
69 if (mRunStartTime == 0 || mCalibrator->getCalibration() == 0) {
73 if (mPrevCalibration == mCalibrator->getCalibration()) {
76 mPrevCalibration = mCalibrator->getCalibration();
82 std::vector<int> l1phase{mPrevCalibration};
83 LOG(info) <<
"Sending L1phase to CCDB";
86 std::map<std::string, std::string> md;
93 <<
" of size " <<
image->size()
100 LOG(info) <<
"Sending histos to QC ";
107 std::vector<OutputSpec> outputs;
112 std::vector<InputSpec> inputs;
113 inputs.emplace_back(
"cells",
"PHS",
"CELLS");
114 inputs.emplace_back(
"cellTR",
"PHS",
"CELLTRIGREC");
115 auto ccdbRequest = std::make_shared<o2::base::GRPGeomRequest>(
true,
123 "calib-phos-l1phase",
126 AlgorithmSpec{adaptFromTask<PHOSL1phaseCalibDevice>(ccdbRequest)},
Utils and constants for calibration and related workflows.
Device to calculate PHOS time shift (L1phase)
void checkUpdates(o2::framework::ProcessingContext &pc)
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
static std::string generateFileName(const std::string &inp)
static std::unique_ptr< std::vector< char > > createObjectImage(const T *obj, CcdbObjectInfo *info=nullptr)
long getEndValidityTimestamp() const
const std::string & getPath() const
static constexpr long DAY
void setMetaData(const std::map< std::string, std::string > &md)
long getStartValidityTimestamp() const
const std::string & getFileName() const
static constexpr long MINUTE
void snapshot(const Output &spec, T const &object)
DataAllocator & outputs()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
ServiceRegistryRef services()
The services registry associated with this processing context.
void endOfStream(o2::framework::EndOfStreamContext &ec)
void sendCCDB(DataAllocator &outputs)
void init(o2::framework::InitContext &ic)
void run(o2::framework::ProcessingContext &pc)
constexpr o2::header::DataOrigin gDataOriginPHS
constexpr TFType INFINITE_TF
std::vector< ConfigParamSpec > Options
o2::framework::DataProcessorSpec getPHOSL1phaseCalibDeviceSpec()
static constexpr o2::header::DataOrigin gDataOriginCDBWrapper
static constexpr o2::header::DataOrigin gDataOriginCDBPayload
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Cell > cells