Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
22  const bool doEndcapEtaNeighbours) : m_neighbours(),m_halfWidth(0)
23 
24 {
25  // construct vector of neighbours of this wafer.
26  Identifier compact;
27  IdContext idCntxt(idHelper.wafer_context());
28 
29  int res = idHelper.get_id(idHash,compact, &idCntxt);
30  if (res) return; // cannot convert
31 
32  //if (idHelper.side(compact)==0) return;
33  // if it is the stereo side do nothing
34  if (element.isStereo()) return;
35  IdentifierHash otherHash;
36  IdentifierHash neighbourHash;
37 
38  res = idHelper.get_other_side(idHash, otherHash);
39  if (res==0) m_neighbours.push_back(otherHash);
40  res = idHelper.get_prev_in_phi(otherHash, neighbourHash);
41  if (res==0) m_neighbours.push_back(neighbourHash);
42  res = idHelper.get_next_in_phi(otherHash, neighbourHash);
43  if (res==0) m_neighbours.push_back(neighbourHash);
44 
45  // These neighbours are only defined for barrel, and may fail
46  // because wafer is at one of the ends
47  if (idHelper.is_barrel(compact))
48  {
49  res = idHelper.get_prev_in_eta(otherHash, neighbourHash);
50  if (res ==0)
51  m_neighbours.push_back(neighbourHash);
52  res = idHelper.get_next_in_eta(otherHash, neighbourHash );
53  if (res ==0)
54  m_neighbours.push_back(neighbourHash);
55  }
56  else if(doEndcapEtaNeighbours){
58  if(nextInEta){
59  neighbourHash = nextInEta->identifyHash();
60  m_neighbours.push_back(neighbourHash);
61  }
62 
63  int trig_eta = idHelper.eta_module(compact);
64  if(trig_eta==9){
65  // For ITk strip endcaps we have a change of module granularity between eta_module=9 and 10
66  // therefore when we are at eta_module=9, we can have two neighbours at larger radius
67  // the second neighbour is put in "prevInEta()" in SCT_DetectorManager (a bit hacky, yes)
68  const InDetDD::SiDetectorElement* nextInEta2 = element.prevInEta();
69  if(nextInEta2){
70  neighbourHash = nextInEta2->identifyHash();
71  m_neighbours.push_back(neighbourHash);
72  }
73  }
74  }
75 
76  // Find half width of wafer at centre
77 
78  m_halfWidth = (element.design().minWidth()+element.design().maxWidth())*.25
79  + epsilonWidth; // add a bit for safety.
80 }
81 
82 //-------------------------------------------------------------------------
84 = default;
85 
86 //----------------------------------------------------------------------------
87 
88 }
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:413
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:403
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDetDD::SolidStateDetectorElementBase::identifyHash
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
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:672
InDetDD::SiDetectorElement::prevInEta
const SiDetectorElement * prevInEta() const
InDet::SiElementProperties::m_halfWidth
float m_halfWidth
Definition: SiElementProperties.h:43
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:11
InDet::SiElementProperties::m_neighbours
std::vector< IdentifierHash > m_neighbours
Definition: SiElementProperties.h:42
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:443
InDet::SiElementProperties::SiElementProperties
SiElementProperties(const IdentifierHash &idHash, const SCT_ID &idHelper, const InDetDD::SiDetectorElement &element, float epsilonWidth, const bool doEncapEtaNeighbours=false)
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:423
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:433
InDetDD::SiDetectorElement::nextInEta
const SiDetectorElement * nextInEta() const
SCT_ID
Definition: SCT_ID.h:68
InDetDD::DetectorDesign::minWidth
virtual double minWidth() const =0
Method to calculate minimum width of a module.
LArNeighbours::nextInEta
@ nextInEta
Definition: LArNeighbours.h:15
SCT_ID::eta_module
int eta_module(const Identifier &id) const
Definition: SCT_ID.h:746
InDet::SiElementProperties::~SiElementProperties
~SiElementProperties()
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
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
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
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
Identifier
Definition: IdentifierFieldParser.cxx:14