Project
Loading...
Searching...
No Matches
Cluster.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_PHOS_CLUSTER_H_
13#define ALICEO2_PHOS_CLUSTER_H_
14#include <vector>
15#include <Rtypes.h>
16
17namespace o2
18{
19namespace phos
20{
21class Geometry;
24
25struct CluElement {
26 short absId = 0;
27 bool isHG = false;
28 int label = -1;
29 float energy = 0.;
30 float time = 0.;
31 float localX = 0.;
32 float localZ = 0.;
33 float fraction = 0.;
34 CluElement() = default;
35 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) {}
36};
37
39{
40
41 public:
42 Cluster() = default;
43 Cluster(const Cluster& clu) = default;
44
45 ~Cluster() = default;
46
50 bool operator<(const Cluster& other) const;
54 bool operator>(const Cluster& other) const;
55
56 float getEnergy() const { return mFullEnergy; }
57 void setEnergy(float e) { mFullEnergy = e; }
58
59 float getCoreEnergy() const { return mCoreEnergy; }
60 void setCoreEnergy(float ec) { mCoreEnergy = ec; }
61
62 float getDispersion() const { return mDispersion; }
63 void setDispersion(float d) { mDispersion = d; }
64
66 void getElipsAxis(float& lambdaShort, float& lambdaLong) const
67 {
68 lambdaShort = mLambdaShort;
69 lambdaLong = mLambdaLong;
70 }
71 void setElipsAxis(float lambdaShort, float lambdaLong)
72 {
73 mLambdaShort = lambdaShort;
74 mLambdaLong = lambdaLong;
75 }
76 void getLocalPosition(float& posX, float& posZ) const
77 {
78 posX = mLocalPosX;
79 posZ = mLocalPosZ;
80 }
81 void setLocalPosition(float posX, float posZ)
82 {
83 mLocalPosX = posX;
84 mLocalPosZ = posZ;
85 }
86 int getMultiplicity() const { return mLastCluElement - mFirstCluElement; } // gets the number of digits making this cluster
87
88 // 0: was no unfolging, -1: unfolding failed
89 void setNExMax(char nmax = 1) { mNExMax = nmax; }
90 char getNExMax() const { return mNExMax; } // Number of maxima found in cluster in unfolding:
91 // 0: was no unfolging, -1: unfolding failed
92 char module() const { return mModule; } // PHOS module of a current cluster
93 void setModule(char mod) { mModule = mod; } // set PHOS module of a current cluster
94
95 float getTime() const { return mTime; }
96 void setTime(float t) { mTime = t; }
97
98 char firedTrigger() const { return mFiredTrigger; }
99 void setFiredTrigger(char t) { mFiredTrigger = t; }
100
103
104 uint32_t getFirstCluEl() const { return mFirstCluElement; }
105 uint32_t getLastCluEl() const { return mLastCluElement; }
107 void setLastCluEl(uint32_t last) { mLastCluElement = last; }
108
109 // // Binary search implementation
110 // std::vector<Digit>::const_iterator BinarySearch(const std::vector<Digit>* container, Digit& element);
111
112 protected:
113 char mModule = 0;
114 char mNExMax = -1;
115 char mFiredTrigger = 0;
116 uint32_t mFirstCluElement = -1;
117 uint32_t mLastCluElement = -1;
118 float mLocalPosX = 0.;
119 float mLocalPosZ = 0.;
120 float mFullEnergy = 0.;
121 float mCoreEnergy = 0.;
122 float mLambdaLong = 0.;
123 float mLambdaShort = 0.;
124 float mDispersion = 0.;
125 float mTime = 0.;
126 float mDistToBadChannel = 999;
127
129};
130} // namespace phos
131} // namespace o2
132
133#endif
Contains PHOS cluster parameters.
Definition Cluster.h:39
float getEnergy() const
Definition Cluster.h:56
void addDigit()
Method to add digit to a cluster.
Definition Cluster.h:102
uint32_t getFirstCluEl() const
Definition Cluster.h:104
float mCoreEnergy
energy in a shower core
Definition Cluster.h:121
uint32_t mLastCluElement
index of the last contributing CluElement in a list
Definition Cluster.h:117
ClassDefNV(Cluster, 4)
void setFirstCluEl(uint32_t first)
Definition Cluster.h:106
void setCoreEnergy(float ec)
Definition Cluster.h:60
float mLocalPosZ
Center of gravity position in local module coordunates (z direction)
Definition Cluster.h:119
int getMultiplicity() const
Definition Cluster.h:86
void setNExMax(char nmax=1)
Definition Cluster.h:89
void setDispersion(float d)
Definition Cluster.h:63
bool operator<(const Cluster &other) const
Comparison oparator, based on time and coordinates.
Definition Cluster.cxx:21
void setFiredTrigger(char t)
Definition Cluster.h:99
float mDistToBadChannel
Distance to nearest bad crystal.
Definition Cluster.h:126
float mLambdaShort
shower ellipse axes
Definition Cluster.h:123
uint32_t mFirstCluElement
index of the first contributing CluElement in a list
Definition Cluster.h:116
void setLocalPosition(float posX, float posZ)
Definition Cluster.h:81
char getNExMax() const
Definition Cluster.h:90
float mTime
Time of the digit with maximal energy deposition.
Definition Cluster.h:125
float mLocalPosX
Center of gravity position in local module coordunates (phi direction)
Definition Cluster.h:118
bool operator>(const Cluster &other) const
Comparison oparator, based on time and coordinates.
Definition Cluster.cxx:47
float mDispersion
shower dispersion
Definition Cluster.h:124
float getDistanceToBadChannel() const
Definition Cluster.h:65
void setModule(char mod)
Definition Cluster.h:93
float getTime() const
Definition Cluster.h:95
void setEnergy(float e)
Definition Cluster.h:57
float getDispersion() const
Definition Cluster.h:62
void setLastCluEl(uint32_t last)
Definition Cluster.h:107
float mLambdaLong
shower ellipse axes
Definition Cluster.h:122
~Cluster()=default
void getElipsAxis(float &lambdaShort, float &lambdaLong) const
Definition Cluster.h:66
char mNExMax
number of (Ex-)maxima before unfolding
Definition Cluster.h:114
char mFiredTrigger
matched with PHOS trigger: 0 no match, bit 1 with 2x2, bit 2 with 4x4
Definition Cluster.h:115
void setElipsAxis(float lambdaShort, float lambdaLong)
Definition Cluster.h:71
char module() const
Definition Cluster.h:92
float mFullEnergy
full energy of a shower
Definition Cluster.h:120
void getLocalPosition(float &posX, float &posZ) const
Definition Cluster.h:76
uint32_t getLastCluEl() const
Definition Cluster.h:105
char firedTrigger() const
Definition Cluster.h:98
char mModule
Module number.
Definition Cluster.h:113
void setTime(float t)
Definition Cluster.h:96
float getCoreEnergy() const
Definition Cluster.h:59
Cluster(const Cluster &clu)=default
GLint GLenum GLint x
Definition glcorearb.h:403
GLint first
Definition glcorearb.h:399
GLuint GLsizei const GLchar * label
Definition glcorearb.h:2519
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
CluElement(short a, bool hg, float e, float t, float x, float z, int lab, float fr)
Definition Cluster.h:35
VectorOfTObjectPtrs other
Cluster clu