24 static const InterfaceID IID_ISiSpacePointMakerTool
25 (
"SiSpacePointMakerTool", 252891434, 0);
28 return IID_ISiSpacePointMakerTool;
33 const std::string&
name,
34 const IInterface*
parent) :
36 declareInterface< SiSpacePointMakerTool>(
this);
44 return StatusCode::SUCCESS;
48 return StatusCode::SUCCESS;
56 InDet::PixelClusterCollection::const_iterator clusStart =
clusters->begin();
57 InDet::PixelClusterCollection::const_iterator clusFinish =
clusters->end();
59 if ((*clusStart)->detectorElement()) {
61 const Amg::Transform3D& T = (*clusStart)->detectorElement()->surface().transform();
62 double Ax[3] = {T(0,0),T(1,0),T(2,0)};
63 double Ay[3] = {T(0,1),T(1,1),T(2,1)};
64 double Az[3] = {T(0,2),T(1,2),T(2,2)};
68 for(; clusStart!=clusFinish; ++clusStart){
75 double B0[2] = {Ax[0]*V(0,0)+Ax[1]*V(1,0),Ax[0]*V(1,0)+Ax[1]*V(1,1)};
76 double B1[2] = {Ay[0]*V(0,0)+Ay[1]*V(1,0),Ay[0]*V(1,0)+Ay[1]*V(1,1)};
77 double B2[2] = {Az[0]*V(0,0)+Az[1]*V(1,0),Az[0]*V(1,0)+Az[1]*V(1,1)};
79 double C01 = B1[0]*Ax[0]+B1[1]*Ax[1];
80 double C02 = B2[0]*Ax[0]+B2[1]*Ax[1];
81 double C12 = B2[0]*Ay[0]+B2[1]*Ay[1];
84 cov << B0[0] * Ax[0] + B0[1] * Ax[1], C01, C02, C01,
85 B1[0] * Ay[0] + B1[1] * Ay[1], C12,
87 C02, C12, B2[0] * Az[0] + B2[1] * Az[1];
115 double x12 = T1(0,0)*T2(0,0)+T1(1,0)*T2(1,0)+T1(2,0)*T2(2,0) ;
116 double r = isAnnulus ? std::sqrt(C[0]*C[0]+C[1]*C[1]) : std::sqrt(T1(0,3)*T1(0,3)+T1(1,3)*T1(1,3));
117 double s = (T1(0,3)-T2(0,3))*T1(0,2)+(T1(1,3)-T2(1,3))*T1(1,2)+(T1(2,3)-T2(2,3))*T1(2,2);
120 double d = isAnnulus ?
dm/.04 :
dm/std::sqrt((1.-x12)*(1.+x12));
122 if (std::abs(T1(2,2)) > 0.7)
d*=(
r/std::abs(T1(2,3)));
124 stripLengthGapTolerance =
d;
135 double& stripLengthGapTolerance,
136 double&
min,
double&
max)
const {
137 double dm =
offset(element1, element2, stripLengthGapTolerance);
148 std::array<const SCT_ClusterCollection*, nNeighbours>&
clusters,
149 std::array<double, 14>& overlapExtents,
178 constexpr
int otherSideIndex{1};
179 constexpr
int maxEtaIndex{3};
187 elementIndex[nElements++] =
n;
191 if(!nElements)
return;
197 std::vector<SCTinformation> sctInfos;
201 for (
const auto *
const cluster : *
clusters[0]) {
205 sctInfos.push_back(sct);
210 std::vector<Trk::SpacePoint*> tmpSpacePoints;
211 tmpSpacePoints.reserve(sctInfos.size());
217 for(;
n < nElements; ++
n) {
219 int currentIndex = elementIndex[
n];
221 if(currentIndex > maxEtaIndex)
break;
228 double min = overlapExtents[currentIndex*2-2];
229 double max = overlapExtents[currentIndex*2-1];
241 double lx1_offset = 0.;
250 for (
const auto *
const cluster : *
clusters[currentIndex]) {
252 bool processed =
false;
254 double lx1 = locpos.x();
257 for(
auto& sct : sctInfos) {
259 double diff = lx1+lx1_offset-sct.locX();
265 if(diff < min || diff >
max)
continue;
270 sctInfo.
set(cluster,ends.first, ends.second, vertexVec,lx1);
274 sct, sctInfo, Id, currentId,
limit, slimit, dataItemsSCT);
276 tmpSpacePoints.push_back(sp);
282 if( currentIndex==otherSideIndex && !tmpSpacePoints.empty() ) {
283 spacepointCollection->
reserve(tmpSpacePoints.size()+spacepointCollection->
size());
287 tmpSpacePoints.clear();
293 for(;
n < nElements; ++
n) {
295 int currentIndex = elementIndex[
n];
298 double min = overlapExtents[4*currentIndex-10];
299 double max = overlapExtents[4*currentIndex- 9];
305 std::vector<SCTinformation*> sctPhiInfos;
306 sctPhiInfos.reserve(sctInfos.size());
308 for(
auto& sct : sctInfos) {
309 double lx0 = sct.locX();
310 if (
min <= lx0 && lx0 <=
max) {
311 sctPhiInfos.push_back(&sct);
315 if(sctPhiInfos.empty())
continue;
319 min = overlapExtents[4*currentIndex-8];
320 max = overlapExtents[4*currentIndex-7];
326 for (
const auto *
const cluster : *
clusters[currentIndex]) {
329 double lx1 = locpos.x();
330 if(lx1 < min || lx1 >
max )
continue;
335 for(
auto& sct : sctPhiInfos) {
337 *sct, sctInfo, Id, currentId,
limit, slimit, dataItemsSCT);
339 tmpSpacePoints.push_back(sp);
346 if(!tmpSpacePoints.empty()) {
347 spacepointoverlapCollection->
reserve(tmpSpacePoints.size()+spacepointoverlapCollection->
size());
349 spacepointoverlapCollection->
push_back(sp);
357 for(
int n=0;
n!=nElements; ++
n) {
359 int currentIndex = elementIndex[
n];
364 offset(element, currentElement, slimit);
367 for (
const auto *
const cluster : *
clusters[currentIndex]) {
373 for(
auto& sct : sctInfos) {
376 tmpSpacePoints.push_back(sp);
382 if( currentIndex==otherSideIndex && !tmpSpacePoints.empty() ) {
383 spacepointCollection->
reserve(tmpSpacePoints.size()+spacepointCollection->
size());
387 tmpSpacePoints.clear();
391 if(!tmpSpacePoints.empty()) {
392 spacepointoverlapCollection->
reserve(tmpSpacePoints.size()+spacepointoverlapCollection->
size());
394 spacepointoverlapCollection->
push_back(sp);
410 if(std::abs(
a) > (std::abs(
b)*
l0))
return nullptr;
416 if(std::abs(
c) > (std::abs(
d)*
l1))
return nullptr;
428 double dmn = (
n-1.)*cs;
429 if(dmn >
dm)
dm = dmn;
431 if(std::abs(
m) >
limit || std::abs(
n) >
limit)
return nullptr;
436 double dmn = -(1.+
n)*cs;
437 if(dmn >
dm)
dm = dmn;
439 if(std::abs(
m) >
limit || std::abs(
n) >
limit)
return nullptr;
444 const std::pair<IdentifierHash,IdentifierHash> elementIdList(ID0,ID1);