CMS 3D CMS Logo

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

#include <MuonCSCDetLayerGeometryBuilder.h>

Static Public Member Functions

static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildLayers (const CSCGeometry &geo)
 

Private Member Functions

 MuonCSCDetLayerGeometryBuilder ()
 

Static Private Member Functions

static MuRingForwardDoubleLayerbuildLayer (int endcap, int station, std::vector< int > &rings, const CSCGeometry &geo)
 
static bool isFront (int station, int ring, int chamber)
 
static MuDetRingmakeDetRing (std::vector< const GeomDet * > &geomDets)
 

Detailed Description

Build the CSC DetLayers.

Author
N. Amapane - CERN

Definition at line 18 of file MuonCSCDetLayerGeometryBuilder.h.

Constructor & Destructor Documentation

◆ MuonCSCDetLayerGeometryBuilder()

MuonCSCDetLayerGeometryBuilder::MuonCSCDetLayerGeometryBuilder ( )
inlineprivate

Definition at line 26 of file MuonCSCDetLayerGeometryBuilder.h.

26 {}

Member Function Documentation

◆ buildLayer()

MuRingForwardDoubleLayer * MuonCSCDetLayerGeometryBuilder::buildLayer ( int  endcap,
int  station,
std::vector< int > &  rings,
const CSCGeometry geo 
)
staticprivate

Definition at line 60 of file MuonCSCDetLayerGeometryBuilder.cc.

63  {
64  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonCSCDetLayerGeometryBuilder";
66 
67  vector<const ForwardDetRing*> frontRings, backRings;
68 
69  for (vector<int>::iterator ring = rings.begin(); ring != rings.end(); ring++) {
70  vector<const GeomDet*> frontGeomDets, backGeomDets;
72  CSCDetId detId(endcap, station, (*ring), chamber, 0);
73  const GeomDet* geomDet = geo.idToDet(detId);
74  // we sometimes loop over more chambers than there are in ring
75  bool isInFront = isFront(station, *ring, chamber);
76  if (geomDet != nullptr) {
77  if (isInFront) {
78  frontGeomDets.push_back(geomDet);
79  } else {
80  backGeomDets.push_back(geomDet);
81  }
82  LogTrace(metname) << "get CSC chamber " << CSCDetId(endcap, station, (*ring), chamber, 0)
83  << " at R=" << geomDet->position().perp() << ", phi=" << geomDet->position().phi()
84  << ", z= " << geomDet->position().z() << " isFront? " << isInFront;
85  }
86  }
87 
88  if (!backGeomDets.empty()) {
89  backRings.push_back(makeDetRing(backGeomDets));
90  }
91 
92  if (!frontGeomDets.empty()) {
93  frontRings.push_back(makeDetRing(frontGeomDets));
94  assert(!backGeomDets.empty());
95  float frontz = frontRings[0]->position().z();
96  float backz = backRings[0]->position().z();
97  assert(fabs(frontz) < fabs(backz));
98  }
99  }
100 
101  // How should they be sorted?
102  // precomputed_value_sort(muDetRods.begin(), muDetRods.end(), geomsort::ExtractZ<GeometricSearchDet,float>());
103  result = new MuRingForwardDoubleLayer(frontRings, backRings);
104  LogTrace(metname) << "New MuRingForwardLayer with " << frontRings.size() << " and " << backRings.size()
105  << " rings, at Z " << result->position().z() << " R1: " << result->specificSurface().innerRadius()
106  << " R2: " << result->specificSurface().outerRadius();
107  return result;
108 }

