ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetRecEvent
InDetPrepRawData
src
PixelCluster.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// PixelCluster.cxx
7
// Implementation file for class PixelCluster
9
// (c) ATLAS Detector software
11
// Version 1.0 15/07/2003 Veronique Boisvert
13
14
#include "
InDetPrepRawData/PixelCluster.h
"
15
// forward includes
16
#include <ostream>
17
#include <sstream>
18
19
#include "GaudiKernel/MsgStream.h"
20
#include "
InDetPrepRawData/SiWidth.h
"
21
#include "
InDetReadoutGeometry/SiDetectorElement.h
"
22
23
// Set maximum charge for calibrated clusters
24
// Needed as protection to avoid FPE in transient-to-persistent
25
// converters. There, to save disk space, charge is stored as an int
26
// up to 0xFFFFFF. Higher charges have no meaning anyhow (may only come from
27
// big clusters with no position information).
28
#define MAXCHARGE (float(0xFFFFFF))
29
30
namespace
InDet
{
31
32
PixelCluster::PixelCluster
(
const
Identifier
& RDOId,
33
const
Amg::Vector2D
& locpos,
34
std::vector<Identifier>&&
rdoList
,
35
const
InDet::SiWidth
&
width
,
36
const
InDetDD::SiDetectorElement
* detEl,
37
Amg::MatrixX
&& locErrMat,
38
const
float
omegax
,
39
const
float
omegay
,
40
bool
split
,
41
float
splitProb1,
42
float
splitProb2)
43
:
SiCluster
(RDOId, locpos,
std
::move(
rdoList
),
width
, detEl,
std
::move(locErrMat)) {
44
m_omegax
=
omegax
;
45
m_omegay
=
omegay
;
46
m_totList
.clear();
47
m_totalToT
= 0;
48
m_chargeList
.clear();
49
m_totalCharge
= 0;
50
m_fake
=
false
;
51
m_ambiguous
=
false
;
52
m_lvl1
= 0;
53
m_tooBigToBeSplit
=
false
;
54
55
packSplitInformation
(
split
, splitProb1, splitProb2);
56
}
57
58
PixelCluster::PixelCluster
(
const
Identifier
& RDOId,
59
const
Amg::Vector2D
& locpos,
60
std::vector<Identifier>&&
rdoList
,
61
const
int
lvl1a,
62
std::vector<int>&&
totList
,
63
const
InDet::SiWidth
&
width
,
64
const
InDetDD::SiDetectorElement
* detEl,
65
Amg::MatrixX
&& locErrMat,
66
const
float
omegax
,
67
const
float
omegay
,
68
bool
split
,
69
float
splitProb1,
70
float
splitProb2)
71
:
SiCluster
(RDOId, locpos,
std
::move(
rdoList
),
width
, detEl,
std
::move(locErrMat)),
72
m_omegax
(
omegax
),
73
m_omegay
(
omegay
),
74
m_totList
(
std
::move(
totList
)),
75
m_totalToT
(0),
76
m_chargeList
(),
77
m_totalCharge
(0),
78
m_fake
(false),
79
m_ambiguous
(false),
80
m_lvl1
(lvl1a),
81
m_tooBigToBeSplit
(false) {
82
int
n =
m_totList
.size();
83
for
(
int
i = 0; i < n; i++){
84
m_totalToT
+= int(
m_totList
[i]);
85
}
86
packSplitInformation
(
split
, splitProb1, splitProb2);
87
}
88
89
PixelCluster::PixelCluster
(
const
Identifier
& RDOId,
90
const
Amg::Vector2D
& locpos,
91
std::vector<Identifier>&&
rdoList
,
92
const
int
lvl1a,
93
std::vector<int>&&
totList
,
94
std::vector<float>&&
chargeList
,
95
const
InDet::SiWidth
&
width
,
96
const
InDetDD::SiDetectorElement
* detEl,
97
Amg::MatrixX
&& locErrMat,
98
const
float
omegax
,
99
const
float
omegay
,
100
bool
split
,
101
float
splitProb1,
102
float
splitProb2)
103
:
SiCluster
(RDOId, locpos,
std
::move(
rdoList
),
width
, detEl,
std
::move(locErrMat)),
104
m_omegax
(
omegax
),
105
m_omegay
(
omegay
),
106
m_totList
(
std
::move(
totList
)),
107
m_totalToT
(0),
108
m_chargeList
(
std
::move(
chargeList
)),
109
m_totalCharge
(0),
110
m_fake
(false),
111
m_ambiguous
(false),
112
m_lvl1
(lvl1a),
113
m_tooBigToBeSplit
(false) {
114
int
n =
m_totList
.size();
115
for
(
int
i = 0; i < n; i++){
116
m_totalToT
+= int(
m_totList
[i]);
117
}
118
n =
m_chargeList
.size();
119
for
(
int
i = 0; i < n; i++){
120
m_totalCharge
+=
m_chargeList
[i];
121
}
122
if
(
m_totalCharge
>
MAXCHARGE
){
123
m_totalCharge
=
MAXCHARGE
;
124
}
125
packSplitInformation
(
split
, splitProb1, splitProb2);
126
}
127
128
PixelCluster::PixelCluster
(
const
Identifier
& RDOId,
129
const
Amg::Vector2D
& locpos,
130
const
Amg::Vector3D
& globpos,
131
std::vector<Identifier>&&
rdoList
,
132
const
int
lvl1a,
133
std::vector<int>&&
totList
,
134
std::vector<float>&&
chargeList
,
135
const
InDet::SiWidth
&
width
,
136
const
InDetDD::SiDetectorElement
* detEl,
137
Amg::MatrixX
&& locErrMat,
138
const
float
omegax
,
139
const
float
omegay
,
140
bool
split
,
float
141
splitProb1,
142
float
splitProb2)
143
:
SiCluster
(RDOId, locpos, globpos,
std
::move(
rdoList
),
width
, detEl,
std
::move(locErrMat)),
144
m_omegax
(
omegax
),
145
m_omegay
(
omegay
),
146
m_totList
(
std
::move(
totList
)),
147
m_totalToT
(0),
148
m_chargeList
(
std
::move(
chargeList
)),
149
m_totalCharge
(0),
150
m_fake
(false),
151
m_ambiguous
(false),
152
m_lvl1
(lvl1a),
153
m_tooBigToBeSplit
(false) {
154
int
n =
m_totList
.size();
155
for
(
int
i = 0; i < n; i++){
156
m_totalToT
+= int(
m_totList
[i]);
157
}
158
n =
m_chargeList
.size();
159
for
(
int
i = 0; i < n; i++){
160
m_totalCharge
+=
m_chargeList
[i];
161
}
162
if
(
m_totalCharge
>
MAXCHARGE
){
163
m_totalCharge
=
MAXCHARGE
;
164
}
165
packSplitInformation
(
split
, splitProb1, splitProb2);
166
}
167
168
PixelCluster::PixelCluster
(
const
Identifier
& RDOId,
169
const
Amg::Vector2D
& locpos,
170
std::vector<Identifier>&&
rdoList
,
171
const
int
lvl1a,
172
int
totalToT
,
173
std::vector<float>&&
chargeList
,
174
float
totalCharge
,
175
const
InDet::SiWidth
&
width
,
176
const
InDetDD::SiDetectorElement
* detEl,
177
Amg::MatrixX
&& locErrMat,
178
const
float
omegax
,
179
const
float
omegay
,
180
int
splitInfoRaw
)
181
:
SiCluster
(RDOId, locpos,
std
::move(
rdoList
),
width
, detEl,
182
std
::move(locErrMat)),
// call base class constructor
183
m_omegax
(
omegax
),
184
m_omegay
(
omegay
),
185
m_totList
(),
186
m_totalToT
(
totalToT
),
187
m_chargeList
(
std
::move(
chargeList
)),
188
m_totalCharge
(
totalCharge
),
189
m_fake
(false),
190
m_ambiguous
(false),
191
m_lvl1
(lvl1a),
192
m_splitInfo
(
splitInfoRaw
),
193
m_tooBigToBeSplit
(false) {}
194
195
// Default constructor:
196
PixelCluster::PixelCluster
()
197
:
SiCluster
(),
198
m_omegax
(-1),
199
m_omegay
(-1),
200
m_totalToT
(0),
201
m_totalCharge
(0),
202
m_fake
(false),
203
m_ambiguous
(false),
204
m_lvl1
(0),
205
m_splitInfo
(0),
206
m_tooBigToBeSplit
(false) {}
207
208
// default dtor
209
PixelCluster::~PixelCluster
() =
default
;
210
211
bool
PixelCluster::type
(
Trk::PrepRawDataType
type
)
const
{
212
return
(
type
==
Trk::PrepRawDataType::PixelCluster
or
213
type
==
Trk::PrepRawDataType::SiCluster
);
214
}
215
Trk::PrepRawDataType
PixelCluster::prdType
()
const
{
216
return
Trk::PrepRawDataType::PixelCluster
;
217
}
218
219
MsgStream&
PixelCluster::dump
(MsgStream& stream)
const
{
220
std::ostringstream out;
221
dump
(out);
222
stream << out.str();
223
return
stream;
224
}
225
226
std::ostream&
PixelCluster::dump
(std::ostream& stream)
const
{
227
const
std::string lf{
"\n"
};
228
stream <<
"PixelCluster object"
<< lf;
229
stream <<
"omegax: "
<<
m_omegax
<<
" omegay: "
<<
m_omegay
<< lf;
230
stream <<
"total ToT: "
<<
m_totalToT
231
<<
", calibrated charge ="
<<
m_totalCharge
<< lf;
232
stream <<
"split information: "
<< (
isSplit
() ?
"split"
:
"not split"
);
233
stream <<
", probabilities "
<<
splitProbability1
() <<
", "
234
<<
splitProbability2
() << lf;
235
stream <<
"Base class (SiCluster):"
<< lf;
236
this->
SiCluster::dump
(stream);
237
238
return
stream;
239
}
240
241
MsgStream&
operator<<
(MsgStream& stream,
const
PixelCluster
& prd) {
242
return
prd.
dump
(stream);
243
}
244
245
std::ostream&
operator<<
(std::ostream& stream,
const
PixelCluster
& prd) {
246
return
prd.
dump
(stream);
247
}
248
249
void
PixelCluster::setToTList
(std::vector<int>&&
totList
) {
250
m_totList
= std::move(
totList
);
251
m_totalToT
= 0;
252
for
(
int
f :
m_totList
) {
253
m_totalToT
+= f;
254
}
255
}
256
257
}
// end of namespace InDet
PixelCluster.h
MAXCHARGE
#define MAXCHARGE
Definition
PixelCluster.cxx:28
SiDetectorElement.h
SiWidth.h
InDetDD::SiDetectorElement
Class to hold geometrical description of a silicon detector element.
Definition
SiDetectorElement.h:109
InDet::PixelCluster
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
InDet::PixelCluster::splitProbability1
double splitProbability1() const
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:253
InDet::PixelCluster::m_tooBigToBeSplit
bool m_tooBigToBeSplit
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:184
InDet::PixelCluster::prdType
virtual Trk::PrepRawDataType prdType() const override final
Interface method checking the type.
Definition
PixelCluster.cxx:215
InDet::PixelCluster::splitProbability2
double splitProbability2() const
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:257
InDet::PixelCluster::m_omegax
float m_omegax
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:174
InDet::PixelCluster::totList
const std::vector< int > & totList() const
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:202
InDet::PixelCluster::dump
virtual MsgStream & dump(MsgStream &stream) const override final
dump information about the PRD object.
Definition
PixelCluster.cxx:219
InDet::PixelCluster::m_lvl1
int m_lvl1
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:182
InDet::PixelCluster::chargeList
const std::vector< float > & chargeList() const
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:210
InDet::PixelCluster::PixelCluster
PixelCluster()
Public, Copy, operator=, constructor.
Definition
PixelCluster.cxx:196
InDet::PixelCluster::m_ambiguous
bool m_ambiguous
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:181
InDet::PixelCluster::m_totList
std::vector< int > m_totList
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:176
InDet::PixelCluster::m_chargeList
std::vector< float > m_chargeList
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:178
InDet::PixelCluster::omegax
float omegax() const
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:194
InDet::PixelCluster::m_totalCharge
float m_totalCharge
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:179
InDet::PixelCluster::totalToT
int totalToT() const
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:206
InDet::PixelCluster::isSplit
bool isSplit() const
access mehtods for splitting
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:249
InDet::PixelCluster::m_fake
bool m_fake
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:180
InDet::PixelCluster::m_omegay
float m_omegay
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:175
InDet::PixelCluster::splitInfoRaw
int splitInfoRaw() const
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:261
InDet::PixelCluster::m_splitInfo
unsigned int m_splitInfo
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:183
InDet::PixelCluster::totalCharge
float totalCharge() const
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:214
InDet::PixelCluster::m_totalToT
int m_totalToT
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:177
InDet::PixelCluster::~PixelCluster
virtual ~PixelCluster()
InDet::PixelCluster::omegay
float omegay() const
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:198
InDet::PixelCluster::type
virtual bool type(Trk::PrepRawDataType type) const override final
Interface method checking the type.
Definition
PixelCluster.cxx:211
InDet::PixelCluster::setToTList
void setToTList(std::vector< int > &&totList)
Definition
PixelCluster.cxx:249
InDet::PixelCluster::packSplitInformation
void packSplitInformation(bool split, float prob1, float prob2)
Definition
InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:241
InDet::SiCluster::width
const InDet::SiWidth & width() const
return width class reference
InDet::SiCluster::dump
virtual MsgStream & dump(MsgStream &stream) const override
dump information about the SiCluster
Definition
SiCluster.cxx:88
InDet::SiCluster::SiCluster
SiCluster()=default
InDet::SiWidth
Definition
SiWidth.h:25
Trk::PrepRawData::rdoList
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
split
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition
hcg.cxx:179
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition
EventPrimitives.h:27
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition
GeoPrimitives.h:48
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Identifier
Definition
IdentifierFieldParser.cxx:14
InDet
Primary Vertex Finder.
Definition
VP1ErrorUtils.h:36
InDet::operator<<
MsgStream & operator<<(MsgStream &, const GNNTrackFinderTritonTool &)
Trk::PrepRawDataType
PrepRawDataType
Definition
PrepRawData.h:39
Trk::PrepRawDataType::SiCluster
@ SiCluster
Definition
PrepRawData.h:40
Trk::PrepRawDataType::PixelCluster
@ PixelCluster
Definition
PrepRawData.h:41
dump
-event-from-file
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0