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

#include <MuonIntersectGeoData.h>

Collaboration diagram for Muon::MuonIntersectGeoData:

Public Member Functions

 ~MuonIntersectGeoData ()
 
 MuonIntersectGeoData ()
 
 MuonIntersectGeoData (MsgStream &msg, const MuonGM::MuonDetectorManager *detMgr, const IMuonIdHelperSvc *idHelperSvc, const MdtCondDbData *cond_data)
 
Muon::MuonStationIntersect tubesCrossedByTrack (const Identifier &id, const Amg::Vector3D &pos, const Amg::Vector3D &dir) const
 
std::vector< std::shared_ptr< const MdtIntersectGeometry > > getStationGeometry (const Identifier &id) const
 get geometry description of the given chamber + neighbouring chambers More...
 
std::shared_ptr< const MdtIntersectGeometrygetChamber (const Identifier &id) const
 get a pointer to the cached chamber More...
 
const MuonGM::MuonDetectorManagerdetMgr () const
 

Private Member Functions

std::vector< IdentifierbinPlusneighbours (const Identifier &id) const
 

Private Attributes

std::vector< std::shared_ptr< MdtIntersectGeometry > > m_geometry {}
 
const IMuonIdHelperSvcm_idHelperSvc {nullptr}
 
const MuonGM::MuonDetectorManagerm_detMgr {nullptr}
 
const MdtCondDbDatam_dbData {nullptr}
 

Detailed Description

Definition at line 22 of file MuonIntersectGeoData.h.

Constructor & Destructor Documentation

◆ ~MuonIntersectGeoData()

Muon::MuonIntersectGeoData::~MuonIntersectGeoData ( )
default

◆ MuonIntersectGeoData() [1/2]

Muon::MuonIntersectGeoData::MuonIntersectGeoData ( )
default

◆ MuonIntersectGeoData() [2/2]

Muon::MuonIntersectGeoData::MuonIntersectGeoData ( MsgStream &  msg,
const MuonGM::MuonDetectorManager detMgr,
const IMuonIdHelperSvc idHelperSvc,
const MdtCondDbData cond_data 
)

Definition at line 18 of file MuonIntersectGeoData.cxx.

19  :
20  m_idHelperSvc{idHelperSvc}, m_detMgr{detMgr}, m_dbData{dbData} {
22  for (unsigned int n = 0; n < m_geometry.size(); ++n) {
23  IdentifierHash id_hash{n};
24  const MuonGM::MdtReadoutElement* mdt_ele = detMgr->getMdtReadoutElement(id_hash);
25  // The Mdt intersectionGeometry relies on the first multi layer. We can skip the other layers
26  if (!mdt_ele || mdt_ele->getMultilayer() != 1) continue;
27  m_geometry[id_hash] = std::make_unique<Muon::MdtIntersectGeometry>(log, mdt_ele->identify(), idHelperSvc, detMgr, dbData);
28  }
29  }

Member Function Documentation

◆ binPlusneighbours()

std::vector< Identifier > Muon::MuonIntersectGeoData::binPlusneighbours ( const Identifier id) const
private

No CSC chambers -> No Mdt EI Station

Definition at line 67 of file MuonIntersectGeoData.cxx.

67  {
68  std::vector<Identifier> chIds;
69  int stName = m_idHelperSvc->mdtIdHelper().stationName(id);
70  int stPhi = m_idHelperSvc->mdtIdHelper().stationPhi(id);
71  int stEta = m_idHelperSvc->mdtIdHelper().stationEta(id);
73  auto [stEtaMin, stEtaMax] = m_idHelperSvc->mdtIdHelper().stationEtaMinMax(id);
74 
75  int chEtaLeft = stEta - 1;
76  int chEtaRight = stEta + 1;
77 
78  // chamber with smallest eta
79  if (chEtaLeft < stEtaMin) chEtaLeft = -999;
80 
81  // chamber with largest eta
82  if (chEtaRight > stEtaMax) chEtaRight = -999;
83 
85 
86  // special treatment of EOS chambers
87  if (chIndex == Muon::MuonStationIndex::EOS) {
88  chEtaRight = -999;
89  chEtaLeft = -999;
90  }
91 
92  if (isBarrel) {
93  // eta = 0 doesn't exist take next
94  if (chEtaLeft == 0) chEtaLeft -= 1;
95  if (chEtaRight == 0) chEtaRight += 1;
96  } else {
97  // do not combined positive and negative endcaps
98  if (chEtaLeft == 0) chEtaLeft = -999;
99  if (chEtaRight == 0) chEtaRight = -999;
100  }
101 
102  // no neighbours for BIS8
103  if (chIndex == Muon::MuonStationIndex::BIS && std::abs(stEta) == 8) {
104  chEtaLeft = -999;
105  chEtaRight = -999;
106  }
107 
108  // BIS 8 never neighbour of a chamber
109  if (chIndex == Muon::MuonStationIndex::BIS) {
110  if (std::abs(chEtaLeft) == 8) chEtaLeft = -999;
111  if (std::abs(chEtaRight) == 8) chEtaRight = -999;
112  }
114  if ((chIndex == Muon::MuonStationIndex::EIS || chIndex == Muon::MuonStationIndex::EIL) && !m_idHelperSvc->hasCSC()) {
115  return chIds;
116  }
117  if (chEtaLeft != -999 &&
118  m_idHelperSvc->mdtIdHelper().validElement(m_idHelperSvc->mdtIdHelper().elementID(stName, chEtaLeft, stPhi)))
119  chIds.push_back(m_idHelperSvc->mdtIdHelper().elementID(stName, chEtaLeft, stPhi));
120  chIds.push_back(m_idHelperSvc->mdtIdHelper().elementID(id));
121  if (chEtaRight != -999 &&
122  m_idHelperSvc->mdtIdHelper().validElement(m_idHelperSvc->mdtIdHelper().elementID(stName, chEtaRight, stPhi)))
123  chIds.push_back(m_idHelperSvc->mdtIdHelper().elementID(stName, chEtaRight, stPhi));
124 
125  // if (msgLvl(MSG::VERBOSE)) {
126  // ATH_MSG_VERBOSE(" returning chambers for id " << m_idHelperSvc->toString(id) << " ids " << chIds.size() << " eta " <<
127  // chEtaLeft
128  // << " " << stEta << " " << chEtaRight << " chambers: ");
129  // for (unsigned int i = 0; i < chIds.size(); ++i) ATH_MSG_VERBOSE(m_idHelperSvc->toString(chIds[i]));
130  // }
131 
132  return chIds;
133  }

