CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Private Member Functions
MuonGEMDetLayerGeometryBuilder Class Reference

#include <MuonGEMDetLayerGeometryBuilder.h>

Public Member Functions

 MuonGEMDetLayerGeometryBuilder ()
 Constructor (disabled, only static access is allowed) More...
 
virtual ~MuonGEMDetLayerGeometryBuilder ()
 Destructor. More...
 

Static Public Member Functions

static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildEndcapLayers (const GEMGeometry &geo)
 

Static Private Member Functions

static bool isFront (const GEMDetId &gemId)
 
static MuDetRingmakeDetRing (std::vector< const GeomDet * > &geomDets)
 

Detailed Description

Build the GEM DetLayers.

Author
R. Radogna

Definition at line 21 of file MuonGEMDetLayerGeometryBuilder.h.

Constructor & Destructor Documentation

◆ MuonGEMDetLayerGeometryBuilder()

MuonGEMDetLayerGeometryBuilder::MuonGEMDetLayerGeometryBuilder ( )
inline

Constructor (disabled, only static access is allowed)

Definition at line 24 of file MuonGEMDetLayerGeometryBuilder.h.

24 {}

◆ ~MuonGEMDetLayerGeometryBuilder()

MuonGEMDetLayerGeometryBuilder::~MuonGEMDetLayerGeometryBuilder ( )
virtual

Destructor.

Definition at line 19 of file MuonGEMDetLayerGeometryBuilder.cc.

19 {}

Member Function Documentation

◆ buildEndcapLayers()

pair< vector< DetLayer * >, vector< DetLayer * > > MuonGEMDetLayerGeometryBuilder::buildEndcapLayers ( const GEMGeometry geo)
static

Builds the forward (+Z, return.first) and backward (-Z, return.second) layers. Both vectors are sorted inside-out

Definition at line 23 of file MuonGEMDetLayerGeometryBuilder.cc.

23  {
24  vector<DetLayer*> endcapLayers[2];
25 
26  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonGEMDetLayerGeometryBuilder";
27  for (auto st : geo.stations()) {
28  const int maxLayerId = (st->station() == GEMDetId::minStationId0) ? GEMDetId::maxLayerId0 : GEMDetId::maxLayerId;
29  for (int layer = GEMDetId::minLayerId + 1; layer <= maxLayerId; ++layer) {
30  ForwardDetLayer* forwardLayer = nullptr;
31  vector<const ForwardDetRing*> frontRings, backRings;
32 
33  for (int roll = GEMDetId::minRollId + 1; roll <= GEMDetId::maxRollId; ++roll) {
34  vector<const GeomDet*> frontDets, backDets;
35 
36  for (auto sc : st->superChambers()) {
37  auto ch = sc->chamber(layer);
38  if (ch == nullptr)
39  continue;
40 
41  auto etaP = ch->etaPartition(roll);
42  if (etaP == nullptr)
43  continue;
44 
45  bool isInFront = isFront(etaP->id());
46  if (isInFront) {
47  frontDets.push_back(etaP);
48  } else {
49  backDets.push_back(etaP);
50  }
51  }
52 
53  if (!frontDets.empty()) {
54  precomputed_value_sort(frontDets.begin(), frontDets.end(), geomsort::DetPhi());
55  frontRings.push_back(new MuDetRing(frontDets));
56  LogTrace(metname) << "New front ring with " << frontDets.size()
57  << " chambers at z=" << frontRings.back()->position().z();
58  }
59  if (!backDets.empty()) {
60  precomputed_value_sort(backDets.begin(), backDets.end(), geomsort::DetPhi());
61  backRings.push_back(new MuDetRing(backDets));
62  LogTrace(metname) << "New back ring with " << backDets.size()
63  << " chambers at z=" << backRings.back()->position().z();
64  }
65  }
66 
67  if (!frontRings.empty()) {
68  if (st->station() == GEMDetId::minStationId0)
69  forwardLayer = new MuRingForwardLayer(frontRings);
70  else if (!backRings.empty())
71  forwardLayer = new MuRingForwardDoubleLayer(frontRings, backRings);
72  }
73 
74  if (forwardLayer != nullptr) {
75  LogTrace(metname) << "New MuRingForwardLayer with " << frontRings.size() << " and " << backRings.size()
76  << " rings, at Z " << forwardLayer->position().z()
77  << " R1: " << forwardLayer->specificSurface().innerRadius()
78  << " R2: " << forwardLayer->specificSurface().outerRadius();
79 
80  int iendcap = (st->region() == 1) ? 0 : 1;
81  endcapLayers[iendcap].push_back(forwardLayer);
82  }
83  }
84  }
85 
86  pair<vector<DetLayer*>, vector<DetLayer*> > res_pair(endcapLayers[0], endcapLayers[1]);
87  return res_pair;
88 }