References cms::cuda::assert(), relativeConstraints::chamber, makeMuonMisalignmentScenario::endcap, CSCGeometry::idToDet(), LogTrace, CSCDetId::maxChamberId(), metname, CSCDetId::minChamberId(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GeomDet::position(), mps_fire::result, relativeConstraints::ring, relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, and PV3DBase< T, PVType, FrameType >::z().

◆ buildLayers()

pair< vector< DetLayer * >, vector< DetLayer * > > MuonCSCDetLayerGeometryBuilder::buildLayers ( const CSCGeometry geo)
static

return.first=forward (+Z), return.second=backward (-Z) both vectors are sorted inside-out

Definition at line 17 of file MuonCSCDetLayerGeometryBuilder.cc.

17  {
18  vector<DetLayer*> result[2]; // one for each endcap
19 
20  for (int i = 0; i < 2; i++) {
21  int endcap = i + 1;
22 
23  // ME/1/1a (= station 1, ring 4) and ME/1/1b (= station 1, ring 1)
24  {
25  vector<int> rings;
26  rings.push_back(4);
27  rings.push_back(1);
28 
29  MuRingForwardDoubleLayer* layer = buildLayer(endcap, 1, rings, geo);
30  if (layer)
31  result[i].push_back(layer);
32  }
33 
34  // ME/1/2 and 1/3 (= station 1, ring 2 and 3)
35  {
36  vector<int> rings;
37  rings.push_back(2);
38  rings.push_back(3);
39 
40  MuRingForwardDoubleLayer* layer = buildLayer(endcap, 1, rings, geo);
41  if (layer)
42  result[i].push_back(layer);
43  }
44 
45  // Stations 2,3,4
46  for (int station = 2; station <= CSCDetId::maxStationId(); station++) {
47  vector<int> rings;
48  for (int ring = CSCDetId::minRingId(); ring <= CSCDetId::maxRingId(); ring++) {
49  rings.push_back(ring);
50  }
51  MuRingForwardDoubleLayer* layer = buildLayer(endcap, station, rings, geo);
52  if (layer)
53  result[i].push_back(layer);
54  }
55  }
56  pair<vector<DetLayer*>, vector<DetLayer*> > res_pair(result[0], result[1]);
57  return res_pair;
58 }

References makeMuonMisalignmentScenario::endcap, mps_fire::i, CSCDetId::maxRingId(), CSCDetId::maxStationId(), CSCDetId::minRingId(), mps_fire::result, relativeConstraints::ring, and relativeConstraints::station.

Referenced by MuonDetLayerGeometryESProducer::produce().

◆ isFront()

bool MuonCSCDetLayerGeometryBuilder::isFront ( int  station,
int  ring,
int  chamber 
)
staticprivate

Definition at line 110 of file MuonCSCDetLayerGeometryBuilder.cc.

110  {
111  bool result = false;
112 
113  bool isOverlapping = !(station == 1 && ring == 3);
114  // not overlapping means back
115  if (isOverlapping) {
116  bool isEven = (chamber % 2 == 0);
117  // odd chambers are bolted to the iron, which faces
118  // forward in 1&2, backward in 3&4, so...
119  result = (station < 3) ? isEven : !isEven;
120  }
121  return result;
122 }

References relativeConstraints::chamber, mps_fire::result, relativeConstraints::ring, and relativeConstraints::station.

◆ makeDetRing()

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

Definition at line 124 of file MuonCSCDetLayerGeometryBuilder.cc.

124  {
125  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonCSCDetLayerGeometryBuilder";
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
CSCDetId::maxStationId
static int maxStationId()
Definition: CSCDetId.h:222
mps_fire.i
i
Definition: mps_fire.py:355
GeomDet
Definition: GeomDet.h:27
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:91
MuonCSCDetLayerGeometryBuilder::buildLayer
static MuRingForwardDoubleLayer * buildLayer(int endcap, int station, std::vector< int > &rings, const CSCGeometry &geo)
Definition: MuonCSCDetLayerGeometryBuilder.cc:60
cms::cuda::assert
assert(be >=bs)
CSCDetId::minChamberId
static int minChamberId()
Definition: CSCDetId.h:225
MuonCSCDetLayerGeometryBuilder::makeDetRing
static MuDetRing * makeDetRing(std::vector< const GeomDet * > &geomDets)
Definition: MuonCSCDetLayerGeometryBuilder.cc:124
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
MuDetRing
Definition: MuDetRing.h:16
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
geomsort::DetPhi
ExtractPhi< GeomDet, float > DetPhi
Definition: DetSorting.h:37
CSCDetId::maxRingId
static int maxRingId()
Definition: CSCDetId.h:224
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCDetId
Definition: CSCDetId.h:26
CSCDetId::maxChamberId
static int maxChamberId()
Definition: CSCDetId.h:226
MuonCSCDetLayerGeometryBuilder::isFront
static bool isFront(int station, int ring, int chamber)
Definition: MuonCSCDetLayerGeometryBuilder.cc:110
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
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
CSCDetId::minRingId
static int minRingId()
Definition: CSCDetId.h:223
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:43