CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
MuonDetLayerGeometry Class Reference

#include <MuonDetLayerGeometry.h>

Inheritance diagram for MuonDetLayerGeometry:
DetLayerGeometry

Public Member Functions

const std::vector< const DetLayer * > & allBackwardLayers () const
 return all backward (-Z) layers (CSC+RPC+GEM+ME0), inside-out More...
 
const std::vector< const DetLayer * > & allBarrelLayers () const
 return all barrel DetLayers (DT+RPC), inside-out More...
 
const std::vector< const DetLayer * > & allCscGemBackwardLayers () const
 return all endcap DetLayers (CSC+GEM), -Z to +Z More...
 
const std::vector< const DetLayer * > & allCscGemForwardLayers () const
 return all endcap DetLayers (CSC+GEM), -Z to +Z More...
 
const std::vector< const DetLayer * > & allCSCLayers () const
 return the CSC DetLayers (endcap), -Z to +Z More...
 
const std::vector< const DetLayer * > & allCscME0BackwardLayers () const
 return all endcap DetLayers (CSC+ME0), -Z to +Z More...
 
const std::vector< const DetLayer * > & allCscME0ForwardLayers () const
 return all endcap DetLayers (CSC+ME0), -Z to +Z More...
 
const std::vector< const DetLayer * > & allDTLayers () const
 return the DT DetLayers (barrel), inside-out More...
 
const std::vector< const DetLayer * > & allEndcapCscGemLayers () const
 return all endcap DetLayers (CSC+GEM), -Z to +Z More...
 
const std::vector< const DetLayer * > & allEndcapCscME0Layers () const
 return all endcap DetLayers (CSC+ME0), -Z to +Z More...
 
const std::vector< const DetLayer * > & allEndcapLayers () const
 return all endcap DetLayers (CSC+RPC+GEM+ME0), -Z to +Z More...
 
const std::vector< const DetLayer * > & allForwardLayers () const
 return all forward (+Z) layers (CSC+RPC+GEM+ME0), inside-out More...
 
const std::vector< const DetLayer * > & allGEMLayers () const
 return the GEM DetLayers (endcap), -Z to +Z More...
 
const std::vector< const DetLayer * > & allLayers () const
 return all layers (DT+CSC+RPC+GEM), order: backward, barrel, forward More...
 
const std::vector< const DetLayer * > & allME0Layers () const
 return the ME0 DetLayers (endcap), -Z to +Z More...
 
const std::vector< const DetLayer * > & allRPCLayers () const
 return all RPC DetLayers, order: backward, barrel, forward More...
 
const std::vector< const DetLayer * > & backwardCSCLayers () const
 return the backward (-Z) CSC DetLayers, inside-out More...
 
const std::vector< const DetLayer * > & backwardGEMLayers () const
 return the backward (-Z) GEM DetLayers, inside-out More...
 
const std::vector< const DetLayer * > & backwardME0Layers () const
 return the backward (-Z) ME0 DetLayers, inside-out More...
 
const std::vector< const DetLayer * > & backwardRPCLayers () const
 return the backward (-Z) RPC DetLayers, inside-out More...
 
const std::vector< const DetLayer * > & barrelRPCLayers () const
 return the barrel RPC DetLayers, inside-out More...
 
const std::vector< const DetLayer * > & endcapRPCLayers () const
 return the endcap RPC DetLayers, -Z to +Z More...
 
const std::vector< const DetLayer * > & forwardCSCLayers () const
 return the forward (+Z) CSC DetLayers, inside-out More...
 
const std::vector< const DetLayer * > & forwardGEMLayers () const
 return the forward (+Z) GEM DetLayers, inside-out More...
 
const std::vector< const DetLayer * > & forwardME0Layers () const
 return the forward (+Z) ME0 DetLayers, inside-out More...
 
const std::vector< const DetLayer * > & forwardRPCLayers () const
 return the forward (+Z) RPC DetLayers, inside-out More...
 
const DetLayeridToLayer (const DetId &detId) const override
 return the DetLayer which correspond to a certain DetId More...
 
 MuonDetLayerGeometry ()
 Constructor. More...
 
 ~MuonDetLayerGeometry () override
 Destructor. More...
 
- Public Member Functions inherited from DetLayerGeometry
 DetLayerGeometry ()
 
virtual ~DetLayerGeometry ()
 

Private Member Functions

void addCSCLayers (const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &csclayers)
 
void addDTLayers (const std::vector< DetLayer * > &dtlayers)
 
void addGEMLayers (const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &gemlayers)
 
void addME0Layers (const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &gemlayers)
 
void addRPCLayers (const std::vector< DetLayer * > &barrelRPCLayers, const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &endcapRPCLayers)
 
DetId makeDetLayerId (const DetLayer *detLayer) const
 
void sortLayers ()
 

Private Attributes

std::vector< const DetLayer * > allBackward
 
std::vector< const DetLayer * > allBarrel
 
std::vector< const DetLayer * > allCscGemBackward
 