References phase1PixelTopology::layer, LogTrace, GEMDetId::maxLayerId, GEMDetId::maxLayerId0, GEMDetId::maxRollId, metname, GEMDetId::minLayerId, GEMDetId::minRollId, GEMDetId::minStationId0, GeometricSearchDet::position(), precomputed_value_sort(), ForwardDetLayer::specificSurface(), GEMGeometry::stations(), AlCaHLTBitMon_QueryRunRegistry::string, and PV3DBase< T, PVType, FrameType >::z().

Referenced by MuonDetLayerGeometryESProducer::produce().

◆ isFront()

bool MuonGEMDetLayerGeometryBuilder::isFront ( const GEMDetId gemId)
staticprivate

Definition at line 90 of file MuonGEMDetLayerGeometryBuilder.cc.

90  {
91  // ME0s do not currently have an arrangement of which are front and which are back, going to always return true
92  if (gemId.station() == GEMDetId::minStationId0)
93  return true;
94 
95  return (gemId.chamber() % 2 == 0);
96 }

References GEMDetId::chamber(), GEMDetId::minStationId0, and GEMDetId::station().

◆ makeDetRing()

MuDetRing * MuonGEMDetLayerGeometryBuilder::makeDetRing ( std::vector< const GeomDet * > &  geomDets)
staticprivate

Definition at line 98 of file MuonGEMDetLayerGeometryBuilder.cc.

98  {
99  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonGEMDetLayerGeometryBuilder";
100 
101  precomputed_value_sort(geomDets.begin(), geomDets.end(), geomsort::DetPhi());
102  MuDetRing* result = new MuDetRing(geomDets);
103  LogTrace(metname) << "New MuDetRing with " << geomDets.size() << " chambers at z=" << result->position().z()
104  << " R1: " << result->specificSurface().innerRadius()
105  << " R2: " << result->specificSurface().outerRadius();
106  return result;
107 }

References LogTrace, metname, precomputed_value_sort(), mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

MuonGEMDetLayerGeometryBuilder::isFront
static bool isFront(const GEMDetId &gemId)
Definition: MuonGEMDetLayerGeometryBuilder.cc:90
GEMGeometry::stations
const std::vector< const GEMStation * > & stations() const
Return a vector of all GEM stations.
Definition: GEMGeometry.cc:32
GEMDetId::minLayerId
static constexpr int32_t minLayerId
Definition: GEMDetId.h:30
GeometricSearchDet::position
virtual const Surface::PositionType & position() const
Returns position of the surface.
Definition: GeometricSearchDet.h:31
MuDetRing
Definition: MuDetRing.h:16
GEMDetId::maxRollId
static constexpr int32_t maxRollId
Definition: GEMDetId.h:36
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
MuRingForwardLayer
Definition: MuRingForwardLayer.h:18
geomsort::DetPhi
ExtractPhi< GeomDet, float > DetPhi
Definition: DetSorting.h:37
GEMDetId::minStationId0
static constexpr int32_t minStationId0
Definition: GEMDetId.h:24
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
GEMDetId::chamber
constexpr int chamber() const
Definition: GEMDetId.h:183
GEMDetId::maxLayerId0
static constexpr int32_t maxLayerId0
Definition: GEMDetId.h:31
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ForwardDetLayer
Definition: ForwardDetLayer.h:22
GEMDetId::maxLayerId
static constexpr int32_t maxLayerId
Definition: GEMDetId.h:32
GEMDetId::minRollId
static constexpr int32_t minRollId
Definition: GEMDetId.h:35
GEMDetId::station
constexpr int station() const
Definition: GEMDetId.h:179
mps_fire.result
result
Definition: mps_fire.py:311
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
precomputed_value_sort
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
Definition: precomputed_value_sort.h:17
MuRingForwardDoubleLayer
Definition: MuRingForwardDoubleLayer.h:19
ForwardDetLayer::specificSurface
virtual const BoundDisk & specificSurface() const final
Definition: ForwardDetLayer.h:39
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40