Project
Loading...
Searching...
No Matches
test_CCDBFetcher.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
16#include "Framework/Task.h"
18
19#include <chrono>
20#include <thread>
21
22using namespace o2::framework;
23
25 void run(ProcessingContext& ctx) final
26 {
27 auto& inputs = ctx.inputs();
28 auto ref = inputs.get("somecondition");
29 auto payloadSize = DataRefUtils::getPayloadSize(ref);
30 if (payloadSize != 2048) {
31 LOGP(error, "Wrong size for condition payload (expected {}, found {}", 2048, payloadSize);
32 }
33 auto condition = inputs.get<o2::dataformats::CalibLHCphaseTOF*>("somecondition");
34 LOG(error) << "Condition size" << condition->size();
35 for (int pi = 0; pi < condition->size(); pi++) {
36 LOGP(info, "Phase at {} for timestamp {} is {}", pi, condition->timestamp(pi), condition->LHCphase(pi));
37 }
38 }
39
41 {
42 LOG(error) << "Deserialization callback invoked";
43 }
44};
45
46// This is how you can define your processing in a declarative way
48{
49 return WorkflowSpec{
50 {
51 "A",
52 {InputSpec{"somecondition", "TOF", "LHCphase", 0, Lifetime::Condition, ccdbParamSpec("TOF/LHCphase")}},
53 //{InputSpec{"somecondition", "TOF", "LHCphase", 0, Lifetime::Condition, ccdbParamSpec("TOF/LHCphase", {{"some", "metadata"}})}},
54 {OutputSpec{"TST", "A1", 0, Lifetime::Timeframe}},
55 adaptFromTask<CCDBTestTask>(),
56 Options{
57 {"test-option", VariantType::String, "test", {"A test option"}}},
58 }};
59}
Class to store the output of the matching to TOF for calibration.
WorkflowSpec defineDataProcessing(ConfigContext const &)
This function hooks up the the workflow specifications into the DPL driver.
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
std::vector< DataProcessorSpec > WorkflowSpec
void finaliseCCDB(ConcreteDataMatcher &, void *) final
void run(ProcessingContext &ctx) final
static o2::header::DataHeader::PayloadSizeType getPayloadSize(const DataRef &ref)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"