34 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)
36 mCalibrator = std::make_unique<o2::tpc::TPCVDriftTglCalibration>(ntgl, tglMax, ndtgl, dtglMax, slotL,
offset, maxDelay, minEnt);
42 mCalibrator->setSaveHistosFile(ic.options().get<std::string>(
"vdtgl-histos-file-name"));
48 if (tinfo.globalRunNumberChanged) {
49 mRunStopRequested =
false;
52 if (mRunStopRequested) {
57 auto data = pc.inputs().get<gsl::span<o2::dataformats::Triplet<float, float, float>>>(
"input");
60 LOG(detail) <<
"Processing TF " << mCalibrator->getCurrentTFInfo().tfCounter <<
" with " <<
data.size() - 2 <<
" tracks";
67 if (
data[0].third == 0) {
69 tp = mPTHelper.
getTP(timestamp);
73 mCalibrator->process(
data, tp);
74 if (pc.transitionState() == TransitionHandlingState::Requested) {
75 LOG(info) <<
"Run stop requested, finalizing";
76 mRunStopRequested =
true;
79 sendOutput(pc.outputs());
84 if (mRunStopRequested) {
87 LOG(info) <<
"Finalizing calibration";
89 sendOutput(ec.outputs());
90 mRunStopRequested =
true;
101 std::unique_ptr<o2::tpc::TPCVDriftTglCalibration> mCalibrator;
102 std::shared_ptr<o2::base::GRPGeomRequest> mCCDBRequest;
104 bool mRunStopRequested =
false;
113 const auto& payloadVec = mCalibrator->getVDPerSlot();
114 auto& infoVec = mCalibrator->getCCDBInfoPerSlot();
115 assert(payloadVec.size() == infoVec.size());
117 for (uint32_t
i = 0;
i < payloadVec.size();
i++) {
118 auto&
w = infoVec[
i];
120 LOG(info) <<
"Sending object " <<
w.getPath() <<
"/" <<
w.getFileName() <<
" of size " <<
image->size()
121 <<
" bytes, valid for " <<
w.getStartValidityTimestamp() <<
" : " <<
w.getEndValidityTimestamp();
125 if (payloadVec.size()) {
126 mCalibrator->initOutput();
137 std::vector<InputSpec> inputs;
138 inputs.emplace_back(
"input",
"GLO",
"TPCITS_VDTGL", 0, Lifetime::Timeframe);
139 auto ccdbRequest = std::make_shared<o2::base::GRPGeomRequest>(
true,
147 std::vector<OutputSpec> outputs;
150 slot0frac = 1. - slot0frac;
158 AlgorithmSpec{adaptFromTask<o2::tpc::TPCVDriftTglCalibSpec>(ntgl, tglMax, ndtgl, dtglMax, slotL, slot0frac, maxDelay, minEnt, ccdbRequest)},
159 Options{{
"vdtgl-histos-file-name", VariantType::String,
"", {
"file to save histos (if name provided)"}}}};
Utils and constants for calibration and related workflows.
Helper class to extract pressure and temperature.
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)
static void requestCCDBInputs(std::vector< o2::framework::InputSpec > &inputs)
float getTP(int64_t ts) const
void extractCCDBInputs(o2::framework::ProcessingContext &pc) const
trigger checking for CCDB objects
bool accountCCDBInputs(const o2::framework::ConcreteDataMatcher &matcher, void *obj)
check for new CCDB objects
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"