Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ATLASTopBinFinder.ipp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ATLASTopBinFinder.ipp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 // DEBUG: THIS REQUIRES THE BINS TO BE SET TO phi:41 z:11
10 template <typename SpacePoint>
12  size_t phiBin, size_t zBin,
13  const Acts::SpacePointGrid<SpacePoint>* binnedSP) {
14  std::set<size_t> neighbourBins =
15  binnedSP->neighborHoodIndices({phiBin, zBin}, 1);
16  if (zBin == 6) {
17  return neighbourBins;
18  }
19  // <10 not necessary because grid doesn't return bins that don't exist (only
20  // works for 11 zbins)
21  if (zBin > 6) {
22  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin, zBin - 1}));
23  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin - 1, zBin - 1}));
24  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin + 1, zBin - 1}));
25  } else {
26  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin, zBin + 1}));
27  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin - 1, zBin + 1}));
28  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin + 1, zBin + 1}));
29  }
30  return neighbourBins;
31 }