22#include "TGraphAsymmErrors.h"
24#include <fairlogger/Logger.h>
38 mCalibrator->setUpdateAtTheEndOfRunOnly();
43 if (mRunStartTime == 0 || crTime < mRunStartTime) {
44 mRunStartTime = crTime;
47 auto tfcounter = o2::header::get<o2::framework::DataProcessingHeader*>(pc.
inputs().
get(
"clusters").header)->startTime;
49 auto cellTR = pc.
inputs().
get<gsl::span<TriggerRecord>>(
"cellTriggerRecords");
51 auto cluTR = pc.
inputs().
get<gsl::span<TriggerRecord>>(
"clusterTriggerRecords");
53 LOG(detail) <<
"[PHOSTurnonCalibDevice - run] Received " <<
cells.size() <<
" cells and " <<
clusters.size() <<
" clusters, running calibration";
55 mCalibrator->process(tfcounter,
cells, cellTR,
clusters, cluTR);
61 mCalibrator->endOfStream();
62 mTriggerMap.reset(
new TriggerMap(mCalibrator->getCalibration()));
66 std::map<std::string, std::string> md;
73 <<
" of size " <<
image->size()
80 LOG(alarm) <<
"Incorrect fit results";
90 std::vector<InputSpec> inputs;
94 inputs.emplace_back(
"clusterTriggerRecords",
o2::header::gDataOriginPHS,
"CLUSTERTRIGREC", 0, o2::framework::Lifetime::Timeframe);
95 auto ccdbRequest = std::make_shared<o2::base::GRPGeomRequest>(
true,
103 std::vector<OutputSpec> outputs;
112 o2::framework::adaptFromTask<PHOSTurnonCalibDevice>(useCCDB, ccdbRequest),
Utils and constants for calibration and related workflows.
Device to calculate PHOS turn-on curves and trigger map.
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
void setMetaData(const std::map< std::string, std::string > &md)
long getStartValidityTimestamp() const
const std::string & getFileName() const
static constexpr long YEAR
static constexpr long MINUTE
void snapshot(const Output &spec, T const &object)
DataAllocator & outputs()
InputRecord & inputs()
The inputs associated with this processing context.
ServiceRegistryRef services()
The services registry associated with this processing context.
void init(o2::framework::InitContext &ic) final
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void run(o2::framework::ProcessingContext &pc) final
constexpr o2::header::DataOrigin gDataOriginPHS
constexpr TFType INFINITE_TF
std::vector< ConfigParamSpec > Options
o2::framework::DataProcessorSpec getPHOSTurnonCalibDeviceSpec(bool useCCDB)
static constexpr o2::header::DataOrigin gDataOriginCDBWrapper
static constexpr o2::header::DataOrigin gDataOriginCDBPayload
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Cluster > clusters
std::vector< Cell > cells