diff --git a/RecoEgamma/EgammaElectronAlgos/interface/ElectronSeedGenerator.h b/RecoEgamma/EgammaElectronAlgos/interface/ElectronSeedGenerator.h index 2e8b6d1e0ec2b..582033f78e929 100644 --- a/RecoEgamma/EgammaElectronAlgos/interface/ElectronSeedGenerator.h +++ b/RecoEgamma/EgammaElectronAlgos/interface/ElectronSeedGenerator.h @@ -17,7 +17,6 @@ #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h" #include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" #include "RecoTracker/TransientTrackingRecHit/interface/TSiPixelRecHit.h" #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" diff --git a/RecoEgamma/EgammaPhotonProducers/interface/ConvertedPhotonProducer.h b/RecoEgamma/EgammaPhotonProducers/interface/ConvertedPhotonProducer.h index f5279923c72af..5e285cdcdc13c 100644 --- a/RecoEgamma/EgammaPhotonProducers/interface/ConvertedPhotonProducer.h +++ b/RecoEgamma/EgammaPhotonProducers/interface/ConvertedPhotonProducer.h @@ -17,7 +17,6 @@ #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" #include "TrackingTools/TransientTrack/interface/TransientTrack.h" #include "TrackingTools/MeasurementDet/interface/LayerMeasurements.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" #include "TrackingTools/DetLayers/interface/NavigationSchool.h" #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h" #include "RecoTracker/TkNavigation/interface/SimpleNavigationSchool.h" diff --git a/RecoEgamma/EgammaPhotonProducers/src/TrackProducerWithSCAssociation.cc b/RecoEgamma/EgammaPhotonProducers/src/TrackProducerWithSCAssociation.cc index e9c5ea57961b9..1660eb4da48e4 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/TrackProducerWithSCAssociation.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/TrackProducerWithSCAssociation.cc @@ -332,7 +332,6 @@ TrackingRecHitRefProd rHits = evt.getRefBeforePut(); { edm::Handle mte; evt.getByLabel(edm::InputTag("MeasurementTrackerEvent"), mte); - // NavigationSetter setter( *theSchool ); setSecondHitPattern(theTraj,track,thePropagator,&*mte); } //============================================================== diff --git a/RecoMuon/GlobalTrackingTools/interface/DynamicTruncation.h b/RecoMuon/GlobalTrackingTools/interface/DynamicTruncation.h index 5317f262d5b49..101c9b1dab4f6 100644 --- a/RecoMuon/GlobalTrackingTools/interface/DynamicTruncation.h +++ b/RecoMuon/GlobalTrackingTools/interface/DynamicTruncation.h @@ -36,7 +36,6 @@ #include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h" #include "RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h" #include "RecoTracker/Record/interface/NavigationSchoolRecord.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h" #include "RecoMuon/Navigation/interface/DirectMuonNavigation.h" #include "Alignment/MuonAlignment/interface/MuonAlignment.h" diff --git a/RecoMuon/GlobalTrackingTools/src/DynamicTruncation.cc b/RecoMuon/GlobalTrackingTools/src/DynamicTruncation.cc index bd9d7c48a9eca..94a550577bb59 100644 --- a/RecoMuon/GlobalTrackingTools/src/DynamicTruncation.cc +++ b/RecoMuon/GlobalTrackingTools/src/DynamicTruncation.cc @@ -19,7 +19,6 @@ #include "RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h" #include "RecoMuon/Records/interface/MuonRecoGeometryRecord.h" #include "RecoMuon/Navigation/interface/MuonNavigationSchool.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" #include "RecoMuon/Navigation/interface/MuonNavigationPrinter.h" #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h" #include "RecoTracker/Record/interface/NavigationSchoolRecord.h" diff --git a/RecoMuon/L3TrackFinder/src/L3MuonTrajectoryBuilder.cc b/RecoMuon/L3TrackFinder/src/L3MuonTrajectoryBuilder.cc index 934c553885d1d..cef75bea984f6 100644 --- a/RecoMuon/L3TrackFinder/src/L3MuonTrajectoryBuilder.cc +++ b/RecoMuon/L3TrackFinder/src/L3MuonTrajectoryBuilder.cc @@ -56,8 +56,6 @@ #include "RecoTracker/TkTrackingRegions/interface/RectangularEtaPhiTrackingRegion.h" #include "TrackingTools/TrajectoryCleaning/interface/TrajectoryCleanerBySharedHits.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" - #include "DataFormats/BeamSpot/interface/BeamSpot.h" #include "DataFormats/VertexReco/interface/Vertex.h" #include "DataFormats/VertexReco/interface/VertexFwd.h" diff --git a/RecoMuon/Navigation/test/MuonNavigationTest.cc b/RecoMuon/Navigation/test/MuonNavigationTest.cc index 0e8014dafc4fc..1b7ec344f0c87 100644 --- a/RecoMuon/Navigation/test/MuonNavigationTest.cc +++ b/RecoMuon/Navigation/test/MuonNavigationTest.cc @@ -19,7 +19,6 @@ #include "RecoMuon/Navigation/interface/MuonNavigationSchool.h" //#include "RecoMuon/Navigation/interface/MuonTkNavigationSchool.h" #include "RecoMuon/Records/interface/MuonRecoGeometryRecord.h" -// #include "TrackingTools/DetLayers/interface/NavigationSetter.h" #include "RecoMuon/Navigation/interface/MuonNavigationPrinter.h" #include "RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h" //#include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" @@ -66,7 +65,6 @@ MuonNavigationTest::analyze( const edm::Event& iEvent, const edm::EventSetup& iS if ( testMuon ) { MuonNavigationSchool school(mm); - // NavigationSetter setter(school); MuonNavigationPrinter* printer = new MuonNavigationPrinter(mm, school ); delete printer; } @@ -82,7 +80,6 @@ MuonNavigationTest::analyze( const edm::Event& iEvent, const edm::EventSetup& iS const MagneticField * field(&(*theMF)); MuonTkNavigationSchool school(mm,tt,field); - NavigationSetter setter(school); MuonNavigationPrinter* printer = new MuonNavigationPrinter(mm, tt); delete printer; } diff --git a/RecoMuon/TrackingTools/src/MuonServiceProxy.cc b/RecoMuon/TrackingTools/src/MuonServiceProxy.cc index bf5c0f3a18d15..99560cf712816 100644 --- a/RecoMuon/TrackingTools/src/MuonServiceProxy.cc +++ b/RecoMuon/TrackingTools/src/MuonServiceProxy.cc @@ -23,7 +23,6 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" // C++ Headers #include diff --git a/RecoTracker/CkfPattern/interface/CkfTrackCandidateMaker.h b/RecoTracker/CkfPattern/interface/CkfTrackCandidateMaker.h index 908a144129d91..8337e040834bb 100644 --- a/RecoTracker/CkfPattern/interface/CkfTrackCandidateMaker.h +++ b/RecoTracker/CkfPattern/interface/CkfTrackCandidateMaker.h @@ -11,7 +11,6 @@ #include "TrackingTools/TrajectoryCleaning/interface/TrajectoryCleaner.h" #include "MagneticField/Engine/interface/MagneticField.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" #include "TrackingTools/DetLayers/interface/NavigationSchool.h" #include "RecoTracker/TkNavigation/interface/SimpleNavigationSchool.h" #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" diff --git a/RecoTracker/CkfPattern/interface/CkfTrackCandidateMakerBase.h b/RecoTracker/CkfPattern/interface/CkfTrackCandidateMakerBase.h index 19a6c52f2fe3d..bda67fbd2f22e 100644 --- a/RecoTracker/CkfPattern/interface/CkfTrackCandidateMakerBase.h +++ b/RecoTracker/CkfPattern/interface/CkfTrackCandidateMakerBase.h @@ -14,7 +14,6 @@ #include "TrackingTools/TrajectoryCleaning/interface/TrajectoryCleaner.h" #include "MagneticField/Engine/interface/MagneticField.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" #include "TrackingTools/DetLayers/interface/NavigationSchool.h" #include "RecoTracker/TkNavigation/interface/SimpleNavigationSchool.h" #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" diff --git a/RecoTracker/CkfPattern/interface/CkfTrajectoryMaker.h b/RecoTracker/CkfPattern/interface/CkfTrajectoryMaker.h index f0bef7c979a4a..3e175161352a3 100644 --- a/RecoTracker/CkfPattern/interface/CkfTrajectoryMaker.h +++ b/RecoTracker/CkfPattern/interface/CkfTrajectoryMaker.h @@ -11,7 +11,6 @@ #include "TrackingTools/TrajectoryCleaning/interface/TrajectoryCleaner.h" #include "MagneticField/Engine/interface/MagneticField.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" #include "TrackingTools/DetLayers/interface/NavigationSchool.h" #include "RecoTracker/TkNavigation/interface/SimpleNavigationSchool.h" #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" diff --git a/RecoTracker/DebugTools/interface/CkfDebugger.h b/RecoTracker/DebugTools/interface/CkfDebugger.h index 6a63bd626ea30..5366da0f1a02c 100644 --- a/RecoTracker/DebugTools/interface/CkfDebugger.h +++ b/RecoTracker/DebugTools/interface/CkfDebugger.h @@ -36,6 +36,7 @@ class TrajectoryStateOnSurface; class MagneticField; class Chi2MeasurementEstimator; class Propagator; +class NavigationSchool; typedef TransientTrackingRecHit::ConstRecHitPointer CTTRHp; @@ -104,6 +105,7 @@ class CkfDebugger { const MeasurementTracker* theMeasurementTracker; const TransientTrackingRecHitBuilder* theTTRHBuilder; const TrackerTopology *theTopo; + NavigationSchool const * theNavSchool; std::map > idHitsMap; diff --git a/RecoTracker/DebugTools/plugins/CkfDebugger.cc b/RecoTracker/DebugTools/plugins/CkfDebugger.cc index 5c08b6c7af567..c901940964249 100644 --- a/RecoTracker/DebugTools/plugins/CkfDebugger.cc +++ b/RecoTracker/DebugTools/plugins/CkfDebugger.cc @@ -7,6 +7,8 @@ #include "DataFormats/GeometryCommonDetAlgo/interface/MeasurementVector.h" #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" +#include "TrackingTools/DetLayers/interface/NavigationSchool.h" +#include "RecoTracker/Record/interface/NavigationSchoolRecord.h" #include "RecoTracker/DebugTools/interface/TSOSFromSimHitFactory.h" #include "TrackingTools/MeasurementDet/interface/MeasurementDet.h" #include "TrackingTools/MaterialEffects/interface/PropagatorWithMaterial.h" @@ -51,6 +53,9 @@ CkfDebugger::CkfDebugger( edm::EventSetup const & es ):totSeeds(0) es.get().get(tTopoHand); theTopo=tTopoHand.product(); + edm::ESHandle nav; + es.get().get("SimpleNavigationSchool", nav); + theNavSchool = nav.product(); for (int i=0; i!=17; i++){ dump.push_back(0); @@ -903,7 +908,7 @@ int CkfDebugger::analyseRecHitNotFound(const Trajectory& traj, CTTRHp correctRec LogTrace("CkfDebugger") << "correct layer id=" << correctLayId ; TSOS currentState( traj.lastMeasurement().updatedState() ); - std::vector nl = traj.lastLayer()->nextLayers( *currentState.freeState(),traj.direction() ); + std::vector nl = theNavSchool->nextLayers(*traj.lastLayer(),*currentState.freeState(),traj.direction() ); if (nl.empty()) { edm::LogVerbatim("CkfDebugger") << "no compatible layers" ; no_layer++;return 2; diff --git a/RecoTracker/DebugTools/src/FixTrackHitPattern.cc b/RecoTracker/DebugTools/src/FixTrackHitPattern.cc index 002e678fcbd9c..11f8dc762a999 100644 --- a/RecoTracker/DebugTools/src/FixTrackHitPattern.cc +++ b/RecoTracker/DebugTools/src/FixTrackHitPattern.cc @@ -20,7 +20,7 @@ #include "TrackingTools/DetLayers/interface/NavigationSchool.h" #include "RecoTracker/Record/interface/NavigationSchoolRecord.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" + #include "TrackingTools/Records/interface/TransientTrackRecord.h" #include "DataFormats/Math/interface/deltaPhi.h" @@ -42,7 +42,7 @@ FixTrackHitPattern::Result FixTrackHitPattern::analyze(const edm::EventSetup& iS // This is also needed to extrapolate amongst the tracker layers. edm::ESHandle theSchool; iSetup.get().get("SimpleNavigationSchool",theSchool); - NavigationSetter junk(*theSchool); + // NavigationSetter junk(*theSchool); FIXME FIXME (or not...) // This is needed to determine which sensors are functioning. edm::ESHandle measTk; diff --git a/RecoTracker/DebugTools/src/GetTrackTrajInfo.cc b/RecoTracker/DebugTools/src/GetTrackTrajInfo.cc index 18dcf9ec496ff..8850cd973fc00 100644 --- a/RecoTracker/DebugTools/src/GetTrackTrajInfo.cc +++ b/RecoTracker/DebugTools/src/GetTrackTrajInfo.cc @@ -16,7 +16,6 @@ #include "TrackingTools/DetLayers/interface/NavigationSchool.h" #include "RecoTracker/Record/interface/NavigationSchoolRecord.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" #include "TrackingTools/Records/interface/TransientTrackRecord.h" #include "DataFormats/Math/interface/deltaPhi.h" @@ -38,7 +37,7 @@ std::vector< GetTrackTrajInfo::Result > GetTrackTrajInfo::analyze(const edm::Eve // This is also needed to extrapolate amongst the tracker layers. edm::ESHandle theSchool; iSetup.get().get("SimpleNavigationSchool",theSchool); - NavigationSetter junk(*theSchool); + // NavigationSetter junk(*theSchool); // FIXME FIXME // Get the magnetic field and use it to define a propagator for extrapolating the track trajectory. edm::ESHandle magField; diff --git a/RecoTracker/NuclearSeedGenerator/interface/NuclearInteractionFinder.h b/RecoTracker/NuclearSeedGenerator/interface/NuclearInteractionFinder.h index 17e42781ee40f..a1da962e337d5 100644 --- a/RecoTracker/NuclearSeedGenerator/interface/NuclearInteractionFinder.h +++ b/RecoTracker/NuclearSeedGenerator/interface/NuclearInteractionFinder.h @@ -36,7 +36,6 @@ #include "RecoTracker/NuclearSeedGenerator/interface/SeedFromNuclearInteraction.h" #include "RecoTracker/NuclearSeedGenerator/interface/TangentHelix.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" #include "TrackingTools/DetLayers/interface/NavigationSchool.h" #include "RecoTracker/TkNavigation/interface/SimpleNavigationSchool.h" diff --git a/RecoTracker/NuclearSeedGenerator/plugins/NuclearSeedsEDProducer.cc b/RecoTracker/NuclearSeedGenerator/plugins/NuclearSeedsEDProducer.cc index abf8143fa9212..27e6030417e9a 100644 --- a/RecoTracker/NuclearSeedGenerator/plugins/NuclearSeedsEDProducer.cc +++ b/RecoTracker/NuclearSeedGenerator/plugins/NuclearSeedsEDProducer.cc @@ -53,7 +53,7 @@ NuclearSeedsEDProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetu edm::Handle data; iEvent.getByLabel(edm::InputTag("MeasurementTrackerEvent"), data); - NavigationSetter setter( *(theNuclearInteractionFinder->nav()) ); +// NavigationSetter setter( *(theNuclearInteractionFinder->nav()) ); why??? std::vector > assocPair; int i=0; diff --git a/RecoTracker/NuclearSeedGenerator/src/NuclearInteractionFinder.cc b/RecoTracker/NuclearSeedGenerator/src/NuclearInteractionFinder.cc index 9f7724dd21224..d4aed3aeebaaf 100644 --- a/RecoTracker/NuclearSeedGenerator/src/NuclearInteractionFinder.cc +++ b/RecoTracker/NuclearSeedGenerator/src/NuclearInteractionFinder.cc @@ -159,7 +159,7 @@ NuclearInteractionFinder::findMeasurementsFromTSOS(const TSOS& currentState, Det vector nl; if(lastLayer) { - nl = lastLayer->nextLayers( *currentState.freeState(), alongMomentum); + nl = theNavigationSchool->nextLayers(*lastLayer,*currentState.freeState(), alongMomentum); } else { edm::LogError("NuclearInteractionFinder") << "In findCompatibleMeasurements : lastLayer not accessible"; diff --git a/RecoTracker/TkNavigation/interface/CfgNavigationSchool.h b/RecoTracker/TkNavigation/interface/CfgNavigationSchool.h deleted file mode 100644 index 68b6c8d914444..0000000000000 --- a/RecoTracker/TkNavigation/interface/CfgNavigationSchool.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef TkNavigation_CfgNavigationSchool_H -#define TkNavigation_CfgNavigationSchool_H - -#include "TrackingTools/DetLayers/interface/NavigationSchool.h" -#include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" -#include "RecoTracker/TkNavigation/interface/SimpleNavigationSchool.h" -namespace edm{ - class ParameterSet; -} - -class MagneticField; - -class CfgNavigationSchool : public SimpleNavigationSchool { - public: - CfgNavigationSchool(){}; - CfgNavigationSchool(const edm::ParameterSet & cfg, - const GeometricSearchTracker* theTracker, - const MagneticField* field); - - ~CfgNavigationSchool(){ cleanMemory();} - - protected: - void makeBwdLinks(std::string & lname, BDLC & reachableBL, FDLC & reachableFL); - void makeFwdLinks(std::string & lname, BDLC & reachableBL, FDLC & reachableFL); - void addLayer(std::string & lname, BDLC & reachableBL, FDLC & reachableFL); - DetLayer * layer(std::string & lname); -}; - -#endif diff --git a/RecoTracker/TkNavigation/interface/LayerCollector.h b/RecoTracker/TkNavigation/interface/LayerCollector.h index 4a3818cc5c402..302c60882d03a 100644 --- a/RecoTracker/TkNavigation/interface/LayerCollector.h +++ b/RecoTracker/TkNavigation/interface/LayerCollector.h @@ -15,7 +15,7 @@ #include "TrackingTools/DetLayers/interface/ForwardDetLayer.h" - +class NavigationSchool; class LayerCollector { @@ -27,10 +27,12 @@ class LayerCollector { public: - LayerCollector(const Propagator* aPropagator, + LayerCollector(NavigationSchool const * aSchool, + const Propagator* aPropagator, const StartingLayerFinder* aFinder, float dr, float dz) : + theSchool(aSchool), thePropagator(aPropagator), theStartingLayerFinder(aFinder), theDeltaR(dr), @@ -48,7 +50,7 @@ class LayerCollector { float deltaZ() const {return theDeltaZ;} private: - + NavigationSchool const * theSchool; const Propagator* thePropagator; const StartingLayerFinder* theStartingLayerFinder; float theDeltaR; diff --git a/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc b/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc deleted file mode 100644 index 746d52d9c9ee5..0000000000000 --- a/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include "RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.h" -#include "RecoTracker/TkNavigation/interface/CfgNavigationSchool.h" - -NavigationSchoolESProducer::ReturnType CfgNavigationSchoolESProducer::produce(const NavigationSchoolRecord& iRecord){ - using namespace edm::es; - - // get the field - edm::ESHandle field; - std::string mfName = ""; - if (theNavigationPSet.exists("SimpleMagneticField")) - mfName = theNavigationPSet.getParameter("SimpleMagneticField"); - iRecord.getRecord().get(mfName,field); - // edm::ESInputTag mfESInputTag(mfName); - // iRecord.getRecord().get(mfESInputTag,field); - - //get the geometricsearch tracker geometry - edm::ESHandle geometricSearchTracker; - iRecord.getRecord().get(geometricSearchTracker); - - theNavigationSchool.reset(new CfgNavigationSchool(theNavigationPSet, - geometricSearchTracker.product(), - field.product()) ); - - return theNavigationSchool; -} diff --git a/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.h b/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.h deleted file mode 100644 index b7d2035288ed5..0000000000000 --- a/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef RecoTracker_TkNavigation_CfgNavigationSchoolESProducer_H -#define RecoTracker_TkNavigation_CfgNavigationSchoolESProducer_H - -#include "RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.h" - -// -// class decleration -// - -class CfgNavigationSchoolESProducer : public NavigationSchoolESProducer { - public: - CfgNavigationSchoolESProducer(const edm::ParameterSet& iConfig) - : NavigationSchoolESProducer(iConfig){} - ~CfgNavigationSchoolESProducer(){} - - ReturnType produce(const NavigationSchoolRecord&); -}; - -#endif diff --git a/RecoTracker/TkNavigation/plugins/modules.cc b/RecoTracker/TkNavigation/plugins/modules.cc index 4bd026ed2ab90..4f3d1309a5fa4 100644 --- a/RecoTracker/TkNavigation/plugins/modules.cc +++ b/RecoTracker/TkNavigation/plugins/modules.cc @@ -14,7 +14,5 @@ DEFINE_EDM_PLUGIN(NavigationSchoolFactory, BeamHaloNavigationSchool, "BeamHaloNa #include "RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.h" #include "RecoTracker/TkNavigation/plugins/SkippingLayerCosmicNavigationSchoolESProducer.h" -#include "RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.h" DEFINE_FWK_EVENTSETUP_MODULE(NavigationSchoolESProducer); DEFINE_FWK_EVENTSETUP_MODULE(SkippingLayerCosmicNavigationSchoolESProducer); -DEFINE_FWK_EVENTSETUP_MODULE(CfgNavigationSchoolESProducer); diff --git a/RecoTracker/TkNavigation/src/BeamHaloNavigationSchool.cc b/RecoTracker/TkNavigation/src/BeamHaloNavigationSchool.cc index 65e131fa27d2c..3372d050f6250 100644 --- a/RecoTracker/TkNavigation/src/BeamHaloNavigationSchool.cc +++ b/RecoTracker/TkNavigation/src/BeamHaloNavigationSchool.cc @@ -12,8 +12,6 @@ #include "RecoTracker/TkNavigation/interface/SimpleForwardNavigableLayer.h" #include "RecoTracker/TkNavigation/interface/SimpleNavigableLayer.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" - using namespace std; BeamHaloNavigationSchool::BeamHaloNavigationSchool(const GeometricSearchTracker* theInputTracker, @@ -81,10 +79,6 @@ BeamHaloNavigationSchool::BeamHaloNavigationSchool(const GeometricSearchTracker* } void BeamHaloNavigationSchool::establishInverseRelations() { - NavigationSetter setter(*this); - - - // find for each layer which are the barrel and forward // layers that point to it @@ -97,7 +91,7 @@ void BeamHaloNavigationSchool::establishInverseRelations() { for ( BDLI bli = theBarrelLayers.begin(); bli!=theBarrelLayers.end(); bli++) { - DLC reachedLC = (**bli).nextLayers( insideOut); + DLC reachedLC = nextLayers(**bli, insideOut); for ( DLI i = reachedLC.begin(); i != reachedLC.end(); i++) { reachedBarrelLayersMap[*i].push_back( *bli); } @@ -105,7 +99,7 @@ void BeamHaloNavigationSchool::establishInverseRelations() { for ( FDLI fli = theForwardLayers.begin(); fli!=theForwardLayers.end(); fli++) { - DLC reachedLC = (**fli).nextLayers( insideOut); + DLC reachedLC = nextLayers(**fli, insideOut); for ( DLI i = reachedLC.begin(); i != reachedLC.end(); i++) { reachedForwardLayersMap[*i].push_back( *fli); } @@ -115,7 +109,7 @@ void BeamHaloNavigationSchool::establishInverseRelations() { vector lc = theTracker->allLayers(); for ( vector::iterator i = lc.begin(); i != lc.end(); i++) { SimpleNavigableLayer* navigableLayer = - dynamic_cast((**i).navigableLayer()); + dynamic_cast(theAllNavigableLayer[(*i)->seqNum()]); if (!navigableLayer) {edm::LogInfo("BeamHaloNavigationSchool")<<"a detlayer does not have a navigable layer, which is normal in beam halo navigation.";} if (navigableLayer){navigableLayer->setInwardLinks( reachedBarrelLayersMap[*i],reachedForwardLayersMap[*i], TkLayerLess(outsideIn, (*i)) );} } @@ -125,7 +119,6 @@ void BeamHaloNavigationSchool::establishInverseRelations() { void BeamHaloNavigationSchool:: linkOtherEndLayers( SymmetricLayerFinder& symFinder){ - NavigationSetter setter(*this); LogDebug("BeamHaloNavigationSchool")<<"reachable from horizontal"; //generally, on the right side, what are the forward layers reachable from the horizontal @@ -143,113 +136,7 @@ linkOtherEndLayers( SymmetricLayerFinder& symFinder){ addInward((DetLayer*)symFinder.mirror(*fl),*fl); } - /* this is not enough to set reachable from each of them: too few links - //this is enough in the end - //for each of them - for (FDLI fl=reachableFL.begin();fl!=reachableFL.end();fl++) - { - LogDebug("BeamHaloNavigationSchool")<<"adding inward from right"; - //link it inward to the mirror reachable from horizontal - addInward((DetLayer*)*fl,symFinder.mirror(reachableFL)); - - LogDebug("BeamHaloNavigationSchool")<<"adding inward from mirror of right (left?)"; - //do the same from the the mirrored layer to the reachable from horizontal - addInward((DetLayer*)symFinder.mirror(*fl),reachableFL); - } - */ - - - /* what about linking every not masked layer in each group. - except for within the same group - - vector groups splitForwardLayers(); - FDLC reachable; - - for ( vector::iterator group = groups.begin(); - group != groups.end(); group++) { - //for each group - - for ( FDLI i = group->begin(); i != group->end(); i++) { - - for ( vector::iterator other_group = groups.begin(); - other_group != groups.end(); other_group++) { - //for each other group - - if (other_group==group && i==group->begin()){ - //other_group is the same as group and dealing with the first layer of the group - //link the first of each group - reachable.push_back(other_group.front()); - continue;} - - //now dealing as if other_group is different than group - for ( FDLI other_i = other_group->begin(); other_i != other_group->end(); other_i++) { - //for each of other group - //is the layer in the other group "masking" this one - //inner radius smaller OR outer radius bigger - if ((**other_i).specificSurface().innerRadius() < (**i).specificSurface().innerRadius() || - (**other_i).specificSurface().outerRadius() > (**i).specificSurface().outerRadius()) - { //not masked - reachableFL.push_back(*other_i); - } - } - //do something special with the first of each group - //do somethign special with layers in its own group - } - } - } - */ - - - - /* this is too much links between layers - FDLC myRightLayers( theRightLayers); - FDLI begin = myRightLayers.begin(); - FDLI end = myRightLayers.end(); - - // for each of the right layers - for (FDLI fl = begin;fl!=end;++fl) - { - //get the navigable layer for this DetLayer - SimpleNavigableLayer* navigableLayer = - dynamic_cast((*fl)->navigableLayer()); - - LogDebug("BeamHaloNavigationSchool")<<"retreive the next layers outsidein"; - //get the OUTward reachable layers. - DLC inwardsLayers(navigableLayer->nextLayers(insideOut)); - - //what is reachable horizontaly - FDLC thisReachableFL (reachableFL); - - LogDebug("BeamHaloNavigationSchool")<<"combine"; - //combine the two vector with a conversion to forward layer - for (DLI i=inwardsLayers.begin();i!=inwardsLayers.end();++i) - { - ForwardDetLayer* fd=dynamic_cast(const_cast(*i)); - // ForwardDetLayer* fd=const_cast(*i); - if (fd){ - // if (thisReachableFL.find(fd)==thisReachableFL.end()) - // {//no duplicate. insert it - thisReachableFL.push_back(fd); - //} - } - LogDebug("BeamHaloNavigationSchool")<<"investigate"; - } - - //please no duplicate !!! - LogDebug("BeamHaloNavigationSchool")<<"no duplicate"; - FDLI new_end =unique(thisReachableFL.begin(),thisReachableFL.end()); - thisReachableFL.erase(new_end,thisReachableFL.end()); - //then set the inwards links - LogDebug("BeamHaloNavigationSchool")<<"adding inward from right"; - //link it inward to the mirror reachable from horizontal - addInward((DetLayer*)*fl,symFinder.mirror(thisReachableFL)); - - LogDebug("BeamHaloNavigationSchool")<<"adding inward from mirror of right (left?)"; - //do the same from the the mirrored layer to the reachable from horizontal - addInward((DetLayer*)symFinder.mirror(*fl),thisReachableFL); - } - */ } @@ -258,7 +145,7 @@ void BeamHaloNavigationSchool:: addInward(DetLayer * det, ForwardDetLayer * newF){ //get the navigable layer for this DetLayer SimpleNavigableLayer* navigableLayer = - dynamic_cast((*det).navigableLayer()); + dynamic_cast(theAllNavigableLayer[(det)->seqNum()]); LogDebug("BeamHaloNavigationSchool")<<"retreive the nextlayer outsidein"; //get the inward reachable layers. @@ -299,7 +186,7 @@ void BeamHaloNavigationSchool:: addInward(DetLayer * det, const FDLC& news){ //get the navigable layer for this DetLayer SimpleNavigableLayer* navigableLayer = - dynamic_cast((*det).navigableLayer()); + dynamic_cast(theAllNavigableLayer[(det)->seqNum()]); LogDebug("BeamHaloNavigationSchool")<<"retreive the nextlayer outsidein"; //get the inward reachable layers. diff --git a/RecoTracker/TkNavigation/src/CfgNavigationSchool.cc b/RecoTracker/TkNavigation/src/CfgNavigationSchool.cc deleted file mode 100644 index 43f2b3a01ace9..0000000000000 --- a/RecoTracker/TkNavigation/src/CfgNavigationSchool.cc +++ /dev/null @@ -1,131 +0,0 @@ -#include "RecoTracker/TkNavigation/interface/CfgNavigationSchool.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" -#include "RecoTracker/TkNavigation/interface/SimpleBarrelNavigableLayer.h" -#include "RecoTracker/TkNavigation/interface/SimpleForwardNavigableLayer.h" -#include "RecoTracker/TkNavigation/interface/SimpleNavigableLayer.h" -#include "TrackingTools/DetLayers/src/DetBelowZ.h" - -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -CfgNavigationSchool::CfgNavigationSchool(const edm::ParameterSet & cfg, - const GeometricSearchTracker* theInputTracker, - const MagneticField* field){ - //some genericinitialisation - theTracker=theInputTracker; - theField=field; - theAllDetLayersInSystem=&theInputTracker->allLayers(); - // Get barrel layers - std::vector blc = theTracker->barrelLayers(); - for ( std::vector::iterator i = blc.begin(); i != blc.end(); i++) - theBarrelLayers.push_back( (*i) ); - // get forward layers - std::vector flc = theTracker->forwardLayers(); - for ( std::vector::iterator i = flc.begin(); i != flc.end(); i++) - theForwardLayers.push_back( (*i) ); - - std::vector< std::string > names; - cfg.getParameterSetNames(names); - - bool inverseRelationShip = true; - for (unsigned int iN=0;iN!=names.size();++iN){ - edm::ParameterSet pset=cfg.getParameter(names[iN]); - std::vector OUT = pset.getParameter >("OUT"); - //will not do automatic inverse relation is any IN is specified - if ( pset.exists("IN") ) inverseRelationShip = false; - - BDLC reachableBL; - FDLC reachableFL; - - //create the OUT links - for (unsigned int iOut=0;iOut!=OUT.size();++iOut) - addLayer(OUT[iOut], reachableBL, reachableFL); - - makeFwdLinks(names[iN],reachableBL,reachableFL); - } - - //set the navigation to be able to access the NavigableLayer from the DetLayer itself - NavigationSetter setter(*this); - - if( inverseRelationShip ){ - establishInverseRelations(); - }else{ - //set it by hand in the configuration - for (unsigned int iN=0;iN!=names.size();++iN){ - edm::ParameterSet pset=cfg.getParameter(names[iN]); - std::vector IN = pset.getParameter >("IN"); - - BDLC reachableBL; - FDLC reachableFL; - - //create the IN links - for (unsigned int iIn=0;iIn!=IN.size();++iIn) - addLayer(IN[iIn], reachableBL, reachableFL); - - makeBwdLinks(names[iN],reachableBL,reachableFL); - } - } -} - -void CfgNavigationSchool::makeFwdLinks(std::string & lname, BDLC & reachableBL, FDLC & reachableFL){ - DetLayer * l = layer(lname); - if (l->location() == GeomDetEnumerators::barrel){ - //split the FL into left and right. - - FDLI middle = find_if( reachableFL.begin(), reachableFL.end(), - not1(DetBelowZ(0))); - FDLC leftFL(reachableFL.begin(), middle); - FDLC rightFL(middle, reachableFL.end()); - - BarrelDetLayer * bl = dynamic_cast(l); - theBarrelNLC.push_back( new SimpleBarrelNavigableLayer(bl, - reachableBL, - rightFL,leftFL, - theField, - 5.)); - } - else{ - ForwardDetLayer * fwdL = dynamic_cast(l); - theForwardNLC.push_back( new SimpleForwardNavigableLayer(fwdL, - reachableBL, - reachableFL, - theField, - 5.)); - } -} - -void CfgNavigationSchool::makeBwdLinks(std::string & lname, BDLC & reachableBL, FDLC & reachableFL){ - DetLayer * l = layer(lname); - SimpleNavigableLayer * nl = dynamic_cast(l->navigableLayer()); - if (nl) nl->setInwardLinks(reachableBL,reachableFL); - else - edm::LogError("CfgNavigationSchool")<<"a layer is not casting to SimpleNavigableLayer."; -} - - -void CfgNavigationSchool::addLayer(std::string & lname, BDLC & reachableBL, FDLC & reachableFL){ - DetLayer * l = layer(lname); - if (l->location() == GeomDetEnumerators::barrel) - reachableBL.push_back(dynamic_cast(l)); - else - reachableFL .push_back(dynamic_cast(l)); -} - - -DetLayer * CfgNavigationSchool::layer(std::string & lname){ - std::string part = lname.substr(0,3); - unsigned int idLayer = atoi(lname.substr(3,1).c_str())-1; - bool isFwd = (lname.find("pos")!=std::string::npos); - LogDebug("CfgNavigationSchool")<<"part: "<tobLayers()[idLayer]; - else if (part == "TIB") return theTracker->tibLayers()[idLayer]; - else if (part == "TID") return (isFwd?theTracker->posTidLayers()[idLayer]:theTracker->negTidLayers()[idLayer]); - else if (part == "TEC") return (isFwd?theTracker->posTecLayers()[idLayer]:theTracker->negTecLayers()[idLayer]); - else if (part == "PXB") return theTracker->pixelBarrelLayers()[idLayer]; - else if (part == "PXF") return (isFwd?theTracker->posPixelForwardLayers()[idLayer]:theTracker->negPixelForwardLayers()[idLayer]); - - edm::LogError("CfgNavigationSchool")<<"layer specification: "< LayerCollector::allLayers(const FTS& aFts) const { myFts = FTS(pTsos.globalParameters()); - nextLayers = (**ilay).nextLayers(*pTsos.freeState(), + nextLayers = theSchool->nextLayers(**ilay, *pTsos.freeState(), propagator()->propagationDirection()); diff --git a/RecoTracker/TkNavigation/test/NavigationSchoolAnalyzer.cc b/RecoTracker/TkNavigation/test/NavigationSchoolAnalyzer.cc index 4268ce800ea76..9f4732b09b8dc 100644 --- a/RecoTracker/TkNavigation/test/NavigationSchoolAnalyzer.cc +++ b/RecoTracker/TkNavigation/test/NavigationSchoolAnalyzer.cc @@ -47,7 +47,7 @@ #include "RecoTracker/Record/interface/NavigationSchoolRecord.h" #include "TrackingTools/DetLayers/interface/DetLayer.h" -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" +// #include "TrackingTools/DetLayers/interface/NavigationSetter.h" // class definition class NavigationSchoolAnalyzer : public edm::EDAnalyzer { @@ -190,6 +190,7 @@ void printUsingGeom(std::ostream&os, const NavigationSchool & nav) { } void printOldStyle(std::ostream&os, const NavigationSchool & nav) { +/* NavigationSetter setter(nav); auto dls = nav.allLayersInSystem(); // ok let's' keep it for debug @@ -215,7 +216,7 @@ void printOldStyle(std::ostream&os, const NavigationSchool & nav) { {os<<(*nl)<<"-----------------\n";}} } os<<"\n"; - +*/ } diff --git a/TrackingTools/DetLayers/interface/DetLayer.h b/TrackingTools/DetLayers/interface/DetLayer.h index 8b15a18ee5a23..d895d233d54c7 100644 --- a/TrackingTools/DetLayers/interface/DetLayer.h +++ b/TrackingTools/DetLayers/interface/DetLayer.h @@ -7,9 +7,7 @@ * components and compatible components. * It extends the interface by providing navigation capability * from one layer to another. - * The Navigation links must be created in a - * NavigationSchool and activated with a NavigationSetter before they - * can be used. + * The Navigation links are managed by the NavigationSchool * */ @@ -26,7 +24,7 @@ class DetLayer : public GeometricSearchDet { typedef GeomDetEnumerators::SubDetector SubDetector; typedef GeomDetEnumerators::Location Location; - DetLayer(bool doHaveGroup, bool ibar) : GeometricSearchDet(doHaveGroup), theNavigableLayer(0), theSeqNum(-1), iAmBarrel(ibar) {} + DetLayer(bool doHaveGroup, bool ibar) : GeometricSearchDet(doHaveGroup), theSeqNum(-1), iAmBarrel(ibar) {} virtual ~DetLayer(); @@ -47,36 +45,8 @@ class DetLayer : public GeometricSearchDet { virtual Location location() const = 0; - // obsoleted my new interface - - /// Return the NavigableLayer associated with this DetLayer - NavigableLayer* navigableLayer() const { return theNavigableLayer;} - - /// Set the NavigableLayer associated with this DetLayer - void setNavigableLayer( NavigableLayer* nlp); - - /// Return the next (closest) layer(s) that can be reached in the specified - /// NavigationDirection - template - std::vector - nextLayers(Args && ...args) const { - return theNavigableLayer - ? theNavigableLayer->nextLayers(std::forward(args)...) - : std::vector(); - } - - /// Returns all layers compatible - template - std::vector - compatibleLayers(Args && ...args) const { - return theNavigableLayer - ? theNavigableLayer->compatibleLayers(std::forward(args)...) - : std::vector(); - } - private: - NavigableLayer* theNavigableLayer; int theSeqNum; bool iAmBarrel; }; diff --git a/TrackingTools/DetLayers/interface/NavigationSetter.h b/TrackingTools/DetLayers/interface/NavigationSetter.h deleted file mode 100644 index 50daa6677e80a..0000000000000 --- a/TrackingTools/DetLayers/interface/NavigationSetter.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef DetLayers_NavigationSetter_H -#define DetLayers_NavigationSetter_H - -#include - -class NavigableLayer; -class NavigationSchool; -class DetLayer; - -/** This class sets the navigation state given by the NavigationSchool, - * and saves the previous state for the affected layers. - * It must be instatiated as a local variable in the method that - * needs the navigation of the school, before using the navigation - * methods. The constructor saves the current state and sets the new one, - * and the destructod restores the previous state. - * This allows different reconstruction algorithms to use different - * navigations in the same set of DetLayers. - */ - -class NavigationSetter { -public: - - typedef std::vector StateType; - - NavigationSetter( const NavigationSchool&); - - ~NavigationSetter(); - -private: - - const NavigationSchool& theNav; - - StateType theSavedState; - - void saveState(); - void setState( const StateType&); - void cleanState(); - -}; - -#endif // NavigationSetter_H diff --git a/TrackingTools/DetLayers/src/DetLayer.cc b/TrackingTools/DetLayers/src/DetLayer.cc index 95bc1901bd12e..e2bb1c0a8b9be 100644 --- a/TrackingTools/DetLayers/src/DetLayer.cc +++ b/TrackingTools/DetLayers/src/DetLayer.cc @@ -1,22 +1,5 @@ #include "TrackingTools/DetLayers/interface/DetLayer.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -DetLayer::~DetLayer() { delete theNavigableLayer;} +DetLayer::~DetLayer() {} -void DetLayer::setNavigableLayer( NavigableLayer* nlp) { - /// delete theNavigableLayer; // bad idea! - theNavigableLayer = nlp; - - //nlp=0 amount to cleaning the link. do nothing further - if (nlp){ - if (nlp->detLayer() != this) { - if (nlp->detLayer() != 0) { - edm::LogWarning("DetLayers") << "DetLayer Warning: my navigable layer does not point to me. " - << " Correcting..." ; - } - theNavigableLayer->setDetLayer( this); - } - }//nlp!=0 -} - diff --git a/TrackingTools/DetLayers/src/NavigationSetter.cc b/TrackingTools/DetLayers/src/NavigationSetter.cc deleted file mode 100644 index 409336e46c9d9..0000000000000 --- a/TrackingTools/DetLayers/src/NavigationSetter.cc +++ /dev/null @@ -1,62 +0,0 @@ -#include "TrackingTools/DetLayers/interface/NavigationSetter.h" -#include "TrackingTools/DetLayers/interface/NavigationSchool.h" -#include "TrackingTools/DetLayers/interface/NavigableLayer.h" -#include "TrackingTools/DetLayers/interface/DetLayer.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -NavigationSetter::NavigationSetter( const NavigationSchool& school) - : theNav(school) -{ - //save the current state from all layer in the system which is being set: allow to set it back - saveState(); - - //remove any links from the detlayer in the system: allow partial navigation (BeamHalo) - cleanState(); - - //set the current navigation - setState(school.navigableLayers()); -} - -NavigationSetter::~NavigationSetter() -{ - //remove any link from the detlyaer in the system which has been set - cleanState(); - /* - LogDebug("NavigationSetter")<<"NavigationSchool settings are totally reset in the destructor of NavigationSetter.\n" - <<"this is the designed behavior. If you do not get track reconstruction, please refer to\n" - <<"https://twiki.cern.ch/twiki/bin/view/CMS/NavigationSchool \n" - <<"to properly use the NavigationSetter."; - */ - - //restore the previous layer DetLayer settings within the system which has been set. - setState( theSavedState); -} - - -void NavigationSetter::saveState() { - //remember all navigable layers from all layer in the system. - std::vector::const_iterator i = theNav.allLayersInSystem().begin(); - std::vector::const_iterator end = theNav.allLayersInSystem().end(); - for (; i != end; ++i){ - if (*i !=0) theSavedState.push_back( (*i)->navigableLayer()); - } -} - -void NavigationSetter::cleanState(){ - //set no navigable layer to all detlayers in the system - std::vector::const_iterator i = theNav.allLayersInSystem().begin(); - std::vector::const_iterator end = theNav.allLayersInSystem().end(); - for (; i != end; ++i){ - if (*i !=0) (*i)->setNavigableLayer(0); - } -} - -void NavigationSetter::setState( const StateType& newState) { - //set DetLayer->NavigableLayer link from navigable layer in given state - StateType::const_iterator i = newState.begin(); - StateType::const_iterator end = newState.end(); - for (; i != end; i++) { - if ( *i != 0) (**i).detLayer()->setNavigableLayer(*i); - } -} -