diff --git a/RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h b/RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h index 15a3b58848eb0..4298524a41989 100644 --- a/RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h +++ b/RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h @@ -27,49 +27,49 @@ class MuonDetLayerGeometry : public DetLayerGeometry{ virtual ~MuonDetLayerGeometry(); /// return the DT DetLayers (barrel), inside-out - const std::vector& allDTLayers() const; + const std::vector& allDTLayers() const; /// return the CSC DetLayers (endcap), -Z to +Z - const std::vector& allCSCLayers() const; + const std::vector& allCSCLayers() const; /// return the forward (+Z) CSC DetLayers, inside-out - const std::vector& forwardCSCLayers() const; + const std::vector& forwardCSCLayers() const; /// return the backward (-Z) CSC DetLayers, inside-out - const std::vector& backwardCSCLayers() const; + const std::vector& backwardCSCLayers() const; /// return all RPC DetLayers, order: backward, barrel, forward - const std::vector& allRPCLayers() const; + const std::vector& allRPCLayers() const; /// return the barrel RPC DetLayers, inside-out - const std::vector& barrelRPCLayers() const; + const std::vector& barrelRPCLayers() const; /// return the endcap RPC DetLayers, -Z to +Z - const std::vector& endcapRPCLayers() const; + const std::vector& endcapRPCLayers() const; /// return the forward (+Z) RPC DetLayers, inside-out - const std::vector& forwardRPCLayers() const; + const std::vector& forwardRPCLayers() const; /// return the backward (-Z) RPC DetLayers, inside-out - const std::vector& backwardRPCLayers() const; + const std::vector& backwardRPCLayers() const; /// return all layers (DT+CSC+RPC), order: backward, barrel, forward - const std::vector& allLayers() const; + const std::vector& allLayers() const; /// return all barrel DetLayers (DT+RPC), inside-out - const std::vector& allBarrelLayers() const; + const std::vector& allBarrelLayers() const; /// return all endcap DetLayers (CSC+RPC), -Z to +Z - const std::vector& allEndcapLayers() const; + const std::vector& allEndcapLayers() const; /// return all forward (+Z) layers (CSC+RPC), inside-out - const std::vector& allForwardLayers() const; + const std::vector& allForwardLayers() const; /// return all backward (-Z) layers (CSC+RPC), inside-out - const std::vector& allBackwardLayers() const; + const std::vector& allBackwardLayers() const; /// return the DetLayer which correspond to a certain DetId - virtual const DetLayer* idToLayer(const DetId& detId) const; + virtual const DetLayer* idToLayer(const DetId& detId) const override; private: /// Add CSC layers @@ -90,22 +90,22 @@ class MuonDetLayerGeometry : public DetLayerGeometry{ void sortLayers(); - std::vector cscLayers_fw; - std::vector cscLayers_bk; - std::vector cscLayers_all; - std::vector rpcLayers_all; - std::vector rpcLayers_endcap; - std::vector rpcLayers_fw; - std::vector rpcLayers_bk; - std::vector rpcLayers_barrel; - std::vector dtLayers; - std::vector allForward; - std::vector allBackward; - std::vector allEndcap; - std::vector allBarrel; - std::vector allDetLayers; + std::vector cscLayers_fw; + std::vector cscLayers_bk; + std::vector cscLayers_all; + std::vector rpcLayers_all; + std::vector rpcLayers_endcap; + std::vector rpcLayers_fw; + std::vector rpcLayers_bk; + std::vector rpcLayers_barrel; + std::vector dtLayers; + std::vector allForward; + std::vector allBackward; + std::vector allEndcap; + std::vector allBarrel; + std::vector allDetLayers; - std::map detLayersMap; + std::map detLayersMap; }; #endif diff --git a/RecoMuon/DetLayers/src/MuonDetLayerGeometry.cc b/RecoMuon/DetLayers/src/MuonDetLayerGeometry.cc index c5857ecf373b4..3d8248a3d5402 100644 --- a/RecoMuon/DetLayers/src/MuonDetLayerGeometry.cc +++ b/RecoMuon/DetLayers/src/MuonDetLayerGeometry.cc @@ -22,7 +22,7 @@ using namespace geomsort; MuonDetLayerGeometry::MuonDetLayerGeometry() {} MuonDetLayerGeometry::~MuonDetLayerGeometry(){ - for(vector::const_iterator it = allDetLayers.begin(); it != allDetLayers.end(); ++it) + for(vector::const_iterator it = allDetLayers.begin(); it != allDetLayers.end(); ++it) { delete *it; } @@ -30,73 +30,69 @@ MuonDetLayerGeometry::~MuonDetLayerGeometry(){ void MuonDetLayerGeometry::addCSCLayers(const pair, vector >& csclayers) { - vector::const_iterator it; - for(it=csclayers.first.begin(); it!=csclayers.first.end(); it++) { - cscLayers_fw.push_back(*it); - // cscLayers_all.push_back(*it); - allForward.push_back(*it); - // allEndcap.push_back(*it); - // allDetLayers.push_back(*it); + for(auto const it : csclayers.first) { + cscLayers_fw.push_back(it); + // cscLayers_all.push_back(it); + allForward.push_back(it); + // allEndcap.push_back(it); + // allDetLayers.push_back(it); - detLayersMap[ makeDetLayerId(*it) ] = *it; + detLayersMap[ makeDetLayerId(it) ] = it; } - - for(it=csclayers.second.begin(); it!=csclayers.second.end(); it++) { - cscLayers_bk.push_back(*it); - // cscLayers_all.push_back(*it); - allBackward.push_back(*it); - // allEndcap.push_back(*it); - // allDetLayers.push_back(*it); + + for(auto const it: csclayers.second) { + cscLayers_bk.push_back(it); + // cscLayers_all.push_back(it); + allBackward.push_back(it); + // allEndcap.push_back(it); + // allDetLayers.push_back(it); - detLayersMap[ makeDetLayerId(*it) ] = *it; + detLayersMap[ makeDetLayerId(it) ] = it; } } void MuonDetLayerGeometry::addRPCLayers(const vector& barrelLayers, const pair, vector >& endcapLayers) { - vector::const_iterator it; - - for (it=barrelLayers.begin();it!=barrelLayers.end();it++){ - rpcLayers_barrel.push_back(*it); - // rpcLayers_all.push_back(*it); - allBarrel.push_back(*it); - // allDetLayers.push_back(*it); + for(auto const it: barrelLayers) { + rpcLayers_barrel.push_back(it); + // rpcLayers_all.push_back(it); + allBarrel.push_back(it); + // allDetLayers.push_back(it); - detLayersMap[ makeDetLayerId(*it) ] = *it; + detLayersMap[ makeDetLayerId(it) ] = it; } - for (it=endcapLayers.first.begin(); it!=endcapLayers.first.end(); it++){ - rpcLayers_fw.push_back(*it); - // rpcLayers_all.push_back(*it); - // rpcLayers_endcap.push_back(*it); - allForward.push_back(*it); - // allEndcap.push_back(*it); - // allDetLayers.push_back(*it); - - detLayersMap[ makeDetLayerId(*it) ] = *it; + for(auto const it: endcapLayers.first) { + rpcLayers_fw.push_back(it); + // rpcLayers_all.push_back(it); + // rpcLayers_endcap.push_back(it); + allForward.push_back(it); + // allEndcap.push_back(it); + // allDetLayers.push_back(it); + + detLayersMap[ makeDetLayerId(it) ] = it; } - - for (it=endcapLayers.second.begin(); it!=endcapLayers.second.end(); it++){ - rpcLayers_bk.push_back(*it); - // rpcLayers_all.push_back(*it); - // rpcLayers_endcap.push_back(*it); - allBackward.push_back(*it); - // allEndcap.push_back(*it); - // allDetLayers.push_back(*it); - - detLayersMap[ makeDetLayerId(*it) ] = *it; + + for(auto const it: endcapLayers.second) { + rpcLayers_bk.push_back(it); + // rpcLayers_all.push_back(it); + // rpcLayers_endcap.push_back(it); + allBackward.push_back(it); + // allEndcap.push_back(it); + // allDetLayers.push_back(it); + + detLayersMap[ makeDetLayerId(it) ] = it; } } void MuonDetLayerGeometry::addDTLayers(const vector& dtlayers) { - vector::const_iterator it; - for(it=dtlayers.begin(); it!=dtlayers.end(); it++) { - dtLayers.push_back(*it); - allBarrel.push_back(*it); - // allDetLayers.push_back(*it); + for(auto const it : dtlayers) { + dtLayers.push_back(it); + allBarrel.push_back(it); + // allDetLayers.push_back(it); - detLayersMap[ makeDetLayerId(*it) ] = *it; + detLayersMap[ makeDetLayerId(it) ] = it; } } @@ -131,83 +127,83 @@ DetId MuonDetLayerGeometry::makeDetLayerId(const DetLayer* detLayer) const{ } -const vector& +const vector& MuonDetLayerGeometry::allDTLayers() const { return dtLayers; } -const vector& +const vector& MuonDetLayerGeometry::allCSCLayers() const { return cscLayers_all; } -const vector& +const vector& MuonDetLayerGeometry::forwardCSCLayers() const { return cscLayers_fw; } -const vector& +const vector& MuonDetLayerGeometry::backwardCSCLayers() const { return cscLayers_bk; } -const vector& +const vector& MuonDetLayerGeometry::allRPCLayers() const { return rpcLayers_all; } -const vector& +const vector& MuonDetLayerGeometry::barrelRPCLayers() const { return rpcLayers_barrel; } -const vector& +const vector& MuonDetLayerGeometry::endcapRPCLayers() const { return rpcLayers_endcap; } -const vector& +const vector& MuonDetLayerGeometry::forwardRPCLayers() const { return rpcLayers_fw; } -const vector& +const vector& MuonDetLayerGeometry::backwardRPCLayers() const { return rpcLayers_bk; } -const vector& +const vector& MuonDetLayerGeometry::allLayers() const { return allDetLayers; } -const vector& +const vector& MuonDetLayerGeometry::allBarrelLayers() const { return allBarrel; } -const vector& +const vector& MuonDetLayerGeometry::allEndcapLayers() const { return allEndcap; } -const vector& +const vector& MuonDetLayerGeometry::allForwardLayers() const { return allForward; } -const vector& +const vector& MuonDetLayerGeometry::allBackwardLayers() const { return allBackward; } @@ -242,7 +238,7 @@ const DetLayer* MuonDetLayerGeometry::idToLayer(const DetId &detId) const{ else throw cms::Exception("InvalidSubdetId")<< detId.subdetId(); - std::map::const_iterator layer = detLayersMap.find(id); + std::map::const_iterator layer = detLayersMap.find(id); if (layer == detLayersMap.end()) return 0; return layer->second; } @@ -312,7 +308,7 @@ void MuonDetLayerGeometry::sortLayers() { // number layers int sq=0; for (auto l : allDetLayers) - (*l).setSeqNum(sq++); + (*const_cast(l)).setSeqNum(sq++); } diff --git a/RecoMuon/DetLayers/test/MuonRecoGeometryAnalyzer.cc b/RecoMuon/DetLayers/test/MuonRecoGeometryAnalyzer.cc index 4ed1e6dc6f3c3..e824f42be2b17 100644 --- a/RecoMuon/DetLayers/test/MuonRecoGeometryAnalyzer.cc +++ b/RecoMuon/DetLayers/test/MuonRecoGeometryAnalyzer.cc @@ -72,91 +72,91 @@ void MuonRecoGeometryAnalyzer::analyze( const Event& ev, // Some printouts cout << "*** allDTLayers(): " << geo->allDTLayers().size() << endl; - for (vector::const_iterator dl = geo->allDTLayers().begin(); + for (auto dl = geo->allDTLayers().begin(); dl != geo->allDTLayers().end(); ++dl) { cout << " " << (int) (dl-geo->allDTLayers().begin()) << " " << dumpLayer(*dl); } cout << endl << endl; cout << "*** allCSCLayers(): " << geo->allCSCLayers().size() << endl; - for (vector::const_iterator dl = geo->allCSCLayers().begin(); + for (auto dl = geo->allCSCLayers().begin(); dl != geo->allCSCLayers().end(); ++dl) { cout << " " << (int) (dl-geo->allCSCLayers().begin()) << " " << dumpLayer(*dl); } cout << endl << endl; cout << "*** forwardCSCLayers(): " << geo->forwardCSCLayers().size() << endl; - for (vector::const_iterator dl = geo->forwardCSCLayers().begin(); + for (auto dl = geo->forwardCSCLayers().begin(); dl != geo->forwardCSCLayers().end(); ++dl) { cout << " " << (int) (dl-geo->forwardCSCLayers().begin()) << " " << dumpLayer(*dl); } cout << endl << endl; cout << "*** backwardCSCLayers(): " << geo->backwardCSCLayers().size() << endl; - for (vector::const_iterator dl = geo->backwardCSCLayers().begin(); + for (auto dl = geo->backwardCSCLayers().begin(); dl != geo->backwardCSCLayers().end(); ++dl) { cout << " " << (int) (dl-geo->backwardCSCLayers().begin()) << " " << dumpLayer(*dl); } cout << endl << endl; cout << "*** allRPCLayers(): " << geo->allRPCLayers().size() << endl; - for (vector::const_iterator dl = geo->allRPCLayers().begin(); + for (auto dl = geo->allRPCLayers().begin(); dl != geo->allRPCLayers().end(); ++dl) { cout << " " << (int) (dl-geo->allRPCLayers().begin()) << " " << dumpLayer(*dl); } cout << endl << endl; cout << "*** endcapRPCLayers(): " << geo->endcapRPCLayers().size() << endl; - for (vector::const_iterator dl = geo->endcapRPCLayers().begin(); + for (auto dl = geo->endcapRPCLayers().begin(); dl != geo->endcapRPCLayers().end(); ++dl) { cout << " " << (int) (dl-geo->endcapRPCLayers().begin()) << " " << dumpLayer(*dl); } cout << endl << endl; cout << "*** barrelRPCLayers(): " << geo->barrelRPCLayers().size() << endl; - for (vector::const_iterator dl = geo->barrelRPCLayers().begin(); + for (auto dl = geo->barrelRPCLayers().begin(); dl != geo->barrelRPCLayers().end(); ++dl) { cout << " " << (int) (dl-geo->barrelRPCLayers().begin()) << " " << dumpLayer(*dl); } cout << endl << endl; cout << "*** forwardRPCLayers(): " << geo->forwardRPCLayers().size() << endl; - for (vector::const_iterator dl = geo->forwardRPCLayers().begin(); + for (auto dl = geo->forwardRPCLayers().begin(); dl != geo->forwardRPCLayers().end(); ++dl) { cout << " " << (int) (dl-geo->forwardRPCLayers().begin()) << " " << dumpLayer(*dl); } cout << endl << endl; cout << "*** backwardRPCLayers(): " << geo->backwardRPCLayers().size() << endl; - for (vector::const_iterator dl = geo->backwardRPCLayers().begin(); + for (auto dl = geo->backwardRPCLayers().begin(); dl != geo->backwardRPCLayers().end(); ++dl) { cout << " " << (int) (dl-geo->backwardRPCLayers().begin()) << " " << dumpLayer(*dl); } cout << endl << endl; cout << "*** allBarrelLayers(): " << geo->allBarrelLayers().size() << endl; - for (vector::const_iterator dl = geo->allBarrelLayers().begin(); + for (auto dl = geo->allBarrelLayers().begin(); dl != geo->allBarrelLayers().end(); ++dl) { cout << " " << (int) (dl-geo->allBarrelLayers().begin()) << " " << dumpLayer(*dl); } cout << endl << endl; cout << "*** allEndcapLayers(): " << geo->allEndcapLayers().size() << endl; - for (vector::const_iterator dl = geo->allEndcapLayers().begin(); + for (auto dl = geo->allEndcapLayers().begin(); dl != geo->allEndcapLayers().end(); ++dl) { cout << " " << (int) (dl-geo->allEndcapLayers().begin()) << " " << dumpLayer(*dl); } cout << endl << endl; cout << "*** allForwardLayers(): " << geo->allForwardLayers().size() << endl; - for (vector::const_iterator dl = geo->allForwardLayers().begin(); + for (auto dl = geo->allForwardLayers().begin(); dl != geo->allForwardLayers().end(); ++dl) { cout << " " << (int) (dl-geo->allForwardLayers().begin()) << " " << dumpLayer(*dl); } cout << endl << endl; cout << "*** allBackwardLayers(): " << geo->allBackwardLayers().size() << endl; - for (vector::const_iterator dl = geo->allBackwardLayers().begin(); + for (auto dl = geo->allBackwardLayers().begin(); dl != geo->allBackwardLayers().end(); ++dl) { cout << " " << (int) (dl-geo->allBackwardLayers().begin()) << " " << dumpLayer(*dl); } @@ -164,7 +164,7 @@ void MuonRecoGeometryAnalyzer::analyze( const Event& ev, cout << "*** allLayers(): " << geo->allLayers().size() << endl; - for (vector::const_iterator dl = geo->allLayers().begin(); + for (auto dl = geo->allLayers().begin(); dl != geo->allLayers().end(); ++dl) { cout << " " << (int) (dl-geo->allLayers().begin()) << " " << dumpLayer(*dl); } @@ -181,9 +181,9 @@ void MuonRecoGeometryAnalyzer::analyze( const Event& ev, void MuonRecoGeometryAnalyzer::testDTLayers(const MuonDetLayerGeometry* geo,const MagneticField* field) { - const vector& layers = geo->allDTLayers(); + const vector& layers = geo->allDTLayers(); - for (vector::const_iterator ilay = layers.begin(); ilay!=layers.end(); ++ilay) { + for (auto ilay = layers.begin(); ilay!=layers.end(); ++ilay) { const MuRodBarrelLayer* layer = (const MuRodBarrelLayer*) (*ilay); const BoundCylinder& cyl = layer->specificSurface(); @@ -238,9 +238,9 @@ void MuonRecoGeometryAnalyzer::testDTLayers(const MuonDetLayerGeometry* geo,cons } void MuonRecoGeometryAnalyzer::testCSCLayers(const MuonDetLayerGeometry* geo,const MagneticField* field) { - const vector& layers = geo->allCSCLayers(); + const vector& layers = geo->allCSCLayers(); - for (vector::const_iterator ilay = layers.begin(); ilay!=layers.end(); ++ilay) { + for (auto ilay = layers.begin(); ilay!=layers.end(); ++ilay) { const MuRingForwardDoubleLayer* layer = (const MuRingForwardDoubleLayer*) (*ilay); const BoundDisk& disk = layer->specificSurface(); diff --git a/RecoMuon/MuonIdentification/src/MuonShowerInformationFiller.cc b/RecoMuon/MuonIdentification/src/MuonShowerInformationFiller.cc index 989d2e3b08da1..4489fe36e9a3e 100644 --- a/RecoMuon/MuonIdentification/src/MuonShowerInformationFiller.cc +++ b/RecoMuon/MuonIdentification/src/MuonShowerInformationFiller.cc @@ -379,9 +379,9 @@ vector MuonShowerInformationFiller::getCompatibleDets(const reco vector allCrossingPoints; - const vector& dtlayers = theService->detLayerGeometry()->allDTLayers(); + const vector& dtlayers = theService->detLayerGeometry()->allDTLayers(); - for (vector::const_iterator iLayer = dtlayers.begin(); iLayer != dtlayers.end(); ++iLayer) { + for (auto iLayer = dtlayers.begin(); iLayer != dtlayers.end(); ++iLayer) { // crossing points of track with cylinder GlobalPoint xPoint = crossingPoint(innerPos, outerPos, dynamic_cast(*iLayer)); @@ -408,8 +408,8 @@ vector MuonShowerInformationFiller::getCompatibleDets(const reco } allCrossingPoints.clear(); - const vector& csclayers = theService->detLayerGeometry()->allCSCLayers(); - for (vector::const_iterator iLayer = csclayers.begin(); iLayer != csclayers.end(); ++iLayer) { + const vector& csclayers = theService->detLayerGeometry()->allCSCLayers(); + for (auto iLayer = csclayers.begin(); iLayer != csclayers.end(); ++iLayer) { GlobalPoint xPoint = crossingPoint(innerPos, outerPos, dynamic_cast(*iLayer)); diff --git a/RecoMuon/MuonSeedGenerator/plugins/CosmicMuonSeedGenerator.cc b/RecoMuon/MuonSeedGenerator/plugins/CosmicMuonSeedGenerator.cc index 2fe81a4854c31..2777214fbe5f6 100644 --- a/RecoMuon/MuonSeedGenerator/plugins/CosmicMuonSeedGenerator.cc +++ b/RecoMuon/MuonSeedGenerator/plugins/CosmicMuonSeedGenerator.cc @@ -105,11 +105,11 @@ void CosmicMuonSeedGenerator::produce(edm::Event& event, const edm::EventSetup& eSetup.get().get(theMuonLayers); // get the DT layers - vector dtLayers = theMuonLayers->allDTLayers(); + vector dtLayers = theMuonLayers->allDTLayers(); // get the CSC layers - vector cscForwardLayers = theMuonLayers->forwardCSCLayers(); - vector cscBackwardLayers = theMuonLayers->backwardCSCLayers(); + vector cscForwardLayers = theMuonLayers->forwardCSCLayers(); + vector cscBackwardLayers = theMuonLayers->backwardCSCLayers(); @@ -123,7 +123,7 @@ void CosmicMuonSeedGenerator::produce(edm::Event& event, const edm::EventSetup& stable_sort(allHits.begin(),allHits.end(),DecreasingGlobalY()); - for (vector::reverse_iterator icsclayer = cscForwardLayers.rbegin(); + for (vector::reverse_iterator icsclayer = cscForwardLayers.rbegin(); icsclayer != cscForwardLayers.rend() - 1; ++icsclayer) { MuonRecHitContainer RHMF = muonMeasurements->recHits(*icsclayer); @@ -131,7 +131,7 @@ void CosmicMuonSeedGenerator::produce(edm::Event& event, const edm::EventSetup& } - for (vector::reverse_iterator icsclayer = cscBackwardLayers.rbegin(); + for (vector::reverse_iterator icsclayer = cscBackwardLayers.rbegin(); icsclayer != cscBackwardLayers.rend() - 1; ++icsclayer) { MuonRecHitContainer RHMF = muonMeasurements->recHits(*icsclayer); @@ -139,7 +139,7 @@ void CosmicMuonSeedGenerator::produce(edm::Event& event, const edm::EventSetup& } - for (vector::reverse_iterator idtlayer = dtLayers.rbegin(); + for (vector::reverse_iterator idtlayer = dtLayers.rbegin(); idtlayer != dtLayers.rend(); ++idtlayer) { MuonRecHitContainer RHMB = muonMeasurements->recHits(*idtlayer); diff --git a/RecoMuon/MuonSeedGenerator/src/MuonSeedBuilder.cc b/RecoMuon/MuonSeedGenerator/src/MuonSeedBuilder.cc index e52460ebba01a..956f288ec771a 100644 --- a/RecoMuon/MuonSeedGenerator/src/MuonSeedBuilder.cc +++ b/RecoMuon/MuonSeedGenerator/src/MuonSeedBuilder.cc @@ -139,7 +139,7 @@ int MuonSeedBuilder::build( edm::Event& event, const edm::EventSetup& eventSetup // 1) Get the various stations and store segments in containers for each station (layers) // 1a. get the DT segments by stations (layers): - std::vector dtLayers = muonLayers->allDTLayers(); + std::vector dtLayers = muonLayers->allDTLayers(); SegmentContainer DTlist4 = muonMeasurements->recHits( dtLayers[3], event ); SegmentContainer DTlist3 = muonMeasurements->recHits( dtLayers[2], event ); @@ -162,7 +162,7 @@ int MuonSeedBuilder::build( edm::Event& event, const edm::EventSetup& eventSetup // 1b. get the CSC segments by stations (layers): // 1b.1 Global z < 0 - std::vector cscBackwardLayers = muonLayers->backwardCSCLayers(); + std::vector cscBackwardLayers = muonLayers->backwardCSCLayers(); SegmentContainer CSClist4B = muonMeasurements->recHits( cscBackwardLayers[4], event ); SegmentContainer CSClist3B = muonMeasurements->recHits( cscBackwardLayers[3], event ); SegmentContainer CSClist2B = muonMeasurements->recHits( cscBackwardLayers[2], event ); @@ -176,7 +176,7 @@ int MuonSeedBuilder::build( edm::Event& event, const edm::EventSetup& eventSetup BoolContainer usedCSClist0B(CSClist0B.size(), false); // 1b.2 Global z > 0 - std::vector cscForwardLayers = muonLayers->forwardCSCLayers(); + std::vector cscForwardLayers = muonLayers->forwardCSCLayers(); SegmentContainer CSClist4F = muonMeasurements->recHits( cscForwardLayers[4], event ); SegmentContainer CSClist3F = muonMeasurements->recHits( cscForwardLayers[3], event ); SegmentContainer CSClist2F = muonMeasurements->recHits( cscForwardLayers[2], event ); diff --git a/RecoMuon/MuonSeedGenerator/src/MuonSeedOrcaPatternRecognition.cc b/RecoMuon/MuonSeedGenerator/src/MuonSeedOrcaPatternRecognition.cc index cad9ed90dd215..022fd101e44d8 100644 --- a/RecoMuon/MuonSeedGenerator/src/MuonSeedOrcaPatternRecognition.cc +++ b/RecoMuon/MuonSeedGenerator/src/MuonSeedOrcaPatternRecognition.cc @@ -67,11 +67,11 @@ void MuonSeedOrcaPatternRecognition::produce(const edm::Event& event, const edm: eSetup.get().get(muonLayers); // get the DT layers - vector dtLayers = muonLayers->allDTLayers(); + vector dtLayers = muonLayers->allDTLayers(); // get the CSC layers - vector cscForwardLayers = muonLayers->forwardCSCLayers(); - vector cscBackwardLayers = muonLayers->backwardCSCLayers(); + vector cscForwardLayers = muonLayers->forwardCSCLayers(); + vector cscBackwardLayers = muonLayers->backwardCSCLayers(); // Backward (z<0) EndCap disk const DetLayer* ME4Bwd = cscBackwardLayers[4]; diff --git a/RecoMuon/MuonSeedGenerator/src/RPCSeedGenerator.cc b/RecoMuon/MuonSeedGenerator/src/RPCSeedGenerator.cc index 2d980a5935cca..9f601d6345dbe 100644 --- a/RecoMuon/MuonSeedGenerator/src/RPCSeedGenerator.cc +++ b/RecoMuon/MuonSeedGenerator/src/RPCSeedGenerator.cc @@ -185,14 +185,14 @@ RPCSeedGenerator::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) iSetup.get().get(muonLayers); // Get the RPC layers - vector RPCBarrelLayers = muonLayers->barrelRPCLayers(); + vector RPCBarrelLayers = muonLayers->barrelRPCLayers(); const DetLayer* RB4L = RPCBarrelLayers[5]; const DetLayer* RB3L = RPCBarrelLayers[4]; const DetLayer* RB22L = RPCBarrelLayers[3]; const DetLayer* RB21L = RPCBarrelLayers[2]; const DetLayer* RB12L = RPCBarrelLayers[1]; const DetLayer* RB11L = RPCBarrelLayers[0]; - vector RPCEndcapLayers = muonLayers->endcapRPCLayers(); + vector RPCEndcapLayers = muonLayers->endcapRPCLayers(); const DetLayer* REM3L = RPCEndcapLayers[0]; const DetLayer* REM2L = RPCEndcapLayers[1]; const DetLayer* REM1L = RPCEndcapLayers[2]; diff --git a/RecoMuon/Navigation/src/DirectMuonNavigation.cc b/RecoMuon/Navigation/src/DirectMuonNavigation.cc index 46d705debe3b1..c769434c7af2e 100644 --- a/RecoMuon/Navigation/src/DirectMuonNavigation.cc +++ b/RecoMuon/Navigation/src/DirectMuonNavigation.cc @@ -100,9 +100,9 @@ DirectMuonNavigation::compatibleEndcapLayers( const FreeTrajectoryState& fts, void DirectMuonNavigation::inOutBarrel(const FreeTrajectoryState& fts, vector& output) const { bool cont = false; - const vector& barrel = theMuonDetLayerGeometry->allBarrelLayers(); + const vector& barrel = theMuonDetLayerGeometry->allBarrelLayers(); - for (vector::const_iterator iter_B = barrel.begin(); iter_B != barrel.end(); iter_B++){ + for (vector::const_iterator iter_B = barrel.begin(); iter_B != barrel.end(); iter_B++){ if( cont ) output.push_back((*iter_B)); else if ( checkCompatible(fts,dynamic_cast(*iter_B))) { @@ -116,17 +116,17 @@ void DirectMuonNavigation::inOutBarrel(const FreeTrajectoryState& fts, vector& output) const { // default barrel layers are in out, reverse order - const vector& barrel = theMuonDetLayerGeometry->allBarrelLayers(); + const vector& barrel = theMuonDetLayerGeometry->allBarrelLayers(); bool cont = false; - vector::const_iterator rbegin = barrel.end(); + vector::const_iterator rbegin = barrel.end(); rbegin--; - vector::const_iterator rend = barrel.begin(); + vector::const_iterator rend = barrel.begin(); rend--; - for (vector::const_iterator iter_B = rbegin; iter_B != rend; iter_B--){ + for (vector::const_iterator iter_B = rbegin; iter_B != rend; iter_B--){ if( cont ) output.push_back((*iter_B)); - else if ( checkCompatible(fts,dynamic_cast(*iter_B))) { + else if ( checkCompatible(fts,dynamic_cast(*iter_B))) { output.push_back((*iter_B)); cont = true; } @@ -135,12 +135,12 @@ void DirectMuonNavigation::outInBarrel(const FreeTrajectoryState& fts, vector& output) const { - const vector& forward = theMuonDetLayerGeometry->allForwardLayers(); + const vector& forward = theMuonDetLayerGeometry->allForwardLayers(); bool cont = false; - for (vector::const_iterator iter_E = forward.begin(); iter_E != forward.end(); + for (vector::const_iterator iter_E = forward.begin(); iter_E != forward.end(); iter_E++){ if( cont ) output.push_back((*iter_E)); - else if ( checkCompatible(fts,dynamic_cast(*iter_E))) { + else if ( checkCompatible(fts,dynamic_cast(*iter_E))) { output.push_back((*iter_E)); cont = true; } @@ -151,15 +151,15 @@ void DirectMuonNavigation::outInForward(const FreeTrajectoryState& fts, vector& forward = theMuonDetLayerGeometry->allForwardLayers(); - vector::const_iterator rbegin = forward.end(); + const vector& forward = theMuonDetLayerGeometry->allForwardLayers(); + vector::const_iterator rbegin = forward.end(); rbegin--; - vector::const_iterator rend = forward.begin(); + vector::const_iterator rend = forward.begin(); rend--; - for (vector::const_iterator iter_E = rbegin; iter_E != rend; + for (vector::const_iterator iter_E = rbegin; iter_E != rend; iter_E--){ if( cont ) output.push_back((*iter_E)); - else if ( checkCompatible(fts,dynamic_cast(*iter_E))) { + else if ( checkCompatible(fts,dynamic_cast(*iter_E))) { output.push_back((*iter_E)); cont = true; } @@ -168,12 +168,12 @@ void DirectMuonNavigation::outInForward(const FreeTrajectoryState& fts, vector& output) const { bool cont = false; - const vector& backward = theMuonDetLayerGeometry->allBackwardLayers(); + const vector& backward = theMuonDetLayerGeometry->allBackwardLayers(); - for (vector::const_iterator iter_E = backward.begin(); iter_E != backward.end(); + for (vector::const_iterator iter_E = backward.begin(); iter_E != backward.end(); iter_E++){ if( cont ) output.push_back((*iter_E)); - else if ( checkCompatible(fts,dynamic_cast(*iter_E))) { + else if ( checkCompatible(fts,dynamic_cast(*iter_E))) { output.push_back((*iter_E)); cont = true; } @@ -183,16 +183,16 @@ void DirectMuonNavigation::inOutBackward(const FreeTrajectoryState& fts, vector< void DirectMuonNavigation::outInBackward(const FreeTrajectoryState& fts, vector& output) const { bool cont = false; - const vector& backward = theMuonDetLayerGeometry->allBackwardLayers(); + const vector& backward = theMuonDetLayerGeometry->allBackwardLayers(); - vector::const_iterator rbegin = backward.end(); + vector::const_iterator rbegin = backward.end(); rbegin--; - vector::const_iterator rend = backward.begin(); + vector::const_iterator rend = backward.begin(); rend--; - for (vector::const_iterator iter_E = rbegin; iter_E != rend; + for (vector::const_iterator iter_E = rbegin; iter_E != rend; iter_E--){ if( cont ) output.push_back((*iter_E)); - else if ( checkCompatible(fts,dynamic_cast(*iter_E))) { + else if ( checkCompatible(fts,dynamic_cast(*iter_E))) { output.push_back((*iter_E)); cont = true; } diff --git a/RecoMuon/Navigation/src/MuonNavigationPrinter.cc b/RecoMuon/Navigation/src/MuonNavigationPrinter.cc index aebb5d0d8e50b..3f243d9e920e3 100644 --- a/RecoMuon/Navigation/src/MuonNavigationPrinter.cc +++ b/RecoMuon/Navigation/src/MuonNavigationPrinter.cc @@ -42,7 +42,7 @@ MuonNavigationPrinter::MuonNavigationPrinter(const MuonDetLayerGeometry * muonLa PRINT("MuonNavigationPrinter")<< "MuonNavigationPrinter::MuonNavigationPrinter" << std::endl; PRINT("MuonNavigationPrinter")<<"================================" << std::endl; PRINT("MuonNavigationPrinter")<< "BARREL:" << std::endl; - vector barrel; + vector barrel; if ( enableRPC ) barrel = muonLayout->allBarrelLayers(); else barrel = muonLayout->allDTLayers(); @@ -51,7 +51,7 @@ MuonNavigationPrinter::MuonNavigationPrinter(const MuonDetLayerGeometry * muonLa PRINT("MuonNavigationPrinter")<<"================================" << std::endl; PRINT("MuonNavigationPrinter") << "BACKWARD:" << std::endl; - vector backward; + vector backward; if ( enableRPC ) backward = muonLayout->allBackwardLayers(); else backward = muonLayout->backwardCSCLayers(); @@ -59,7 +59,7 @@ MuonNavigationPrinter::MuonNavigationPrinter(const MuonDetLayerGeometry * muonLa for (auto i : backward ) printLayer(i); PRINT("MuonNavigationPrinter") << "==============================" << std::endl; PRINT("MuonNavigationPrinter") << "FORWARD:" << std::endl; - vector forward; + vector forward; if ( enableRPC ) forward = muonLayout->allForwardLayers(); else forward = muonLayout->forwardCSCLayers(); @@ -79,7 +79,7 @@ MuonNavigationPrinter::MuonNavigationPrinter(const MuonDetLayerGeometry * muonLa vector tkbarrel = tracker->barrelLayers(); PRINT("MuonNavigationPrinter")<<"There are "< barrel = muonLayout->allBarrelLayers(); + vector barrel = muonLayout->allBarrelLayers(); PRINT("MuonNavigationPrinter")<<"There are "< tkbackward = tracker->negForwardLayers(); PRINT("MuonNavigationPrinter")<<"There are "< backward = muonLayout->allBackwardLayers(); + vector backward = muonLayout->allBackwardLayers(); PRINT("MuonNavigationPrinter")<<"There are "< forward = muonLayout->allForwardLayers(); + vector forward = muonLayout->allForwardLayers(); PRINT("MuonNavigationPrinter")<<"There are "<*>(&muonLayout->allLayers()); + theAllDetLayersInSystem=&muonLayout->allLayers(); theAllNavigableLayer.resize(muonLayout->allLayers().size(),nullptr); // get all barrel DetLayers (DT + optional RPC) - vector barrel; + vector barrel; if ( enableRPC ) barrel = muonLayout->allBarrelLayers(); else barrel = muonLayout->allDTLayers(); @@ -54,7 +54,7 @@ MuonNavigationSchool::MuonNavigationSchool(const MuonDetLayerGeometry * muonLayo } // get all endcap DetLayers (CSC + optional RPC) - vector endcap; + vector endcap; if ( enableRPC ) endcap = muonLayout->allEndcapLayers(); else endcap = muonLayout->allCSCLayers();