◆ detMgr()

const MuonGM::MuonDetectorManager* Muon::MuonIntersectGeoData::detMgr ( ) const
inline

Definition at line 36 of file MuonIntersectGeoData.h.

36 { return m_detMgr; }

◆ getChamber()

std::shared_ptr< const MdtIntersectGeometry > Muon::MuonIntersectGeoData::getChamber ( const Identifier id) const

get a pointer to the cached chamber

Definition at line 46 of file MuonIntersectGeoData.cxx.

46  {
48  const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
49  if (idHelper.get_detectorElement_hash(idHelper.multilayerID(chId), hash)) return nullptr;
50  return hash < m_geometry.size() ? m_geometry[hash] : nullptr;
51  }

◆ getStationGeometry()

std::vector< std::shared_ptr< const Muon::MdtIntersectGeometry > > Muon::MuonIntersectGeoData::getStationGeometry ( const Identifier id) const

get geometry description of the given chamber + neighbouring chambers

Definition at line 31 of file MuonIntersectGeoData.cxx.

31  {
32  // get ids of geometry associated with identifier
33  std::vector<Identifier> chambers = binPlusneighbours(id);
34 
35  // vector to store result
36  std::vector<std::shared_ptr<const Muon::MdtIntersectGeometry>> stations;
37  stations.reserve(chambers.size());
38  // loop over bins, retrieve geometry
39  for (const Identifier& chId : chambers) {
40  if (m_dbData && !m_dbData->isGood(chId)) { continue; }
41  std::shared_ptr<const MdtIntersectGeometry> chamb = getChamber(chId);
42  if (chamb) stations.push_back(std::move(chamb));
43  }
44  return stations;
45  }

◆ tubesCrossedByTrack()

Muon::MuonStationIntersect Muon::MuonIntersectGeoData::tubesCrossedByTrack ( const Identifier id,
const Amg::Vector3D pos,
const Amg::Vector3D dir 
) const

Definition at line 53 of file MuonIntersectGeoData.cxx.

54  {
55  std::vector<std::shared_ptr<const Muon::MdtIntersectGeometry>> stations = getStationGeometry(id);
56 
58  for (std::shared_ptr<const Muon::MdtIntersectGeometry>& it : stations) {
59  Muon::MuonStationIntersect intersect = it->intersection(pos, dir);
60  tubeIntersects.insert(tubeIntersects.end(), intersect.tubeIntersects().begin(), intersect.tubeIntersects().end());
61  }
62 
63  Muon::MuonStationIntersect intersection{std::move(tubeIntersects)};
64  return intersection;
65  }

Member Data Documentation

◆ m_dbData

const MdtCondDbData* Muon::MuonIntersectGeoData::m_dbData {nullptr}
private

Definition at line 44 of file MuonIntersectGeoData.h.

◆ m_detMgr

const MuonGM::MuonDetectorManager* Muon::MuonIntersectGeoData::m_detMgr {nullptr}
private

Definition at line 43 of file MuonIntersectGeoData.h.

◆ m_geometry

std::vector<std::shared_ptr<MdtIntersectGeometry> > Muon::MuonIntersectGeoData::m_geometry {}
private

Definition at line 41 of file MuonIntersectGeoData.h.

◆ m_idHelperSvc

