23 using namespace geomsort;
28 for(vector<const DetLayer*>::const_iterator it = allDetLayers.begin(); it != allDetLayers.end(); ++it)
36 for(
auto const it : csclayers.first) {
37 cscLayers_fw.push_back(it);
38 allForward.push_back(it);
40 detLayersMap[ makeDetLayerId(it) ] = it;
43 for(
auto const it: csclayers.second) {
44 cscLayers_bk.push_back(it);
45 allBackward.push_back(it);
47 detLayersMap[ makeDetLayerId(it) ] = it;
53 for(
auto const it : gemlayers.first) {
54 gemLayers_fw.push_back(it);
55 allForward.push_back(it);
56 detLayersMap[ makeDetLayerId(it) ] = it;
58 for(
auto const it: gemlayers.second) {
59 gemLayers_bk.push_back(it);
60 allBackward.push_back(it);
61 detLayersMap[ makeDetLayerId(it) ] = it;
67 for(
auto const it: barrelLayers) {
68 rpcLayers_barrel.push_back(it);
69 allBarrel.push_back(it);
71 detLayersMap[ makeDetLayerId(it) ] = it;
73 for(
auto const it: endcapLayers.first) {
74 rpcLayers_fw.push_back(it);
75 allForward.push_back(it);
77 detLayersMap[ makeDetLayerId(it) ] = it;
80 for(
auto const it: endcapLayers.second) {
81 rpcLayers_bk.push_back(it);
82 allBackward.push_back(it);
84 detLayersMap[ makeDetLayerId(it) ] = it;
91 for(
auto const it : dtlayers) {
92 dtLayers.push_back(it);
93 allBarrel.push_back(it);
95 detLayersMap[ makeDetLayerId(it) ] = it;
106 if(
id.
ring() == 1 ||
id.ring() == 4)
108 else if(
id.
ring() == 2 ||
id.ring() == 3)
111 throw cms::Exception(
"InvalidCSCRing")<<
" Invalid CSC Ring: "<<
id.ring()<<endl;
135 const vector<const DetLayer*>&
140 const vector<const DetLayer*>&
142 return cscLayers_all;
146 const vector<const DetLayer*>&
152 const vector<const DetLayer*>&
158 const vector<const DetLayer*>&
160 return gemLayers_all;
164 const vector<const DetLayer*>&
170 const vector<const DetLayer*>&
177 const vector<const DetLayer*>&
179 return rpcLayers_all;
183 const vector<const DetLayer*>&
185 return rpcLayers_barrel;
189 const vector<const DetLayer*>&
191 return rpcLayers_endcap;
195 const vector<const DetLayer*>&
201 const vector<const DetLayer*>&
207 const vector<const DetLayer*>&
213 const vector<const DetLayer*>&
218 const vector<const DetLayer*>&
224 const vector<const DetLayer*>&
230 const vector<const DetLayer*>&
237 const vector<const DetLayer*>&
239 return allEndcapCscGem;
243 const vector<const DetLayer*>&
245 return allCscGemForward;
249 const vector<const DetLayer*>&
251 return allCscGemBackward;
263 if(cscId.station() == 1)
265 if(cscId.ring() == 1 || cscId.ring() == 4)
266 id =
CSCDetId(cscId.endcap(),1,1,0,0);
267 else if(cscId.ring() == 2 || cscId.ring() == 3)
268 id =
CSCDetId(cscId.endcap(),1,2,0,0);
270 throw cms::Exception(
"InvalidCSCRing")<<
" Invalid CSC Ring: "<<cscId.ring()<<endl;
272 else id =
CSCDetId(cscId.endcap(),cscId.station(),0,0,0);
281 id =
RPCDetId(rpcId.region(),0,rpcId.station(),0,rpcId.layer(),0,0);
285 id =
GEMDetId(gemId.region(),1,gemId.station(),gemId.layer(),0,0);
290 std::map<DetId,const DetLayer*>::const_iterator layer = detLayersMap.find(
id);
291 if (layer == detLayersMap.end())
return 0;
292 return layer->second;
326 cscLayers_all.reserve(cscLayers_bk.size()+cscLayers_fw.size());
327 std::copy(cscLayers_bk.begin(),cscLayers_bk.end(),back_inserter(cscLayers_all));
328 std::reverse(cscLayers_all.begin(),cscLayers_all.end());
329 std::copy(cscLayers_fw.begin(),cscLayers_fw.end(),back_inserter(cscLayers_all));
332 gemLayers_all.reserve(gemLayers_bk.size()+gemLayers_fw.size());
333 std::copy(gemLayers_bk.begin(),gemLayers_bk.end(),back_inserter(gemLayers_all));
334 std::reverse(gemLayers_all.begin(),gemLayers_all.end());
335 std::copy(gemLayers_fw.begin(),gemLayers_fw.end(),back_inserter(gemLayers_all));
338 rpcLayers_endcap.reserve(rpcLayers_bk.size()+rpcLayers_fw.size());
339 std::copy(rpcLayers_bk.begin(),rpcLayers_bk.end(),back_inserter(rpcLayers_endcap));
340 std::reverse(rpcLayers_endcap.begin(),rpcLayers_endcap.end());
341 std::copy(rpcLayers_fw.begin(),rpcLayers_fw.end(),back_inserter(rpcLayers_endcap));
344 rpcLayers_all.reserve(rpcLayers_bk.size()+rpcLayers_barrel.size()+rpcLayers_fw.size());
345 std::copy(rpcLayers_bk.begin(),rpcLayers_bk.end(),back_inserter(rpcLayers_all));
346 std::reverse(rpcLayers_all.begin(),rpcLayers_all.end());
347 std::copy(rpcLayers_barrel.begin(),rpcLayers_barrel.end(),back_inserter(rpcLayers_all));
348 std::copy(rpcLayers_fw.begin(),rpcLayers_fw.end(),back_inserter(rpcLayers_all));
351 allEndcap.reserve(allBackward.size()+allForward.size());
352 std::copy(allBackward.begin(),allBackward.end(),back_inserter(allEndcap));
353 std::reverse(allEndcap.begin(),allEndcap.end());
354 std::copy(allForward.begin(),allForward.end(),back_inserter(allEndcap));
357 allEndcapCscGem.reserve(cscLayers_bk.size()+cscLayers_fw.size()+gemLayers_bk.size()+gemLayers_fw.size());
358 std::copy(cscLayers_bk.begin(),cscLayers_bk.end(),back_inserter(allEndcapCscGem));
359 std::copy(gemLayers_bk.begin(),gemLayers_bk.end(),back_inserter(allEndcapCscGem));
360 std::reverse(allEndcapCscGem.begin(),allEndcapCscGem.end());
361 std::copy(cscLayers_fw.begin(),cscLayers_fw.end(),back_inserter(allEndcapCscGem));
362 std::copy(gemLayers_fw.begin(),gemLayers_fw.end(),back_inserter(allEndcapCscGem));
365 allCscGemForward.reserve(cscLayers_fw.size()+gemLayers_fw.size());
366 std::copy(cscLayers_fw.begin(),cscLayers_fw.end(),back_inserter(allCscGemForward));
367 std::copy(gemLayers_fw.begin(),gemLayers_fw.end(),back_inserter(allCscGemForward));
370 allCscGemBackward.reserve(cscLayers_bk.size()+gemLayers_bk.size());
371 std::copy(cscLayers_bk.begin(),cscLayers_bk.end(),back_inserter(allCscGemBackward));
372 std::copy(gemLayers_bk.begin(),gemLayers_bk.end(),back_inserter(allCscGemBackward));
375 allDetLayers.reserve(allBackward.size()+allBarrel.size()+allForward.size());
376 std::copy(allBackward.begin(),allBackward.end(),back_inserter(allDetLayers));
377 std::reverse(allDetLayers.begin(),allDetLayers.end());
378 std::copy(allBarrel.begin(),allBarrel.end(),back_inserter(allDetLayers));
379 std::copy(allForward.begin(),allForward.end(),back_inserter(allDetLayers));
383 for (
auto l : allDetLayers)
384 (*
const_cast<DetLayer*
>(
l)).setSeqNum(sq++);
const std::vector< const DetLayer * > & backwardGEMLayers() const
return the backward (-Z) GEM DetLayers, inside-out
const std::vector< const DetLayer * > & allCscGemBackwardLayers() const
return all endcap DetLayers (CSC+GEM), -Z to +Z
const std::vector< const DetLayer * > & allEndcapLayers() const
return all endcap DetLayers (CSC+RPC+GEM), -Z to +Z
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
const std::vector< const DetLayer * > & forwardRPCLayers() const
return the forward (+Z) RPC DetLayers, inside-out
virtual const DetLayer * idToLayer(const DetId &detId) const override
return the DetLayer which correspond to a certain DetId
void addDTLayers(const std::vector< DetLayer * > &dtlayers)
const std::vector< const DetLayer * > & allCSCLayers() const
return the CSC DetLayers (endcap), -Z to +Z
uint32_t rawId() const
get the raw id
const std::vector< const DetLayer * > & allForwardLayers() const
return all forward (+Z) layers (CSC+RPC+GEM), inside-out
void addGEMLayers(const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &gemlayers)
const std::vector< const DetLayer * > & allBarrelLayers() const
return all barrel DetLayers (DT+RPC), inside-out
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
MuonDetLayerGeometry()
Constructor.
const std::vector< const DetLayer * > & endcapRPCLayers() const
return the endcap RPC DetLayers, -Z to +Z
const std::vector< const DetLayer * > & allDTLayers() const
return the DT DetLayers (barrel), inside-out
const std::vector< const DetLayer * > & forwardCSCLayers() const
return the forward (+Z) CSC DetLayers, inside-out
virtual const BoundCylinder & specificSurface() const
Extension of the interface.
virtual const std::vector< const GeomDet * > & basicComponents() const =0
DetId makeDetLayerId(const DetLayer *detLayer) const
virtual ~MuonDetLayerGeometry()
Destructor.
void addRPCLayers(const std::vector< DetLayer * > &barrelRPCLayers, const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &endcapRPCLayers)
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
const std::vector< const DetLayer * > & allBackwardLayers() const
return all backward (-Z) layers (CSC+RPC+GEM), inside-out
const std::vector< const DetLayer * > & allGEMLayers() const
return the GEM DetLayers (endcap), -Z to +Z
const std::vector< const DetLayer * > & allLayers() const
return all layers (DT+CSC+RPC+GEM), order: backward, barrel, forward
const std::vector< const DetLayer * > & forwardGEMLayers() const
return the forward (+Z) GEM DetLayers, inside-out
const std::vector< const DetLayer * > & backwardCSCLayers() const
return the backward (-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 * > & barrelRPCLayers() const
return the barrel RPC DetLayers, inside-out
const std::vector< const DetLayer * > & allEndcapCscGemLayers() 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
void addCSCLayers(const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &csclayers)
const std::vector< const DetLayer * > & allRPCLayers() const
return all RPC DetLayers, order: backward, barrel, forward