ATLAS Offline Software
Loading...
Searching...
No Matches
HGTD_OverlapDescriptor Class Reference

Class to describe overlaps in the HGTD detector. More...

#include <HGTD_OverlapDescriptor.h>

Inheritance diagram for HGTD_OverlapDescriptor:
Collaboration diagram for HGTD_OverlapDescriptor:

Public Member Functions

 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.
virtual ~HGTD_OverlapDescriptor ()
 Destructor.
 HGTD_OverlapDescriptor (const HGTD_OverlapDescriptor &)=delete
 Delete copy.
HGTD_OverlapDescriptoroperator= (const HGTD_OverlapDescriptor &)=delete
 Delete assignment.
virtual HGTD_OverlapDescriptorclone () const override
 Pseudo-Constructor.
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

Private Member Functions

bool dumpSurfaces (std::vector< Trk::SurfaceIntersection > &surfaces) const

Private Attributes

const Trk::BinnedArray< Trk::Surface > * m_binnedArray
std::vector< float > m_valuesR
std::vector< std::vector< float > > m_valuesPhi
int m_nStepsR
int m_nStepsPhi
std::atomic< const HGTD_ID * > m_hgtdIdHelper {nullptr}

Detailed Description

Class to describe overlaps in the HGTD detector.

It extends the Trk::OverlapDescriptor base class.

There are two interface methods, one provides the most probably overlapcell, the second provides a list of overlap cells, based on an restricted area

Definition at line 39 of file HGTD_OverlapDescriptor.h.

Constructor & Destructor Documentation

◆ HGTD_OverlapDescriptor() [1/2]

HGTD_OverlapDescriptor::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.

Definition at line 24 of file HGTD_OverlapDescriptor.cxx.

27 :
28 m_binnedArray(bin_array),
29 m_valuesR(std::move(valuesR)),
30 m_valuesPhi(std::move(valuesPhi)),
31 m_nStepsR(nStepsR),
32 m_nStepsPhi(nStepsPhi)
33{}
const Trk::BinnedArray< Trk::Surface > * m_binnedArray
std::vector< float > m_valuesR
std::vector< std::vector< float > > m_valuesPhi

◆ ~HGTD_OverlapDescriptor()

virtual HGTD_OverlapDescriptor::~HGTD_OverlapDescriptor ( )
inlinevirtual

Destructor.

Definition at line 49 of file HGTD_OverlapDescriptor.h.

49 {
50 }

◆ HGTD_OverlapDescriptor() [2/2]

HGTD_OverlapDescriptor::HGTD_OverlapDescriptor ( const HGTD_OverlapDescriptor & )
delete

Delete copy.

Member Function Documentation

◆ clone()

HGTD_OverlapDescriptor * HGTD_OverlapDescriptor::clone ( ) const
inlineoverridevirtual

Pseudo-Constructor.

Implements Trk::OverlapDescriptor.

Definition at line 84 of file HGTD_OverlapDescriptor.h.

84 {
85 return new HGTD_OverlapDescriptor();
86}
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.

◆ dumpSurfaces()

bool HGTD_OverlapDescriptor::dumpSurfaces ( std::vector< Trk::SurfaceIntersection > & surfaces) const
private

Definition at line 88 of file HGTD_OverlapDescriptor.cxx.

88 {
89
90 if (m_hgtdIdHelper==nullptr) {
91 // Get Storegate, ID helpers, and so on
92 ISvcLocator* svcLocator = Gaudi::svcLocator();
93
94 // get DetectorStore service
95 SmartIF<StoreGateSvc> detStore{svcLocator->service("DetectorStore")};
96 if (!detStore) {
97 return false;
98 }
99
100 const HGTD_ID* hgtdIdHelper = nullptr;
101 if (detStore->retrieve(hgtdIdHelper, "HGTD_ID").isFailure()) {
102 return false;
103 }
104 m_hgtdIdHelper = hgtdIdHelper;
105 }
106
107 std::cout << "Dumping Surfaces for HGTD with size = " << surfaces.size() << std::endl;
108 for (auto & surface : surfaces) {
109 Identifier hitId = (surface.object)->associatedDetectorElementIdentifier();
110 std::cout << "barrel_ec " << m_hgtdIdHelper.load()->endcap(hitId) << ", layer_disk " << m_hgtdIdHelper.load()->layer(hitId) << ", phi_module " << m_hgtdIdHelper.load()->phi_module(hitId) << ", eta_module " << m_hgtdIdHelper.load()->eta_module(hitId) << std::endl;
111 }
112 return true;
113}
std::atomic< const HGTD_ID * > m_hgtdIdHelper

