Project
Loading...
Searching...
No Matches
AnalysisCluster.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_ANALYSISCLUSTER_H_
13#define ALICEO2_EMCAL_ANALYSISCLUSTER_H_
14
15#include <fairlogger/Logger.h>
16#include <gsl/span>
17#include <array>
18#include "Rtypes.h"
19#include "MathUtils/Cartesian.h"
20#include "TLorentzVector.h"
21
22namespace o2
23{
24
25namespace emcal
26{
27
35
37{
38
39 public:
43 class CellOutOfRangeException final : public std::exception
44 {
45 public:
48 CellOutOfRangeException(Int_t cellIndex) : std::exception(),
49 mCellIndex(cellIndex),
50 mMessage("Cell index " + std::to_string(mCellIndex) + " out of range.")
51 {
52 }
53
55 ~CellOutOfRangeException() noexcept final = default;
56
59 Int_t getCellIndex() const noexcept { return mCellIndex; }
60
63 const char* what() const noexcept final { return mMessage.data(); }
64
65 private:
66 Int_t mCellIndex;
67 std::string mMessage;
68 };
69
70 AnalysisCluster() = default;
71 ~AnalysisCluster() = default;
72 AnalysisCluster(const AnalysisCluster& clus) = default;
74 void clear();
75
76 // Common EMCAL/PHOS/FMD/PMD
77
78 void setID(int id) { mID = id; }
79 int getID() const { return mID; }
80
81 void setE(float ene) { mEnergy = ene; }
82 float E() const { return mEnergy; }
83
84 void setChi2(float chi2) { mChi2 = chi2; }
85 float Chi2() const { return mChi2; }
86
94
100
101 void setDispersion(float disp) { mDispersion = disp; }
102 float getDispersion() const { return mDispersion; }
103
104 void setM20(float m20) { mM20 = m20; }
105 float getM20() const { return mM20; }
106
107 void setM02(float m02) { mM02 = m02; }
108 float getM02() const { return mM02; }
109
110 void setNExMax(unsigned char nExMax) { mNExMax = nExMax; }
111 unsigned char getNExMax() const { return mNExMax; }
112
113 void setEmcCpvDistance(float dEmcCpv) { mEmcCpvDistance = dEmcCpv; }
114 float getEmcCpvDistance() const { return mEmcCpvDistance; }
115 void setTrackDistance(float dx, float dz)
116 {
117 mTrackDx = dx;
118 mTrackDz = dz;
119 }
120 float getTrackDx() const { return mTrackDx; }
121 float getTrackDz() const { return mTrackDz; }
122
123 void setDistanceToBadChannel(float dist) { mDistToBadChannel = dist; }
125
126 void setNCells(int n) { mNCells = n; }
127 int getNCells() const { return mNCells; }
128
131 void setCellsIndices(const std::vector<unsigned short>& array)
132 {
134 }
135
136 const std::vector<unsigned short>& getCellsIndices() const { return mCellsIndices; }
137
142 void setCellsAmplitudeFraction(const std::vector<float>& array)
143 {
145 }
146 const std::vector<float>& getCellsAmplitudeFraction() const { return mCellsAmpFraction; }
147
148 int getCellIndex(int i) const
149 {
150 if (i >= 0 && i < mNCells) {
151 return mCellsIndices[i];
152 } else {
154 }
155 }
156
158 {
159 if (i >= 0 && i < mNCells) {
160 return mCellsAmpFraction[i];
161 } else {
163 }
164 }
165
166 bool getIsExotic() const { return mIsExotic; }
167 void setIsExotic(bool b) { mIsExotic = b; }
168
170 {
171 mTime = time;
172 }
173
174 float getClusterTime() const
175 {
176 return mTime;
177 }
178
179 int getIndMaxInput() const { return mInputIndMax; }
180 void setIndMaxInput(const int ind) { mInputIndMax = ind; }
181
182 float getCoreEnergy() const { return mCoreEnergy; }
183 void setCoreEnergy(float energy) { mCoreEnergy = energy; }
184
185 float getFCross() const { return mFCross; }
186 void setFCross(float fCross) { mFCross = fCross; }
187
192 TLorentzVector getMomentum(std::array<const float, 3> vertexPosition) const;
193
194 protected:
196 std::vector<int> mLabels;
197
198 int mNCells = 0;
199
201 std::vector<unsigned short> mCellsIndices; //[mNCells]
202
205 std::vector<float> mCellsAmpFraction; //[mNCells][0.,1.,16]
206
209 float mEnergy = 0;
210 float mCoreEnergy = 0.;
211 float mDispersion = 0;
212 float mChi2 = 0;
213 float mM20 = 0;
214 float mM02 = 0;
215
216 float mEmcCpvDistance = 1024;
217
218 float mTrackDx = 1024;
219 float mTrackDz = 1024;
220
221 float mDistToBadChannel = 1024;
222
223 int mID = 0;
224 unsigned char mNExMax = 0;
225
226 float mTime = 0.;
227
228 bool mIsExotic = false;
229 float mFCross = 0.f;
230
231 int mInputIndMax = -1;
232
234};
235
236} // namespace emcal
237} // namespace o2
238#endif // ANALYSISCLUSTER_H
int16_t time
Definition RawEventData.h:4
int32_t i
Exception handling non-existing cell indices.
const char * what() const noexcept final
Access to error message of the exception.
CellOutOfRangeException(Int_t cellIndex)
Constructor, setting cell wrong cell index raising the exception.
~CellOutOfRangeException() noexcept final=default
Destructor.
Int_t getCellIndex() const noexcept
Access to cell ID raising the exception.
Cluster class for kinematic cluster parametersported from AliVCluster in AliRoot.
float mDistToBadChannel
Distance to nearest bad channel.
math_utils::Point3D< float > mGlobalPos
Position in global coordinate system (cm).
void setNExMax(unsigned char nExMax)
void setGlobalPosition(math_utils::Point3D< float > x)
Set the cluster global position.
float mM02
2-nd moment along the main eigen axis.
const std::vector< float > & getCellsAmplitudeFraction() const
void setFCross(float fCross)
void setDistanceToBadChannel(float dist)
AnalysisCluster(const AnalysisCluster &clus)=default
ClassDefNV(AnalysisCluster, 2)
void setCoreEnergy(float energy)
float mTrackDx
Distance to closest track in phi.
unsigned char getNExMax() const
float mEmcCpvDistance
the distance from PHOS EMC rec.point to the closest CPV rec.point.
math_utils::Point3D< float > getGlobalPosition() const
float mChi2
Chi2 of cluster fit (unfolded clusters)
math_utils::Point3D< float > getLocalPosition() const
float mTrackDz
Distance to closest track in z.
int mInputIndMax
exoticity parameter (1-E_cross/E_cell^max)
float mEnergy
Energy measured by calorimeter in GeV.
void setCellsAmplitudeFraction(const std::vector< float > &array)
int mID
Unique Id of the cluster.
bool mIsExotic
! Cluster marked as "exotic" (high energy deposition concentrated in a single cell)
void setCellsIndices(const std::vector< unsigned short > &array)
Set the array of cell indices.
math_utils::Point3D< float > mLocalPos
Local position in the sub-detector coordinate.
void setEmcCpvDistance(float dEmcCpv)
TLorentzVector getMomentum(std::array< const float, 3 > vertexPosition) const
float mM20
2-nd moment along the second eigen axis.
AnalysisCluster & operator=(const AnalysisCluster &source)=default
float mDispersion
Cluster shape dispersion.
float getDistanceToBadChannel() const
float getCellAmplitudeFraction(int i) const
std::vector< float > mCellsAmpFraction
const std::vector< unsigned short > & getCellsIndices() const
std::vector< int > mLabels
TODO to replace later by o2::MCLabel when implementing the MC handling.
void setIndMaxInput(const int ind)
void setTrackDistance(float dx, float dz)
unsigned char mNExMax
Number of Local (Ex-)maxima before unfolding.
std::vector< unsigned short > mCellsIndices
Array of cell indices contributing to this cluster.
void setClusterTime(float time)
float mCoreEnergy
Energy in a shower core.
float mTime
Time of the digit/cell with maximal energy deposition.
int mNCells
Number of cells in cluster.
void setLocalPosition(math_utils::Point3D< float > x)
GLdouble n
Definition glcorearb.h:1982
GLint GLenum GLint x
Definition glcorearb.h:403
GLenum array
Definition glcorearb.h:4274
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLsizei GLsizei GLchar * source
Definition glcorearb.h:798
GLuint id
Definition glcorearb.h:650
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.
std::string to_string(gsl::span< T, Size > span)
Definition common.h:52