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 MuRingForwardDoubleLayerbuildLayer (int endcap, std::vector< int > &rings, int station, int layer, std::vector< int > &chambers, std::vector< int > &rolls, const GEMGeometry &geo)
 
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 19 of file MuonGEMDetLayerGeometryBuilder.h.

Constructor & Destructor Documentation

◆ MuonGEMDetLayerGeometryBuilder()

MuonGEMDetLayerGeometryBuilder::MuonGEMDetLayerGeometryBuilder ( )
inline

Constructor (disabled, only static access is allowed)

Definition at line 22 of file MuonGEMDetLayerGeometryBuilder.h.

22 {}

◆ ~MuonGEMDetLayerGeometryBuilder()

MuonGEMDetLayerGeometryBuilder::~MuonGEMDetLayerGeometryBuilder ( )
virtual

Destructor.

Definition at line 20 of file MuonGEMDetLayerGeometryBuilder.cc.

20 {}

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 24 of file MuonGEMDetLayerGeometryBuilder.cc.

24  {
25  vector<DetLayer*> result[2];
26 
27  for (int endcap = -1; endcap <= 1; endcap += 2) {
28  int iendcap = (endcap == 1) ? 0 : 1; // +1: forward, -1: backward
29 
31  for (int layer = GEMDetId::minLayerId + 1; layer <= GEMDetId::maxLayerId; ++layer) {
32  vector<int> rolls, rings, chambers;
34  rings.push_back(ring);
36  chambers.push_back(chamber);
37  for (int roll = GEMDetId::minRollId + 1; roll <= GEMDetId::maxRollId; ++roll)
38  rolls.push_back(roll);
39 
40  MuRingForwardDoubleLayer* ringLayer = buildLayer(endcap, rings, station, layer, chambers, rolls, geo);
41 
42  if (ringLayer)
43  result[iendcap].push_back(ringLayer);
44  }
45  }
46  }
47  pair<vector<DetLayer*>, vector<DetLayer*> > res_pair(result[0], result[1]);
48 
49  return res_pair;
50 }

References relativeConstraints::chamber, chambers, makeMuonMisalignmentScenario::endcap, GEMDetId::maxChamberId, GEMDetId::maxLayerId, GEMDetId::maxRingId, GEMDetId::maxRollId, GEMDetId::maxStationId, GEMDetId::minChamberId, GEMDetId::minLayerId, GEMDetId::minRingId, GEMDetId::minRollId, GEMDetId::minStationId, mps_fire::result, relativeConstraints::ring, and relativeConstraints::station.

Referenced by MuonDetLayerGeometryESProducer::produce().

◆ buildLayer()

MuRingForwardDoubleLayer * MuonGEMDetLayerGeometryBuilder::buildLayer ( int  endcap,
std::vector< int > &  rings,
int  station,
int  layer,
std::vector< int > &  chambers,
std::vector< int > &  rolls,
const GEMGeometry geo 
)
staticprivate

Definition at line 52 of file MuonGEMDetLayerGeometryBuilder.cc.

58  {
59  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonGEMDetLayerGeometryBuilder";
61  vector<const ForwardDetRing*> frontRings, backRings;
62 
63  for (std::vector<int>::iterator ring = rings.begin(); ring != rings.end() - 2; ring++) {
64  for (vector<int>::iterator roll = rolls.begin(); roll != rolls.end(); roll++) {
65  vector<const GeomDet*> frontDets, backDets;
66 
67  for (std::vector<int>::iterator chamber = chambers.begin(); chamber < chambers.end(); chamber++) {
68  GEMDetId gemId(endcap, (*ring), station, layer, (*chamber), (*roll));
69 
70  const GeomDet* geomDet = geo.idToDet(gemId);
71 
72  if (geomDet != nullptr) {
73  bool isInFront = isFront(gemId);
74  if (isInFront) {
75  frontDets.push_back(geomDet);
76  } else {
77  backDets.push_back(geomDet);
78  }
79  LogTrace(metname) << "get GEM Endcap roll " << gemId << (isInFront ? "front" : "back ")
80  << " at R=" << geomDet->position().perp() << ", phi=" << geomDet->position().phi()
81  << ", Z=" << geomDet->position().z();
82  }
83  }
84 
85  if (!frontDets.empty()) {
86  precomputed_value_sort(frontDets.begin(), frontDets.end(), geomsort::DetPhi());
87  frontRings.push_back(new MuDetRing(frontDets));
88  LogTrace(metname) << "New front ring with " << frontDets.size()
89  << " chambers at z=" << frontRings.back()->position().z();
90  }
91  if (!backDets.empty()) {
92  precomputed_value_sort(backDets.begin(), backDets.end(), geomsort::DetPhi());
93  backRings.push_back(new MuDetRing(backDets));
94  LogTrace(metname) << "New back ring with " << backDets.size()
95  << " chambers at z=" << backRings.back()->position().z();
96  }
97  }
98  }
99 
100  // How should they be sorted?
101  // precomputed_value_sort(muDetRods.begin(), muDetRods.end(), geomsort::ExtractZ<GeometricSearchDet,float>());
102  if (!backRings.empty() && !frontRings.empty())
103  result = new MuRingForwardDoubleLayer(frontRings, backRings);
104  else
105  result = nullptr;
106  if (result != nullptr) {
107  LogTrace(metname) << "New MuRingForwardLayer with " << frontRings.size() << " and " << backRings.size()
108  << " rings, at Z " << result->position().z() << " R1: " << result->specificSurface().innerRadius()
109  << " R2: " << result->specificSurface().outerRadius();
110  }
111  return result;
112 }

