32 (
const std::array<float,6> & startingPoint,
33 const std::array<float,3> & searchDirection,
34 std::vector<InDet::SiDetElementLink_xk::ElementWay> &lDE,
35 std::vector<bool> &
used)
const
45 float minusB =2*( searchDirection[0]*startingPoint[0]
46 +searchDirection[1]*startingPoint[1]);
47 float C = (
m_r-startingPoint[0]-startingPoint[1])
48 *(
m_r+startingPoint[0]+startingPoint[1])
49 +2.*startingPoint[0]*startingPoint[1];
50 float twoA = 2.*( searchDirection[0]*searchDirection[0]
51 +searchDirection[1]*searchDirection[1]);
52 if(twoA == 0.)
return;
53 float sq = minusB*minusB+2.*C*twoA;
61 float s1 =-(minusB+
sq)/twoA;
62 float s2 =-(minusB-
sq)/twoA;
68 s = (std::abs(s1) < std::abs(
s2) ? s1 :
s2);
72 s = (s1 > 0. ? s1 :
s2);
75 float zc = startingPoint[2]+searchDirection[2]*
s;
77 float At = std::sqrt(1.-searchDirection[2]*searchDirection[2]);
84 if(At != 0. && std::abs(zc-
m_z) > (
m_dz+(
m_dr*std::abs(searchDirection[2])+startingPoint[4])/At))
return;
86 float phiCrossing = std::atan2(startingPoint[1]+searchDirection[1]*
s,startingPoint[0]+searchDirection[0]*
s);
88 float reducedRoadWidth = startingPoint[4]/
m_r;
95 (
const std::array<float,6> & startingPoint,
96 const std::array<float,3> & searchDirection,
97 std::vector<InDet::SiDetElementLink_xk::ElementWay> &lDE,
98 std::vector<bool> &
used)
const
100 constexpr
float pi =
M_PI;
101 constexpr
float pi2 = 2.*
pi;
106 float minusB =2*( searchDirection[0]*startingPoint[0]
107 +searchDirection[1]*startingPoint[1]);
108 float C = (
m_r-startingPoint[0]-startingPoint[1])
109 *(
m_r+startingPoint[0]+startingPoint[1])
110 +2.*startingPoint[0]*startingPoint[1];
111 float twoA = 2.*( searchDirection[0]*searchDirection[0]
112 +searchDirection[1]*searchDirection[1]);
113 if(twoA == 0.)
return;
114 float sq = minusB*minusB+2.*C*twoA;
122 float s1 =-(minusB+
sq)/twoA;
123 float s2 =-(minusB-
sq)/twoA;
129 s = (std::abs(s1) < std::abs(
s2) ? s1 :
s2);
133 s = (s1 > 0. ? s1 :
s2);
136 float zc = startingPoint[2]+searchDirection[2]*
s;
138 float At = std::sqrt(1.-searchDirection[2]*searchDirection[2]);
139 float Sz = (
m_dr*std::abs(searchDirection[2])+startingPoint[4])/At;
146 if(At != 0. && std::abs(zc-
m_z) > (
m_dz+Sz))
return;
148 float reducedRoadWidth = startingPoint[4]/
m_r +
m_dfe;
150 float phiCrossing = std::atan2(startingPoint[1]+searchDirection[1]*
s,startingPoint[0]+searchDirection[0]*
s) - reducedRoadWidth;
151 if(phiCrossing<-
pi) phiCrossing +=
pi2;
156 if (phiCrossing <=
m_elements[ 0].phi()) i1 = 0 ;
167 phiCrossing += 2.*reducedRoadWidth;
169 for(
int i = i1;
i!=
ie; ++
i) {
174 &&
m_elements[
i].intersectITk(&(startingPoint[0]),&(searchDirection[0]),
s)) {
182 for(
int i=0;
i!=i1; ++
i) {
187 &&
m_elements[
i].intersectITk(&(startingPoint[0]),&(searchDirection[0]),
s)) {
207 (
const std::array<float,6> & startingPoint,
208 const std::array<float,3> & searchDirection,
209 std::vector<InDet::SiDetElementLink_xk::ElementWay> &lDE,
210 std::vector<bool> &
used)
const
214 float s =(
m_z-startingPoint[2])/searchDirection[2];
216 float xc = startingPoint[0]+searchDirection[0]*
s;
217 float yc = startingPoint[1]+searchDirection[1]*
s;
218 float rc = std::sqrt(xc*xc+yc*yc);
220 float A23 = searchDirection[2]*startingPoint[3];
225 if(A23 != 0. && std::abs(rc-
m_r) >
m_dr+std::abs(2.*(startingPoint[0]*searchDirection[0]+startingPoint[1]*searchDirection[1])*
m_dz/A23)+startingPoint[4])
return;
226 float phiCrossing = std::atan2(yc,xc);
227 float reducedRoadWidth = startingPoint[4]/rc;
234 (
const std::array<float,6> & startingPoint,
235 const std::array<float,3> & searchDirection,
236 std::vector<InDet::SiDetElementLink_xk::ElementWay> &lDE,
237 std::vector<bool> &
used)
const
239 constexpr
float pi =
M_PI;
240 constexpr
float pi2 = 2.*
pi;
244 float s =(
m_z-startingPoint[2])/searchDirection[2];
246 float xc = startingPoint[0]+searchDirection[0]*
s;
247 float yc = startingPoint[1]+searchDirection[1]*
s;
248 float rc = std::sqrt(xc*xc+yc*yc);
250 float A23 = searchDirection[2]*startingPoint[3];
255 if(A23 != 0. && std::abs(rc-
m_r) >
m_dr+std::abs(2.*(startingPoint[0]*searchDirection[0]+startingPoint[1]*searchDirection[1])*
m_dz/A23)+startingPoint[4])
return;
256 float reducedRoadWidth = startingPoint[4]/rc +
m_dfe;
257 float phiCrossing = std::atan2(yc,xc)-reducedRoadWidth;
258 if(phiCrossing<-
pi) phiCrossing +=
pi2;
263 if (phiCrossing <=
m_elements[ 0].phi()) i1 = 0 ;
274 phiCrossing += 2.*reducedRoadWidth;
276 for(
int i = i1;
i!=
ie; ++
i) {
280 if(
m_elements[
i].intersectITk(&(startingPoint[0]),&(searchDirection[0]),
s)) {
288 for(
int i=0;
i!=i1; ++
i) {
292 if(
m_elements[
i].intersectITk(&(startingPoint[0]),&(searchDirection[0]),
s)) {
312 (
const std::array<float,6> & startingPoint,
313 const std::array<float,3> & searchDirection,
315 float reducedRoadWidth,
316 std::vector<InDet::SiDetElementLink_xk::ElementWay> &lDE,
317 std::vector<bool> &
used)
const
319 constexpr
float pi =
M_PI;
320 constexpr
float pi2 = 2.*
pi;
340 std::array<float,3> intersectionOutcome{};
344 assert(
static_cast<unsigned int>(
i)<
m_elements.size() );
359 m_elements[
i].intersect(&(startingPoint[0]),&(searchDirection[0]),&(intersectionOutcome[0]));
362 if ( intersectionOutcome[0]<=startingPoint[4]
363 && (intersectionOutcome[1]<=startingPoint[4])
366 lDE.emplace_back(&
m_elements[
i],startingPoint[5]+intersectionOutcome[2],
std::max(intersectionOutcome[0],intersectionOutcome[1]));
383 assert(
static_cast<unsigned int>(
i)<
m_elements.size() );
387 if((
dPhi-reducedRoadWidth)>
m_dfe)
return;
388 m_elements[
i].intersect(&(startingPoint[0]),&(searchDirection[0]),&(intersectionOutcome[0]));
390 if((intersectionOutcome[0]-startingPoint[4])<=0 && (intersectionOutcome[1]-startingPoint[4])<=0.) {
391 lDE.emplace_back(&
m_elements[
i],startingPoint[5]+intersectionOutcome[2],
std::max(intersectionOutcome[0],intersectionOutcome[1]));