9 const float hardPtCut) {
11 for (
auto hd : hitDoublets) {
15 unsigned int cellId = 0;
17 float region_origin_x =
region.origin().x();
18 float region_origin_y =
region.origin().y();
19 float region_origin_radius =
region.originRBound();
21 std::vector<bool> alreadyVisitedLayerPairs;
23 for (
auto visited : alreadyVisitedLayerPairs) {
27 std::queue<int> LayerPairsToVisit;
30 LayerPairsToVisit.push(LayerPair);
33 unsigned int numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size();
35 while (not LayerPairsToVisit.empty()) {
36 auto currentLayerPair = LayerPairsToVisit.front();
40 bool allInnerLayerPairsAlreadyVisited{
true};
42 for (
auto innerLayerPair : currentInnerLayerRef.theInnerLayerPairs) {
43 allInnerLayerPairsAlreadyVisited &= alreadyVisitedLayerPairs[innerLayerPair];
46 if (alreadyVisitedLayerPairs[currentLayerPair] ==
false and allInnerLayerPairsAlreadyVisited) {
47 const HitDoublets *doubletLayerPairId = hitDoublets[currentLayerPair];
48 auto numberOfDoublets = doubletLayerPairId->
size();
49 currentLayerPairRef.theFoundCells[0] = cellId;
50 currentLayerPairRef.theFoundCells[1] = cellId + numberOfDoublets;
51 for (
unsigned int i = 0;
i < numberOfDoublets; ++
i) {
55 currentOuterLayerRef.isOuterHitOfCell[doubletLayerPairId->
outerHitId(
i)].push_back(cellId);
59 auto &neigCells = currentInnerLayerRef.isOuterHitOfCell[doubletLayerPairId->
innerHitId(
i)];
70 assert(cellId == currentLayerPairRef.theFoundCells[1]);
71 for (
auto outerLayerPair : currentOuterLayerRef.theOuterLayerPairs) {
72 LayerPairsToVisit.push(outerLayerPair);
75 alreadyVisitedLayerPairs[currentLayerPair] =
true;
77 LayerPairsToVisit.pop();
78 numberOfLayerPairsToVisitAtThisDepth--;
79 if (numberOfLayerPairsToVisitAtThisDepth == 0) {
80 numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size();
89 unsigned int numberOfIterations = minHitsPerNtuplet - 2;
93 for (
auto i = layerPair.theFoundCells[0];
i < layerPair.theFoundCells[1]; ++
i) {
99 for (
auto i = layerPair.theFoundCells[0];
i < layerPair.theFoundCells[1]; ++
i) {
110 for (
auto i = foundCells[0];
i < foundCells[1]; ++
i) {
114 if (cell.isRootCell(minHitsPerNtuplet - 2)) {
123 const unsigned int minHitsPerNtuplet) {
125 tmpNtuplet.reserve(minHitsPerNtuplet);
129 tmpNtuplet.push_back(root_cell);
130 allCells[root_cell].findNtuplets(
allCells, foundNtuplets, tmpNtuplet, minHitsPerNtuplet);
135 std::vector<CACell::CAntuplet> &foundTriplets,
137 const float thetaCut,
139 const float hardPtCut) {
141 for (
auto hd : hitDoublets) {
146 unsigned int cellId = 0;
148 float region_origin_x =
region.origin().x();
149 float region_origin_y =
region.origin().y();
150 float region_origin_radius =
region.originRBound();
152 std::vector<bool> alreadyVisitedLayerPairs;
154 for (
auto visited : alreadyVisitedLayerPairs) {
158 std::queue<int> LayerPairsToVisit;
161 LayerPairsToVisit.push(LayerPair);
164 unsigned int numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size();
166 while (not LayerPairsToVisit.empty()) {
167 auto currentLayerPair = LayerPairsToVisit.front();
171 bool allInnerLayerPairsAlreadyVisited{
true};
173 for (
auto innerLayerPair : currentInnerLayerRef.theInnerLayerPairs) {
174 allInnerLayerPairsAlreadyVisited &= alreadyVisitedLayerPairs[innerLayerPair];
177 if (alreadyVisitedLayerPairs[currentLayerPair] ==
false and allInnerLayerPairsAlreadyVisited) {
178 const HitDoublets *doubletLayerPairId = hitDoublets[currentLayerPair];
179 auto numberOfDoublets = doubletLayerPairId->
size();
180 currentLayerPairRef.theFoundCells[0] = cellId;
181 currentLayerPairRef.theFoundCells[1] = cellId + numberOfDoublets;
182 for (
unsigned int i = 0;
i < numberOfDoublets; ++
i) {
186 currentOuterLayerRef.isOuterHitOfCell[doubletLayerPairId->
outerHitId(
i)].push_back(cellId);
190 auto &neigCells = currentInnerLayerRef.isOuterHitOfCell[doubletLayerPairId->
innerHitId(
i)];
197 region_origin_radius,
202 assert(cellId == currentLayerPairRef.theFoundCells[1]);
203 for (
auto outerLayerPair : currentOuterLayerRef.theOuterLayerPairs) {
204 LayerPairsToVisit.push(outerLayerPair);
207 alreadyVisitedLayerPairs[currentLayerPair] =
true;
209 LayerPairsToVisit.pop();
210 numberOfLayerPairsToVisitAtThisDepth--;
211 if (numberOfLayerPairsToVisitAtThisDepth == 0) {
212 numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size();