std::vector< const DetLayer * > allCscGemForward
 
std::vector< const DetLayer * > allCscME0Backward
 
std::vector< const DetLayer * > allCscME0Forward
 
std::vector< const DetLayer * > allDetLayers
 
std::vector< const DetLayer * > allEndcap
 
std::vector< const DetLayer * > allEndcapCscGem
 
std::vector< const DetLayer * > allEndcapCscME0
 
std::vector< const DetLayer * > allForward
 
std::vector< const DetLayer * > cscLayers_all
 
std::vector< const DetLayer * > cscLayers_bk
 
std::vector< const DetLayer * > cscLayers_fw
 
std::map< DetId, const DetLayer * > detLayersMap
 
std::vector< const DetLayer * > dtLayers
 
std::vector< const DetLayer * > gemLayers_all
 
std::vector< const DetLayer * > gemLayers_bk
 
std::vector< const DetLayer * > gemLayers_fw
 
std::vector< const DetLayer * > me0Layers_all
 
std::vector< const DetLayer * > me0Layers_bk
 
std::vector< const DetLayer * > me0Layers_fw
 
std::vector< const DetLayer * > rpcLayers_all
 
std::vector< const DetLayer * > rpcLayers_barrel
 
std::vector< const DetLayer * > rpcLayers_bk
 
std::vector< const DetLayer * > rpcLayers_endcap
 
std::vector< const DetLayer * > rpcLayers_fw
 

Friends

class MuonDetLayerGeometryESProducer
 

Detailed Description

Provide access to the DetLayers of muon detectors.

Author
N. Amapane - CERN

by R. Radogna & C. Calabria & A. Sharma by D. Nash

Definition at line 21 of file MuonDetLayerGeometry.h.

Constructor & Destructor Documentation

MuonDetLayerGeometry::MuonDetLayerGeometry ( )

Constructor.

Definition at line 28 of file MuonDetLayerGeometry.cc.

28 {}
MuonDetLayerGeometry::~MuonDetLayerGeometry ( )
override

Destructor.

Definition at line 30 of file MuonDetLayerGeometry.cc.

30  {
31  for(vector<const DetLayer*>::const_iterator it = allDetLayers.begin(); it != allDetLayers.end(); ++it)
32  {
33  delete *it;
34  }
35 }
std::vector< const DetLayer * > allDetLayers

Member Function Documentation

void MuonDetLayerGeometry::addCSCLayers ( const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &  csclayers)
private

Add CSC layers csclayers.first=forward (+Z), csclayers.second=backward (-Z) both vectors are ASSUMED to be sorted inside-out

Definition at line 37 of file MuonDetLayerGeometry.cc.

37  {
38 
39  for(auto const it : csclayers.first) {
40  cscLayers_fw.push_back(it);
41  allForward.push_back(it);
42 
43  detLayersMap[ makeDetLayerId(it) ] = it;
44  }
45 
46  for(auto const it: csclayers.second) {
47  cscLayers_bk.push_back(it);
48  allBackward.push_back(it);
49 
50  detLayersMap[ makeDetLayerId(it) ] = it;
51  }
52 }
std::map< DetId, const DetLayer * > detLayersMap
std::vector< const DetLayer * > allForward
std::vector< const DetLayer * > allBackward
std::vector< const DetLayer * > cscLayers_fw
std::vector< const DetLayer * > cscLayers_bk
DetId makeDetLayerId(const DetLayer *detLayer) const
void MuonDetLayerGeometry::addDTLayers ( const std::vector< DetLayer * > &  dtlayers)
private

Definition at line 115 of file MuonDetLayerGeometry.cc.

115  {
116 
117  for(auto const it : dtlayers) {
118  dtLayers.push_back(it);
119  allBarrel.push_back(it);
120 
121  detLayersMap[ makeDetLayerId(it) ] = it;
122  }
123 }
std::vector< const DetLayer * > allBarrel
std::map< DetId, const DetLayer * > detLayersMap
DetId makeDetLayerId(const DetLayer *detLayer) const
std::vector< const DetLayer * > dtLayers
void MuonDetLayerGeometry::addGEMLayers ( const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &  gemlayers)
private

Add GEM layers gemlayers.first=forward (+Z), gemlayers.second=backward (-Z) both vectors are ASSUMED to be sorted inside-out

Definition at line 54 of file MuonDetLayerGeometry.cc.

References LogDebug.

54  {
55  LogDebug("Muon|RecoMuon|MuonDetLayerGeometry") << "Adding GEMlayers "<<std::endl;
56  for(auto const it : gemlayers.first) {
57  gemLayers_fw.push_back(it);
58  allForward.push_back(it);
59  detLayersMap[ makeDetLayerId(it) ] = it;
60  LogDebug("Muon|RecoMuon|MuonDetLayerGeometry") << "Adding GEMforward "<<std::endl;
61  }
62  for(auto const it: gemlayers.second) {
63  gemLayers_bk.push_back(it);
64  allBackward.push_back(it);
65  detLayersMap[ makeDetLayerId(it) ] = it;
66  LogDebug("Muon|RecoMuon|MuonDetLayerGeometry") << "Adding GEMbackward "<<std::endl;
67  }
68 }
#define LogDebug(id)
std::vector< const DetLayer * > gemLayers_bk
std::map< DetId, const DetLayer * > detLayersMap
std::vector< const DetLayer * > allForward
std::vector< const DetLayer * > allBackward
DetId makeDetLayerId(const DetLayer *detLayer) const
std::vector< const DetLayer * > gemLayers_fw
void MuonDetLayerGeometry::addME0Layers ( const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &  gemlayers)
private

