31 for (vector<const DetLayer*>::const_iterator it = allDetLayers.begin(); it != allDetLayers.end(); ++it) {
37 for (
auto const it : csclayers.first) {
38 cscLayers_fw.push_back(it);
39 allForward.push_back(it);
41 detLayersMap[makeDetLayerId(it)] = it;
44 for (
auto const it : csclayers.second) {
45 cscLayers_bk.push_back(it);
46 allBackward.push_back(it);
48 detLayersMap[makeDetLayerId(it)] = it;
53 LogDebug(
"Muon|RecoMuon|MuonDetLayerGeometry") <<
"Adding GEMlayers " << std::endl;
54 for (
auto const it : gemlayers.first) {
55 gemLayers_fw.push_back(it);
56 allForward.push_back(it);
57 detLayersMap[makeDetLayerId(it)] = it;
58 LogDebug(
"Muon|RecoMuon|MuonDetLayerGeometry") <<
"Adding GEMforward " << std::endl;
60 for (
auto const it : gemlayers.second) {
61 gemLayers_bk.push_back(it);
62 allBackward.push_back(it);
63 detLayersMap[makeDetLayerId(it)] = it;
64 LogDebug(
"Muon|RecoMuon|MuonDetLayerGeometry") <<
"Adding GEMbackward " << std::endl;
69 LogDebug(
"Muon|RecoMuon|MuonDetLayerGeometry") <<
"Adding ME0layers " << std::endl;
71 for (
auto const it : me0layers.first) {
72 me0Layers_fw.push_back(it);
73 allForward.push_back(it);
75 detLayersMap[makeDetLayerId(it)] = it;
76 LogDebug(
"Muon|RecoMuon|MuonDetLayerGeometry") <<
"Adding ME0forward " << std::endl;
78 for (
auto const it : me0layers.second) {
79 me0Layers_bk.push_back(it);
80 allBackward.push_back(it);
82 detLayersMap[makeDetLayerId(it)] = it;
83 LogDebug(
"Muon|RecoMuon|MuonDetLayerGeometry") <<
"Adding ME0backward " << std::endl;
88 const pair<vector<DetLayer*>, vector<DetLayer*> >& endcapLayers) {
89 for (
auto const it : barrelLayers) {
90 rpcLayers_barrel.push_back(it);
91 allBarrel.push_back(it);
93 detLayersMap[makeDetLayerId(it)] = it;
95 for (
auto const it : endcapLayers.first) {
96 rpcLayers_fw.push_back(it);
97 allForward.push_back(it);
99 detLayersMap[makeDetLayerId(it)] = it;
102 for (
auto const it : endcapLayers.second) {
103 rpcLayers_bk.push_back(it);
104 allBackward.push_back(it);
106 detLayersMap[makeDetLayerId(it)] = it;
111 for (
auto const it : dtlayers) {
112 dtLayers.push_back(it);
113 allBarrel.push_back(it);
115 detLayersMap[makeDetLayerId(it)] = it;
124 if (
id.
ring() == 1 ||
id.ring() == 4)
126 else if (
id.
ring() == 2 ||
id.ring() == 3)
129 throw cms::Exception(
"InvalidCSCRing") <<
" Invalid CSC Ring: " <<
id.ring() << endl;
221 if (cscId.station() == 1) {
222 if (cscId.ring() == 1 || cscId.ring() == 4)
223 id =
CSCDetId(cscId.endcap(), 1, 1, 0, 0);
224 else if (cscId.ring() == 2 || cscId.ring() == 3)
225 id =
CSCDetId(cscId.endcap(), 1, 2, 0, 0);
227 throw cms::Exception(
"InvalidCSCRing") <<
" Invalid CSC Ring: " << cscId.ring() << endl;
229 id =
CSCDetId(cscId.endcap(), cscId.station(), 0, 0, 0);
237 id =
RPCDetId(rpcId.region(), 0, rpcId.station(), 0, rpcId.layer(), 0, 0);
240 id =
GEMDetId(gemId.region(), 1, gemId.station(), gemId.layer(), 0, 0);
243 id =
ME0DetId(me0Id.region(), me0Id.layer(), 0, 0);
244 LogDebug(
"Muon|RecoMuon|MuonDetLayerGeometry")
245 <<
" Found an ME0DetId: " << me0Id.rawId() <<
",id: " <<
id.rawId() << std::endl;
250 std::map<DetId, const DetLayer*>::const_iterator layer = detLayersMap.find(
id);
251 if (layer == detLayersMap.end())
253 return layer->second;
287 cscLayers_all.reserve(cscLayers_bk.size() + cscLayers_fw.size());
288 std::copy(cscLayers_bk.begin(), cscLayers_bk.end(), back_inserter(cscLayers_all));
289 std::reverse(cscLayers_all.begin(), cscLayers_all.end());
290 std::copy(cscLayers_fw.begin(), cscLayers_fw.end(), back_inserter(cscLayers_all));
293 gemLayers_all.reserve(gemLayers_bk.size() + gemLayers_fw.size());
294 std::copy(gemLayers_bk.begin(), gemLayers_bk.end(), back_inserter(gemLayers_all));
295 std::reverse(gemLayers_all.begin(), gemLayers_all.end());
296 std::copy(gemLayers_fw.begin(), gemLayers_fw.end(), back_inserter(gemLayers_all));
299 me0Layers_all.reserve(me0Layers_bk.size() + me0Layers_fw.size());
300 std::copy(me0Layers_bk.begin(), me0Layers_bk.end(), back_inserter(me0Layers_all));
301 std::reverse(me0Layers_all.begin(), me0Layers_all.end());
302 std::copy(me0Layers_fw.begin(), me0Layers_fw.end(), back_inserter(me0Layers_all));
305 rpcLayers_endcap.reserve(rpcLayers_bk.size() + rpcLayers_fw.size());
306 std::copy(rpcLayers_bk.begin(), rpcLayers_bk.end(), back_inserter(rpcLayers_endcap));
307 std::reverse(rpcLayers_endcap.begin(), rpcLayers_endcap.end());
308 std::copy(rpcLayers_fw.begin(), rpcLayers_fw.end(), back_inserter(rpcLayers_endcap));
311 rpcLayers_all.reserve(rpcLayers_bk.size() + rpcLayers_barrel.size() + rpcLayers_fw.size());
312 std::copy(rpcLayers_bk.begin(), rpcLayers_bk.end(), back_inserter(rpcLayers_all));
313 std::reverse(rpcLayers_all.begin(), rpcLayers_all.end());
314 std::copy(rpcLayers_barrel.begin(), rpcLayers_barrel.end(), back_inserter(rpcLayers_all));
315 std::copy(rpcLayers_fw.begin(), rpcLayers_fw.end(), back_inserter(rpcLayers_all));
318 allEndcap.reserve(allBackward.size() + allForward.size());
319 std::copy(allBackward.begin(), allBackward.end(), back_inserter(allEndcap));
321 std::copy(allForward.begin(), allForward.end(), back_inserter(allEndcap));
324 allEndcapCscGem.reserve(cscLayers_bk.size() + cscLayers_fw.size() + gemLayers_bk.size() + gemLayers_fw.size());
325 std::copy(cscLayers_bk.begin(), cscLayers_bk.end(), back_inserter(allEndcapCscGem));
326 std::copy(gemLayers_bk.begin(), gemLayers_bk.end(), back_inserter(allEndcapCscGem));
327 std::reverse(allEndcapCscGem.begin(), allEndcapCscGem.end());
328 std::copy(cscLayers_fw.begin(), cscLayers_fw.end(), back_inserter(allEndcapCscGem));
329 std::copy(gemLayers_fw.begin(), gemLayers_fw.end(), back_inserter(allEndcapCscGem));
332 allCscGemForward.reserve(cscLayers_fw.size() + gemLayers_fw.size());
333 std::copy(cscLayers_fw.begin(), cscLayers_fw.end(), back_inserter(allCscGemForward));
334 std::copy(gemLayers_fw.begin(), gemLayers_fw.end(), back_inserter(allCscGemForward));
337 allCscGemBackward.reserve(cscLayers_bk.size() + gemLayers_bk.size());
338 std::copy(cscLayers_bk.begin(), cscLayers_bk.end(), back_inserter(allCscGemBackward));
339 std::copy(gemLayers_bk.begin(), gemLayers_bk.end(), back_inserter(allCscGemBackward));
342 allCscME0Forward.reserve(cscLayers_fw.size() + me0Layers_fw.size());
343 std::copy(cscLayers_fw.begin(), cscLayers_fw.end(), back_inserter(allCscME0Forward));
344 std::copy(me0Layers_fw.begin(), me0Layers_fw.end(), back_inserter(allCscME0Forward));
347 allCscME0Backward.reserve(cscLayers_bk.size() + me0Layers_bk.size());
348 std::copy(cscLayers_bk.begin(), cscLayers_bk.end(), back_inserter(allCscME0Backward));
349 std::copy(me0Layers_bk.begin(), me0Layers_bk.end(), back_inserter(allCscME0Backward));
352 allEndcapCscME0.reserve(cscLayers_bk.size() + cscLayers_fw.size() + me0Layers_bk.size() + me0Layers_fw.size());
353 std::copy(cscLayers_bk.begin(), cscLayers_bk.end(), back_inserter(allEndcapCscME0));
354 std::copy(me0Layers_bk.begin(), me0Layers_bk.end(), back_inserter(allEndcapCscME0));
355 std::reverse(allEndcapCscME0.begin(), allEndcapCscME0.end());
356 std::copy(cscLayers_fw.begin(), cscLayers_fw.end(), back_inserter(allEndcapCscME0));
357 std::copy(me0Layers_fw.begin(), me0Layers_fw.end(), back_inserter(allEndcapCscME0));
360 allDetLayers.reserve(allBackward.size() + allBarrel.size() + allForward.size());
361 std::copy(allBackward.begin(), allBackward.end(), back_inserter(allDetLayers));
363 std::copy(allBarrel.begin(), allBarrel.end(), back_inserter(allDetLayers));
364 std::copy(allForward.begin(), allForward.end(), back_inserter(allDetLayers));
368 for (
auto l : allDetLayers)
369 (*
const_cast<DetLayer*
>(
l)).setSeqNum(sq++);
const std::vector< const DetLayer * > & allBackwardLayers() const
return all backward (-Z) layers (CSC+RPC+GEM+ME0), inside-out
const std::vector< const DetLayer * > & allEndcapCscME0Layers() const
return all endcap DetLayers (CSC+ME0), -Z to +Z
const std::vector< const DetLayer * > & forwardCSCLayers() const
return the forward (+Z) CSC DetLayers, inside-out
const std::vector< const DetLayer * > & allCscGemForwardLayers() const
return all endcap DetLayers (CSC+GEM), -Z to +Z
const std::vector< const DetLayer * > & backwardRPCLayers() const
return the backward (-Z) RPC DetLayers, inside-out
~MuonDetLayerGeometry() override
Destructor.
const std::vector< const DetLayer * > & endcapRPCLayers() const
return the endcap RPC DetLayers, -Z to +Z
const std::vector< const DetLayer * > & backwardME0Layers() const
return the backward (-Z) ME0 DetLayers, inside-out
const std::vector< const DetLayer * > & allForwardLayers() const
return all forward (+Z) layers (CSC+RPC+GEM+ME0), inside-out
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
const DetLayer * idToLayer(const DetId &detId) const override
return the DetLayer which correspond to a certain DetId
void addGEMLayers(const std::pair< std::vector< DetLayer *>, std::vector< DetLayer *> > &gemlayers)
const std::vector< const DetLayer * > & allDTLayers() const
return the DT DetLayers (barrel), inside-out
const std::vector< const DetLayer * > & forwardME0Layers() const
return the forward (+Z) ME0 DetLayers, inside-out
const std::vector< const DetLayer * > & allRPCLayers() const
return all RPC DetLayers, order: backward, barrel, forward
const std::vector< const DetLayer * > & allLayers() const
return all layers (DT+CSC+RPC+GEM), order: backward, barrel, forward
const std::vector< const DetLayer * > & forwardRPCLayers() const
return the forward (+Z) RPC DetLayers, inside-out
void addDTLayers(const std::vector< DetLayer *> &dtlayers)
void addRPCLayers(const std::vector< DetLayer *> &barrelRPCLayers, const std::pair< std::vector< DetLayer *>, std::vector< DetLayer *> > &endcapRPCLayers)
const std::vector< const DetLayer * > & forwardGEMLayers() const
return the forward (+Z) GEM DetLayers, inside-out
const std::vector< const DetLayer * > & allME0Layers() const
return the ME0 DetLayers (endcap), -Z to +Z
const std::vector< const DetLayer * > & allCscGemBackwardLayers() const
return all endcap DetLayers (CSC+GEM), -Z to +Z
const std::vector< const DetLayer * > & allGEMLayers() const
return the GEM DetLayers (endcap), -Z to +Z
void addME0Layers(const std::pair< std::vector< DetLayer *>, std::vector< DetLayer *> > &gemlayers)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
MuonDetLayerGeometry()
Constructor.
void addCSCLayers(const std::pair< std::vector< DetLayer *>, std::vector< DetLayer *> > &csclayers)
const std::vector< const DetLayer * > & allEndcapCscGemLayers() const
return all endcap DetLayers (CSC+GEM), -Z to +Z
DetId makeDetLayerId(const DetLayer *detLayer) const
const std::vector< const DetLayer * > & allCSCLayers() const
return the CSC DetLayers (endcap), -Z to +Z
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
const std::vector< const DetLayer * > & backwardGEMLayers() const
return the backward (-Z) GEM DetLayers, inside-out
const std::vector< const DetLayer * > & backwardCSCLayers() const
return the backward (-Z) CSC DetLayers, inside-out
constexpr uint32_t rawId() const
get the raw id
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
const std::vector< const DetLayer * > & allCscME0BackwardLayers() const
return all endcap DetLayers (CSC+ME0), -Z to +Z
virtual const std::vector< const GeomDet * > & basicComponents() const =0
const std::vector< const DetLayer * > & allBarrelLayers() const
return all barrel DetLayers (DT+RPC), inside-out
const std::vector< const DetLayer * > & allEndcapLayers() const
return all endcap DetLayers (CSC+RPC+GEM+ME0), -Z to +Z
const std::vector< const DetLayer * > & allCscME0ForwardLayers() const
return all endcap DetLayers (CSC+ME0), -Z to +Z
const std::vector< const DetLayer * > & barrelRPCLayers() const
return the barrel RPC DetLayers, inside-out