forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCellLabel.h
More file actions
80 lines (63 loc) · 2.71 KB
/
CellLabel.h
File metadata and controls
80 lines (63 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef ALICEO2_EMCAL_CELLLABEL_H_
#define ALICEO2_EMCAL_CELLLABEL_H_
#include <cstddef>
#include <cstdint>
#include <gsl/span>
#include <vector>
namespace o2
{
namespace emcal
{
/// \class CellLabel
/// \brief cell class for MC particle IDs and their respective amplitude fraction
/// \ingroup EMCALDataFormat
/// \author Marvin Hemmer <marvin.hemmer@cern.ch>, Goethe university Frankfurt
/// \since December 13, 2023
///
class CellLabel
{
public:
// CellLabel() = default;
/// \brief Constructor using std::vector by moving NOT copying
/// \param labels list of mc labels
/// \param amplitudeFractions list of amplitude fractions
CellLabel(std::vector<int> labels, std::vector<float> amplitudeFractions);
/// \brief Constructor using gsl::span
/// \param labels list of mc labels
/// \param amplitudeFractions list of amplitude fractions
CellLabel(gsl::span<const int> labels, gsl::span<const float> amplitudeFractions);
// ~CellLabel() = default;
// CellLabel(const CellLabel& clus) = default;
// CellLabel& operator=(const CellLabel& source) = default;
/// \brief Getter of label size
/// \param index index which label to get
size_t GetLabelSize(void) const { return mLabels.size(); }
/// \brief Getter for label
/// \param index index which label to get
int32_t GetLabel(size_t index) const { return mLabels[index]; }
/// \brief Getter for labels
std::vector<int32_t> GetLabels() const { return mLabels; }
/// \brief Getter for amplitude fraction
/// \param index index which amplitude fraction to get
float GetAmplitudeFraction(size_t index) const { return mAmplitudeFraction[index]; }
/// \brief Getter for amplitude fractions
std::vector<float> GetAmplitudeFractions() const { return mAmplitudeFraction; }
/// \brief Getter for label with leading amplitude fraction
int32_t GetLeadingMCLabel() const;
protected:
std::vector<int32_t> mLabels; ///< List of MC particles that generated the cluster, ordered in deposited energy.
std::vector<float> mAmplitudeFraction; ///< List of the fraction of the cell energy coming from a MC particle. Index aligns with mLabels!
};
} // namespace emcal
} // namespace o2
#endif // ALICEO2_EMCAL_CELLLABEL_H_