ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HGTD_OverlapDescriptor Class Reference

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

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 {}

◆ ~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 }

◆ 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
96  if (svcLocator->service("DetectorStore",detStore).isFailure()) {
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 }

◆ 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 }

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.

◆ 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:
HGTD_OverlapDescriptor::m_valuesR
std::vector< float > m_valuesR
Definition: HGTD_OverlapDescriptor.h:75
Trk::Intersection
Definition: Intersection.h:24
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
HGTD_OverlapDescriptor::m_nStepsPhi
int m_nStepsPhi
Definition: HGTD_OverlapDescriptor.h:78
HGTD_OverlapDescriptor::m_valuesPhi
std::vector< std::vector< float > > m_valuesPhi
Definition: HGTD_OverlapDescriptor.h:76
M_PI
#define M_PI
Definition: ActiveFraction.h:11
Trk::BinnedArray::object
virtual T * object(const Amg::Vector2D &lp) const =0
Returns the pointer to the templated class object from the BinnedArray, it returns 0 if not defined,...
HGTD_OverlapDescriptor::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: HGTD_OverlapDescriptor.cxx:24
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
HGTD_ID
Definition: HGTD_ID.h:47
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
HGTD_OverlapDescriptor::m_hgtdIdHelper
std::atomic< const HGTD_ID * > m_hgtdIdHelper
Definition: HGTD_OverlapDescriptor.h:79
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
eflowRec::phiIndex
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition: EtaPhiLUT.cxx:23
HGTD_OverlapDescriptor::m_nStepsR
int m_nStepsR
Definition: HGTD_OverlapDescriptor.h:77
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
HGTD_OverlapDescriptor::m_binnedArray
const Trk::BinnedArray< Trk::Surface > * m_binnedArray
Definition: HGTD_OverlapDescriptor.h:74
Muon::nsw::STGTPSegments::MergedSegmentProperty::rIndex
@ rIndex