Add ME0 layers gemlayers.first=forward (+Z), gemlayers.second=backward (-Z) both vectors are ASSUMED to be sorted inside-out

Definition at line 71 of file MuonDetLayerGeometry.cc.

References LogDebug.

71  {
72 
73  LogDebug("Muon|RecoMuon|MuonDetLayerGeometry") << "Adding ME0layers "<<std::endl;
74 
75  for(auto const it : me0layers.first) {
76  me0Layers_fw.push_back(it);
77  allForward.push_back(it);
78 
79  detLayersMap[ makeDetLayerId(it) ] = it;
80  LogDebug("Muon|RecoMuon|MuonDetLayerGeometry") << "Adding ME0forward "<<std::endl;
81  }
82  for(auto const it : me0layers.second) {
83  me0Layers_bk.push_back(it);
84  allBackward.push_back(it);
85 
86  detLayersMap[ makeDetLayerId(it) ] = it;
87  LogDebug("Muon|RecoMuon|MuonDetLayerGeometry") << "Adding ME0backward "<<std::endl;
88  }
89 }
#define LogDebug(id)
std::vector< const DetLayer * > me0Layers_fw
std::map< DetId, const DetLayer * > detLayersMap
std::vector< const DetLayer * > allForward
std::vector< const DetLayer * > allBackward
std::vector< const DetLayer * > me0Layers_bk
DetId makeDetLayerId(const DetLayer *detLayer) const
void MuonDetLayerGeometry::addRPCLayers ( const std::vector< DetLayer * > &  barrelRPCLayers,
const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &  endcapRPCLayers 
)
private

Add RPC layers endcapRPCLayers.first=forward (+Z), endcapRPCLayers.second=backward (-Z) All three vectors are ASSUMED to be sorted inside-out

Definition at line 91 of file MuonDetLayerGeometry.cc.

91  {
92 
93  for(auto const it: barrelLayers) {
94  rpcLayers_barrel.push_back(it);
95  allBarrel.push_back(it);
96 
97  detLayersMap[ makeDetLayerId(it) ] = it;
98  }
99  for(auto const it: endcapLayers.first) {
100  rpcLayers_fw.push_back(it);
101  allForward.push_back(it);
102 
103  detLayersMap[ makeDetLayerId(it) ] = it;
104  }
105 
106  for(auto const it: endcapLayers.second) {
107  rpcLayers_bk.push_back(it);
108  allBackward.push_back(it);
109 
110  detLayersMap[ makeDetLayerId(it) ] = it;
111  }
112 
113 }
std::vector< const DetLayer * > allBarrel
std::map< DetId, const DetLayer * > detLayersMap
std::vector< const DetLayer * > allForward
std::vector< const DetLayer * > allBackward
std::vector< const DetLayer * > rpcLayers_barrel
std::vector< const DetLayer * > rpcLayers_bk
DetId makeDetLayerId(const DetLayer *detLayer) const
std::vector< const DetLayer * > rpcLayers_fw
const vector< const DetLayer * > & MuonDetLayerGeometry::allBackwardLayers ( ) const

return all backward (-Z) layers (CSC+RPC+GEM+ME0), inside-out

Definition at line 282 of file MuonDetLayerGeometry.cc.

Referenced by DirectMuonNavigation::inOutBackward(), MuonNavigationPrinter::MuonNavigationPrinter(), and DirectMuonNavigation::outInBackward().

282  {
283  return allBackward;
284 }
std::vector< const DetLayer * > allBackward
const vector< const DetLayer * > & MuonDetLayerGeometry::allBarrelLayers ( ) const

return all barrel DetLayers (DT+RPC), inside-out

Definition at line 265 of file MuonDetLayerGeometry.cc.

Referenced by DirectMuonNavigation::inOutBarrel(), MuonNavigationPrinter::MuonNavigationPrinter(), MuonNavigationSchool::MuonNavigationSchool(), and DirectMuonNavigation::outInBarrel().

265  {
266  return allBarrel;
267 }
std::vector< const DetLayer * > allBarrel
const vector< const DetLayer * > & MuonDetLayerGeometry::allCscGemBackwardLayers ( ) const

return all endcap DetLayers (CSC+GEM), -Z to +Z

Definition at line 301 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationPrinter::MuonNavigationPrinter().

301  {
302  return allCscGemBackward;
303 }
std::vector< const DetLayer * > allCscGemBackward
const vector< const DetLayer * > & MuonDetLayerGeometry::allCscGemForwardLayers ( ) const

