4 const std::vector<int> &innerDoublets,
9 int nDoublets = innerDoublets.size();
10 int constexpr VSIZE = 4;
21 auto loop = [&](
int i,
int vs) {
22 for (
int j = 0;
j < vs; ++
j) {
23 auto otherDoubletId = innerDoublets[
i +
j];
24 auto &otherDoublet = allDoublets[otherDoubletId];
25 xi[
j] = otherDoublet.innerX();
26 yi[
j] = otherDoublet.innerY();
27 zi[
j] = otherDoublet.innerZ();
28 seedi[
j] = otherDoublet.seedIndex();
30 LogDebug(
"HGCDoublet") <<
i +
j <<
" is doublet " << otherDoubletId << std::endl;
33 for (
int j = 0;
j < vs; ++
j) {
40 LogDebug(
"HGCDoublet") <<
"Are aligned for InnerDoubletId: " <<
i +
j <<
" is " <<
ok[
j] << std::endl;
43 for (
int j = 0;
j < vs; ++
j) {
44 auto otherDoubletId = innerDoublets[
i +
j];
45 auto &otherDoublet = allDoublets[otherDoubletId];
47 otherDoublet.tagAsOuterNeighbor(doubletId);
48 allDoublets[doubletId].tagAsInnerNeighbor(otherDoubletId);
52 auto lim = VSIZE * (nDoublets / VSIZE);
53 for (
int i = 0;
i < lim;
i += VSIZE)
55 loop(lim, nDoublets - lim);
59 <<
" considered" << std::endl;
83 auto dot = dx1 * dx2 + dy1 * dy2 + dz1 * dz2;
86 auto mag1sq = dx1 * dx1 + dy1 * dy1 + dz1 * dz1;
87 auto mag2sq = dx2 * dx2 + dy2 * dy2 + dz2 * dz2;
89 auto minCosTheta_sq = minCosTheta * minCosTheta;
90 bool isWithinLimits = (dotsq > minCosTheta_sq * mag1sq * mag2sq);
93 LogDebug(
"HGCDoublet") <<
"-- Are Aligned -- dotsq: " << dotsq <<
" mag1sq: " << mag1sq <<
" mag2sq: " << mag2sq
94 <<
"minCosTheta_sq:" << minCosTheta_sq <<
" isWithinLimits: " << isWithinLimits << std::endl;
107 auto dot_pointing = pointingDir.
dot(firstDoublet);
108 auto dot_pointing_sq = dot_pointing * dot_pointing;
109 auto mag_pointing_sq = pointingDir.
mag2();
110 auto minCosPointing_sq = minCosPointing * minCosPointing;
111 bool isWithinLimitsPointing = (dot_pointing_sq > minCosPointing_sq * mag_pointing_sq * mag2sq);
113 LogDebug(
"HGCDoublet") <<
"Pointing direction: " << pointingDir << std::endl;
114 LogDebug(
"HGCDoublet") <<
"-- Are Aligned -- dot_pointing_sq: " << dot_pointing_sq
115 <<
" mag_pointing_sq: " << mag_pointing_sq <<
" mag2sq: " << mag2sq
116 <<
" isWithinLimitsPointing: " << isWithinLimitsPointing << std::endl;
120 return isWithinLimits && isWithinLimitsPointing;
127 const unsigned int outInHops,
128 const unsigned int maxOutInHops,
129 std::vector<std::pair<unsigned int, unsigned int> > &outInToVisit) {
134 for (
unsigned int i = 0;
i < numberOfOuterNeighbors; ++
i) {
136 allDoublets, tmpNtuplet,
seedIndex, outInDFS, outInHops, maxOutInHops, outInToVisit);
138 if (outInDFS && outInHops < maxOutInHops) {
140 outInToVisit.emplace_back(inN, outInHops + 1);