Project
Loading...
Searching...
No Matches
ClusterLabel.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 ALICEO2_EMCAL_CLUSTERLABEL_H_
13#define ALICEO2_EMCAL_CLUSTERLABEL_H_
14
15#include <fairlogger/Logger.h>
16#include <gsl/span>
17#include <vector>
18#include "Rtypes.h"
19
20namespace o2
21{
22
23namespace emcal
24{
25
32
34{
35 public:
38 struct labelWithE {
39
42
46 labelWithE(int l, float e) : label(l), energyFraction(e) {}
47
54 bool operator>=(labelWithE const& rhs) const
55 {
56 return energyFraction >= rhs.energyFraction;
57 }
58
60 int label;
61 };
62
63 // ClusterLabel() = default;
64 // ~ClusterLabel() = default;
65 // ClusterLabel(const ClusterLabel& clus) = default;
66 // ClusterLabel& operator=(const ClusterLabel& source) = default;
67
69 void clear();
70
74 void addValue(int label, float energyFraction);
75
78 void normalize(float factor);
79
81 std::vector<int32_t> getLabels();
82
84 std::vector<float> getEnergyFractions();
85
87 void orderLabels();
88
89 protected:
90 std::vector<labelWithE> mClusterLabels;
91};
92
93} // namespace emcal
94} // namespace o2
95#endif // ALICEO2_EMCAL_CLUSTERLABEL_H_
cluster class for MC particle IDs and their respective energy fraction
void orderLabels()
Sort the labels and energy fraction in descending order (largest energy fraction to smallest)
void clear()
Clear the member variables.
void normalize(float factor)
Normalize the energy fraction.
void addValue(int label, float energyFraction)
Add label and energy fraction to the.
std::vector< labelWithE > mClusterLabels
List of MC particles that generated the cluster, paired with energy fraction.
std::vector< float > getEnergyFractions()
Getter for vector of energy fractions.
std::vector< int32_t > getLabels()
Getter for vector of labels.
GLuint GLsizei const GLchar * label
Definition glcorearb.h:2519
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Wrapper structure to make cluster label sortable in energy fraction.
bool operator>=(labelWithE const &rhs) const
Comparison lower operator comparing cells based on energy.
float energyFraction
Energy Fraction.
labelWithE(int l, float e)
Constructor.