References relativeConstraints::chamber, chambers, makeMuonMisalignmentScenario::endcap, GEMGeometry::idToDet(), LogTrace, metname, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GeomDet::position(), precomputed_value_sort(), mps_fire::result, relativeConstraints::ring, relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, and PV3DBase< T, PVType, FrameType >::z().

◆ isFront()

bool MuonGEMDetLayerGeometryBuilder::isFront ( const GEMDetId gemId)
staticprivate

Definition at line 114 of file MuonGEMDetLayerGeometryBuilder.cc.

114  {
115  bool result = false;
116  int chamber = gemId.chamber();
117 
118  if (chamber % 2 == 0)
119  result = !result;
120 
121  return result;
122 }

References relativeConstraints::chamber, GEMDetId::chamber(), and mps_fire::result.

◆ makeDetRing()

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

Definition at line 124 of file MuonGEMDetLayerGeometryBuilder.cc.

124  {
125  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonGEMDetLayerGeometryBuilder";
126 
127  precomputed_value_sort(geomDets.begin(), geomDets.end(), geomsort::DetPhi());
128  MuDetRing* result = new MuDetRing(geomDets);
129  LogTrace(metname) << "New MuDetRing with " << geomDets.size() << " chambers at z=" << result->position().z()
130  << " R1: " << result->specificSurface().innerRadius()
131  << " R2: " << result->specificSurface().outerRadius();
132  return result;
133 }

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

GeomDet::position
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
GeomDet
Definition: GeomDet.h:27
GEMGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:25
relativeConstraints.station
station
Definition: relativeConstraints.py:67
MuonGEMDetLayerGeometryBuilder::isFront
static bool isFront(const GEMDetId &gemId)
Definition: MuonGEMDetLayerGeometryBuilder.cc:114
GEMDetId::maxStationId
static constexpr int32_t maxStationId
Definition: GEMDetId.h:26
GEMDetId::minChamberId
static constexpr int32_t minChamberId
Definition: GEMDetId.h:27
GEMDetId::minLayerId
static constexpr int32_t minLayerId
Definition: GEMDetId.h:29
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
MuDetRing
Definition: MuDetRing.h:16
GEMDetId::maxRollId
static constexpr int32_t maxRollId
Definition: GEMDetId.h:33
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
geomsort::DetPhi
ExtractPhi< GeomDet, float > DetPhi
Definition: DetSorting.h:37
GEMDetId::maxRingId
static constexpr int32_t maxRingId
Definition: GEMDetId.h:22
GEMDetId::maxChamberId
static constexpr int32_t maxChamberId
Definition: GEMDetId.h:28
GEMDetId::minRingId
static constexpr int32_t minRingId
Definition: GEMDetId.h:21
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GEMDetId::chamber
constexpr int chamber() const
Definition: GEMDetId.h:177
GEMDetId
Definition: GEMDetId.h:17
chambers
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
MuonGEMDetLayerGeometryBuilder::buildLayer
static MuRingForwardDoubleLayer * buildLayer(int endcap, std::vector< int > &rings, int station, int layer, std::vector< int > &chambers, std::vector< int > &rolls, const GEMGeometry &geo)
Definition: MuonGEMDetLayerGeometryBuilder.cc:52
GEMDetId::maxLayerId
static constexpr int32_t maxLayerId
Definition: GEMDetId.h:31
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
GEMDetId::minRollId
static constexpr int32_t minRollId
Definition: GEMDetId.h:32
GEMDetId::minStationId
static constexpr int32_t minStationId
Definition: GEMDetId.h:24
mps_fire.result
result
Definition: mps_fire.py:303
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
precomputed_value_sort
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
Definition: precomputed_value_sort.h:17
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
MuRingForwardDoubleLayer
Definition: MuRingForwardDoubleLayer.h:19
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:43