return all endcap DetLayers (CSC+GEM), -Z to +Z

Definition at line 295 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationPrinter::MuonNavigationPrinter().

295  {
296  return allCscGemForward;
297 }
std::vector< const DetLayer * > allCscGemForward
const vector< const DetLayer * > & MuonDetLayerGeometry::allCSCLayers ( ) const

return the CSC DetLayers (endcap), -Z to +Z

Definition at line 170 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationSchool::MuonNavigationSchool().

170  {
171  return cscLayers_all;
172 }
std::vector< const DetLayer * > cscLayers_all
const vector< const DetLayer * > & MuonDetLayerGeometry::allCscME0BackwardLayers ( ) const

return all endcap DetLayers (CSC+ME0), -Z to +Z

Definition at line 320 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationPrinter::MuonNavigationPrinter().

320  {
321  return allCscME0Backward;
322 }
std::vector< const DetLayer * > allCscME0Backward
const vector< const DetLayer * > & MuonDetLayerGeometry::allCscME0ForwardLayers ( ) const

return all endcap DetLayers (CSC+ME0), -Z to +Z

Definition at line 314 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationPrinter::MuonNavigationPrinter().

314  {
315  return allCscME0Forward;
316 }
std::vector< const DetLayer * > allCscME0Forward
const vector< const DetLayer * > & MuonDetLayerGeometry::allDTLayers ( ) const
const vector< const DetLayer * > & MuonDetLayerGeometry::allEndcapCscGemLayers ( ) const

return all endcap DetLayers (CSC+GEM), -Z to +Z

Definition at line 289 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationSchool::MuonNavigationSchool().

289  {
290  return allEndcapCscGem;
291 }
std::vector< const DetLayer * > allEndcapCscGem
const vector< const DetLayer * > & MuonDetLayerGeometry::allEndcapCscME0Layers ( ) const

return all endcap DetLayers (CSC+ME0), -Z to +Z

Definition at line 308 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationSchool::MuonNavigationSchool().

308  {
309  return allEndcapCscME0;
310 }
std::vector< const DetLayer * > allEndcapCscME0
const vector< const DetLayer * > & MuonDetLayerGeometry::allEndcapLayers ( ) const

return all endcap DetLayers (CSC+RPC+GEM+ME0), -Z to +Z

Definition at line 270 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationSchool::MuonNavigationSchool().

270  {
271  return allEndcap;
272 }
std::vector< const DetLayer * > allEndcap
const vector< const DetLayer * > & MuonDetLayerGeometry::allForwardLayers ( ) const

return all forward (+Z) layers (CSC+RPC+GEM+ME0), inside-out

Definition at line 276 of file MuonDetLayerGeometry.cc.

Referenced by DirectMuonNavigation::inOutForward(), MuonNavigationPrinter::MuonNavigationPrinter(), and DirectMuonNavigation::outInForward().

276  {
277  return allForward;
278 }
std::vector< const DetLayer * > allForward
const vector< const DetLayer * > & MuonDetLayerGeometry::allGEMLayers ( ) const

return the GEM DetLayers (endcap), -Z to +Z

Definition at line 188 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationSchool::MuonNavigationSchool().

188  {
189  return gemLayers_all;
190 }
std::vector< const DetLayer * > gemLayers_all
const vector< const DetLayer * > & MuonDetLayerGeometry::allLayers ( ) const

return all layers (DT+CSC+RPC+GEM), order: backward, barrel, forward

Definition at line 259 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationSchool::MuonNavigationSchool().

259  {
260  return allDetLayers;
261 }
std::vector< const DetLayer * > allDetLayers
const vector< const DetLayer * > & MuonDetLayerGeometry::allME0Layers ( ) const

return the ME0 DetLayers (endcap), -Z to +Z

Definition at line 210 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationSchool::MuonNavigationSchool().

210  {
211  return me0Layers_all;
212 }
std::vector< const DetLayer * > me0Layers_all
const vector< const DetLayer * > & MuonDetLayerGeometry::allRPCLayers ( ) const

return all RPC DetLayers, order: backward, barrel, forward

Definition at line 229 of file MuonDetLayerGeometry.cc.

229  {
230  return rpcLayers_all;
231 }
std::vector< const DetLayer * > rpcLayers_all
const vector< const DetLayer * > & MuonDetLayerGeometry::backwardCSCLayers ( ) const

return the backward (-Z) CSC DetLayers, inside-out

Definition at line 182 of file MuonDetLayerGeometry.cc.

Referenced by MuonSeedBuilder::build(), PropagateToMuon::extrapolate(), PropagateToMuon::init(), MuonNavigationPrinter::MuonNavigationPrinter(), MuonSeedOrcaPatternRecognition::produce(), and PropagateToMuon::startingState().

182  {
183  return cscLayers_bk;
184 }
std::vector< const DetLayer * > cscLayers_bk
const vector< const DetLayer * > & MuonDetLayerGeometry::backwardGEMLayers ( ) const

