6 const std::vector<const HitDoublets *> & hitDoublets,
10 const float hardPtCut)
13 for (
auto hd : hitDoublets) {
17 unsigned int cellId = 0;
19 float region_origin_x = region.
origin().
x();
20 float region_origin_y = region.
origin().
y();
23 std::vector<bool> alreadyVisitedLayerPairs;
25 for (
auto visited : alreadyVisitedLayerPairs) {
29 std::queue<int> LayerPairsToVisit;
32 LayerPairsToVisit.push(LayerPair);
35 unsigned int numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size();
37 while (not LayerPairsToVisit.empty()) {
38 auto currentLayerPair = LayerPairsToVisit.front();
42 bool allInnerLayerPairsAlreadyVisited{
true};
44 for (
auto innerLayerPair : currentInnerLayerRef.theInnerLayerPairs) {
45 allInnerLayerPairsAlreadyVisited &= alreadyVisitedLayerPairs[innerLayerPair];
48 if (alreadyVisitedLayerPairs[currentLayerPair] ==
false and allInnerLayerPairsAlreadyVisited) {
49 const HitDoublets *doubletLayerPairId = hitDoublets[currentLayerPair];
50 auto numberOfDoublets = doubletLayerPairId->
size();
51 currentLayerPairRef.theFoundCells[0] = cellId;
52 currentLayerPairRef.theFoundCells[1] = cellId + numberOfDoublets;
53 for (
unsigned int i = 0;
i < numberOfDoublets; ++
i) {
54 allCells.emplace_back(doubletLayerPairId,
i,
58 currentOuterLayerRef.isOuterHitOfCell[doubletLayerPairId->
outerHitId(
i)].push_back(cellId);
62 auto & neigCells = currentInnerLayerRef.isOuterHitOfCell[doubletLayerPairId->
innerHitId(
i)];
63 allCells.back().checkAlignmentAndTag(
64 allCells, neigCells, ptmin, region_origin_x, region_origin_y,
65 region_origin_radius, thetaCut, phiCut, hardPtCut);
67 assert(cellId == currentLayerPairRef.theFoundCells[1]);
68 for (
auto outerLayerPair : currentOuterLayerRef.theOuterLayerPairs) {
69 LayerPairsToVisit.push(outerLayerPair);
72 alreadyVisitedLayerPairs[currentLayerPair] =
true;
74 LayerPairsToVisit.pop();
75 numberOfLayerPairsToVisitAtThisDepth--;
76 if (numberOfLayerPairsToVisitAtThisDepth == 0) {
77 numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size();
87 unsigned int numberOfIterations = minHitsPerNtuplet - 2;
91 for (
auto i = layerPair.theFoundCells[0];
i < layerPair.theFoundCells[1]; ++
i) {
97 for (
auto i = layerPair.theFoundCells[0];
i < layerPair.theFoundCells[1]; ++
i) {
108 for (
auto i = foundCells[0];
i < foundCells[1]; ++
i) {
112 if (cell.isRootCell(minHitsPerNtuplet - 2)) {
123 tmpNtuplet.reserve(minHitsPerNtuplet);
128 tmpNtuplet.push_back(root_cell);
129 allCells[root_cell].findNtuplets(
allCells, foundNtuplets, tmpNtuplet, minHitsPerNtuplet);
134 std::vector<const HitDoublets *>
const& hitDoublets,
135 std::vector<CACell::CAntuplet> & foundTriplets,
TrackingRegion const& region,
136 const float thetaCut,
138 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();
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) {
183 allCells.emplace_back(doubletLayerPairId,
i,
187 currentOuterLayerRef.isOuterHitOfCell[doubletLayerPairId->
outerHitId(
i)].push_back(cellId);
191 auto & neigCells = currentInnerLayerRef.isOuterHitOfCell[doubletLayerPairId->
innerHitId(
i)];
192 allCells.back().checkAlignmentAndPushTriplet(
193 allCells, neigCells, foundTriplets, ptmin, region_origin_x, region_origin_y,
194 region_origin_radius, thetaCut, phiCut, hardPtCut);
196 assert(cellId == currentLayerPairRef.theFoundCells[1]);
197 for (
auto outerLayerPair : currentOuterLayerRef.theOuterLayerPairs) {
198 LayerPairsToVisit.push(outerLayerPair);
201 alreadyVisitedLayerPairs[currentLayerPair] =
true;
203 LayerPairsToVisit.pop();
204 numberOfLayerPairsToVisitAtThisDepth--;
205 if (numberOfLayerPairsToVisitAtThisDepth == 0) {
206 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)