109{
110
111
113 {
114 const InDetDD::SiDetectorElement* element=origCluster.
detectorElement();
115 if (element==nullptr) {
117 return {};
118 }
119 const AtlasDetectorID* aid = element->
getIdHelper();
120 if (aid==nullptr)
121 {
123 return {};
124 }
125
127 {
129 return {};
130 }
131 const PixelID* pixelIDp=static_cast<const PixelID*>(aid);
132
133 Identifier pixelId = origCluster.
identify();
135 {
136
137 ATH_MSG_VERBOSE(
" Cluster not on b-layer. Return empty object-->back to default clustering." );
138
139 return {};
140 }
141 }
142
143
144
145 const std::vector<Identifier>& rdos = origCluster.
rdoList();
146 const std::vector<int>& totList = origCluster.
totList();
147
148
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
178
179 std::vector<Amg::Vector2D> allLocalPositions;
180 std::vector<Amg::MatrixX> allErrorMatrix;
181
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;
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;
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;
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)
DoubleProperty m_thresholdSplittingIntoTwoClusters
BooleanProperty m_splitOnlyOnBLayer
DoubleProperty m_thresholdSplittingIntoThreeClusters
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....
Identifier identify() const
return the identifier