ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::NnPixelClusterSplitter Class Referencefinal

#include <NnPixelClusterSplitter.h>

Inheritance diagram for InDet::NnPixelClusterSplitter:
Collaboration diagram for InDet::NnPixelClusterSplitter:

Public Member Functions

 NnPixelClusterSplitter (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor.
 ~NnPixelClusterSplitter ()=default
 Destructor.
virtual StatusCode initialize () override
 AthAlgTool interface methods.
virtual StatusCode finalize () override
virtual std::vector< InDet::PixelClusterPartssplitCluster (const InDet::PixelCluster &origCluster) const override
 take one, give zero or many
virtual std::vector< InDet::PixelClusterPartssplitCluster (const InDet::PixelCluster &origCluster, const InDet::PixelClusterSplitProb &spo) const override
 take one, give zero or many - with split probability object

Private Attributes

ToolHandle< NnClusterizationFactorym_NnClusterizationFactory { this, "NnClusterizationFactory", "InDet::NnClusterizationFactory/NnClusterizationFactory" }
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
DoubleProperty m_thresholdSplittingIntoTwoClusters { this, "ThresholdSplittingIntoTwoClusters", 0.95 }
DoubleProperty m_thresholdSplittingIntoThreeClusters { this, "ThresholdSplittingIntoThreeClusters", 0.90 }
BooleanProperty m_splitOnlyOnBLayer { this, "SplitOnlyOnBLayer", true }
BooleanProperty m_useBeamSpotInfo { this, "useBeamSpotInfo", true }

Detailed Description

Constructor & Destructor Documentation

◆ NnPixelClusterSplitter()

InDet::NnPixelClusterSplitter::NnPixelClusterSplitter ( const std::string & type,
const std::string & name,
const IInterface * parent )

Constructor.

Name : NnClusterizationFactory.cxx Package : SiClusterizationTool Author : Andi Salzburger (CERN PH-ADP) Giacinto Piacquadio (PH-ADE-ID) Created : January 2011.

DESCRIPTION: Split cluster in sub-clusters, given a certain PixelClusterSplitProb If no PixelClusterSplitProb is given split cluster in 1,2 and 3 sub-clusters and store all results.

Definition at line 32 of file NnPixelClusterSplitter.cxx.

34 :
35 base_class(type,name,parent)
36{
37}

◆ ~NnPixelClusterSplitter()

InDet::NnPixelClusterSplitter::~NnPixelClusterSplitter ( )
default

Destructor.

Member Function Documentation

◆ finalize()

StatusCode InDet::NnPixelClusterSplitter::finalize ( )
overridevirtual

Definition at line 53 of file NnPixelClusterSplitter.cxx.

53 {
54 return StatusCode::SUCCESS;
55}

◆ initialize()

StatusCode InDet::NnPixelClusterSplitter::initialize ( )
overridevirtual

AthAlgTool interface methods.

Definition at line 39 of file NnPixelClusterSplitter.cxx.

39 {
40
41 if (m_NnClusterizationFactory.retrieve().isFailure())
42 {
43 ATH_MSG_ERROR(" Unable to retrieve "<< m_NnClusterizationFactory );
44 return StatusCode::FAILURE;
45 }
46
47 ATH_CHECK(m_beamSpotKey.initialize());
48
49 ATH_MSG_DEBUG(" Cluster splitter initialized successfully "<< m_NnClusterizationFactory );
50 return StatusCode::SUCCESS;
51}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
ToolHandle< NnClusterizationFactory > m_NnClusterizationFactory
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey

◆ splitCluster() [1/2]

std::vector< InDet::PixelClusterParts > InDet::NnPixelClusterSplitter::splitCluster ( const InDet::PixelCluster & origCluster) const
overridevirtual

take one, give zero or many

Definition at line 58 of file NnPixelClusterSplitter.cxx.

59{
60
61 //add treatment for b-layer only HERE
62
63
64 const std::vector<Identifier>& rdos = origCluster.rdoList();
65 const std::vector<int>& totList = origCluster.totList();
66
67 //fill lvl1group all with the same value... (not best way but ...)
68 std::vector<int> lvl1group(rdos.size(),origCluster.LVL1A());
69
70
71
72 std::vector<Amg::Vector2D> allLocalPositions;
73 std::vector<Amg::MatrixX> allErrorMatrix;
74
75
76 std::vector<Amg::MatrixX> errorMatrix;
77
78 Amg::Vector3D beamSpotPosition(0,0,0);
80 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
81 beamSpotPosition = beamSpotHandle->beamPos();
82 }
83
84 std::vector<Amg::Vector2D> localPosition=m_NnClusterizationFactory->estimatePositions(origCluster,
85 beamSpotPosition,
86 errorMatrix,
87 2);
88
89
90
91 if (errorMatrix.size()!=2 || localPosition.size()!=2)
92 {
93 ATH_MSG_WARNING("Error matrix or local position vector size is not 2, it is:" << errorMatrix.size() << " or " << localPosition.size() << ".");
94 }
95
96 std::vector<InDet::PixelClusterParts> allMultiPClusters;
97
98
99 allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[0],errorMatrix[0]);
100 allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[1],errorMatrix[1]);
101
102
103 return allMultiPClusters;
104
105}
#define ATH_MSG_WARNING(x)
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
Eigen::Matrix< double, 3, 1 > Vector3D

