Project
Loading...
Searching...
No Matches
tof-dummy-ccdb-for-calib.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.
13#include <TClass.h>
17
18using namespace o2::framework;
19
20// This is how you can define your processing in a declarative way
21std::vector<DataProcessorSpec> defineDataProcessing(ConfigContext const&)
22{
23 return {
25 "simple",
26 Inputs{{"input", "TOF", "CALIBDATA"}},
27 Outputs{OutputSpec{{"phase"}, "TOF", "LHCphase"},
28 OutputSpec{{"timeSlewing"}, "TOF", "ChannelCalib"},
29 OutputSpec{{"startLHCphase"}, "TOF", "StartLHCphase"},
30 OutputSpec{{"startTimeChCal"}, "TOF", "StartChCalib"}},
31 adaptStateless([](DataAllocator& outputs, ControlService& control) {
32 // Create and fill a dummy LHCphase object
33 auto& lhcPhase = outputs.make<o2::dataformats::CalibLHCphaseTOF>(OutputRef{"phase", 0});
34 lhcPhase.addLHCphase(0, 1234); // should be in ps
35 lhcPhase.addLHCphase(2000000000, 2345); // should be in ps
36 auto& calibTimeSlewing = outputs.make<o2::dataformats::CalibTimeSlewingParamTOF>(OutputRef{"timeSlewing", 0});
37 for (int ich = 0; ich < o2::dataformats::CalibTimeSlewingParamTOF::NCHANNELS; ich++) {
38 calibTimeSlewing.addTimeSlewingInfo(ich, 0, 0);
41 calibTimeSlewing.setFractionUnderPeak(sector, channelInSector, 1);
42 }
43 auto& startTimeLHCphase = outputs.make<long>(OutputRef{"startLHCphase", 0}); // we send also the start validity of the LHC phase
44 auto& startTimeChCalib = outputs.make<long>(OutputRef{"startTimeChCal", 0}); // we send also the start validity of the channel calibration
45 // you should uncomment the lines below if you need that this workflow triggers the end of the subsequent ones (e.g. in the tof reconstruction workflow, but not fot the tof-calib-workflow
46 //control.endOfStream();
47 //control.readyToQuit(QuitRequest::Me);
48 })}};
49}
Class to store the output of the matching to TOF for calibration.
Class to store the output of the matching to TOF for calibration.
void addLHCphase(int timestamp, float phaseLHC)
void addTimeSlewingInfo(int channel, float tot, float time)
decltype(auto) make(const Output &spec, Args... args)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
AlgorithmSpec::ProcessCallback adaptStateless(LAMBDA l)
std::vector< InputSpec > Inputs
std::vector< OutputSpec > Outputs
std::vector< DataProcessorSpec > defineDataProcessing(ConfigContext const &)