Project
Loading...
Searching...
No Matches
ReconstructorSpec.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
13
14#include <vector>
17#include "Framework/Logger.h"
21
22using namespace o2::framework;
23
24namespace o2
25{
26namespace fdd
27{
28
32
34{
35 mRecPoints.clear();
36 mRecChData.clear();
37 auto digitsBC = pc.inputs().get<gsl::span<o2::fdd::Digit>>("digitsBC");
38 auto digitsCh = pc.inputs().get<gsl::span<o2::fdd::ChannelData>>("digitsCh");
39 // RS: if we need to process MC truth, uncomment lines below
40 // std::unique_ptr<const o2::dataformats::MCTruthContainer<o2::fdd::MCLabel>> labels;
41 // const o2::dataformats::MCTruthContainer<o2::fdd::MCLabel>* lblPtr = nullptr;
42 if (mUseMC) {
43 // labels = pc.inputs().get<const o2::dataformats::MCTruthContainer<o2::fdd::MCLabel>*>("labels");
44 // lblPtr = labels.get();
45 LOG(info) << "Ignoring MC info";
46 }
47 int nDig = digitsBC.size();
48 mRecPoints.reserve(nDig);
49 mRecChData.reserve(digitsCh.size());
50 for (int id = 0; id < nDig; id++) {
51 const auto& digit = digitsBC[id];
52 auto channels = digit.getBunchChannelData(digitsCh);
53 mReco.process(digit, channels, mRecPoints, mRecChData);
54 }
55 // do we ignore MC in this task?
56 LOG(debug) << "FDD reconstruction pushes " << mRecPoints.size() << " RecPoints";
57 pc.outputs().snapshot(Output{mOrigin, "RECPOINTS", 0}, mRecPoints);
58 pc.outputs().snapshot(Output{mOrigin, "RECCHDATA", 0}, mRecChData);
59}
60
62{
63 std::vector<InputSpec> inputSpec;
64 std::vector<OutputSpec> outputSpec;
65 inputSpec.emplace_back("digitsBC", o2::header::gDataOriginFDD, "DIGITSBC", 0, Lifetime::Timeframe);
66 inputSpec.emplace_back("digitsCh", o2::header::gDataOriginFDD, "DIGITSCH", 0, Lifetime::Timeframe);
67 if (useMC) {
68 LOG(info) << "Currently FDDReconstructor does not consume and provide MC truth";
69 // inputSpec.emplace_back("labels", o2::header::gDataOriginFDD, "DIGITSMCTR", 0, Lifetime::Timeframe);
70 }
71 outputSpec.emplace_back(o2::header::gDataOriginFDD, "RECPOINTS", 0, Lifetime::Timeframe);
72 outputSpec.emplace_back(o2::header::gDataOriginFDD, "RECCHDATA", 0, Lifetime::Timeframe);
73
74 return DataProcessorSpec{
75 "fdd-reconstructor",
76 inputSpec,
77 outputSpec,
78 AlgorithmSpec{adaptFromTask<FDDReconstructorDPL>(useMC)},
79 Options{}};
80}
81
82} // namespace fdd
83} // namespace o2
Definition of a container to keep Monte Carlo truth external to simulation objects.
std::ostringstream debug
void run(ProcessingContext &pc) final
void init(InitContext &ic) final
void process(o2::fdd::Digit const &digitBC, gsl::span< const o2::fdd::ChannelData > inChData, std::vector< o2::fdd::RecPoint > &RecPoints, std::vector< o2::fdd::ChannelDataFloat > &outChData)
void snapshot(const Output &spec, T const &object)
decltype(auto) get(R binding, int part=0) const
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
GLuint id
Definition glcorearb.h:650
constexpr o2::header::DataOrigin gDataOriginFDD
Definition DataHeader.h:568
framework::DataProcessorSpec getFDDReconstructorSpec(bool useMC=true)
create a processor spec
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< ConfigParamSpec > Options
struct o2::upgrades_utils::@459 fdd
Collision labels.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< ChannelData > channels