return the backward (-Z) GEM DetLayers, inside-out

Definition at line 200 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationPrinter::MuonNavigationPrinter().

200  {
201  return gemLayers_bk;
202 }
std::vector< const DetLayer * > gemLayers_bk
const vector< const DetLayer * > & MuonDetLayerGeometry::backwardME0Layers ( ) const

return the backward (-Z) ME0 DetLayers, inside-out

Definition at line 222 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationPrinter::MuonNavigationPrinter(), and MuonSeedOrcaPatternRecognition::produce().

222  {
223  return me0Layers_bk;
224 }
std::vector< const DetLayer * > me0Layers_bk
const vector< const DetLayer * > & MuonDetLayerGeometry::backwardRPCLayers ( ) const

return the backward (-Z) RPC DetLayers, inside-out

Definition at line 253 of file MuonDetLayerGeometry.cc.

253  {
254  return rpcLayers_bk;
255 }
std::vector< const DetLayer * > rpcLayers_bk
const vector< const DetLayer * > & MuonDetLayerGeometry::barrelRPCLayers ( ) const

return the barrel RPC DetLayers, inside-out

Definition at line 235 of file MuonDetLayerGeometry.cc.

235  {
236  return rpcLayers_barrel;
237 }
std::vector< const DetLayer * > rpcLayers_barrel
const vector< const DetLayer * > & MuonDetLayerGeometry::endcapRPCLayers ( ) const

return the endcap RPC DetLayers, -Z to +Z

Definition at line 241 of file MuonDetLayerGeometry.cc.

241  {
242  return rpcLayers_endcap;
243 }
std::vector< const DetLayer * > rpcLayers_endcap
const vector< const DetLayer * > & MuonDetLayerGeometry::forwardCSCLayers ( ) const

return the forward (+Z) CSC DetLayers, inside-out

Definition at line 176 of file MuonDetLayerGeometry.cc.

Referenced by MuonSeedBuilder::build(), PropagateToMuon::extrapolate(), PropagateToMuon::init(), MuonNavigationPrinter::MuonNavigationPrinter(), MuonSeedOrcaPatternRecognition::produce(), and PropagateToMuon::startingState().

176  {
177  return cscLayers_fw;
178 }
std::vector< const DetLayer * > cscLayers_fw
const vector< const DetLayer * > & MuonDetLayerGeometry::forwardGEMLayers ( ) const

return the forward (+Z) GEM DetLayers, inside-out

Definition at line 194 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationPrinter::MuonNavigationPrinter().

194  {
195  return gemLayers_fw;
196 }
std::vector< const DetLayer * > gemLayers_fw
const vector< const DetLayer * > & MuonDetLayerGeometry::forwardME0Layers ( ) const

return the forward (+Z) ME0 DetLayers, inside-out

Definition at line 216 of file MuonDetLayerGeometry.cc.

Referenced by MuonNavigationPrinter::MuonNavigationPrinter(), and MuonSeedOrcaPatternRecognition::produce().

216  {
217  return me0Layers_fw;
218 }
std::vector< const DetLayer * > me0Layers_fw
const vector< const DetLayer * > & MuonDetLayerGeometry::forwardRPCLayers ( ) const

return the forward (+Z) RPC DetLayers, inside-out

Definition at line 247 of file MuonDetLayerGeometry.cc.

247  {
248  return rpcLayers_fw;
249 }
std::vector< const DetLayer * > rpcLayers_fw
const DetLayer * MuonDetLayerGeometry::idToLayer ( const DetId detId) const
overridevirtual

return the DetLayer which correspond to a certain DetId

Reimplemented from DetLayerGeometry.

Definition at line 327 of file MuonDetLayerGeometry.cc.

References MuonSubdetId::CSC, MuonSubdetId::DT, Exception, MuonSubdetId::GEM, triggerObjects_cff::id, LogDebug, MuonSubdetId::ME0, DetId::rawId(), MuonSubdetId::RPC, and DetId::subdetId().

Referenced by GlobalDetLayerGeometry::idToLayer().