◆ splitCluster() [2/2]

std::vector< InDet::PixelClusterParts > InDet::NnPixelClusterSplitter::splitCluster ( const InDet::PixelCluster & origCluster,
const InDet::PixelClusterSplitProb & spo ) const
overridevirtual

take one, give zero or many - with split probability object

Definition at line 107 of file NnPixelClusterSplitter.cxx.

109{
110
111
113 {
114 const InDetDD::SiDetectorElement* element=origCluster.detectorElement();
115 if (element==nullptr) {
116 ATH_MSG_WARNING("Could not get detector element");
117 return {};
118 }
119 const AtlasDetectorID* aid = element->getIdHelper();
120 if (aid==nullptr)
121 {
122 ATH_MSG_WARNING("Could not get ATLASDetectorID");
123 return {};
124 }
125
127 {
128 ATH_MSG_WARNING("Not a PixelID helper");
129 return {};
130 }
131 const PixelID* pixelIDp=static_cast<const PixelID*>(aid);
132 //check if original pixel is on b-layer and if yes continue, otherwise interrupt...
133 Identifier pixelId = origCluster.identify();
134 if (!pixelIDp->is_blayer(pixelId))
135 {
136 //return empty object...
137 ATH_MSG_VERBOSE(" Cluster not on b-layer. Return empty object-->back to default clustering." );
138
139 return {};
140 }
141 }
142
143 //add treatment for b-layer only HERE
144
145 const std::vector<Identifier>& rdos = origCluster.rdoList();
146 const std::vector<int>& totList = origCluster.totList();
147
148 //fill lvl1group all with the same value... (not best way but ...)
149 std::vector<int> lvl1group(rdos.size(), origCluster.LVL1A());
150
151
152
153 if (splitProb.getHighestSplitMultiplicityStored()<3) return {};
154
155 double splitProb2=splitProb.splitProbability(2);
156 double splitProb3rel=splitProb.splitProbability(3);
157
158 double splitProb3=splitProb3rel/(splitProb3rel+splitProb2);
159
160 ATH_MSG_VERBOSE( " SplitProb -->2 " << splitProb2 << " SplitProb -->3 " << splitProb3 );
161
162 int nParticles=1;
163
165 {
167 {
168 nParticles=3;
169 }
170 else
171 {
172 nParticles=2;
173 }
174 }
175
176
177 ATH_MSG_VERBOSE( " Decided for n. particles: " << nParticles << "." );
178
179 std::vector<Amg::Vector2D> allLocalPositions;
180 std::vector<Amg::MatrixX> allErrorMatrix;
181
182 Amg::Vector3D beamSpotPosition(0,0,0);
184 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
185 beamSpotPosition = beamSpotHandle->beamPos();
186 }
187
188 std::vector<InDet::PixelClusterParts> allMultiPClusters;
189
190 if (nParticles==1)
191 {
192 std::vector<Amg::MatrixX> errorMatrix;
193 std::vector<Amg::Vector2D> localPosition=m_NnClusterizationFactory->estimatePositions(origCluster,
194 beamSpotPosition,
195 errorMatrix,
196 1);
197
198 if (errorMatrix.size()!=1 || localPosition.size()!=1)
199 {
200 ATH_MSG_ERROR("Error matrix or local position vector size is not 1, it is:" << errorMatrix.size() << " or " << localPosition.size() << ".");
201 }
202
203 allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[0],errorMatrix[0]);
204 }
205 else if (nParticles==2)
206 {
207
208 std::vector<Amg::MatrixX> errorMatrix;
209 std::vector<Amg::Vector2D> localPosition=m_NnClusterizationFactory->estimatePositions(origCluster,
210 beamSpotPosition,
211 errorMatrix,
212 2);
213
214 if (errorMatrix.size()!=2 || localPosition.size()!=2)
215 {
216 ATH_MSG_ERROR("Error matrix or local position vector size is not 2, it is:" << errorMatrix.size() << " or " << localPosition.size() << ".");
217 }
218
219 allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[0],errorMatrix[0]);
220 allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[1],errorMatrix[1]);
221 }
222 else if (nParticles==3)
223 {
224
225 std::vector<Amg::MatrixX> errorMatrix;
226 std::vector<Amg::Vector2D> localPosition=m_NnClusterizationFactory->estimatePositions(origCluster,
227 beamSpotPosition,
228 errorMatrix,
229 3);
230
231 if (errorMatrix.size()!=3 || localPosition.size()!=3)
232 {
233 ATH_MSG_ERROR("Error matrix or local position vector size is not 2, it is:" << errorMatrix.size() << " or " << localPosition.size() << ".");
234 }
235
236
237 allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[0],errorMatrix[0]);
238 allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[1],errorMatrix[1]);
239 allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[2],errorMatrix[2]);
240 }
241
242 return allMultiPClusters;
243
244}
#define ATH_MSG_VERBOSE(x)
virtual HelperType helper() const
Type of helper, defaulted to 'Unimplemented'.
const AtlasDetectorID * getIdHelper() const
Returns the id helper (inline)
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
bool is_blayer(const Identifier &id) const
Test for b-layer - WARNING: id MUST be pixel id, otherwise answer is not accurate....
Definition PixelID.h:614
Identifier identify() const
return the identifier

