138 const std::vector<VxdID> friends6XX1 = {
VxdID(3, 0, 1),
VxdID(3, 0, 2),
VxdID(4, 0, 1),
VxdID(4, 0, 2),
VxdID(5, 0, 1),
VxdID(5, 0, 2),
VxdID(5, 0, 3),
VxdID(6, 0, 2),
VxdID(6, 0, 3)};
139 const std::vector<VxdID> friends6XX5 = {
VxdID(3, 0, 2),
VxdID(4, 0, 2),
VxdID(4, 0, 3),
VxdID(5, 0, 3),
VxdID(5, 0, 4),
VxdID(6, 0, 3),
VxdID(6, 0, 4)};
142 thetaFriends.insert(std::make_pair(
VxdID(6, 0, 1), friends6XX1));
143 thetaFriends.insert(std::make_pair(
VxdID(6, 0, 5), friends6XX5));
145 const std::vector<VxdID> friends601X = {
VxdID(3, 1, 0),
VxdID(3, 6, 0),
VxdID(3, 7, 0),
VxdID(4, 1, 0),
VxdID(4, 2, 0),
VxdID(4, 10, 0),
VxdID(5, 1, 0),
VxdID(5, 2, 0),
VxdID(5, 12, 0),
VxdID(6, 1, 0)};
146 const std::vector<VxdID> friends602X = {
VxdID(3, 1, 0),
VxdID(3, 2, 0),
VxdID(3, 7, 0),
VxdID(4, 1, 0),
VxdID(4, 2, 0),
VxdID(4, 10, 0),
VxdID(5, 1, 0),
VxdID(5, 2, 0),
VxdID(5, 3, 0),
VxdID(6, 2, 0)};
147 const std::vector<VxdID> friends603X = {
VxdID(3, 1, 0),
VxdID(3, 2, 0),
VxdID(3, 7, 0),
VxdID(4, 1, 0),
VxdID(4, 2, 0),
VxdID(4, 3, 0),
VxdID(5, 2, 0),
VxdID(5, 3, 0),
VxdID(6, 3, 0)};
148 const std::vector<VxdID> friends604X = {
VxdID(3, 1, 0),
VxdID(3, 2, 0),
VxdID(4, 2, 0),
VxdID(4, 3, 0),
VxdID(5, 3, 0),
VxdID(5, 4, 0),
VxdID(6, 4, 0)};
149 const std::vector<VxdID> friends605X = {
VxdID(3, 1, 0),
VxdID(3, 2, 0),
VxdID(3, 3, 0),
VxdID(4, 2, 0),
VxdID(4, 3, 0),
VxdID(4, 4, 0),
VxdID(5, 3, 0),
VxdID(5, 4, 0),
VxdID(5, 5, 0),
VxdID(6, 5, 0)};
150 const std::vector<VxdID> friends606X = {
VxdID(3, 2, 0),
VxdID(3, 3, 0),
VxdID(4, 3, 0),
VxdID(4, 4, 0),
VxdID(4, 5, 0),
VxdID(5, 4, 0),
VxdID(5, 5, 0),
VxdID(5, 6, 0),
VxdID(6, 6, 0)};
151 const std::vector<VxdID> friends607X = {
VxdID(3, 2, 0),
VxdID(3, 3, 0),
VxdID(3, 4, 0),
VxdID(4, 4, 0),
VxdID(4, 5, 0),
VxdID(5, 5, 0),
VxdID(5, 6, 0),
VxdID(6, 7, 0)};
152 const std::vector<VxdID> friends608X = {
VxdID(3, 2, 0),
VxdID(3, 3, 0),
VxdID(3, 4, 0),
VxdID(4, 4, 0),
VxdID(4, 5, 0),
VxdID(4, 6, 0),
VxdID(5, 6, 0),
VxdID(5, 7, 0),
VxdID(6, 8, 0)};
153 const std::vector<VxdID> friends609X = {
VxdID(3, 3, 0),
VxdID(3, 4, 0),
VxdID(3, 5, 0),
VxdID(4, 5, 0),
VxdID(4, 6, 0),
VxdID(4, 7, 0),
VxdID(5, 6, 0),
VxdID(5, 7, 0),
VxdID(5, 8, 0),
VxdID(6, 9, 0)};
154 const std::vector<VxdID> friends610X = {
VxdID(3, 3, 0),
VxdID(3, 4, 0),
VxdID(3, 5, 0),
VxdID(4, 5, 0),
VxdID(4, 6, 0),
VxdID(4, 7, 0),
VxdID(5, 7, 0),
VxdID(5, 8, 0),
VxdID(5, 9, 0),
VxdID(6, 10, 0)};
155 const std::vector<VxdID> friends611X = {
VxdID(3, 4, 0),
VxdID(3, 5, 0),
VxdID(4, 6, 0),
VxdID(4, 7, 0),
VxdID(4, 8, 0),
VxdID(5, 8, 0),
VxdID(5, 9, 0),
VxdID(6, 11, 0)};
156 const std::vector<VxdID> friends612X = {
VxdID(3, 4, 0),
VxdID(3, 5, 0),
VxdID(3, 6, 0),
VxdID(4, 7, 0),
VxdID(4, 8, 0),
VxdID(5, 9, 0),
VxdID(5, 10, 0),
VxdID(6, 12, 0)};
157 const std::vector<VxdID> friends613X = {
VxdID(3, 5, 0),
VxdID(3, 6, 0),
VxdID(4, 7, 0),
VxdID(4, 8, 0),
VxdID(4, 9, 0),
VxdID(5, 9, 0),
VxdID(5, 10, 0),
VxdID(5, 11, 0),
VxdID(6, 13, 0)};
158 const std::vector<VxdID> friends614X = {
VxdID(3, 5, 0),
VxdID(3, 6, 0),
VxdID(3, 7, 0),
VxdID(4, 8, 0),
VxdID(4, 9, 0),
VxdID(4, 10, 0),
VxdID(5, 10, 0),
VxdID(5, 11, 0),
VxdID(5, 12, 0),
VxdID(6, 14, 0)};
159 const std::vector<VxdID> friends615X = {
VxdID(3, 6, 0),
VxdID(3, 7, 0),
VxdID(4, 9, 0),
VxdID(4, 10, 0),
VxdID(5, 11, 0),
VxdID(5, 12, 0),
VxdID(6, 15, 0)};
160 const std::vector<VxdID> friends616X = {
VxdID(3, 1, 0),
VxdID(3, 7, 0),
VxdID(4, 1, 0),
VxdID(4, 9, 0),
VxdID(4, 10, 0),
VxdID(5, 1, 0),
VxdID(5, 12, 0),
VxdID(6, 16, 0)};
163 phiFriends.insert(std::make_pair(
VxdID(6, 1, 0), friends601X));
164 phiFriends.insert(std::make_pair(
VxdID(6, 2, 0), friends602X));
165 phiFriends.insert(std::make_pair(
VxdID(6, 3, 0), friends603X));
166 phiFriends.insert(std::make_pair(
VxdID(6, 4, 0), friends604X));
167 phiFriends.insert(std::make_pair(
VxdID(6, 5, 0), friends605X));
168 phiFriends.insert(std::make_pair(
VxdID(6, 6, 0), friends606X));
169 phiFriends.insert(std::make_pair(
VxdID(6, 7, 0), friends607X));
170 phiFriends.insert(std::make_pair(
VxdID(6, 8, 0), friends608X));
171 phiFriends.insert(std::make_pair(
VxdID(6, 9, 0), friends609X));
172 phiFriends.insert(std::make_pair(
VxdID(6, 10, 0), friends610X));
173 phiFriends.insert(std::make_pair(
VxdID(6, 11, 0), friends611X));
174 phiFriends.insert(std::make_pair(
VxdID(6, 12, 0), friends612X));
175 phiFriends.insert(std::make_pair(
VxdID(6, 13, 0), friends613X));
176 phiFriends.insert(std::make_pair(
VxdID(6, 14, 0), friends614X));
177 phiFriends.insert(std::make_pair(
VxdID(6, 15, 0), friends615X));
178 phiFriends.insert(std::make_pair(
VxdID(6, 16, 0), friends616X));
180 std::vector<VxdID> friendSensors;
183 for (
auto& phiFriendPair : phiFriends) {
185 std::vector<VxdID> phiFriendLadders = phiFriendPair.second;
186 unsigned short layer6Ladder = phiFriendPair.first.getLadderNumber();
188 for (
auto& thetaFriendPair : thetaFriends) {
189 friendSensors.clear();
191 std::vector<VxdID> thetaFriendSensors = thetaFriendPair.second;
192 unsigned short layer6Sensor = thetaFriendPair.first.getSensorNumber();
195 for (
auto& phiFriend : phiFriendLadders) {
197 for (
auto& thetaFriend : thetaFriendSensors) {
198 if (phiFriend.getLayerNumber() == thetaFriend.getLayerNumber()) {
200 friendSensors.emplace_back(
VxdID(phiFriend.getLayerNumber(), phiFriend.getLadderNumber(), thetaFriend.getSensorNumber()));
205 friendSensors.emplace_back(
VxdID(6, layer6Ladder, layer6Sensor));
214 uint ymax, uint currentRecursion)
216 std::vector<VXDHoughState*> containedHits;
217 containedHits.reserve(hits.size());
218 std::bitset<8> layerHits;
223 const uint centerx = xmin + (uint)((xmax - xmin) / 2);
224 const uint centery = ymin + (uint)((ymax - ymin) / 2);
225 const uint xIndexCache[3] = {xmin, centerx, xmax};
226 const uint yIndexCache[3] = {ymin, centery, ymax};
228 for (
int i = 0; i < 2 ; ++i) {
229 const uint left = xIndexCache[i];
230 const uint right = xIndexCache[i + 1];
231 const uint localIndexX = left;
233 if (left == right)
continue;
245 for (
int j = 0; j < 2; ++j) {
246 const uint lowerIndex = yIndexCache[j];
247 const uint upperIndex = yIndexCache[j + 1];
249 if (lowerIndex == upperIndex)
continue;
251 const uint localIndexY = lowerIndex;
252 const double& localUpperCoordinate =
m_HSYLUT[lowerIndex];
253 const double& localLowerCoordinate =
m_HSYLUT[upperIndex];
257 containedHits.clear();
264 const double derivativeyLeft = m * -sinLeft + a * cosLeft;
265 const double derivativeyRight = m * -sinRight + a * cosRight;
266 const double derivativeyCenter = m * -sinCenter + a * cosCenter;
270 if (derivativeyLeft < 0 and derivativeyRight < 0 and derivativeyCenter < 0)
continue;
272 const double yLeft = m * cosLeft + a * sinLeft;
273 const double yRight = m * cosRight + a * sinRight;
274 const double yCenter = m * cosCenter + a * sinCenter;
277 if ((yLeft <= localUpperCoordinate and yRight >= localLowerCoordinate) or
278 (yCenter <= localUpperCoordinate and yLeft >= localLowerCoordinate and yRight >= localLowerCoordinate) or
279 (yCenter >= localLowerCoordinate and yLeft <= localUpperCoordinate and yRight <= localUpperCoordinate)) {
280 layerHits[hitData.
layer] =
true;
281 containedHits.emplace_back(hit);