327  {
328 
329  DetId id;
330 
331  if(detId.subdetId() == MuonSubdetId::CSC){
332  CSCDetId cscId( detId.rawId() );
333 
334  if(cscId.station() == 1)
335  {
336  if(cscId.ring() == 1 || cscId.ring() == 4)
337  id = CSCDetId(cscId.endcap(),1,1,0,0);
338  else if(cscId.ring() == 2 || cscId.ring() == 3)
339  id = CSCDetId(cscId.endcap(),1,2,0,0);
340  else
341  throw cms::Exception("InvalidCSCRing")<<" Invalid CSC Ring: "<<cscId.ring()<<endl;
342  }
343  else id = CSCDetId(cscId.endcap(),cscId.station(),0,0,0);
344  }
345 
346  else if (detId.subdetId() == MuonSubdetId::DT){
347  DTChamberId dtId( detId.rawId() );
348  id = DTChamberId(0,dtId.station(),0);
349  }
350  else if (detId.subdetId() == MuonSubdetId::RPC){
351  RPCDetId rpcId(detId.rawId() );
352  id = RPCDetId(rpcId.region(),0,rpcId.station(),0,rpcId.layer(),0,0);
353  }
354  else if (detId.subdetId() == MuonSubdetId::GEM){
355  GEMDetId gemId(detId.rawId() );
356  id = GEMDetId(gemId.region(),1,gemId.station(),gemId.layer(),0,0);
357  }
358  else if (detId.subdetId() == MuonSubdetId::ME0){
359  ME0DetId me0Id(detId.rawId() );
360  id = ME0DetId(me0Id.region(),me0Id.layer(),0,0);
361  LogDebug("Muon|RecoMuon|MuonDetLayerGeometry") << " Found an ME0DetId: " << me0Id.rawId()
362  <<",id: "<< id.rawId()<<std::endl;
363 
364  }
365  else throw cms::Exception("InvalidSubdetId")<< detId.subdetId();
366 
367  std::map<DetId,const DetLayer*>::const_iterator layer = detLayersMap.find(id);
368  if (layer == detLayersMap.end()) return nullptr;
369  return layer->second;
370 }
#define LogDebug(id)
static constexpr int GEM
Definition: MuonSubdetId.h:15
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
std::map< DetId, const DetLayer * > detLayersMap
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
static constexpr int ME0
Definition: MuonSubdetId.h:16
Definition: DetId.h:18
static constexpr int RPC
Definition: MuonSubdetId.h:14
static constexpr int DT
Definition: MuonSubdetId.h:12
static constexpr int CSC
Definition: MuonSubdetId.h:13
DetId MuonDetLayerGeometry::makeDetLayerId ( const DetLayer detLayer) const
private

Definition at line 125 of file MuonDetLayerGeometry.cc.

References GeometricSearchDet::basicComponents(), GeomDetEnumerators::CSC, GeomDetEnumerators::DT, makeMuonMisalignmentScenario::endcap, Exception, GeomDetEnumerators::GEM, triggerObjects_cff::id, GeomDetEnumerators::ME0, relativeConstraints::ring, GeomDetEnumerators::RPCBarrel, GeomDetEnumerators::RPCEndcap, relativeConstraints::station, and DetLayer::subDetector().

125  {
126 
127  if(detLayer->subDetector() == GeomDetEnumerators::CSC){
128  CSCDetId id( detLayer->basicComponents().front()->geographicalId().rawId() ) ;
129 
130  if(id.station() == 1 )
131  {
132  if(id.ring() == 1 || id.ring() == 4)
133  return CSCDetId(id.endcap(),1,1,0,0);
134  else if(id.ring() == 2 || id.ring() == 3)
135  return CSCDetId(id.endcap(),1,2,0,0);
136  else
137  throw cms::Exception("InvalidCSCRing")<<" Invalid CSC Ring: "<<id.ring()<<endl;
138  }
139  else
140  return CSCDetId(id.endcap(),id.station(),0,0,0);
141 
142  }
143  else if(detLayer->subDetector() == GeomDetEnumerators::DT){
144  DTChamberId id( detLayer->basicComponents().front()->geographicalId().rawId() ) ;
145  return DTChamberId(0,id.station(),0);
146  }
147  else if(detLayer->subDetector()== GeomDetEnumerators::RPCBarrel ||
149  RPCDetId id( detLayer->basicComponents().front()->geographicalId().rawId());
150  return RPCDetId(id.region(),0,id.station(),0,id.layer(),0,0);
151  }
152  else if( detLayer->subDetector()== GeomDetEnumerators::GEM){
153  GEMDetId id( detLayer->basicComponents().front()->geographicalId().rawId());
154  return GEMDetId(id.region(),1,id.station(),id.layer(),0,0);
155  }
156  else if( detLayer->subDetector()== GeomDetEnumerators::ME0){
157  ME0DetId id( detLayer->basicComponents().front()->geographicalId().rawId());
158  return ME0DetId(id.region(),id.layer(),0,0);
159  }
160  else throw cms::Exception("InvalidModuleIdentification"); // << detLayer->module();
161 }
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
virtual const std::vector< const GeomDet * > & basicComponents() const =0
void MuonDetLayerGeometry::sortLayers ( )
private

Definition at line 385 of file MuonDetLayerGeometry.cc.

References popcon2dropbox::copy(), checklumidiff::l, precomputed_value_sort(), and groupFilesInBlocks::reverse.

