 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #include "Identifier/Identifier.h"
6 #include <GeoModelKernel/throwExcept.h>
10 #include <Acts/Surfaces/PlaneSurface.hpp>
11 #include <Acts/Geometry/TrapezoidVolumeBounds.hpp>
12 #include <Acts/Geometry/Volume.hpp>
25 std::vector<unsigned int>
range (
unsigned min,
unsigned max) {
27 std::vector<unsigned int>
v(
max -
min);
28 std::iota(
v.begin(),
v.end(),
min);
36 using BoundEnums = Acts::TrapezoidVolumeBounds::BoundValues;
40 for (
auto &
chamber : m_args.chambers) {
96 toReturn.insert(toReturn.end(),
ch->readoutEles().begin(),
ch->readoutEles().end());
107 <<
"halfX (S/L): "<<
args.bounds->get(BoundEnums::eHalfLengthXnegY)
108 <<
"/"<<
args.bounds->get(BoundEnums::eHalfLengthXposY)<<
" [mm], ";
109 ostr<<
"halfY: "<<
args.bounds->get(BoundEnums::eHalfLengthY)<<
" [mm], ";
110 ostr<<
"halfZ: "<<
args.bounds->get(BoundEnums::eHalfLengthZ)<<
" [mm], ";
111 ostr<<
"************************************************************************"<<std::endl;
113 ostr<<
" --- "<<(*ch)<<std::endl;
118 ostr<<
"MS sector "<<
chamber.identString()<<
" "<<
chamber.parameters();
126 std::unordered_map<const MuonReadoutElement*, std::vector<unsigned int>>
129 std::unordered_map<const MuonReadoutElement*, std::vector<unsigned int>> cache{};
140 auto nextLayer = [
this, &cache, &reEleSorted](
const Identifier& lastId) ->
141 std::pair<const MuonReadoutElement*, const Identifier> {
149 if (cache.count(reEle))
continue;
156 if (logicalId == lastId){
157 return std::make_pair(reEle, logicalId);
167 return std::make_pair(nextReEle, nextId);
170 unsigned int layCounter {0}, nIter {0};
172 while(++nIter <= reEleSorted.size()){
174 auto [nextReEle, nextId] = nextLayer(lastId);
176 THROW_EXCEPTION(
"Failed to retrieve next reEle in fillDetLayIdCache()");
181 if (nextId != lastId) {
182 cache[nextReEle] =
range(layCounter, layCounter + nLayers);
184 layCounter += nLayers;
187 cache[nextReEle] =
range(layCounter - nLayers, layCounter);
191 " Add logicLay: " <<
idHelperSvc()->toStringGasGap(nextId) <<
" nInserted, layCounter " << cache.at(nextReEle).size() <<
" ," << layCounter);
202 mdtRele->stationPhi(),
203 mdtRele->multilayer(),
209 rpcRele->stationPhi(),
210 rpcRele->doubletR(), 1, 1,
216 tgcRele->stationPhi(),
222 stgcRele->stationPhi(),
223 stgcRele->multilayer(),
229 mmRele->stationPhi(),
230 mmRele->multilayer(),
234 THROW_EXCEPTION(
"Unexpected Readout Element Type in computeDetLayerId()");
262 THROW_EXCEPTION(
"Unexpected Readout Element Type in nLayerPerReadout()");
The TransientConstSharedPtr allows non-const access if the pointer itself is non-const but in the con...
std::shared_ptr< Acts::Volume > boundingVolume(const ActsGeometryContext &gctx) const
Returns the Acts::Volume representation of the sector.
virtual const sTgcIdHelper & stgcIdHelper() const =0
access to TgcIdHelper
int sector() const
Returns the sector of the MS-sector.
int8_t side() const
Returns the side of the MS-sector 1 -> A side ; -1 -> C side.
unsigned int nGasGaps() const
Returns the number of gas gaps.
unsigned nGasGaps() const
Returns the number of gasgaps described by this ReadOutElement (usally 2 or 3)
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
int stationPhi() const
: Returns the station phi of the sector
Identifier computeDetLayerId(const MuonReadoutElement *rele) const
Helper function calculating the logic layer Id and the physical layer id.
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
const ChamberSet & chambers() const
Returns the associated chambers with this sector.
std::unordered_map< const MuonReadoutElement *, std::vector< unsigned int > > fillDetLayIdCache() const
Function filling the map mapping the readout elements to layer numbers.
Chamber::ReadoutSet readoutEles() const
Returns the list of all associated readout elements.
@ Tgc
Resitive Plate Chambers.
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
double halfXShort() const
Short extend of the chamber in the x-direction at negative Y.
virtual DetectorType detectorType() const =0
Returns the detector element type.
double halfZ() const
Thickness of the chamber in the z-direction.
Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
virtual const MmIdHelper & mmIdHelper() const =0
access to CscIdHelper
std::string identString() const
Returns a string encoding the chamber index & the sector of the MS sector.
unsigned nGasGaps() const
Returns the number of gasgaps described by this ReadOutElement (usally 2 or 3)
Acts::TrapezoidVolumeBounds::BoundValues BoundEnums
SpectrometerSector::ChamberSet ChamberSet
double halfY() const
Extend of the chamber in the y-direction.
const std::unordered_map< const MuonReadoutElement *, std::vector< unsigned int > > m_detLayIdCache
Map mapping each Readout Element to the layer numbering in the sector frame.
Acts::GeometryContext context() const
Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index scheme.
double halfXLong() const
Long-extend of the chamber in the x-direction at positive Y.
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
const std::vector< unsigned int > & logicalLayerIdx(const MuonReadoutElement *reEle) const
Returns the logic layer numbering of a given Readout Element.
@ Mm
Maybe not needed in the migration.
const std::vector< chamberLocation > & chamberLocations() const
returns the list of all MDT chambers in the sector for fast navigation
const std::string & chName(ChIndex index)
convert ChIndex into a string
bool barrel() const
Returns whether the sector is placed in the barrel.
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &gctx) const
Returns the global -> local transformation from the ATLAS global.
unsigned int nLayerPerReadout(const MuonReadoutElement *rele) const
Helper function giving the number of measurement layers in a given readout ele.
unsigned int numLayers() const
Returns the number of tube layer.
Eigen::Affine3d Transform3D
std::vector< const MuonReadoutElement * > ReadoutSet
Define the list of read out elements of the chamber.
Amg::Vector3D center(const ActsGeometryContext &ctx) const
Returns the detector center (Which is the same as the detector center of the first measurement layer)
Class to provide easy MsgStream access and capabilities.
const Acts::PlaneSurface & surface() const
Returns the associated surface.
Include the GeoPrimitives which need to be put first.
SpectrometerSector(defineArgs &&args)
Standard constructor taking the defining parameters.
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the IdHelpeSvc.
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
std::shared_ptr< const Acts::PlaneSurface > surface
Surface in the centre of the chamber plane.
virtual const MdtIdHelper & mdtIdHelper() const =0
access to MdtIdHelper
std::shared_ptr< Acts::TrapezoidVolumeBounds > bounds
Surrouding box chamber bounds.
Identifier identify() const override final
Return the athena identifier.
ChamberSet chambers
List of readout elements in the chamber.
std::shared_ptr< Acts::TrapezoidVolumeBounds > bounds() const
Returns the volume bounds.
#define THROW_EXCEPTION(MESSAGE)
unsigned int numLayers() const
Returns the number of gas gap layers.
virtual const TgcIdHelper & tgcIdHelper() const =0
access to TgcIdHelper
const defineArgs & parameters() const
Returns the reference to the defining parameters of the sector.
std::vector< ChamberPtr > ChamberSet
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &gctx) const
Returns the local -> global tarnsformation from the sector.
@ Rpc
Monitored Drift Tubes.
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Identifier channelID(int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel) const
std::vector< chamberLocation > detectorLocs
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
std::ostream & operator<<(std::ostream &ostr, const Chamber::defineArgs &args)
virtual const RpcIdHelper & rpcIdHelper() const =0
access to RpcIdHelper
bool operator<(const SpectrometerSector &other) const