◆ operator=()

HGTD_OverlapDescriptor & HGTD_OverlapDescriptor::operator= ( const HGTD_OverlapDescriptor & )
delete

Delete assignment.

◆ reachableSurfaces()

bool HGTD_OverlapDescriptor::reachableSurfaces ( std::vector< Trk::SurfaceIntersection > & surfaces,
const Trk::Surface & sf,
const Amg::Vector3D & pos,
const Amg::Vector3D & dir ) const
overridevirtual

get the compatible surfaces

  • return vector : surfaces
  • primary bin surface : sf
  • position & direction : pos, dir

Implements Trk::OverlapDescriptor.

Definition at line 36 of file HGTD_OverlapDescriptor.cxx.

41{
42 surfaces.emplace_back(Trk::Intersection(pos, 0., true),&tsf);
43
44 // add the other targets
45 // use the center of this surface in (x,y) global coordinates and look for
46 // adjactent ones in the binutiliy
47
48 float centerR = tsf.center().perp();
49 float centerPhi = tsf.center().phi();
50
51 std::vector<const Trk::Surface*> allSurfaces = {};
52
53 const auto rBoundVal = std::lower_bound(m_valuesR.begin(), m_valuesR.end(), centerR);
54 int rIndex = std::distance(m_valuesR.begin(), rBoundVal);
55
56 for (int stepR=-m_nStepsR; stepR<=m_nStepsR; stepR++) {
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);
61 for (int stepPhi=-m_nStepsPhi; stepPhi<=m_nStepsPhi; stepPhi++) {
62 int index_phi = phiIndex+stepPhi;
63 if (index_phi<0)
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());
67 float pos_r = 0.5*(m_valuesR.at(index_r)+m_valuesR.at(index_r+1));
68 float pos_phi = 0.;
69 if (index_phi == int(m_valuesPhi.at(index_r).size()-1))
70 pos_phi = 0.5*(m_valuesPhi.at(index_r).at(index_phi)+M_PI);
71 else
72 pos_phi = 0.5*(m_valuesPhi.at(index_r).at(index_phi)+m_valuesPhi.at(index_r).at(index_phi+1));
73 const Trk::Surface* surf = m_binnedArray->object(Amg::Vector2D(pos_r, pos_phi));
74 if (surf and std::find(allSurfaces.begin(), allSurfaces.end(), surf) == allSurfaces.end()) {
75 allSurfaces.push_back(surf);
76 }
77 }
78 }
79 }
80
81 for (auto& surface : allSurfaces)
82 surfaces.emplace_back(Trk::Intersection(Amg::Vector3D(0.,0.,0.),0.,true),surface);
83
84 return false;
85}
#define M_PI
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition EtaPhiLUT.cxx:23

Member Data Documentation

◆ m_binnedArray

const Trk::BinnedArray<Trk::Surface>* HGTD_OverlapDescriptor::m_binnedArray
private

Definition at line 74 of file HGTD_OverlapDescriptor.h.

◆ m_hgtdIdHelper

std::atomic<const HGTD_ID*> HGTD_OverlapDescriptor::m_hgtdIdHelper {nullptr}
mutableprivate

Definition at line 79 of file HGTD_OverlapDescriptor.h.

79{nullptr};

◆ m_nStepsPhi

int HGTD_OverlapDescriptor::m_nStepsPhi
private

Definition at line 78 of file HGTD_OverlapDescriptor.h.

◆ m_nStepsR

int HGTD_OverlapDescriptor::m_nStepsR
private

Definition at line 77 of file HGTD_OverlapDescriptor.h.

◆ m_valuesPhi

std::vector< std::vector< float> > HGTD_OverlapDescriptor::m_valuesPhi
private

Definition at line 76 of file HGTD_OverlapDescriptor.h.

◆ m_valuesR

std::vector< float > HGTD_OverlapDescriptor::m_valuesR
private

Definition at line 75 of file HGTD_OverlapDescriptor.h.


The documentation for this class was generated from the following files: