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};
47 for (
auto innerLayerPair : currentInnerLayerRef.theInnerLayerPairs) {
48 allInnerLayerPairsAlreadyVisited &= alreadyVisitedLayerPairs[innerLayerPair];
51 if (alreadyVisitedLayerPairs[currentLayerPair] ==
false and allInnerLayerPairsAlreadyVisited) {
52 const HitDoublets *doubletLayerPairId = hitDoublets[currentLayerPair];
53 auto numberOfDoublets = doubletLayerPairId->
size();
54 currentLayerPairRef.theFoundCells[0] = cellId;
55 currentLayerPairRef.theFoundCells[1] = cellId + numberOfDoublets;
56 for (
unsigned int i = 0;
i < numberOfDoublets; ++
i) {
60 currentOuterLayerRef.isOuterHitOfCell[doubletLayerPairId->
outerHitId(
i)].push_back(cellId);
64 auto &neigCells = currentInnerLayerRef.isOuterHitOfCell[doubletLayerPairId->
innerHitId(
i)];
75 assert(cellId == currentLayerPairRef.theFoundCells[1]);
76 for (
auto outerLayerPair : currentOuterLayerRef.theOuterLayerPairs) {
77 LayerPairsToVisit.push(outerLayerPair);
80 alreadyVisitedLayerPairs[currentLayerPair] =
true;
82 LayerPairsToVisit.pop();
83 numberOfLayerPairsToVisitAtThisDepth--;
84 if (numberOfLayerPairsToVisitAtThisDepth == 0) {
85 numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size();
98 for (
auto i = layerPair.theFoundCells[0];
i < layerPair.theFoundCells[1]; ++
i) {
104 for (
auto i = layerPair.theFoundCells[0];
i < layerPair.theFoundCells[1]; ++
i) {
115 for (
auto i = foundCells[0];
i < foundCells[1]; ++
i) {
134 tmpNtuplet.push_back(root_cell);
140 std::vector<CACell::CAntuplet> &foundTriplets,
142 const CACut &thetaCut,
144 const float hardPtCut) {
146 for (
auto hd : hitDoublets) {
151 unsigned int cellId = 0;
153 float region_origin_x =
region.origin().x();
154 float region_origin_y =
region.origin().y();
155 float region_origin_radius =
region.originRBound();
157 std::vector<bool> alreadyVisitedLayerPairs;
159 for (
auto visited : alreadyVisitedLayerPairs) {
163 std::queue<int> LayerPairsToVisit;
166 LayerPairsToVisit.push(LayerPair);
169 unsigned int numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size();
171 while (not LayerPairsToVisit.empty()) {
172 auto currentLayerPair = LayerPairsToVisit.front();
176 bool allInnerLayerPairsAlreadyVisited{
true};
179 thetaCut.
getCutsByInnerLayer(currentInnerLayerRef.seqNum(), currentOuterLayerRef.seqNum());
183 for (
auto innerLayerPair : currentInnerLayerRef.theInnerLayerPairs) {
184 allInnerLayerPairsAlreadyVisited &= alreadyVisitedLayerPairs[innerLayerPair];
187 if (alreadyVisitedLayerPairs[currentLayerPair] ==
false and allInnerLayerPairsAlreadyVisited) {
188 const HitDoublets *doubletLayerPairId = hitDoublets[currentLayerPair];
189 auto numberOfDoublets = doubletLayerPairId->
size();
190 currentLayerPairRef.theFoundCells[0] = cellId;
191 currentLayerPairRef.theFoundCells[1] = cellId + numberOfDoublets;
192 for (
unsigned int i = 0;
i < numberOfDoublets; ++
i) {
196 currentOuterLayerRef.isOuterHitOfCell[doubletLayerPairId->
outerHitId(
i)].push_back(cellId);
200 auto &neigCells = currentInnerLayerRef.isOuterHitOfCell[doubletLayerPairId->
innerHitId(
i)];
207 region_origin_radius,
212 assert(cellId == currentLayerPairRef.theFoundCells[1]);
213 for (
auto outerLayerPair : currentOuterLayerRef.theOuterLayerPairs) {
214 LayerPairsToVisit.push(outerLayerPair);
217 alreadyVisitedLayerPairs[currentLayerPair] =
true;
219 LayerPairsToVisit.pop();
220 numberOfLayerPairsToVisitAtThisDepth--;
221 if (numberOfLayerPairsToVisitAtThisDepth == 0) {
222 numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size();
void findNtuplets(std::vector< CACell::CAntuplet > &, const unsigned int)
std::vector< CACellStatus > allStatus
std::vector< unsigned int > CAntuple
std::vector< CALayer > theLayers
std::vector< unsigned int > theRootCells
std::vector< CALayerPair > theLayerPairs
int outerHitId(int i) const
std::vector< CACell > allCells
auto const & foundNtuplets
void createAndConnectCells(const std::vector< const HitDoublets *> &, const TrackingRegion &, const CACut &, const CACut &, const float)
std::vector< int > theRootLayers
CAValuesByInnerLayerIds getCutsByInnerLayer(int layerIds1, int layerIds2) const
void findTriplets(const std::vector< const HitDoublets *> &hitDoublets, std::vector< CACell::CAntuplet > &foundTriplets, const TrackingRegion ®ion, const CACut &thetaCut, const CACut &phiCut, const float hardPtCut)
void evolve(const unsigned int)
int innerHitId(int i) const