ATLAS Offline Software
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 
30 namespace 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)) {
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 
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++){
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)),
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++){
121  }
122  if (m_totalCharge > MAXCHARGE){
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)),
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++){
161  }
162  if (m_totalCharge > MAXCHARGE){
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
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:
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 
214 }
215 
216 MsgStream& PixelCluster::dump(MsgStream& stream) const {
217  std::ostringstream out;
218  dump(out);
219  stream << out.str();
220  return stream;
221 }
222 
223 std::ostream& PixelCluster::dump(std::ostream& stream) const {
224  const std::string lf{"\n"};
225  stream << "PixelCluster object" << lf;
226  stream << "omegax: " << m_omegax << " omegay: " << m_omegay << lf;
227  stream << "total ToT: " << m_totalToT
228  << ", calibrated charge =" << m_totalCharge << lf;
229  stream << "split information: " << (isSplit() ? "split" : "not split");
230  stream << ", probabilities " << splitProbability1() << ", "
231  << splitProbability2() << lf;
232  stream << "Base class (SiCluster):" << lf;
233  this->SiCluster::dump(stream);
234 
235  return stream;
236 }
237 
238 MsgStream& operator<<(MsgStream& stream, const PixelCluster& prd) {
239  return prd.dump(stream);
240 }
241 
242 std::ostream& operator<<(std::ostream& stream, const PixelCluster& prd) {
243  return prd.dump(stream);
244 }
245 
246 void PixelCluster::setToTList(std::vector<int>&& totList) {
247  m_totList = std::move(totList);
248  m_totalToT = 0;
249  for (int f : m_totList) {
250  m_totalToT += f;
251  }
252 }
253 
254 } // end of namespace InDet
InDet::operator<<
MsgStream & operator<<(MsgStream &, const GNNTrackReaderTool &)
SiWidth.h
Trk::PrepRawDataType
PrepRawDataType
Definition: PrepRawData.h:39
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
InDet::PixelCluster::omegay
float omegay() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:197
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
PixelCluster.h
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
InDet::PixelCluster::PixelCluster
PixelCluster()
Public, Copy, operator=, constructor.
Definition: PixelCluster.cxx:196
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
MAXCHARGE
#define MAXCHARGE
Definition: PixelCluster.cxx:28
InDet::PixelCluster::isSplit
bool isSplit() const
access mehtods for splitting
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:248
InDet::PixelCluster::m_lvl1
int m_lvl1
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:181
InDet::PixelCluster::m_fake
bool m_fake
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:179
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
InDet::PixelCluster::splitProbability1
double splitProbability1() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:252
InDet::PixelCluster::packSplitInformation
void packSplitInformation(bool split, float prob1, float prob2)
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:240
python.TriggerAPI.TriggerAPISession.lf
lf
Definition: TriggerAPISession.py:390
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
InDet::PixelCluster::totList
const std::vector< int > & totList() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:201
InDet::PixelCluster::splitProbability2
double splitProbability2() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:256
InDet::PixelCluster::m_tooBigToBeSplit
bool m_tooBigToBeSplit
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:183
InDet::PixelCluster::dump
virtual MsgStream & dump(MsgStream &stream) const override final
dump information about the PRD object.
Definition: PixelCluster.cxx:216
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
InDet::PixelCluster::m_totalToT
int m_totalToT
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:176
InDet::PixelCluster::~PixelCluster
virtual ~PixelCluster()
InDet::PixelCluster::m_omegax
float m_omegax
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:173
InDet::PixelCluster::m_totalCharge
float m_totalCharge
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:178
hist_file_dump.f
f
Definition: hist_file_dump.py:135
Trk::PrepRawDataType::SiCluster
@ SiCluster
InDet::PixelCluster::setToTList
void setToTList(std::vector< int > &&totList)
Definition: PixelCluster.cxx:246
InDet::PixelCluster::m_omegay
float m_omegay
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:174
InDet::SiCluster::dump
virtual MsgStream & dump(MsgStream &stream) const override
dump information about the SiCluster
Definition: SiCluster.cxx:88
Trk::PrepRawDataType::PixelCluster
@ PixelCluster
InDet::PixelCluster::type
virtual bool type(Trk::PrepRawDataType type) const override final
Interface method checking the type.
Definition: PixelCluster.cxx:211
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
SiDetectorElement.h
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
InDet::PixelCluster::omegax
float omegax() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:193
InDet::PixelCluster::m_totList
std::vector< int > m_totList
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:175
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
InDet::SiWidth
Definition: SiWidth.h:25
InDet::PixelCluster::m_chargeList
std::vector< float > m_chargeList
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:177
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
InDet::SiCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h:40
InDet::PixelCluster::m_ambiguous
bool m_ambiguous
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:180
Identifier
Definition: IdentifierFieldParser.cxx:14