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;
85 auto mag1 =
std::sqrt(dx1 * dx1 + dy1 * dy1 + dz1 * dz1);
88 auto cosTheta =
dot / (mag1 *
mag2);
90 LogDebug(
"HGCDoublet") <<
"-- Are Aligned -- dot: " <<
dot <<
" mag1: " << mag1 <<
" mag2: " <<
mag2
91 <<
" cosTheta: " << cosTheta <<
" isWithinLimits: " << (cosTheta > minCosTheta) << std::endl;
104 auto dot_pointing = pointingDir.
dot(firstDoublet);
105 auto mag_pointing =
sqrt(pointingDir.
mag2());
106 auto cosTheta_pointing = dot_pointing / (
mag2 * mag_pointing);
108 LogDebug(
"HGCDoublet") <<
"-- Are Aligned -- dot_pointing: " << dot_pointing <<
" mag_pointing: " << mag_pointing
109 <<
" mag2: " <<
mag2 <<
" cosTheta_pointing: " << cosTheta_pointing
110 <<
" isWithinLimits: " << (cosTheta_pointing > minCosPointing) << std::endl;
113 return (cosTheta > minCosTheta) && (cosTheta_pointing > minCosPointing);
120 const unsigned int outInHops,
121 const unsigned int maxOutInHops,
122 std::vector<std::pair<unsigned int, unsigned int> > &outInToVisit) {
127 for (
unsigned int i = 0;
i < numberOfOuterNeighbors; ++
i) {
129 allDoublets, tmpNtuplet,
seedIndex, outInDFS, outInHops, maxOutInHops, outInToVisit);
131 if (outInDFS && outInHops < maxOutInHops) {
133 outInToVisit.emplace_back(inN, outInHops + 1);