Project
Loading...
Searching...
No Matches
KrClustererSpec.h
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
#ifndef O2_TRD_KRCLUSTERERSPEC_H
13
#define O2_TRD_KRCLUSTERERSPEC_H
14
18
19
// input TRD digits, TRD trigger records
20
// output Kr clusters
21
22
#include "
TRDWorkflow/KrClustererSpec.h
"
23
#include "
TRDCalibration/KrClusterFinder.h
"
24
#include "
Framework/Task.h
"
25
#include "
Framework/ConfigParamRegistry.h
"
26
#include "
Framework/DataProcessorSpec.h
"
27
#include "TStopwatch.h"
28
#include <fairlogger/Logger.h>
29
30
using namespace
o2::framework
;
31
32
namespace
o2
33
{
34
namespace
trd
35
{
36
class
TRDKrClustererDevice
:
public
Task
37
{
38
public
:
39
TRDKrClustererDevice
() =
default
;
40
~TRDKrClustererDevice
()
override
=
default
;
41
void
init
(
InitContext
& ic)
final
;
42
void
run
(
ProcessingContext
& pc)
final
;
43
void
endOfStream
(
framework::EndOfStreamContext
& ec)
final
;
44
45
private
:
46
o2::trd::KrClusterFinder
mKrClFinder;
47
};
48
49
void
TRDKrClustererDevice::init
(
InitContext
& ic)
50
{
51
mKrClFinder.
init
();
52
}
53
54
void
TRDKrClustererDevice::run
(
ProcessingContext
& pc)
55
{
56
TStopwatch timer;
57
58
const
auto
digits
= pc.
inputs
().
get
<gsl::span<Digit>>(
"digits"
);
59
const
auto
triggerRecords = pc.
inputs
().
get
<gsl::span<TriggerRecord>>(
"triggerRecords"
);
60
61
mKrClFinder.
reset
();
62
mKrClFinder.
setInput
(
digits
, triggerRecords);
63
timer.Start();
64
mKrClFinder.
findClusters
();
65
timer.Stop();
66
67
LOGP(info,
"Found {} Kr clusters in {} input trigger records. Timing: CPU: {}, Real: {}"
,
68
mKrClFinder.
getKrClusters
().size(), triggerRecords.size(), timer.CpuTime(), timer.RealTime());
69
70
pc.
outputs
().
snapshot
(
Output
{
o2::header::gDataOriginTRD
,
"KRCLUSTER"
, 0}, mKrClFinder.
getKrClusters
());
71
pc.
outputs
().
snapshot
(
Output
{
o2::header::gDataOriginTRD
,
"TRGKRCLS"
, 0}, mKrClFinder.
getKrTrigRecs
());
72
}
73
74
void
TRDKrClustererDevice::endOfStream
(
EndOfStreamContext
& ec)
75
{
76
LOG
(info) <<
"Done with the cluster finding (EoS received)"
;
77
}
78
79
framework::DataProcessorSpec
getKrClustererSpec
()
80
{
81
std::vector<InputSpec> inputs;
82
inputs.emplace_back(
"digits"
,
ConcreteDataTypeMatcher
{
o2::header::gDataOriginTRD
,
"DIGITS"
}, Lifetime::Timeframe);
83
inputs.emplace_back(
"triggerRecords"
,
ConcreteDataTypeMatcher
{
o2::header::gDataOriginTRD
,
"TRKTRGRD"
}, Lifetime::Timeframe);
84
std::vector<OutputSpec> outputs;
85
outputs.emplace_back(
o2::header::gDataOriginTRD
,
"KRCLUSTER"
, 0, Lifetime::Timeframe);
86
outputs.emplace_back(
o2::header::gDataOriginTRD
,
"TRGKRCLS"
, 0, Lifetime::Timeframe);
87
88
return
DataProcessorSpec
{
89
"trd-kr-clusterer"
,
90
inputs,
91
outputs,
92
AlgorithmSpec
{adaptFromTask<o2::trd::TRDKrClustererDevice>()},
93
Options
{}};
94
}
95
96
}
// namespace trd
97
98
}
// namespace o2
99
100
#endif
// O2_TRD_KRCLUSTERERSPEC_H
ConfigParamRegistry.h
DataProcessorSpec.h
KrClusterFinder.h
The TRD Krypton cluster finder from digits.
KrClustererSpec.h
Steers the TRD Krypton cluster finder.
Task.h
o2::framework::DataAllocator::snapshot
void snapshot(const Output &spec, T const &object)
Definition
DataAllocator.h:325
o2::framework::EndOfStreamContext
Definition
EndOfStreamContext.h:22
o2::framework::InitContext
Definition
InitContext.h:25
o2::framework::InputRecord::get
decltype(auto) get(R binding, int part=0) const
Definition
InputRecord.h:248
o2::framework::ProcessingContext
Definition
ProcessingContext.h:27
o2::framework::ProcessingContext::outputs
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
Definition
ProcessingContext.h:41
o2::framework::ProcessingContext::inputs
InputRecord & inputs()
The inputs associated with this processing context.
Definition
ProcessingContext.h:37
o2::framework::Task
Definition
Task.h:32
o2::trd::KrClusterFinder
Definition
KrClusterFinder.h:39
o2::trd::KrClusterFinder::setInput
void setInput(const gsl::span< const Digit > &digitsIn, const gsl::span< const TriggerRecord > &trigRecIn)
Provide digits and trigger records as input.
Definition
KrClusterFinder.cxx:99
o2::trd::KrClusterFinder::findClusters
void findClusters()
Definition
KrClusterFinder.cxx:105
o2::trd::KrClusterFinder::getKrClusters
const std::vector< KrCluster > & getKrClusters() const
Output.
Definition
KrClusterFinder.h:83
o2::trd::KrClusterFinder::getKrTrigRecs
const std::vector< KrClusterTriggerRecord > & getKrTrigRecs() const
Definition
KrClusterFinder.h:84
o2::trd::KrClusterFinder::init
void init()
Initialization.
Definition
KrClusterFinder.cxx:83
o2::trd::KrClusterFinder::reset
void reset()
Definition
KrClusterFinder.cxx:93
o2::trd::TRDKrClustererDevice
Definition
KrClustererSpec.h:37
o2::trd::TRDKrClustererDevice::TRDKrClustererDevice
TRDKrClustererDevice()=default
o2::trd::TRDKrClustererDevice::endOfStream
void endOfStream(framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
Definition
KrClustererSpec.h:74
o2::trd::TRDKrClustererDevice::~TRDKrClustererDevice
~TRDKrClustererDevice() override=default
o2::trd::TRDKrClustererDevice::init
void init(InitContext &ic) final
Definition
KrClustererSpec.h:49
o2::trd::TRDKrClustererDevice::run
void run(ProcessingContext &pc) final
Definition
KrClustererSpec.h:54
o2::header::gDataOriginTRD
constexpr o2::header::DataOrigin gDataOriginTRD
Definition
DataHeader.h:577
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::Options
std::vector< ConfigParamSpec > Options
Definition
DataProcessorSpec.h:31
o2::trd::getKrClustererSpec
framework::DataProcessorSpec getKrClustererSpec()
Definition
KrClustererSpec.h:79
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
o2::framework::AlgorithmSpec
Definition
AlgorithmSpec.h:43
o2::framework::ConcreteDataTypeMatcher
Definition
ConcreteDataMatcher.h:21
o2::framework::DataProcessorSpec
Definition
DataProcessorSpec.h:41
o2::framework::Output
Definition
Output.h:27
LOG
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
digits
std::vector< Digit > digits
Definition
test_ctf_io_hmpid.cxx:40
Detectors
TRD
workflow
include
TRDWorkflow
KrClustererSpec.h
Generated on Tue Feb 25 2025 17:03:16 for Project by
1.9.8