33 TPCVDriftTglCalibSpec(
int ntgl,
float tglMax,
int ndtgl,
float dtglMax,
size_t slotL,
float offset,
float maxDelay,
size_t minEnt, std::shared_ptr<o2::base::GRPGeomRequest> req) : mCCDBRequest(req)
35 mCalibrator = std::make_unique<o2::tpc::TPCVDriftTglCalibration>(ntgl, tglMax, ndtgl, dtglMax, slotL,
offset, maxDelay, minEnt);
41 mCalibrator->setSaveHistosFile(ic.options().get<std::string>(
"vdtgl-histos-file-name"));
47 if (tinfo.globalRunNumberChanged) {
48 mRunStopRequested =
false;
51 if (mRunStopRequested) {
55 auto data = pc.inputs().get<gsl::span<o2::dataformats::Triplet<float, float, float>>>(
"input");
58 LOG(detail) <<
"Processing TF " << mCalibrator->getCurrentTFInfo().tfCounter <<
" with " <<
data.size() - 2 <<
" tracks";
60 mCalibrator->process(
data);
61 if (pc.transitionState() == TransitionHandlingState::Requested) {
62 LOG(info) <<
"Run stop requested, finalizing";
63 mRunStopRequested =
true;
66 sendOutput(pc.outputs());
71 if (mRunStopRequested) {
74 LOG(info) <<
"Finalizing calibration";
76 sendOutput(ec.outputs());
77 mRunStopRequested =
true;
87 std::unique_ptr<o2::tpc::TPCVDriftTglCalibration> mCalibrator;
88 std::shared_ptr<o2::base::GRPGeomRequest> mCCDBRequest;
89 bool mRunStopRequested =
false;
98 const auto& payloadVec = mCalibrator->getVDPerSlot();
99 auto& infoVec = mCalibrator->getCCDBInfoPerSlot();
100 assert(payloadVec.size() == infoVec.size());
102 for (uint32_t
i = 0;
i < payloadVec.size();
i++) {
103 auto&
w = infoVec[
i];
105 LOG(info) <<
"Sending object " <<
w.getPath() <<
"/" <<
w.getFileName() <<
" of size " <<
image->size()
106 <<
" bytes, valid for " <<
w.getStartValidityTimestamp() <<
" : " <<
w.getEndValidityTimestamp();
110 if (payloadVec.size()) {
111 mCalibrator->initOutput();
122 std::vector<InputSpec> inputs;
123 inputs.emplace_back(
"input",
"GLO",
"TPCITS_VDTGL", 0, Lifetime::Timeframe);
124 auto ccdbRequest = std::make_shared<o2::base::GRPGeomRequest>(
true,
132 std::vector<OutputSpec> outputs;
135 slot0frac = 1. - slot0frac;
141 AlgorithmSpec{adaptFromTask<o2::tpc::TPCVDriftTglCalibSpec>(ntgl, tglMax, ndtgl, dtglMax, slotL, slot0frac, maxDelay, minEnt, ccdbRequest)},
142 Options{{
"vdtgl-histos-file-name", VariantType::String,
"", {
"file to save histos (if name provided)"}}}};
Utils and constants for calibration and related workflows.
void checkUpdates(o2::framework::ProcessingContext &pc)
bool finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj)
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
static std::unique_ptr< std::vector< char > > createObjectImage(const T *obj, CcdbObjectInfo *info=nullptr)
void init(InitContext &ic) final
void endOfStream(EndOfStreamContext &ec) final
TPCVDriftTglCalibSpec(int ntgl, float tglMax, int ndtgl, float dtglMax, size_t slotL, float offset, float maxDelay, size_t minEnt, std::shared_ptr< o2::base::GRPGeomRequest > req)
void run(ProcessingContext &pc) final
void finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj) final
GLubyte GLubyte GLubyte GLubyte w
constexpr TFType INFINITE_TF
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
o2::framework::DataProcessorSpec getTPCVDriftTglCalibSpec(int ntgl, float tglMax, int ndtgl, float dtglMax, size_t slotL, float offset, float maxDelay, size_t minEnt)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
static void fillTFIDInfo(o2::framework::ProcessingContext &pc, o2::dataformats::TFIDInfo &ti)
static constexpr o2::header::DataOrigin gDataOriginCDBWrapper
static constexpr o2::header::DataOrigin gDataOriginCDBPayload
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"