Member Data Documentation

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> InDet::NnPixelClusterSplitter::m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
private

Definition at line 55 of file NnPixelClusterSplitter.h.

55{ this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };

◆ m_NnClusterizationFactory

ToolHandle<NnClusterizationFactory> InDet::NnPixelClusterSplitter::m_NnClusterizationFactory { this, "NnClusterizationFactory", "InDet::NnClusterizationFactory/NnClusterizationFactory" }
private

Definition at line 54 of file NnPixelClusterSplitter.h.

54{ this, "NnClusterizationFactory", "InDet::NnClusterizationFactory/NnClusterizationFactory" };

◆ m_splitOnlyOnBLayer

BooleanProperty InDet::NnPixelClusterSplitter::m_splitOnlyOnBLayer { this, "SplitOnlyOnBLayer", true }
private

Definition at line 58 of file NnPixelClusterSplitter.h.

58{ this, "SplitOnlyOnBLayer", true };

◆ m_thresholdSplittingIntoThreeClusters

DoubleProperty InDet::NnPixelClusterSplitter::m_thresholdSplittingIntoThreeClusters { this, "ThresholdSplittingIntoThreeClusters", 0.90 }
private

Definition at line 57 of file NnPixelClusterSplitter.h.

57{ this, "ThresholdSplittingIntoThreeClusters", 0.90 };

◆ m_thresholdSplittingIntoTwoClusters

DoubleProperty InDet::NnPixelClusterSplitter::m_thresholdSplittingIntoTwoClusters { this, "ThresholdSplittingIntoTwoClusters", 0.95 }
private

Definition at line 56 of file NnPixelClusterSplitter.h.

56{ this, "ThresholdSplittingIntoTwoClusters", 0.95 };

◆ m_useBeamSpotInfo

BooleanProperty InDet::NnPixelClusterSplitter::m_useBeamSpotInfo { this, "useBeamSpotInfo", true }
private

Definition at line 59 of file NnPixelClusterSplitter.h.

59{ this, "useBeamSpotInfo", true };

The documentation for this class was generated from the following files: