ATLAS Offline Software
SiElementProperties.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6 
7  -------------------
8  ATLAS Collaboration
9  ***************************************************************************/
10 
11 #include "Identifier/Identifier.h"
13 #include "InDetIdentifier/SCT_ID.h"
15 
16 namespace InDet{
17 
19  const SCT_ID& idHelper,
20  const InDetDD::SiDetectorElement& element,
21  float epsilonWidth) : m_neighbours(),m_halfWidth(0)
22 
23 {
24  // construct vector of neighbours of this wafer.
25  Identifier compact;
26  IdContext idCntxt(idHelper.wafer_context());
27 
28  int res = idHelper.get_id(idHash,compact, &idCntxt);
29  if (res) return; // cannot convert
30 
31  //if (idHelper.side(compact)==0) return;
32  // if it is the stereo side do nothing
33  if (element.isStereo()) return;
34  IdentifierHash otherHash;
35  IdentifierHash neighbourHash;
36 
37  res = idHelper.get_other_side(idHash, otherHash);
38  if (res==0) m_neighbours.push_back(otherHash);
39  res = idHelper.get_prev_in_phi(otherHash, neighbourHash);
40  if (res==0) m_neighbours.push_back(neighbourHash);
41  res = idHelper.get_next_in_phi(otherHash, neighbourHash);
42  if (res==0) m_neighbours.push_back(neighbourHash);
43 
44  // These neighbours are only defined for barrel, and may fail
45  // because wafer is at one of the ends
46  if (idHelper.is_barrel(compact))
47  {
48  res = idHelper.get_prev_in_eta(otherHash, neighbourHash);
49  if (res ==0)
50  m_neighbours.push_back(neighbourHash);
51  res = idHelper.get_next_in_eta(otherHash, neighbourHash );
52  if (res ==0)
53  m_neighbours.push_back(neighbourHash);
54  }
55 
56  // Find half width of wafer at centre
57 
58  m_halfWidth = (element.design().minWidth()+element.design().maxWidth())*.25
59  + epsilonWidth; // add a bit for safety.
60 }
61 
62 //-------------------------------------------------------------------------
64 = default;
65 
66 //----------------------------------------------------------------------------
67 
68 }
SCT_ID::get_next_in_phi
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in phi (return == 0 for neighbor found)
Definition: SCT_ID.cxx:405
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
SCT_ID::get_prev_in_phi
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in phi (return == 0 for neighbor found)
Definition: SCT_ID.cxx:395
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
SCT_ID::get_id
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const override final
Create compact id from hash id (return == 0 for OK)
Definition: SCT_ID.cxx:666
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
SCT_ID::wafer_context
IdContext wafer_context(void) const
Definition: SCT_ID.h:705
InDetDD::DetectorDesign::maxWidth
virtual double maxWidth() const =0
Method to calculate maximum width of a module.
SCT_ID::get_other_side
int get_other_side(const IdentifierHash &id, IdentifierHash &other) const
Wafer hash on other side.
Definition: SCT_ID.cxx:435
InDet::SiElementProperties::SiElementProperties
SiElementProperties(const IdentifierHash &idHash, const SCT_ID &idHelper, const InDetDD::SiDetectorElement &element, float epsilonWidth)
Definition: SiElementProperties.cxx:22
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SiDetectorElement.h
SCT_ID::get_prev_in_eta
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in eta (return == 0 for neighbor found)
Definition: SCT_ID.cxx:415
SiElementProperties.h
SCT_ID::get_next_in_eta
int get_next_in_eta(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in eta (return == 0 for neighbor found)
Definition: SCT_ID.cxx:425
SCT_ID
Definition: SCT_ID.h:68
InDetDD::DetectorDesign::minWidth
virtual double minWidth() const =0
Method to calculate minimum width of a module.
InDet::SiElementProperties::~SiElementProperties
~SiElementProperties()
IdentifierHash
Definition: IdentifierHash.h:38
InDetDD::SiDetectorElement::isStereo
bool isStereo() const
Check if it is the stereo side (useful for SCT)
Definition: SiDetectorElement.cxx:300
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
IdContext
class IdContext
Definition: IdContext.h:34
SCT_ID::is_barrel
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be sct id, otherwise answer is not accurate. Use SiliconID for gen...
Definition: SCT_ID.h:721