Project
Loading...
Searching...
No Matches
EventFinder.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
16
17#ifndef O2_MCH_EVENTFINDER_H_
18#define O2_MCH_EVENTFINDER_H_
19
20#include <map>
21#include <unordered_map>
22#include <vector>
23
24#include <gsl/span>
25
31
32namespace o2
33{
34namespace mch
35{
36
39{
40 public:
41 EventFinder() = default;
42 ~EventFinder() = default;
43
44 EventFinder(const EventFinder&) = delete;
48
49 void run(const gsl::span<const mch::ROFRecord>& mchROFs, const gsl::span<const mch::Digit>& digits,
50 const dataformats::MCLabelContainer* labels, const gsl::span<const mid::ROFRecord>& midROFs);
51
53 const std::vector<mch::ROFRecord>& getOutputROFs() const { return mROFs; }
55 const std::vector<mch::Digit>& getOutputDigits() const { return mDigits; }
57 const dataformats::MCLabelContainer& getOutputLabels() const { return mLabels; }
58
59 private:
61 struct Event {
63 Event(int64_t bcMin, int64_t bcMax) : maxRORange(bcMin)
64 {
65 trgRange[0] = bcMin;
66 trgRange[1] = bcMax;
67 }
68
69 int64_t trgRange[2]{};
70 int64_t maxRORange = 0;
71 std::vector<int> iMCHROFs{};
72 };
73
74 std::map<int64_t, Event> mEvents{};
75 std::vector<mch::ROFRecord> mROFs{};
76 std::vector<mch::Digit> mDigits{};
78 std::unordered_map<int, int> mDigitLoc{};
79};
80
81} // namespace mch
82} // namespace o2
83
84#endif // O2_MCH_EVENTFINDER_H_
Definition of a container to keep Monte Carlo truth external to simulation objects.
Definition of the MCH ROFrame record.
Definition of the MID event record.
Class to group MCH digits based on MID information.
Definition EventFinder.h:39
const std::vector< mch::ROFRecord > & getOutputROFs() const
get the output MCH ROFs
Definition EventFinder.h:53
EventFinder & operator=(EventFinder &&)=delete
EventFinder(const EventFinder &)=delete
const std::vector< mch::Digit > & getOutputDigits() const
get the output MCH digits
Definition EventFinder.h:55
EventFinder(EventFinder &&)=delete
EventFinder & operator=(const EventFinder &)=delete
const dataformats::MCLabelContainer & getOutputLabels() const
get the output MCH labels
Definition EventFinder.h:57
void run(const gsl::span< const mch::ROFRecord > &mchROFs, const gsl::span< const mch::Digit > &digits, const dataformats::MCLabelContainer *labels, const gsl::span< const mid::ROFRecord > &midROFs)
run the event finder algorithm
o2::dataformats::MCTruthContainer< o2::MCCompLabel > MCLabelContainer
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< o2::mid::ROFRecord > midROFs
std::vector< o2::mch::ROFRecord > mchROFs
std::vector< Digit > digits