ATLAS Offline Software
Loading...
Searching...
No Matches
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
15// forward includes
16#include <ostream>
17#include <sstream>
18
19#include "GaudiKernel/MsgStream.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
30namespace InDet {
31
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)) {
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
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)),
74 m_totList(std::move(totList)),
75 m_totalToT(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
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)),
106 m_totList(std::move(totList)),
107 m_totalToT(0),
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++){
121 }
124 }
125 packSplitInformation(split, splitProb1, splitProb2);
126}
127
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)),
146 m_totList(std::move(totList)),
147 m_totalToT(0),
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++){
161 }
164 }
165 packSplitInformation(split, splitProb1, splitProb2);
166}
167
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
185 m_totList(),
189 m_fake(false),
190 m_ambiguous(false),
191 m_lvl1(lvl1a),
193 m_tooBigToBeSplit(false) {}
194
195// Default constructor:
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
210
218
219MsgStream& PixelCluster::dump(MsgStream& stream) const {
220 std::ostringstream out;
221 dump(out);
222 stream << out.str();
223 return stream;
224}
225
226std::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
241MsgStream& operator<<(MsgStream& stream, const PixelCluster& prd) {
242 return prd.dump(stream);
243}
244
245std::ostream& operator<<(std::ostream& stream, const PixelCluster& prd) {
246 return prd.dump(stream);
247}
248
249void 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
#define MAXCHARGE
Class to hold geometrical description of a silicon detector element.
virtual Trk::PrepRawDataType prdType() const override final
Interface method checking the type.
virtual MsgStream & dump(MsgStream &stream) const override final
dump information about the PRD object.
PixelCluster()
Public, Copy, operator=, constructor.
virtual ~PixelCluster()
virtual bool type(Trk::PrepRawDataType type) const override final
Interface method checking the type.
void setToTList(std::vector< int > &&totList)
const InDet::SiWidth & width() const
return width class reference
virtual MsgStream & dump(MsgStream &stream) const override
dump information about the SiCluster
Definition SiCluster.cxx:88
SiCluster()=default
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Primary Vertex Finder.
MsgStream & operator<<(MsgStream &, const GNNTrackFinderTritonTool &)
PrepRawDataType
Definition PrepRawData.h:39
-event-from-file
STL namespace.