20 using namespace geomsort;
25 for(vector<const DetLayer*>::const_iterator it = allDetLayers.begin(); it != allDetLayers.end(); ++it)
33 for(
auto const it : csclayers.first) {
34 cscLayers_fw.push_back(it);
36 allForward.push_back(it);
40 detLayersMap[ makeDetLayerId(it) ] = it;
43 for(
auto const it: csclayers.second) {
44 cscLayers_bk.push_back(it);
46 allBackward.push_back(it);
50 detLayersMap[ makeDetLayerId(it) ] = it;
56 for(
auto const it: barrelLayers) {
57 rpcLayers_barrel.push_back(it);
59 allBarrel.push_back(it);
62 detLayersMap[ makeDetLayerId(it) ] = it;
64 for(
auto const it: endcapLayers.first) {
65 rpcLayers_fw.push_back(it);
68 allForward.push_back(it);
72 detLayersMap[ makeDetLayerId(it) ] = it;
75 for(
auto const it: endcapLayers.second) {
76 rpcLayers_bk.push_back(it);
79 allBackward.push_back(it);
83 detLayersMap[ makeDetLayerId(it) ] = it;
90 for(
auto const it : dtlayers) {
91 dtLayers.push_back(it);
92 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;
130 const vector<const DetLayer*>&
135 const vector<const DetLayer*>&
137 return cscLayers_all;
141 const vector<const DetLayer*>&
147 const vector<const DetLayer*>&
153 const vector<const DetLayer*>&
155 return rpcLayers_all;
159 const vector<const DetLayer*>&
161 return rpcLayers_barrel;
165 const vector<const DetLayer*>&
167 return rpcLayers_endcap;
171 const vector<const DetLayer*>&
177 const vector<const DetLayer*>&
183 const vector<const DetLayer*>&
189 const vector<const DetLayer*>&
194 const vector<const DetLayer*>&
200 const vector<const DetLayer*>&
206 const vector<const DetLayer*>&
218 if(cscId.station() == 1)
220 if(cscId.ring() == 1 || cscId.ring() == 4)
221 id =
CSCDetId(cscId.endcap(),1,1,0,0);
222 else if(cscId.ring() == 2 || cscId.ring() == 3)
223 id =
CSCDetId(cscId.endcap(),1,2,0,0);
225 throw cms::Exception(
"InvalidCSCRing")<<
" Invalid CSC Ring: "<<cscId.ring()<<endl;
227 else id =
CSCDetId(cscId.endcap(),cscId.station(),0,0,0);
236 id =
RPCDetId(rpcId.region(),0,rpcId.station(),0,rpcId.layer(),0,0);
241 std::map<DetId,const DetLayer*>::const_iterator layer = detLayersMap.find(
id);
242 if (layer == detLayersMap.end())
return 0;
243 return layer->second;
277 cscLayers_all.reserve(cscLayers_bk.size()+cscLayers_fw.size());
278 std::copy(cscLayers_bk.begin(),cscLayers_bk.end(),back_inserter(cscLayers_all));
279 std::reverse(cscLayers_all.begin(),cscLayers_all.end());
280 std::copy(cscLayers_fw.begin(),cscLayers_fw.end(),back_inserter(cscLayers_all));
283 rpcLayers_endcap.reserve(rpcLayers_bk.size()+rpcLayers_fw.size());
284 std::copy(rpcLayers_bk.begin(),rpcLayers_bk.end(),back_inserter(rpcLayers_endcap));
285 std::reverse(rpcLayers_endcap.begin(),rpcLayers_endcap.end());
286 std::copy(rpcLayers_fw.begin(),rpcLayers_fw.end(),back_inserter(rpcLayers_endcap));
289 rpcLayers_all.reserve(rpcLayers_bk.size()+rpcLayers_barrel.size()+rpcLayers_fw.size());
290 std::copy(rpcLayers_bk.begin(),rpcLayers_bk.end(),back_inserter(rpcLayers_all));
291 std::reverse(rpcLayers_all.begin(),rpcLayers_all.end());
292 std::copy(rpcLayers_barrel.begin(),rpcLayers_barrel.end(),back_inserter(rpcLayers_all));
293 std::copy(rpcLayers_fw.begin(),rpcLayers_fw.end(),back_inserter(rpcLayers_all));
296 allEndcap.reserve(allBackward.size()+allForward.size());
297 std::copy(allBackward.begin(),allBackward.end(),back_inserter(allEndcap));
298 std::reverse(allEndcap.begin(),allEndcap.end());
299 std::copy(allForward.begin(),allForward.end(),back_inserter(allEndcap));
302 allDetLayers.reserve(allBackward.size()+allBarrel.size()+allForward.size());
303 std::copy(allBackward.begin(),allBackward.end(),back_inserter(allDetLayers));
304 std::reverse(allDetLayers.begin(),allDetLayers.end());
305 std::copy(allBarrel.begin(),allBarrel.end(),back_inserter(allDetLayers));
306 std::copy(allForward.begin(),allForward.end(),back_inserter(allDetLayers));
310 for (
auto l : allDetLayers)
311 (*
const_cast<DetLayer*
>(
l)).setSeqNum(sq++);
const std::vector< const DetLayer * > & allEndcapLayers() const
return all endcap DetLayers (CSC+RPC), -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), inside-out
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), inside-out
const std::vector< const DetLayer * > & allLayers() const
return all layers (DT+CSC+RPC), order: backward, barrel, forward
const std::vector< const DetLayer * > & backwardCSCLayers() const
return the backward (-Z) CSC DetLayers, inside-out
const std::vector< const DetLayer * > & barrelRPCLayers() const
return the barrel RPC DetLayers, inside-out
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