forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCluster.h
More file actions
133 lines (113 loc) · 4.87 KB
/
Cluster.h
File metadata and controls
133 lines (113 loc) · 4.87 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// 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_PHOS_CLUSTER_H_
#define ALICEO2_PHOS_CLUSTER_H_
#include <vector>
#include <Rtypes.h>
namespace o2
{
namespace phos
{
class Geometry;
/// \class Cluster
/// \brief Contains PHOS cluster parameters
struct CluElement {
short absId = 0;
bool isHG = false;
int label = -1;
float energy = 0.;
float time = 0.;
float localX = 0.;
float localZ = 0.;
float fraction = 0.;
CluElement() = default;
CluElement(short a, bool hg, float e, float t, float x, float z, int lab, float fr) : absId(a), isHG(hg), label(lab), energy(e), time(t), localX(x), localZ(z), fraction(fr) {}
};
class Cluster
{
public:
Cluster() = default;
Cluster(const Cluster& clu) = default;
~Cluster() = default;
/// \brief Comparison oparator, based on time and coordinates
/// \param another PHOS Cluster
/// \return result of comparison: x and z coordinates
bool operator<(const Cluster& other) const;
/// \brief Comparison oparator, based on time and coordinates
/// \param another PHOS Cluster
/// \return result of comparison: x and z coordinates
bool operator>(const Cluster& other) const;
float getEnergy() const { return mFullEnergy; }
void setEnergy(float e) { mFullEnergy = e; }
float getCoreEnergy() const { return mCoreEnergy; }
void setCoreEnergy(float ec) { mCoreEnergy = ec; }
float getDispersion() const { return mDispersion; }
void setDispersion(float d) { mDispersion = d; }
float getDistanceToBadChannel() const { return mDistToBadChannel; }
void getElipsAxis(float& lambdaShort, float& lambdaLong) const
{
lambdaShort = mLambdaShort;
lambdaLong = mLambdaLong;
}
void setElipsAxis(float lambdaShort, float lambdaLong)
{
mLambdaShort = lambdaShort;
mLambdaLong = lambdaLong;
}
void getLocalPosition(float& posX, float& posZ) const
{
posX = mLocalPosX;
posZ = mLocalPosZ;
}
void setLocalPosition(float posX, float posZ)
{
mLocalPosX = posX;
mLocalPosZ = posZ;
}
int getMultiplicity() const { return mLastCluElement - mFirstCluElement; } // gets the number of digits making this cluster
// 0: was no unfolging, -1: unfolding failed
void setNExMax(int8_t nmax = 1) { mNExMax = nmax; }
int8_t getNExMax() const { return mNExMax; } // Number of maxima found in cluster in unfolding:
// 0: was no unfolging, -1: unfolding failed
int8_t module() const { return mModule; } // PHOS module of a current cluster
void setModule(int8_t mod) { mModule = mod; } // set PHOS module of a current cluster
float getTime() const { return mTime; }
void setTime(float t) { mTime = t; }
int8_t firedTrigger() const { return mFiredTrigger; }
void setFiredTrigger(int8_t t) { mFiredTrigger = t; }
/// \brief Method to add digit to a cluster
void addDigit() { mLastCluElement++; }
uint32_t getFirstCluEl() const { return mFirstCluElement; }
uint32_t getLastCluEl() const { return mLastCluElement; }
void setFirstCluEl(uint32_t first) { mFirstCluElement = first; }
void setLastCluEl(uint32_t last) { mLastCluElement = last; }
// // Binary search implementation
// std::vector<Digit>::const_iterator BinarySearch(const std::vector<Digit>* container, Digit& element);
protected:
int8_t mModule = 0; ///< Module number
int8_t mNExMax = -1; ///< number of (Ex-)maxima before unfolding
int8_t mFiredTrigger = 0; ///< matched with PHOS trigger: 0 no match, bit 1 with 2x2, bit 2 with 4x4
uint32_t mFirstCluElement = -1; ///< index of the first contributing CluElement in a list
uint32_t mLastCluElement = -1; ///< index of the last contributing CluElement in a list
float mLocalPosX = 0.; ///< Center of gravity position in local module coordunates (phi direction)
float mLocalPosZ = 0.; ///< Center of gravity position in local module coordunates (z direction)
float mFullEnergy = 0.; ///< full energy of a shower
float mCoreEnergy = 0.; ///< energy in a shower core
float mLambdaLong = 0.; ///< shower ellipse axes
float mLambdaShort = 0.; ///< shower ellipse axes
float mDispersion = 0.; ///< shower dispersion
float mTime = 0.; ///< Time of the digit with maximal energy deposition
float mDistToBadChannel = 999; ///< Distance to nearest bad crystal
ClassDefNV(Cluster, 4);
};
} // namespace phos
} // namespace o2
#endif