Project
Loading...
Searching...
No Matches
tof-calibinfo-reader.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
17
#include "
DetectorsBase/Propagator.h
"
18
#include "
TOFWorkflowIO/CalibInfoReaderSpec.h
"
19
#include "
Framework/WorkflowSpec.h
"
20
#include "
Framework/ConfigParamSpec.h
"
21
#include <fairlogger/Logger.h>
22
#include "
CommonUtils/ConfigurableParam.h
"
23
#include "
CommonUtils/NameConf.h
"
24
#include "
DetectorsRaw/HBFUtilsInitializer.h
"
25
#include "
Framework/CallbacksPolicy.h
"
26
27
#include <string>
28
#include <stdexcept>
29
#include <unordered_map>
30
31
void
customize
(std::vector<o2::framework::CallbacksPolicy>& policies)
32
{
33
o2::raw::HBFUtilsInitializer::addNewTimeSliceCallback
(policies);
34
}
35
36
// add workflow options, note that customization needs to be declared before
37
// including Framework/runDataProcessing
38
void
customize
(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
39
{
40
workflowOptions.push_back(
ConfigParamSpec
{
"collection-infile"
,
o2::framework::VariantType::String
,
"list-calibfile"
, {
"Name of the collection input file"
}});
41
workflowOptions.push_back(
ConfigParamSpec
{
"ninstances"
,
o2::framework::VariantType::Int
, 1, {
"Number of reader instances"
}});
42
workflowOptions.push_back(
ConfigParamSpec
{
"tpc-matches"
,
o2::framework::VariantType::Bool
,
false
, {
"Made from TOF-TPC matches"
}});
43
workflowOptions.push_back(
ConfigParamSpec
{
"configKeyValues"
,
o2::framework::VariantType::String
,
""
, {
"Semicolon separated key=value strings ..."
}});
44
o2::raw::HBFUtilsInitializer::addConfigOption
(workflowOptions,
o2::raw::HBFUtilsInitializer::HBFUSrc
);
45
}
46
47
#include "
Framework/runDataProcessing.h
"
// the main driver
48
49
using namespace
o2::framework
;
50
65
WorkflowSpec
defineDataProcessing
(
ConfigContext
const
& cfgc)
66
{
67
WorkflowSpec
specs;
68
69
if
(!cfgc.
helpOnCommandLine
()) {
70
o2::conf::ConfigurableParam::updateFromString
(cfgc.
options
().
get
<std::string>(
"configKeyValues"
));
71
}
72
73
int
ninstances = cfgc.
options
().
get
<
int
>(
"ninstances"
);
74
auto
listname = cfgc.
options
().
get
<std::string>(
"collection-infile"
);
75
auto
toftpc = cfgc.
options
().
get
<
bool
>(
"tpc-matches"
);
76
77
char
* stringTBP =
new
char
[listname.size() + 1];
78
snprintf(stringTBP, listname.size() + 1,
"%s"
, listname.c_str());
79
80
// the lane configuration defines the subspecification ids to be distributed among the lanes.
81
// auto tofSectors = o2::RangeTokenizer::tokenize<int>(cfgc.options().get<std::string>("tof-sectors"));
82
// std::vector<int> laneConfiguration = tofSectors;
83
84
for
(
int
i
= 0;
i
< ninstances;
i
++) {
85
specs.emplace_back(
o2::tof::getCalibInfoReaderSpec
(
i
, ninstances, stringTBP, toftpc));
86
}
87
88
LOG
(info) <<
"Number of active devices = "
<< specs.size();
89
if
(ninstances == 1) {
90
o2::raw::HBFUtilsInitializer
hbfIni(cfgc, specs);
91
}
else
{
92
LOG
(warning) <<
"Cannot use HBFUtilsInitializer with multiple instances"
;
93
}
94
return
std::move(specs);
95
}
CalibInfoReaderSpec.h
CallbacksPolicy.h
ConfigParamSpec.h
ConfigurableParam.h
i
int32_t i
Definition
GPUCommonAlgorithm.h:431
HBFUtilsInitializer.h
NameConf.h
Definition of the Names Generator class.
Propagator.h
WorkflowSpec.h
o2::conf::ConfigurableParam::updateFromString
static void updateFromString(std::string const &)
Definition
ConfigurableParam.cxx:433
o2::framework::ConfigContext
Definition
ConfigContext.h:24
o2::framework::ConfigContext::helpOnCommandLine
bool helpOnCommandLine() const
Definition
ConfigContext.cxx:20
o2::framework::ConfigContext::options
ConfigParamRegistry & options() const
Definition
ConfigContext.h:28
o2::framework::ConfigParamRegistry::get
T get(const char *key) const
Definition
ConfigParamRegistry.h:98
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::VariantType::Int
@ Int
o2::framework::VariantType::String
@ String
o2::framework::VariantType::Bool
@ Bool
o2::framework::WorkflowSpec
std::vector< DataProcessorSpec > WorkflowSpec
Definition
HBFUtilsInitializer.h:39
o2::tof::getCalibInfoReaderSpec
framework::DataProcessorSpec getCalibInfoReaderSpec(int instance, int ninstances, const char *filename, bool toftpc=false)
Definition
CalibInfoReaderSpec.cxx:109
runDataProcessing.h
o2::framework::ConfigParamSpec
Definition
ConfigParamSpec.h:31
o2::raw::HBFUtilsInitializer
Definition
HBFUtilsInitializer.h:45
o2::raw::HBFUtilsInitializer::HBFUSrc
static constexpr char HBFUSrc[]
Definition
HBFUtilsInitializer.h:56
o2::raw::HBFUtilsInitializer::addNewTimeSliceCallback
static void addNewTimeSliceCallback(std::vector< o2::framework::CallbacksPolicy > &policies)
Definition
HBFUtilsInitializer.cxx:267
o2::raw::HBFUtilsInitializer::addConfigOption
static void addConfigOption(std::vector< o2::framework::ConfigParamSpec > &opts, const std::string &defOpt=std::string(o2::base::NameConf::DIGITIZATIONCONFIGFILE))
Definition
HBFUtilsInitializer.cxx:323
LOG
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
defineDataProcessing
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
Definition
tof-calibinfo-reader.cxx:65
customize
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)
Definition
tof-calibinfo-reader.cxx:31
Detectors
GlobalTrackingWorkflow
tofworkflow
src
tof-calibinfo-reader.cxx
Generated on Fri Apr 11 2025 11:41:26 for Project by
1.9.8