const IMuonIdHelperSvc* Muon::MuonIntersectGeoData::m_idHelperSvc {nullptr}
private

Definition at line 42 of file MuonIntersectGeoData.h.


The documentation for this class was generated from the following files:
Muon::MuonStationIndex::BIS
@ BIS
Definition: MuonStationIndex.h:17
MdtIdHelper::validElement
bool validElement(const Identifier &id) const
Definition: MdtIdHelper.cxx:557
MdtCondDbData::isGood
bool isGood(const Identifier &Id) const
Returns if the identifier (tube/multiLayer/chamber) is masked in the conditions database.
Definition: MdtCondDbData.cxx:25
Muon::MuonIntersectGeoData::m_geometry
std::vector< std::shared_ptr< MdtIntersectGeometry > > m_geometry
Definition: MuonIntersectGeoData.h:41
Muon::IMuonIdHelperSvc::hasCSC
virtual bool hasCSC() const =0
returns whether the CSC identifiers are loaded
MuonIdHelper::detectorElement_hash_max
size_type detectorElement_hash_max() const
Definition: MuonIdHelper.h:186
skel.it
it
Definition: skel.GENtoEVGEN.py:423
Muon::MuonIntersectGeoData::getStationGeometry
std::vector< std::shared_ptr< const MdtIntersectGeometry > > getStationGeometry(const Identifier &id) const
get geometry description of the given chamber + neighbouring chambers
Definition: MuonIntersectGeoData.cxx:31
Muon::MuonIntersectGeoData::m_dbData
const MdtCondDbData * m_dbData
Definition: MuonIntersectGeoData.h:44
MuonIdHelper::stationName
int stationName(const Identifier &id) const
Definition: MuonIdHelper.cxx:804
intersection
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
Definition: compareFlatTrees.cxx:25
Muon::MuonStationIndex::EIS
@ EIS
Definition: MuonStationIndex.h:18
Muon::MuonIntersectGeoData::m_idHelperSvc
const IMuonIdHelperSvc * m_idHelperSvc
Definition: MuonIntersectGeoData.h:42
Muon::MuonStationIndex::EOS
@ EOS
Definition: MuonStationIndex.h:18
MuonGM::MuonDetectorManager::getMdtReadoutElement
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:204
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:50
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
MdtIdHelper
Definition: MdtIdHelper.h:61
Muon::MuonIntersectGeoData::detMgr
const MuonGM::MuonDetectorManager * detMgr() const
Definition: MuonIntersectGeoData.h:36
MuonGM::MdtReadoutElement::getMultilayer
int getMultilayer() const
Returns the multilayer represented by the readout element.
MdtIdHelper::stationEtaMinMax
std::pair< int, int > stationEtaMinMax(const Identifier &id) const
Definition: MdtIdHelper.cxx:443
Muon::IMuonIdHelperSvc::chamberIndex
virtual MuonStationIndex::ChIndex chamberIndex(const Identifier &id) const =0
calculate chamber index from Identifier
beamspotman.dir
string dir
Definition: beamspotman.py:623
Muon::MuonIntersectGeoData::getChamber
std::shared_ptr< const MdtIntersectGeometry > getChamber(const Identifier &id) const
get a pointer to the cached chamber
Definition: MuonIntersectGeoData.cxx:46
MuonIdHelper::stationPhi
int stationPhi(const Identifier &id) const
Definition: MuonIdHelper.cxx:814
Muon::MuonIntersectGeoData::m_detMgr
const MuonGM::MuonDetectorManager * m_detMgr
Definition: MuonIntersectGeoData.h:43
Muon::IMuonIdHelperSvc::mdtIdHelper
virtual const MdtIdHelper & mdtIdHelper() const =0
access to MdtIdHelper
MuonIdHelper::isBarrel
bool isBarrel(const Identifier &id) const
Definition: MuonIdHelper.cxx:829
MuonIdHelper::stationEta
int stationEta(const Identifier &id) const
Definition: MuonIdHelper.cxx:809
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Muon::MuonStationIntersect
Definition: MuonStationIntersect.h:12
MdtIdHelper::elementID
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Definition: MdtIdHelper.cxx:630
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
Amg::intersect
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the closest approach of two lines.
Definition: GeoPrimitivesHelpers.h:302
Muon::MuonIntersectGeoData::binPlusneighbours
std::vector< Identifier > binPlusneighbours(const Identifier &id) const
Definition: MuonIntersectGeoData.cxx:67
MuonGM::MuonReadoutElement::identify
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:184
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
python.LArCondContChannels.isBarrel
isBarrel
Definition: LArCondContChannels.py:659
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
IdentifierHash
Definition: IdentifierHash.h:38
Muon::MuonStationIntersect::TubeIntersects
std::vector< MuonTubeIntersect > TubeIntersects
Definition: MuonStationIntersect.h:14
Muon::MuonStationIndex::EIL
@ EIL
Definition: MuonStationIndex.h:18