19#include "Identifier/Identifier.h"
25 std::vector < float > valuesR,
26 std::vector < std::vector< float> > valuesPhi,
27 int nStepsR,
int nStepsPhi):
48 float centerR = tsf.
center().perp();
49 float centerPhi = tsf.
center().phi();
51 std::vector<const Trk::Surface*> allSurfaces = {};
54 int rIndex = std::distance(
m_valuesR.begin(), rBoundVal);
57 int index_r = rIndex+stepR;
58 if (index_r>=0 and index_r<
int(
m_valuesR.size()-1)) {
59 const auto phiBoundVal = std::lower_bound(
m_valuesPhi.at(index_r).begin(),
m_valuesPhi.at(index_r).end(), centerPhi);
60 int phiIndex = std::distance(
m_valuesPhi.at(index_r).begin(), phiBoundVal);
62 int index_phi = phiIndex+stepPhi;
64 index_phi = int(
m_valuesPhi.at(index_r).size())+index_phi;
65 else if (index_phi>
int(
m_valuesPhi.at(index_r).size()-1))
66 index_phi = index_phi-int(
m_valuesPhi.at(index_r).size());
69 if (index_phi ==
int(
m_valuesPhi.at(index_r).size()-1))
74 if (surf and std::find(allSurfaces.begin(), allSurfaces.end(), surf) == allSurfaces.end()) {
75 allSurfaces.push_back(surf);
81 for (
auto& surface : allSurfaces)
92 ISvcLocator* svcLocator = Gaudi::svcLocator();
95 SmartIF<StoreGateSvc> detStore{svcLocator->service(
"DetectorStore")};
100 const HGTD_ID* hgtdIdHelper =
nullptr;
101 if (detStore->retrieve(hgtdIdHelper,
"HGTD_ID").isFailure()) {
107 std::cout <<
"Dumping Surfaces for HGTD with size = " << surfaces.size() << std::endl;
108 for (
auto & surface : surfaces) {
109 Identifier hitId = (surface.object)->associatedDetectorElementIdentifier();
This is an Identifier helper class for the HGTD subdetector.
const Trk::BinnedArray< Trk::Surface > * m_binnedArray
bool dumpSurfaces(std::vector< Trk::SurfaceIntersection > &surfaces) const
std::atomic< const HGTD_ID * > m_hgtdIdHelper
std::vector< float > m_valuesR
bool reachableSurfaces(std::vector< Trk::SurfaceIntersection > &surfaces, const Trk::Surface &sf, const Amg::Vector3D &pos, const Amg::Vector3D &dir) const override
get the compatible surfaces
HGTD_OverlapDescriptor(const Trk::BinnedArray< Trk::Surface > *bin_array=nullptr, std::vector< float > valuesR={}, std::vector< std::vector< float > > valuesPhi={}, int nStepsR=3, int nStepsPhi=10)
Constructor.
std::vector< std::vector< float > > m_valuesPhi
Binned Array for avoiding map searches/.
Abstract Base Class for tracking surfaces.
const Amg::Vector3D & center() const
Returns the center position of the Surface.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D