Project
Loading...
Searching...
No Matches
alignment-workflow.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.
11
16
18
23#include "Headers/STFHeader.h"
29#include "Framework/Lifetime.h"
30#include "Framework/Output.h"
31#include "Framework/Task.h"
32#include "Framework/Logger.h"
33
34using namespace o2::framework;
35using namespace std;
36
37namespace o2::mch
38{
39
40class SeederTask : public Task
41{
42 public:
43 void run(ProcessingContext& pc) final
44 {
45 const auto& hbfu = o2::raw::HBFUtils::Instance();
46 auto& tinfo = pc.services().get<o2::framework::TimingInfo>();
47 if (hbfu.startTime != 0) {
48 tinfo.creation = hbfu.startTime;
49 } else {
50 tinfo.creation = std::chrono::time_point_cast<std::chrono::milliseconds>(std::chrono::system_clock::now()).time_since_epoch().count();
51 }
52 if (hbfu.orbitFirstSampled != 0) {
53 tinfo.firstTForbit = hbfu.orbitFirstSampled;
54 } else {
55 tinfo.firstTForbit = 0;
56 }
57 auto& stfDist = pc.outputs().make<o2::header::STFHeader>(Output{"FLP", "DISTSUBTIMEFRAME", 0});
58 pc.services().get<ControlService>().endOfStream();
59 pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
60 }
61};
62
63} // namespace o2::mch
64
66{
67 return DataProcessorSpec{
68 "seeder",
69 Inputs{},
70 Outputs{{"FLP", "DISTSUBTIMEFRAME", 0}},
71 AlgorithmSpec{o2::framework::adaptFromTask<o2::mch::SeederTask>()},
72 Options{}};
73}
74
75// we need to add workflow options before including Framework/runDataProcessing
76void customize(vector<ConfigParamSpec>& workflowOptions)
77{
78 workflowOptions.emplace_back("configKeyValues", VariantType::String, "",
79 ConfigParamSpec::HelpString{"Semicolon separated key=value strings"});
80 workflowOptions.emplace_back("disable-input-from-ccdb", VariantType::Bool, false,
81 ConfigParamSpec::HelpString{"Do not read magnetic field and geometry from CCDB"});
82}
83
86{
87 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
88 bool disableCCDB = configcontext.options().get<bool>("disable-input-from-ccdb");
90}
Definition of alignment process for muon spectrometer.
void customize(vector< ConfigParamSpec > &workflowOptions)
WorkflowSpec defineDataProcessing(const ConfigContext &configcontext)
o2::framework::DataProcessorSpec getSeederSpec()
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
virtual void endOfStream(EndOfStreamContext &context)
This is invoked whenever we have an EndOfStream event.
Definition Task.h:43
void run(ProcessingContext &pc) final
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
std::vector< InputSpec > Inputs
std::vector< OutputSpec > Outputs
o2::framework::DataProcessorSpec getAlignmentSpec(bool disableCCDB=false)
Defining DataPointCompositeObject explicitly as copiable.