7 const float thetaCut,
const float phiCut,
const float hardPtCut)
10 for (
auto hd : hitDoublets) tsize+=hd->size();
12 unsigned int cellId = 0;
13 float ptmin = region.
ptMin();
14 float region_origin_x = region.
origin().
x();
15 float region_origin_y = region.
origin().
y();
18 std::vector<bool> alreadyVisitedLayerPairs;
20 for (
auto visited : alreadyVisitedLayerPairs)
27 std::queue<int> LayerPairsToVisit;
31 LayerPairsToVisit.push(LayerPair);
35 unsigned int numberOfLayerPairsToVisitAtThisDepth =
36 LayerPairsToVisit.size();
38 while (!LayerPairsToVisit.empty())
40 auto currentLayerPair = LayerPairsToVisit.front();
44 bool allInnerLayerPairsAlreadyVisited {
true };
46 for (
auto innerLayerPair : currentInnerLayerRef.theInnerLayerPairs)
48 allInnerLayerPairsAlreadyVisited &=
49 alreadyVisitedLayerPairs[innerLayerPair];
52 if (alreadyVisitedLayerPairs[currentLayerPair] ==
false 53 && allInnerLayerPairsAlreadyVisited)
57 hitDoublets[currentLayerPair];
58 auto numberOfDoublets = doubletLayerPairId->
size();
59 currentLayerPairRef.theFoundCells[0] = cellId;
60 currentLayerPairRef.theFoundCells[1] = cellId+numberOfDoublets;
61 for (
unsigned int i = 0;
i < numberOfDoublets; ++
i)
63 allCells.emplace_back(doubletLayerPairId,
i,
68 currentOuterLayerRef.isOuterHitOfCell[doubletLayerPairId->
outerHitId(
i)].push_back(cellId);
72 auto & neigCells = currentInnerLayerRef.isOuterHitOfCell[doubletLayerPairId->
innerHitId(
i)];
74 neigCells, ptmin, region_origin_x,
75 region_origin_y, region_origin_radius, thetaCut,
81 assert(cellId==currentLayerPairRef.theFoundCells[1]);
82 for (
auto outerLayerPair : currentOuterLayerRef.theOuterLayerPairs)
84 LayerPairsToVisit.push(outerLayerPair);
87 alreadyVisitedLayerPairs[currentLayerPair] =
true;
89 LayerPairsToVisit.pop();
90 numberOfLayerPairsToVisitAtThisDepth--;
91 if (numberOfLayerPairsToVisitAtThisDepth == 0)
93 numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size();
107 unsigned int numberOfIterations = minHitsPerNtuplet - 2;
114 for (
auto i =layerPair.theFoundCells[0];
i<layerPair.theFoundCells[1]; ++
i)
122 for (
auto i =layerPair.theFoundCells[0];
i<layerPair.theFoundCells[1]; ++
i)
138 for (
auto i =foundCells[0];
i<foundCells[1]; ++
i)
143 if (cell.isRootCell(minHitsPerNtuplet - 2))
154 std::vector<CACell::CAntuplet>& foundNtuplets,
155 const unsigned int minHitsPerNtuplet)
158 tmpNtuplet.reserve(minHitsPerNtuplet);
163 tmpNtuplet.push_back(root_cell);
164 allCells[root_cell].findNtuplets(
allCells,foundNtuplets, tmpNtuplet, minHitsPerNtuplet);
171 const float thetaCut,
const float phiCut,
const float hardPtCut)
174 for (
auto hd : hitDoublets) tsize+=hd->size();
177 unsigned int cellId = 0;
178 float ptmin = region.
ptMin();
179 float region_origin_x = region.
origin().
x();
180 float region_origin_y = region.
origin().
y();
183 std::vector<bool> alreadyVisitedLayerPairs;
185 for (
auto visited : alreadyVisitedLayerPairs)
192 std::queue<int> LayerPairsToVisit;
196 LayerPairsToVisit.push(LayerPair);
200 unsigned int numberOfLayerPairsToVisitAtThisDepth =
201 LayerPairsToVisit.size();
203 while (!LayerPairsToVisit.empty())
205 auto currentLayerPair = LayerPairsToVisit.front();
209 bool allInnerLayerPairsAlreadyVisited {
true };
211 for (
auto innerLayerPair : currentInnerLayerRef.theInnerLayerPairs)
213 allInnerLayerPairsAlreadyVisited &=
214 alreadyVisitedLayerPairs[innerLayerPair];
217 if (alreadyVisitedLayerPairs[currentLayerPair] ==
false 218 && allInnerLayerPairsAlreadyVisited)
222 hitDoublets[currentLayerPair];
223 auto numberOfDoublets = doubletLayerPairId->
size();
224 currentLayerPairRef.theFoundCells[0] = cellId;
225 currentLayerPairRef.theFoundCells[1] = cellId+numberOfDoublets;
226 for (
unsigned int i = 0;
i < numberOfDoublets; ++
i)
228 allCells.emplace_back(doubletLayerPairId,
i,
233 currentOuterLayerRef.isOuterHitOfCell[doubletLayerPairId->
outerHitId(
i)].push_back(cellId);
237 auto & neigCells = currentInnerLayerRef.isOuterHitOfCell[doubletLayerPairId->
innerHitId(
i)];
239 neigCells, foundTriplets, ptmin, region_origin_x,
240 region_origin_y, region_origin_radius, thetaCut,
244 assert(cellId==currentLayerPairRef.theFoundCells[1]);
247 for (
auto outerLayerPair : currentOuterLayerRef.theOuterLayerPairs)
249 LayerPairsToVisit.push(outerLayerPair);
252 alreadyVisitedLayerPairs[currentLayerPair] =
true;
254 LayerPairsToVisit.pop();
255 numberOfLayerPairsToVisitAtThisDepth--;
256 if (numberOfLayerPairsToVisitAtThisDepth == 0)
258 numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size();
float originRBound() const
bounds the particle vertex in the transverse plane
void findNtuplets(std::vector< CACell::CAntuplet > &, const unsigned int)
void createAndConnectCells(const std::vector< const HitDoublets * > &, const TrackingRegion &, const float, const float, const float)
GlobalPoint const & origin() const
std::vector< CACellStatus > allStatus
std::vector< unsigned int > CAntuple
std::vector< CALayer > theLayers
int outerHitId(int i) const
std::vector< unsigned int > theRootCells
std::vector< CALayerPair > theLayerPairs
std::vector< CACell > allCells
float ptMin() const
minimal pt of interest
std::vector< int > theRootLayers
int innerHitId(int i) const
void findTriplets(const std::vector< const HitDoublets * > &hitDoublets, std::vector< CACell::CAntuplet > &foundTriplets, const TrackingRegion ®ion, const float thetaCut, const float phiCut, const float hardPtCut)
void evolve(const unsigned int)