Skip to content

Commit 88a1e07

Browse files
committed
Change MCLabels
1 parent 8e06932 commit 88a1e07

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

DataFormats/Detectors/EMCAL/include/DataFormatsEMCAL/CellLabel.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <cstddef>
1616
#include <cstdint>
1717
#include <gsl/span>
18+
#include <vector>
1819

1920
namespace o2
2021
{
@@ -37,7 +38,7 @@ class CellLabel
3738
/// \brief Constructor
3839
/// \param labels list of mc labels
3940
/// \param amplitudeFractions list of amplitude fractions
40-
CellLabel(const gsl::span<const int> labels, const gsl::span<const float> amplitudeFractions);
41+
CellLabel(std::vector<int> labels, std::vector<float> amplitudeFractions);
4142

4243
// ~CellLabel() = default;
4344
// CellLabel(const CellLabel& clus) = default;
@@ -52,21 +53,21 @@ class CellLabel
5253
int32_t GetLabel(size_t index) const { return mLabels[index]; }
5354

5455
/// \brief Getter for labels
55-
gsl::span<const int32_t> GetLabels() const { return mLabels; }
56+
std::vector<int32_t> GetLabels() const { return mLabels; }
5657

5758
/// \brief Getter for amplitude fraction
5859
/// \param index index which amplitude fraction to get
5960
float GetAmplitudeFraction(size_t index) const { return mAmplitudeFraction[index]; }
6061

6162
/// \brief Getter for amplitude fractions
62-
gsl::span<const float> GetAmplitudeFractions() const { return mAmplitudeFraction; }
63+
std::vector<float> GetAmplitudeFractions() const { return mAmplitudeFraction; }
6364

6465
/// \brief Getter for label with leading amplitude fraction
6566
int32_t GetLeadingMCLabel() const;
6667

6768
protected:
68-
gsl::span<const int32_t> mLabels; ///< List of MC particles that generated the cluster, ordered in deposited energy.
69-
gsl::span<const float> mAmplitudeFraction; ///< List of the fraction of the cell energy coming from a MC particle. Index aligns with mLabels!
69+
std::vector<int32_t> mLabels; ///< List of MC particles that generated the cluster, ordered in deposited energy.
70+
std::vector<float> mAmplitudeFraction; ///< List of the fraction of the cell energy coming from a MC particle. Index aligns with mLabels!
7071
};
7172

7273
} // namespace emcal

DataFormats/Detectors/EMCAL/src/CellLabel.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
#include "fairlogger/Logger.h"
1616
#include <cstddef>
1717
#include <cstdint>
18+
#include <vector>
1819
#include <gsl/span>
1920

2021
using namespace o2::emcal;
2122

22-
CellLabel::CellLabel(const gsl::span<const int> labels, const gsl::span<const float> amplitudeFractions) : mLabels(labels), mAmplitudeFraction(amplitudeFractions)
23+
CellLabel::CellLabel(std::vector<int> labels, std::vector<float> amplitudeFractions) : mLabels(labels), mAmplitudeFraction(amplitudeFractions)
2324
{
2425
if (labels.size() != amplitudeFractions.size()) {
2526
LOG(error) << "Size of labels " << labels.size() << " does not match size of amplitude fraction " << amplitudeFractions.size() << " !";

0 commit comments

Comments
 (0)