ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
InDet::DiscOverlapDescriptor Class Reference

#include <DiscOverlapDescriptor.h>

Inheritance diagram for InDet::DiscOverlapDescriptor:
Collaboration diagram for InDet::DiscOverlapDescriptor:

Public Member Functions

 DiscOverlapDescriptor (const Trk::BinnedArray< Trk::Surface > *bin_array=0, std::vector< Trk::BinUtility * > *singleBinUtils=0, bool isPixel=false)
 Constructor. More...
 
virtual ~DiscOverlapDescriptor ()
 Destructor. More...
 
 DiscOverlapDescriptor (const DiscOverlapDescriptor &)=delete
 Delete copy. More...
 
DiscOverlapDescriptoroperator= (const DiscOverlapDescriptor &)=delete
 Delete assignment. More...
 
virtual DiscOverlapDescriptorclone () 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_bin_array
 
std::vector< Trk::BinUtility * > * m_singleBinUtils
 
bool m_pixelCase
 

Detailed Description

Class to describe overlaps in the custom 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

Author
Noemi.nosp@m..Cal.nosp@m.ace@c.nosp@m.ern..nosp@m.ch

Definition at line 79 of file DiscOverlapDescriptor.h.

Constructor & Destructor Documentation

◆ DiscOverlapDescriptor() [1/2]

InDet::DiscOverlapDescriptor::DiscOverlapDescriptor ( const Trk::BinnedArray< Trk::Surface > *  bin_array = 0,
std::vector< Trk::BinUtility * > *  singleBinUtils = 0,
bool  isPixel = false 
)

Constructor.

Definition at line 64 of file DiscOverlapDescriptor.cxx.

66  :
67  m_bin_array(bin_array),
68  m_singleBinUtils(singleBinUtils),
69  m_pixelCase(isPixel)
70 {}

◆ ~DiscOverlapDescriptor()

virtual InDet::DiscOverlapDescriptor::~DiscOverlapDescriptor ( )
inlinevirtual

Destructor.

Definition at line 88 of file DiscOverlapDescriptor.h.

88  {
89  if (m_singleBinUtils) {
91  for ( ; binIter != m_singleBinUtils->end(); ++binIter) delete *binIter;
92  }
93  delete m_singleBinUtils;
94  }

◆ DiscOverlapDescriptor() [2/2]

InDet::DiscOverlapDescriptor::DiscOverlapDescriptor ( const DiscOverlapDescriptor )
delete

Delete copy.

Member Function Documentation

◆ clone()

DiscOverlapDescriptor * InDet::DiscOverlapDescriptor::clone ( ) const
inlineoverridevirtual

Pseudo-Constructor.

Implements Trk::OverlapDescriptor.

Definition at line 124 of file DiscOverlapDescriptor.h.

124 { return new DiscOverlapDescriptor(); }

◆ dumpSurfaces()

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

Definition at line 240 of file DiscOverlapDescriptor.cxx.

240  {
241  std::cout << "Dumping Surfaces for " << (m_pixelCase ? "Pixel " : "SCT ")
242  << "with size = " << surfaces.size() << std::endl;
243  static const StoreGateSvc* const detStore = getDetStore();
244  static const PixelID* const pixIdHelper = getPixelID(detStore);
245  static const SCT_ID* const sctIdHelper = getSCT_ID(detStore);
246 
247  for (auto & surface : surfaces) {
248  Identifier hitId = (surface.object)->associatedDetectorElementIdentifier();
249  if (m_pixelCase)
250  std::cout << "barrel_ec " << pixIdHelper->barrel_ec(hitId)
251  << ", layer_disk " << pixIdHelper->layer_disk(hitId)
252  << ", phi_module " << pixIdHelper->phi_module(hitId)
253  << ", eta_module " << pixIdHelper->eta_module(hitId) << std::endl;
254  else
255  std::cout << "barrel_ec " << sctIdHelper->barrel_ec(hitId)
256  << ", layer_disk " << sctIdHelper->layer_disk(hitId)
257  << ", phi_module " << sctIdHelper->phi_module(hitId)
258  << ", eta_module " << sctIdHelper->eta_module(hitId)
259  << ", side " << sctIdHelper->side(hitId) << std::endl;
260  }
261  return true;
262 }

