Project
Loading...
Searching...
No Matches
CellConverterSpec.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_EMCAL_CELLCONVERTER_SPEC
13#define O2_EMCAL_CELLCONVERTER_SPEC
14
15#include <vector>
16
21#include "Framework/Task.h"
22#include "EMCALBase/Geometry.h"
27
28namespace o2
29{
30
31namespace emcal
32{
33
34namespace reco_workflow
35{
36
49{
50 public:
56 CellConverterSpec(bool propagateMC, int inputSubsepc, int outputSubspec, std::shared_ptr<o2::emcal::CalibLoader> calibhandler) : framework::Task(), mPropagateMC(propagateMC), mSubspecificationIn(inputSubsepc), mSubspecificationOut(outputSubspec), mCalibHandler(calibhandler){};
57
59 ~CellConverterSpec() override = default;
60
63 void init(framework::InitContext& ctx) final;
64
81 void run(framework::ProcessingContext& ctx) final;
82
83 void finaliseCCDB(o2::framework::ConcreteDataMatcher& matcher, void* obj) final;
84
85 protected:
86 std::vector<o2::emcal::SRUBunchContainer> digitsToBunches(gsl::span<const o2::emcal::Digit> digits, std::vector<gsl::span<const o2::emcal::MCLabel>>& mcLabels);
87
88 std::vector<AltroBunch> findBunches(const std::vector<const o2::emcal::Digit*>& channelDigits, const std::vector<gsl::span<const o2::emcal::MCLabel>>& mcLabels, ChannelType_t channelType);
89
90 void mergeLabels(std::vector<o2::emcal::AltroBunch>& channelBunches);
91
92 int selectMaximumBunch(const gsl::span<const Bunch>& bunchvector);
93
96
97 private:
98 bool mPropagateMC = false;
99 unsigned int mSubspecificationIn = 0;
100 unsigned int mSubspecificationOut = 0;
101 o2::emcal::Geometry* mGeometry = nullptr;
102 std::shared_ptr<o2::emcal::CalibLoader> mCalibHandler;
103 std::unique_ptr<o2::emcal::CaloRawFitter> mRawFitter;
104 std::vector<o2::emcal::Cell> mOutputCells;
105 std::vector<o2::emcal::TriggerRecord> mOutputTriggers;
107};
108
117framework::DataProcessorSpec getCellConverterSpec(bool propagateMC, int inputSubsepc = 0, int outputSubspec = 0);
118
119} // namespace reco_workflow
120
121} // namespace emcal
122
123} // namespace o2
124
125#endif // O2_EMCAL_CELLCONVERTER_SPEC
Definition of a container to keep Monte Carlo truth external to simulation objects.
A container to hold and manage MC truth information/labels.
EMCAL geometry definition.
Definition Geometry.h:40
Coverter task for EMCAL digits to EMCAL cells.
std::vector< AltroBunch > findBunches(const std::vector< const o2::emcal::Digit * > &channelDigits, const std::vector< gsl::span< const o2::emcal::MCLabel > > &mcLabels, ChannelType_t channelType)
~CellConverterSpec() override=default
Destructor.
void init(framework::InitContext &ctx) final
Initializing the CellConverterSpec.
void updateCalibrationObjects()
Update calibration objects.
int selectMaximumBunch(const gsl::span< const Bunch > &bunchvector)
void mergeLabels(std::vector< o2::emcal::AltroBunch > &channelBunches)
CellConverterSpec(bool propagateMC, int inputSubsepc, int outputSubspec, std::shared_ptr< o2::emcal::CalibLoader > calibhandler)
Constructor.
std::vector< o2::emcal::SRUBunchContainer > digitsToBunches(gsl::span< const o2::emcal::Digit > digits, std::vector< gsl::span< const o2::emcal::MCLabel > > &mcLabels)
void run(framework::ProcessingContext &ctx) final
Run conversion of digits to cells.
void finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj) final
framework::DataProcessorSpec getCellConverterSpec(bool propagateMC, int inputSubsepc=0, int outputSubspec=0)
Creating DataProcessorSpec for the EMCAL Cell Converter Spec.
ChannelType_t
Type of a raw data channel.
Definition Constants.h:33
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< Digit > digits