Project
Loading...
Searching...
No Matches
tracks-dumper-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
12
#include "
DataFormatsMCH/ROFRecord.h
"
13
#include "
DataFormatsMCH/TrackMCH.h
"
14
#include "
DetectorsRaw/HBFUtilsInitializer.h
"
15
#include "
Framework/ConfigParamSpec.h
"
16
#include "
SimulationDataFormat/MCCompLabel.h
"
17
#include "
TrackDumperSpec.h
"
18
#include <fmt/format.h>
19
#include <gsl/span>
20
#include <iostream>
21
#include <vector>
22
23
void
dump
(std::ostream& os,
const
o2::mch::TrackMCH
& t)
24
{
25
auto
pt = std::sqrt(t.
getPx
() * t.
getPx
() + t.
getPy
() * t.
getPy
());
26
os << fmt::format(
"({:s}) p {:7.2f} pt {:7.2f} nclusters: {} \n"
, t.
getSign
() == -1 ?
"-"
:
"+"
, t.
getP
(), pt, t.
getNClusters
());
27
}
28
29
using namespace
o2::framework
;
30
31
// we need to add workflow options before including Framework/runDataProcessing
32
void
customize
(std::vector<ConfigParamSpec>& workflowOptions)
33
{
34
std::vector<ConfigParamSpec> options{
35
{
"enable-mc"
, VariantType::Bool,
false
,
ConfigParamSpec::HelpString
{
"Read MC info"
}}};
36
o2::raw::HBFUtilsInitializer::addConfigOption
(options);
37
std::swap(workflowOptions, options);
38
}
39
40
#include "
Framework/runDataProcessing.h
"
41
42
WorkflowSpec
defineDataProcessing
(
const
ConfigContext
& config)
43
{
44
bool
useMC = config.
options
().
get
<
bool
>(
"enable-mc"
);
45
WorkflowSpec
specs{
o2::mch::getTrackDumperSpec
(useMC,
"mch-tracks-dumper"
)};
46
o2::raw::HBFUtilsInitializer
hbfIni(config, specs);
47
return
specs;
48
}
ConfigParamSpec.h
HBFUtilsInitializer.h
MCCompLabel.h
ROFRecord.h
Definition of the MCH ROFrame record.
TrackDumperSpec.h
TrackMCH.h
Definition of the MCH track.
o2::framework::ConfigContext
Definition
ConfigContext.h:24
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::mch::TrackMCH
MCH track external format.
Definition
TrackMCH.h:34
o2::mch::TrackMCH::getP
double getP() const
Definition
TrackMCH.cxx:68
o2::mch::TrackMCH::getPx
double getPx() const
Definition
TrackMCH.cxx:43
o2::mch::TrackMCH::getNClusters
int getNClusters() const
get the number of clusters attached to the track
Definition
TrackMCH.h:106
o2::mch::TrackMCH::getPy
double getPy() const
Definition
TrackMCH.cxx:50
o2::mch::TrackMCH::getSign
short getSign() const
get the muon sign
Definition
TrackMCH.h:65
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::WorkflowSpec
std::vector< DataProcessorSpec > WorkflowSpec
Definition
HBFUtilsInitializer.h:39
o2::mch::getTrackDumperSpec
DataProcessorSpec getTrackDumperSpec(bool useMC, const char *specName)
Definition
TrackDumperSpec.cxx:77
runDataProcessing.h
o2::framework::ConfigParamSpec::HelpString
Definition
ConfigParamSpec.h:34
o2::raw::HBFUtilsInitializer
Definition
HBFUtilsInitializer.h:45
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
dump
void dump(std::ostream &os, const o2::mch::TrackMCH &t)
Definition
tracks-dumper-workflow.cxx:23
defineDataProcessing
WorkflowSpec defineDataProcessing(const ConfigContext &config)
Definition
tracks-dumper-workflow.cxx:42
customize
void customize(std::vector< ConfigParamSpec > &workflowOptions)
Definition
tracks-dumper-workflow.cxx:32
Detectors
MUON
MCH
IO
src
tracks-dumper-workflow.cxx
Generated on Tue Feb 25 2025 23:16:22 for Project by
1.9.8