385  {
386 
387  // The following are filled inside-out, no need to re-sort
388  // precomputed_value_sort(dtLayers.begin(), dtLayers.end(),ExtractR<DetLayer,float>());
389  // precomputed_value_sort(cscLayers_fw.begin(), cscLayers_fw.end(),ExtractAbsZ<DetLayer,float>());
390  // precomputed_value_sort(cscLayers_bk.begin(), cscLayers_bk.end(),ExtractAbsZ<DetLayer,float>());
391  // precomputed_value_sort(rpcLayers_fw.begin(), rpcLayers_fw.end(),ExtractAbsZ<DetLayer,float>());
392  // precomputed_value_sort(rpcLayers_bk.begin(), rpcLayers_bk.end(),ExtractAbsZ<DetLayer,float>());
393  // precomputed_value_sort(rpcLayers_barrel.begin(), rpcLayers_barrel.end(), ExtractR<DetLayer,float>());
394 
395  // Sort these inside-out
399 
400  // Build more complicated vectors with correct sorting
401 
402  //cscLayers_all: from -Z to +Z
403  cscLayers_all.reserve(cscLayers_bk.size()+cscLayers_fw.size());
404  std::copy(cscLayers_bk.begin(),cscLayers_bk.end(),back_inserter(cscLayers_all));
406  std::copy(cscLayers_fw.begin(),cscLayers_fw.end(),back_inserter(cscLayers_all));
407 
408  //gemLayers_all: from -Z to +Z
409  gemLayers_all.reserve(gemLayers_bk.size()+gemLayers_fw.size());
410  std::copy(gemLayers_bk.begin(),gemLayers_bk.end(),back_inserter(gemLayers_all));
412  std::copy(gemLayers_fw.begin(),gemLayers_fw.end(),back_inserter(gemLayers_all));
413 
414  //me0Layers_all: from -Z to +Z
415  me0Layers_all.reserve(me0Layers_bk.size()+me0Layers_fw.size());
416  std::copy(me0Layers_bk.begin(),me0Layers_bk.end(),back_inserter(me0Layers_all));
418  std::copy(me0Layers_fw.begin(),me0Layers_fw.end(),back_inserter(me0Layers_all));
419 
420  //rpcLayers_endcap: from -Z to +Z
421  rpcLayers_endcap.reserve(rpcLayers_bk.size()+rpcLayers_fw.size());
422  std::copy(rpcLayers_bk.begin(),rpcLayers_bk.end(),back_inserter(rpcLayers_endcap));
424  std::copy(rpcLayers_fw.begin(),rpcLayers_fw.end(),back_inserter(rpcLayers_endcap));
425 
426  //rpcLayers_all: order is bw, barrel, fw
427  rpcLayers_all.reserve(rpcLayers_bk.size()+rpcLayers_barrel.size()+rpcLayers_fw.size());
428  std::copy(rpcLayers_bk.begin(),rpcLayers_bk.end(),back_inserter(rpcLayers_all));
430  std::copy(rpcLayers_barrel.begin(),rpcLayers_barrel.end(),back_inserter(rpcLayers_all));
431  std::copy(rpcLayers_fw.begin(),rpcLayers_fw.end(),back_inserter(rpcLayers_all));
432 
433  // allEndcap: order is all bw, all fw
434  allEndcap.reserve(allBackward.size()+allForward.size());
435  std::copy(allBackward.begin(),allBackward.end(),back_inserter(allEndcap));
436  std::reverse(allEndcap.begin(),allEndcap.end());
437  std::copy(allForward.begin(),allForward.end(),back_inserter(allEndcap));
438 
439  // allEndcapCSCGEM: order is all bw, all fw
440  allEndcapCscGem.reserve(cscLayers_bk.size()+cscLayers_fw.size()+gemLayers_bk.size()+gemLayers_fw.size());
441  std::copy(cscLayers_bk.begin(),cscLayers_bk.end(),back_inserter(allEndcapCscGem));
442  std::copy(gemLayers_bk.begin(),gemLayers_bk.end(),back_inserter(allEndcapCscGem));
444  std::copy(cscLayers_fw.begin(),cscLayers_fw.end(),back_inserter(allEndcapCscGem));
445  std::copy(gemLayers_fw.begin(),gemLayers_fw.end(),back_inserter(allEndcapCscGem));
446 
447  // allCscGemForward
448  allCscGemForward.reserve(cscLayers_fw.size()+gemLayers_fw.size());
449  std::copy(cscLayers_fw.begin(),cscLayers_fw.end(),back_inserter(allCscGemForward));
450  std::copy(gemLayers_fw.begin(),gemLayers_fw.end(),back_inserter(allCscGemForward));
451 
452  // allCscGemBackward
453  allCscGemBackward.reserve(cscLayers_bk.size()+gemLayers_bk.size());
454  std::copy(cscLayers_bk.begin(),cscLayers_bk.end(),back_inserter(allCscGemBackward));
455  std::copy(gemLayers_bk.begin(),gemLayers_bk.end(),back_inserter(allCscGemBackward));
456 
457  // allCscME0Forward
458  allCscME0Forward.reserve(cscLayers_fw.size()+me0Layers_fw.size());
459  std::copy(cscLayers_fw.begin(),cscLayers_fw.end(),back_inserter(allCscME0Forward));
460  std::copy(me0Layers_fw.begin(),me0Layers_fw.end(),back_inserter(allCscME0Forward));
461 
462  // allCscME0Backward
463  allCscME0Backward.reserve(cscLayers_bk.size()+me0Layers_bk.size());
464  std::copy(cscLayers_bk.begin(),cscLayers_bk.end(),back_inserter(allCscME0Backward));
465  std::copy(me0Layers_bk.begin(),me0Layers_bk.end(),back_inserter(allCscME0Backward));
466 
467  // allEndcapCSCME0: order is all bw, all fw
468  allEndcapCscME0.reserve(cscLayers_bk.size()+cscLayers_fw.size()+me0Layers_bk.size()+me0Layers_fw.size());
469  std::copy(cscLayers_bk.begin(),cscLayers_bk.end(),back_inserter(allEndcapCscME0));
470  std::copy(me0Layers_bk.begin(),me0Layers_bk.end(),back_inserter(allEndcapCscME0));
472  std::copy(cscLayers_fw.begin(),cscLayers_fw.end(),back_inserter(allEndcapCscME0));
473  std::copy(me0Layers_fw.begin(),me0Layers_fw.end(),back_inserter(allEndcapCscME0));
474 
475  // allDetLayers: order is all bw, all barrel, all fw
476  allDetLayers.reserve(allBackward.size()+allBarrel.size()+allForward.size());
477  std::copy(allBackward.begin(),allBackward.end(),back_inserter(allDetLayers));
478  std::reverse(allDetLayers.begin(),allDetLayers.end());
479  std::copy(allBarrel.begin(),allBarrel.end(),back_inserter(allDetLayers));
480  std::copy(allForward.begin(),allForward.end(),back_inserter(allDetLayers));
481 
482  // number layers
483  int sq=0;
484  for (auto l : allDetLayers)
485  (*const_cast<DetLayer*>(l)).setSeqNum(sq++);
486 
487 
488 }
std::vector< const DetLayer * > gemLayers_all
std::vector< const DetLayer * > allDetLayers
std::vector< const DetLayer * > allBarrel
def copy(args, dbName)
std::vector< const DetLayer * > gemLayers_bk
std::vector< const DetLayer * > me0Layers_fw
std::vector< const DetLayer * > me0Layers_all
std::vector< const DetLayer * > allCscME0Backward
std::vector< const DetLayer * > allForward
std::vector< const DetLayer * > allBackward
std::vector< const DetLayer * > allCscGemForward
std::vector< const DetLayer * > rpcLayers_barrel
std::vector< const DetLayer * > rpcLayers_all
std::vector< const DetLayer * > rpcLayers_bk
std::vector< const DetLayer * > cscLayers_fw
std::vector< const DetLayer * > me0Layers_bk
std::vector< const DetLayer * > allEndcapCscGem
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
std::vector< const DetLayer * > allEndcap
std::vector< const DetLayer * > cscLayers_bk
std::vector< const DetLayer * > cscLayers_all
std::vector< const DetLayer * > allCscGemBackward
std::vector< const DetLayer * > rpcLayers_fw
std::vector< const DetLayer * > rpcLayers_endcap
std::vector< const DetLayer * > gemLayers_fw
std::vector< const DetLayer * > allEndcapCscME0
std::vector< const DetLayer * > allCscME0Forward