◆ operator=()

DiscOverlapDescriptor& InDet::DiscOverlapDescriptor::operator= ( const DiscOverlapDescriptor )
delete

Delete assignment.

◆ reachableSurfaces()

bool InDet::DiscOverlapDescriptor::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 72 of file DiscOverlapDescriptor.cxx.

76 { //These are done once no matter how many
77  //instances of DiscOverlapDescriptor we have
78  static const StoreGateSvc* const detStore = getDetStore();
79  static const PixelID* const pixIdHelper = getPixelID(detStore);
80  static const SCT_ID* const sctIdHelper = getSCT_ID(detStore);
81 
82  // get the according detector element
83  const InDetDD::SiDetectorElement* pElement = dynamic_cast<const InDetDD::SiDetectorElement*>(tsf.associatedDetectorElement());
84 
85  // first add the target surface
86  surfaces.emplace_back(Trk::Intersection(pos, 0., true),&tsf);
87  int etaModule =
89  ? pixIdHelper->eta_module(tsf.associatedDetectorElementIdentifier())
90  : sctIdHelper->eta_module(tsf.associatedDetectorElementIdentifier());
91 
92  // return empty cell vector
93  if (pElement) {
94  size_t newCapacity = surfaces.size() + 19;
95  if (pElement->otherSide()) newCapacity += 19;
96  surfaces.reserve(newCapacity);
97 
98  addOtherSideDO(pElement,surfaces);
99 
100  addNextInPhiDO(pElement,surfaces);
101  addPrevInPhiDO(pElement,surfaces);
102 
103  addNextInPhiDO(pElement->nextInPhi(),surfaces);
104  addPrevInPhiDO(pElement->prevInPhi(),surfaces);
105 
106  // First use the bin utiliy to find the surfaces on the same disc but in different rings
107  // This is done as follows:
108  // 1 -> Find at which bin corresponds the surface, i.e. at which ring on the disc it corresponds
109  // 2 -> If it is not 0 (i.e. the surface doesn't belong to the innermost ring),
110  // look for the surfaces in the ring with smaller eta value (it returns 2 or 3 surfaces)
111  // 3 -> If it is smaller than the number of rings (i.e. the surface doen't belong to the outermost ring),
112  // look for the surfaces in the ring with bigger eta value (it returns 2 or 3 surfaces)//
113 
114  if (m_bin_array && !m_singleBinUtils->empty()){
115 
116  const Trk::Surface* samePhi_PrevEta = nullptr;
117  const Trk::Surface* samePhi_NextEta = nullptr;
118 
119  const Trk::Surface* previousPhi_PrevEta = nullptr;
120  const Trk::Surface* nextPhi_PrevEta = nullptr;
121 
122  const Trk::Surface* previousPhi_NextEta = nullptr;
123  const Trk::Surface* nextPhi_NextEta = nullptr;
124 
126  size_t offset = 0;
127  for (unsigned int bin = 0; bin < m_singleBinUtils->size(); bin++) {
128  int etamod =
130  ? pixIdHelper->eta_module(
131  (*(surf[offset])).associatedDetectorElementIdentifier())
132  : sctIdHelper->eta_module(
133  (*(surf[offset])).associatedDetectorElementIdentifier());
134 
135  if (etamod == etaModule || etamod < (etaModule - 1) ||
136  etamod > (etaModule + 1)) {
137  offset += (std::as_const(*m_singleBinUtils).at(bin))->bins();
138  continue;
139  }
140 
141  double PrevDeltaPhi = 9999.;
142  double NextDeltaPhi = -9999.;
143  for (unsigned int ss = offset; ss < (offset+(std::as_const(*m_singleBinUtils).at(bin))->bins()); ss++ ) {
144  if (etamod == (etaModule-1) ) {
145  if( tsf.center().phi() == (*(surf[ss])).center().phi() )
146  samePhi_PrevEta = surf[ss];
147  double DeltaPhi = tsf.center().phi() - (*(surf[ss])).center().phi();
148  if( DeltaPhi < PrevDeltaPhi && DeltaPhi > 0) {
149  previousPhi_PrevEta = surf[ss];
150  PrevDeltaPhi = DeltaPhi;
151  }
152  if( DeltaPhi > NextDeltaPhi && DeltaPhi < 0) {
153  nextPhi_PrevEta = surf[ss];
154  NextDeltaPhi = DeltaPhi;
155  }
156  } else if (etamod == (etaModule+1) ) {
157  if( tsf.center().phi() == (*(surf[ss])).center().phi() )
158  samePhi_NextEta = surf[ss];
159  double DeltaPhi = tsf.center().phi() - (*(surf[ss])).center().phi();
160  if( DeltaPhi < PrevDeltaPhi && DeltaPhi > 0) {
161  previousPhi_NextEta = surf[ss];
162  PrevDeltaPhi = DeltaPhi;
163  }
164 
165  if( DeltaPhi > NextDeltaPhi && DeltaPhi < 0) {
166  nextPhi_NextEta = surf[ss];
167  NextDeltaPhi = DeltaPhi;
168  }
169  }
170  }
171  offset += (std::as_const(*m_singleBinUtils).at(bin))->bins();
172  }
173 
174  if (samePhi_PrevEta) {
175  const InDetDD::SiDetectorElement* PhiEta_Element = dynamic_cast<const InDetDD::SiDetectorElement*>(samePhi_PrevEta->associatedDetectorElement());
176  if (PhiEta_Element) {
177  addSurfaceDO(PhiEta_Element,surfaces);
178  addOtherSideDO(PhiEta_Element, surfaces);
179  }
180  }
181 
182  if (previousPhi_PrevEta) {
183  const InDetDD::SiDetectorElement* PhiEta_Element = dynamic_cast<const InDetDD::SiDetectorElement*>(previousPhi_PrevEta->associatedDetectorElement());
184  if (PhiEta_Element) {
185  addSurfaceDO(PhiEta_Element,surfaces);
186  addOtherSideDO(PhiEta_Element, surfaces);
187 
188  addPrevInPhiDO(PhiEta_Element,surfaces);
189  addPrevInPhiDO(PhiEta_Element->prevInPhi(),surfaces);
190  }
191  }
192 
193  if (nextPhi_PrevEta) {
194  const InDetDD::SiDetectorElement* PhiEta_Element = dynamic_cast<const InDetDD::SiDetectorElement*>(nextPhi_PrevEta->associatedDetectorElement());
195  if (PhiEta_Element) {
196  addSurfaceDO(PhiEta_Element,surfaces);
197  addOtherSideDO(PhiEta_Element, surfaces);
198 
199  addNextInPhiDO(PhiEta_Element,surfaces);
200  addNextInPhiDO(PhiEta_Element->nextInPhi(),surfaces);
201  }
202  }
203 
204  if (samePhi_NextEta) {
205  const InDetDD::SiDetectorElement* PhiEta_Element = dynamic_cast<const InDetDD::SiDetectorElement*>(samePhi_NextEta->associatedDetectorElement());
206  if (PhiEta_Element) {
207  addSurfaceDO(PhiEta_Element,surfaces);
208  addOtherSideDO(PhiEta_Element, surfaces);
209  }
210  }
211 
212  if (previousPhi_NextEta) {
213  const InDetDD::SiDetectorElement* PhiEta_Element = dynamic_cast<const InDetDD::SiDetectorElement*>(previousPhi_NextEta->associatedDetectorElement());
214  if (PhiEta_Element) {
215  addSurfaceDO(PhiEta_Element,surfaces);
216  addOtherSideDO(PhiEta_Element, surfaces);
217 
218  addPrevInPhiDO(PhiEta_Element,surfaces);
219  addPrevInPhiDO(PhiEta_Element->prevInPhi(),surfaces);
220  }
221  }
222 
223  if (nextPhi_NextEta) {
224  const InDetDD::SiDetectorElement* PhiEta_Element = dynamic_cast<const InDetDD::SiDetectorElement*>(nextPhi_NextEta->associatedDetectorElement());
225  if (PhiEta_Element) {
226  addSurfaceDO(PhiEta_Element,surfaces);
227  addOtherSideDO(PhiEta_Element, surfaces);
228 
229  addNextInPhiDO(PhiEta_Element,surfaces);
230  addNextInPhiDO(PhiEta_Element->nextInPhi(),surfaces);
231  }
232  }
233  }
234  }
235 
236  return false;
237 
238 }

