Project
Loading...
Searching...
No Matches
DigitsPrinterSpec.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 <vector>
13
#include <iostream>
14
15
#include <fairlogger/Logger.h>
16
17
#include "
Framework/ControlService.h
"
18
#include "
Framework/DataRefUtils.h
"
19
#include "
DataFormatsPHOS/PHOSBlockHeader.h
"
20
#include "
DataFormatsPHOS/Digit.h
"
21
#include "
PHOSWorkflow/DigitsPrinterSpec.h
"
22
23
using namespace
o2::phos::reco_workflow
;
24
25
void
DigitsPrinterSpec::init
(
framework::InitContext
& ctx)
26
{
27
}
28
29
void
DigitsPrinterSpec::run
(
framework::ProcessingContext
& pc)
30
{
31
// Get the PHOS block header and check whether it contains digits
32
LOG
(
debug
) <<
"[PHOSDigitsPrinter - process] called"
;
33
auto
dataref = pc.
inputs
().
get
(
"digits"
);
34
auto
const
* phosheader = o2::framework::DataRefUtils::getHeader<o2::phos::PHOSBlockHeader*>(dataref);
35
if
(!phosheader->mHasPayload) {
36
LOG
(
debug
) <<
"[PHOSDigitsPrinter - process] No more digits"
<< std::endl;
37
pc.
services
().
get
<
o2::framework::ControlService
>().readyToQuit(
framework::QuitRequest::Me
);
38
return
;
39
}
40
41
auto
digits
= pc.
inputs
().
get
<std::vector<o2::phos::Digit>>(
"digits"
);
42
std::cout <<
"[PHOSDigitsPrinter - process] receiveed "
<<
digits
.size() <<
" digits ..."
<< std::endl;
43
if
(
digits
.size()) {
44
for
(
const
auto
& d :
digits
) {
45
std::cout <<
"[PHOSDigitsPrinter - process] Channel("
<< d.getAbsId() <<
") energy: "
<< d.getAmplitude() << std::endl;
46
}
47
}
48
}
49
50
o2::framework::DataProcessorSpec
o2::phos::reco_workflow::getPhosDigitsPrinterSpec
()
51
{
52
53
return
o2::framework::DataProcessorSpec
{
"PHOSDigitsPrinter"
,
54
{{
"digits"
,
o2::header::gDataOriginPHS
,
"DIGITS"
, 0, o2::framework::Lifetime::Timeframe}},
55
{},
56
o2::framework::adaptFromTask<o2::phos::reco_workflow::DigitsPrinterSpec>()};
57
}
ControlService.h
Digit.h
DataRefUtils.h
PHOSBlockHeader.h
DigitsPrinterSpec.h
debug
std::ostringstream debug
Definition
VariantJSONHelpers.h:307
o2::framework::ControlService
Definition
ControlService.h:40
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::inputs
InputRecord & inputs()
The inputs associated with this processing context.
Definition
ProcessingContext.h:37
o2::framework::ProcessingContext::services
ServiceRegistryRef services()
The services registry associated with this processing context.
Definition
ProcessingContext.h:39
o2::framework::ServiceRegistryRef::get
T & get() const
Definition
ServiceRegistryRef.h:85
o2::phos::reco_workflow::DigitsPrinterSpec::run
void run(framework::ProcessingContext &ctx) final
Printing digit-related information.
Definition
DigitsPrinterSpec.cxx:29
o2::phos::reco_workflow::DigitsPrinterSpec::init
void init(framework::InitContext &ctx) final
Initializing the digits printer task.
Definition
DigitsPrinterSpec.cxx:25
o2::header::gDataOriginPHS
constexpr o2::header::DataOrigin gDataOriginPHS
Definition
DataHeader.h:574
o2::framework::QuitRequest::Me
@ Me
Only quit this data processor.
o2::phos::reco_workflow
Definition
CellConverterSpec.h:29
o2::phos::reco_workflow::getPhosDigitsPrinterSpec
o2::framework::DataProcessorSpec getPhosDigitsPrinterSpec()
Creating digits printer spec.
Definition
DigitsPrinterSpec.cxx:50
o2::framework::DataProcessorSpec
Definition
DataProcessorSpec.h:41
LOG
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
digits
std::vector< Digit > digits
Definition
test_ctf_io_hmpid.cxx:40
Detectors
PHOS
workflow
src
DigitsPrinterSpec.cxx
Generated on Tue Feb 25 2025 23:16:25 for Project by
1.9.8