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.

References 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().

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 }
virtual const Surface::PositionType & position() const
Returns position of the surface.
ExtractPhi< GeomDet, float > DetPhi
Definition: DetSorting.h:37
T z() const
Definition: PV3DBase.h:61
const std::string metname
const std::vector< const GEMStation * > & stations() const
Return a vector of all GEM stations.
Definition: GEMGeometry.cc:32
static constexpr int32_t maxLayerId0
Definition: GEMDetId.h:31
#define LogTrace(id)
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
static constexpr int32_t minStationId0
Definition: GEMDetId.h:24
static bool isFront(const GEMDetId &gemId)
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
static constexpr int32_t minRollId
Definition: GEMDetId.h:35
static constexpr int32_t maxLayerId
Definition: GEMDetId.h:32
virtual const BoundDisk & specificSurface() const final
static constexpr int32_t minLayerId
Definition: GEMDetId.h:30
static constexpr int32_t maxRollId
Definition: GEMDetId.h:36

◆ isFront()

bool MuonGEMDetLayerGeometryBuilder::isFront ( const GEMDetId gemId)
staticprivate

Definition at line 90 of file MuonGEMDetLayerGeometryBuilder.cc.

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

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 }
constexpr int station() const
Definition: GEMDetId.h:179
constexpr int chamber() const
Definition: GEMDetId.h:183
static constexpr int32_t minStationId0
Definition: GEMDetId.h:24

◆ makeDetRing()

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

Definition at line 98 of file MuonGEMDetLayerGeometryBuilder.cc.

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

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 }
ExtractPhi< GeomDet, float > DetPhi
Definition: DetSorting.h:37
const std::string metname
#define LogTrace(id)
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)