Project
Loading...
Searching...
No Matches
ClusterOriginal.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_CLUSTERORIGINAL_H_
18#define O2_MCH_CLUSTERORIGINAL_H_
19
20#include "PadOriginal.h"
21#include <utility>
22#include <vector>
23
24#include <TMath.h>
25
26namespace o2
27{
28namespace mch
29{
30
33{
34 public:
35 ClusterOriginal() = default;
36 ~ClusterOriginal() = default;
37
38 ClusterOriginal(const ClusterOriginal& cl) = default;
42
43 void clear();
44
45 void addPad(double x, double y, double dx, double dy, double charge, bool isSaturated, int plane, int digitIdx, int status);
46
47 void removePad(size_t iPad);
48
49 void sortPads(double precision);
50
52 size_t multiplicity() const { return mPads.size(); }
53 size_t multiplicity(int plane) const;
54
56 PadOriginal& pad(size_t i) { return mPads[i]; }
57 const PadOriginal& pad(size_t i) const { return mPads[i]; }
58
60 auto begin() { return mPads.begin(); }
61 auto begin() const { return mPads.begin(); }
62 auto end() { return mPads.end(); }
63 auto end() const { return mPads.end(); }
64
66 float charge() const { return mCharge[0] + mCharge[1]; }
68 float chargeAsymmetry() const { return charge() > 0 ? TMath::Abs(mCharge[0] - mCharge[1]) / charge() : 0.; }
70 int maxChargePlane() const { return mCharge[0] > mCharge[1] ? 0 : 1; }
71
73 bool isSaturated() const { return mIsSaturated[0] && mIsSaturated[1]; }
74
75 std::pair<double, double> minPadDimensions(int statusMask, bool matchMask) const;
76 std::pair<double, double> minPadDimensions(int plane, int statusMask, bool matchMask) const;
77
78 void area(int plane, double area[2][2]) const;
79
80 std::pair<int, int> sizeInPads(int statusMask) const;
81 std::pair<int, int> sizeInPads(int plane, int statusMask) const;
82
83 private:
84 std::vector<PadOriginal> mPads{};
85 size_t mMultiplicity[2] = {0, 0};
86 float mCharge[2] = {0., 0.};
87 bool mIsSaturated[2] = {false, false};
88};
89
90} // namespace mch
91} // namespace o2
92
93#endif // O2_MCH_CLUSTERORIGINAL_H_
int32_t i
Definition of the pad used by the original cluster finder algorithm.
cluster for internal use
size_t multiplicity() const
return the total number of pads associated to this cluster
bool isSaturated() const
return whether there are saturated pads on both plane or not
ClusterOriginal & operator=(const ClusterOriginal &cl)=default
void addPad(double x, double y, double dx, double dy, double charge, bool isSaturated, int plane, int digitIdx, int status)
float charge() const
return the total charge of this cluster
PadOriginal & pad(size_t i)
return the ith pad (no bound checking)
void sortPads(double precision)
int maxChargePlane() const
return the plane with the highest charge
std::pair< int, int > sizeInPads(int statusMask) const
ClusterOriginal & operator=(ClusterOriginal &&)=delete
std::pair< double, double > minPadDimensions(int statusMask, bool matchMask) const
ClusterOriginal(const ClusterOriginal &cl)=default
void removePad(size_t iPad)
auto begin()
return begin/end iterators to be able to iterate over the pads without accessing the internal vector
const PadOriginal & pad(size_t i) const
float chargeAsymmetry() const
return the charge asymmetry of this cluster
ClusterOriginal(ClusterOriginal &&)=delete
void area(int plane, double area[2][2]) const
pad for internal use
Definition PadOriginal.h:33
GLint GLenum GLint x
Definition glcorearb.h:403
GLenum GLint GLint * precision
Definition glcorearb.h:1899
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...