Friends And Related Function Documentation

friend class MuonDetLayerGeometryESProducer
friend

Definition at line 27 of file MuonDetLayerGeometry.h.

Member Data Documentation

std::vector<const DetLayer*> MuonDetLayerGeometry::allBackward
private

Definition at line 193 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::allBarrel
private

Definition at line 195 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::allCscGemBackward
private

Definition at line 202 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::allCscGemForward
private

Definition at line 201 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::allCscME0Backward
private

Definition at line 211 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::allCscME0Forward
private

Definition at line 210 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::allDetLayers
private

Definition at line 196 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::allEndcap
private

Definition at line 194 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::allEndcapCscGem
private

Definition at line 200 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::allEndcapCscME0
private

Definition at line 209 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::allForward
private

Definition at line 192 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::cscLayers_all
private

Definition at line 170 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::cscLayers_bk
private

Definition at line 169 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::cscLayers_fw
private

Definition at line 168 of file MuonDetLayerGeometry.h.

std::map<DetId,const DetLayer*> MuonDetLayerGeometry::detLayersMap
private

Definition at line 216 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::dtLayers
private

Definition at line 191 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::gemLayers_all
private

Definition at line 176 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::gemLayers_bk
private

Definition at line 175 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::gemLayers_fw
private

Definition at line 174 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::me0Layers_all
private

Definition at line 182 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::me0Layers_bk
private

Definition at line 181 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::me0Layers_fw
private

Definition at line 180 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::rpcLayers_all
private

Definition at line 186 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::rpcLayers_barrel
private

Definition at line 190 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::rpcLayers_bk
private

Definition at line 189 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::rpcLayers_endcap
private

Definition at line 187 of file MuonDetLayerGeometry.h.

std::vector<const DetLayer*> MuonDetLayerGeometry::rpcLayers_fw
private

Definition at line 188 of file MuonDetLayerGeometry.h.