Member Data Documentation

◆ m_bin_array

const Trk::BinnedArray<Trk::Surface>* InDet::DiscOverlapDescriptor::m_bin_array
private

Definition at line 118 of file DiscOverlapDescriptor.h.

◆ m_pixelCase

bool InDet::DiscOverlapDescriptor::m_pixelCase
private

Definition at line 120 of file DiscOverlapDescriptor.h.

◆ m_singleBinUtils

std::vector<Trk::BinUtility*>* InDet::DiscOverlapDescriptor::m_singleBinUtils
private

Definition at line 119 of file DiscOverlapDescriptor.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Trk::Intersection
Definition: Intersection.h:24
Trk::Surface::associatedDetectorElement
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
python.App.bins
bins
Definition: App.py:410
PixelID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: PixelID.h:619
InDet::DiscOverlapDescriptor::m_singleBinUtils
std::vector< Trk::BinUtility * > * m_singleBinUtils
Definition: DiscOverlapDescriptor.h:119
bin
Definition: BinsDiffFromStripMedian.h:43
addOtherSideDO
#define addOtherSideDO(cur, surfaces)
Definition: DiscOverlapDescriptor.h:31
SCT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: SCT_ID.h:728
SCT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: SCT_ID.h:740
CaloSwCorrections.etamod
def etamod(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:206
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
InDetDD::SiDetectorElement::nextInPhi
const SiDetectorElement * nextInPhi() const
InDetDD::SiDetectorElement::prevInPhi
const SiDetectorElement * prevInPhi() const
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:626
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
PixelID::eta_module
int eta_module(const Identifier &id) const
Definition: PixelID.h:651
InDetDD::SiDetectorElement::otherSide
const SiDetectorElement * otherSide() const
Useful for SCT only.
InDet::DiscOverlapDescriptor::m_bin_array
const Trk::BinnedArray< Trk::Surface > * m_bin_array
Definition: DiscOverlapDescriptor.h:118
Trk::BinnedArray::arrayObjects
virtual BinnedArraySpan< T *const > arrayObjects()=0
Return all objects of the Array non-const we can still modify the T.
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
SCT_ID
Definition: SCT_ID.h:68
SCT_ID::eta_module
int eta_module(const Identifier &id) const
Definition: SCT_ID.h:746
addNextInPhiDO
#define addNextInPhiDO(cur, surfaces)
Definition: DiscOverlapDescriptor.h:37
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
InDet::DiscOverlapDescriptor::m_pixelCase
bool m_pixelCase
Definition: DiscOverlapDescriptor.h:120
SCT_ID::side
int side(const Identifier &id) const
Definition: SCT_ID.h:752
addPrevInPhiDO
#define addPrevInPhiDO(cur, surfaces)
Definition: DiscOverlapDescriptor.h:41
PixelID::phi_module
int phi_module(const Identifier &id) const
Definition: PixelID.h:644
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
PixelID
Definition: PixelID.h:67
Trk::BinnedArraySpan
std::span< T > BinnedArraySpan
Definition: BinnedArray.h:34
addSurfaceDO
#define addSurfaceDO(cur, surfaces)
Definition: DiscOverlapDescriptor.h:26
InDet::DiscOverlapDescriptor::DiscOverlapDescriptor
DiscOverlapDescriptor(const Trk::BinnedArray< Trk::Surface > *bin_array=0, std::vector< Trk::BinUtility * > *singleBinUtils=0, bool isPixel=false)
Constructor.
Definition: DiscOverlapDescriptor.cxx:64