Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ATLASBottomBinFinder.ipp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ATLASBottomBinFinder.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 
11 template <typename SpacePoint>
13  size_t phiBin, size_t zBin,
14  const Acts::SpacePointGrid<SpacePoint>* binnedSP) {
15  std::set<size_t> neighbourBins =
16  binnedSP->neighborHoodIndices({phiBin, zBin}, 1);
17  if (zBin == 6) {
18  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin, zBin + 1}));
19  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin - 1, zBin + 1}));
20  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin + 1, zBin + 1}));
21  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin, zBin - 1}));
22  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin - 1, zBin - 1}));
23  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin + 1, zBin - 1}));
24  return neighbourBins;
25  }
26  if (zBin > 6) {
27  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin, zBin + 1}));
28  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin - 1, zBin + 1}));
29  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin + 1, zBin + 1}));
30  } else {
31  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin, zBin - 1}));
32  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin - 1, zBin - 1}));
33  neighbourBins.erase(binnedSP->getGlobalBinIndex({phiBin + 1, zBin - 1}));
34  }
35  if (zBin == 4) {
36  neighbourBins.insert(binnedSP->getGlobalBinIndex({phiBin, zBin + 2}));
37  neighbourBins.insert(binnedSP->getGlobalBinIndex({phiBin - 1, zBin + 2}));
38  neighbourBins.insert(binnedSP->getGlobalBinIndex({phiBin + 1, zBin + 2}));
39  }
40  if (zBin == 8) {
41  neighbourBins.insert(binnedSP->getGlobalBinIndex({phiBin, zBin - 2}));
42  neighbourBins.insert(binnedSP->getGlobalBinIndex({phiBin - 1, zBin - 2}));
43  neighbourBins.insert(binnedSP->getGlobalBinIndex({phiBin + 1, zBin - 2}));
44  }
45  return neighbourBins;
46 }