From b7146fb278d154930804d4a82546d5dedd90933c Mon Sep 17 00:00:00 2001 From: Giuseppe Date: Mon, 9 Dec 2013 10:57:17 +0100 Subject: [PATCH 01/11] first commit --- .../plugins/ParabolicParametrizedMagneticField.cc | 2 +- .../CkfPattern/python/CkfTrackCandidates_cfi.py | 5 +++-- RecoTracker/CkfPattern/python/CkfTrajectories_cfi.py | 4 ++-- .../python/CkfTrajectoryBuilderESProducer_cfi.py | 4 ++-- .../GroupedCkfTrajectoryBuilderESProducer_cfi.py | 4 ++-- .../CkfPattern/src/CkfTrackCandidateMakerBase.cc | 5 ++++- .../python/PixelLessTripletStep_cff.py | 1 + .../python/PostLS1_PixelLessTripletStep_cff.py | 2 ++ .../python/PostLS1_TobTecHybridStep_cff.py | 1 + .../IterativeTracking/python/TobTecHybridStep_cff.py | 1 + .../plugins/CfgNavigationSchoolESProducer.cc | 5 ++++- .../plugins/NavigationSchoolESProducer.cc | 5 ++++- .../TkNavigation/python/CfgNavigationSchool_cfi.py | 4 +++- .../python/NavigationSchoolESProducer_cfi.py | 3 ++- .../plugins/MultiHitGeneratorFromChi2.cc | 9 ++++++++- .../plugins/MultiHitGeneratorFromChi2.h | 3 ++- .../plugins/SeedFromConsecutiveHitsCreator.cc | 5 ++++- .../plugins/SeedFromConsecutiveHitsCreator.h | 12 +++++++++--- .../python/SeedFromConsecutiveHitsCreator_cfi.py | 5 +++-- ...SeedFromConsecutiveHitsStraightLineCreator_cfi.py | 2 +- .../SeedFromConsecutiveHitsTripletOnlyCreator_cfi.py | 2 +- .../TkSeedGenerator/src/SeedFromProtoTrack.cc | 2 +- .../plugins/TrackingRecHitPropagatorESProducer.cc | 5 ++++- .../python/TrackingRecHitPropagatorESProducer_cfi.py | 3 ++- .../plugins/PropagatorWithMaterialESProducer.cc | 10 +++++++--- .../python/PropagatorsForLoopers_cff.py | 4 ++-- .../MaterialEffects/python/Propagators_cff.py | 2 ++ .../Producers/src/AnalyticalPropagatorESProducer.cc | 5 ++++- 28 files changed, 82 insertions(+), 33 deletions(-) diff --git a/MagneticField/ParametrizedEngine/plugins/ParabolicParametrizedMagneticField.cc b/MagneticField/ParametrizedEngine/plugins/ParabolicParametrizedMagneticField.cc index 6ffc193325e69..fed41d0d5fc56 100644 --- a/MagneticField/ParametrizedEngine/plugins/ParabolicParametrizedMagneticField.cc +++ b/MagneticField/ParametrizedEngine/plugins/ParabolicParametrizedMagneticField.cc @@ -25,7 +25,7 @@ ParabolicParametrizedMagneticField::inTesla(const GlobalPoint& gp) const { if (isDefined(gp)) { return inTeslaUnchecked(gp); } else { - edm::LogWarning("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of ParabolicParametrizedMagneticField"; + //edm::LogWarning("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of ParabolicParametrizedMagneticField"; return GlobalVector(); } } diff --git a/RecoTracker/CkfPattern/python/CkfTrackCandidates_cfi.py b/RecoTracker/CkfPattern/python/CkfTrackCandidates_cfi.py index 240bb59232f95..66dde54b54f48 100644 --- a/RecoTracker/CkfPattern/python/CkfTrackCandidates_cfi.py +++ b/RecoTracker/CkfPattern/python/CkfTrackCandidates_cfi.py @@ -18,11 +18,12 @@ maxSeedsBeforeCleaning = cms.uint32(5000), # SeedProducer:SeedLabel descoped to src src = cms.InputTag('globalMixedSeeds'), + SimpleMagneticField = cms.string('ParabolicMf'), NavigationSchool = cms.string('SimpleNavigationSchool'), TrajectoryBuilder = cms.string('GroupedCkfTrajectoryBuilder'), TransientInitialStateEstimatorParameters = cms.PSet( - propagatorAlongTISE = cms.string('PropagatorWithMaterial'), - propagatorOppositeTISE = cms.string('PropagatorWithMaterialOpposite'), + propagatorAlongTISE = cms.string('PropagatorWithMaterialParabolicMf'), + propagatorOppositeTISE = cms.string('PropagatorWithMaterialParabolicMfOpposite'), numberMeasurementsForFit = cms.int32(4) ), MeasurementTrackerEvent = cms.InputTag("MeasurementTrackerEvent"), diff --git a/RecoTracker/CkfPattern/python/CkfTrajectories_cfi.py b/RecoTracker/CkfPattern/python/CkfTrajectories_cfi.py index df32f563879c8..c434630f9853f 100644 --- a/RecoTracker/CkfPattern/python/CkfTrajectories_cfi.py +++ b/RecoTracker/CkfPattern/python/CkfTrajectories_cfi.py @@ -22,8 +22,8 @@ TrajectoryBuilder = cms.string('GroupedCkfTrajectoryBuilder'), # nested parameter set for TransientInitialStateEstimator TransientInitialStateEstimatorParameters = cms.PSet( - propagatorAlongTISE = cms.string('PropagatorWithMaterial'), - propagatorOppositeTISE = cms.string('PropagatorWithMaterialOpposite'), + propagatorAlongTISE = cms.string('PropagatorWithMaterialParabolicMf'), + propagatorOppositeTISE = cms.string('PropagatorWithMaterialParabolicMfOpposite'), numberMeasurementsForFit = cms.int32(4) ), MeasurementTrackerEvent = cms.InputTag("MeasurementTrackerEvent") diff --git a/RecoTracker/CkfPattern/python/CkfTrajectoryBuilderESProducer_cfi.py b/RecoTracker/CkfPattern/python/CkfTrajectoryBuilderESProducer_cfi.py index 271414256386b..a5195bad1ad02 100644 --- a/RecoTracker/CkfPattern/python/CkfTrajectoryBuilderESProducer_cfi.py +++ b/RecoTracker/CkfPattern/python/CkfTrajectoryBuilderESProducer_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms CkfTrajectoryBuilder = cms.ESProducer("CkfTrajectoryBuilderESProducer", - propagatorAlong = cms.string('PropagatorWithMaterial'), + propagatorAlong = cms.string('PropagatorWithMaterialParabolicMf'), trajectoryFilterName = cms.string('ckfBaseTrajectoryFilter'), maxCand = cms.int32(5), ComponentName = cms.string('CkfTrajectoryBuilder'), @@ -11,7 +11,7 @@ TTRHBuilder = cms.string('WithTrackAngle'), updator = cms.string('KFUpdator'), alwaysUseInvalidHits = cms.bool(True), - propagatorOpposite = cms.string('PropagatorWithMaterialOpposite'), + propagatorOpposite = cms.string('PropagatorWithMaterialParabolicMfOpposite'), lostHitPenalty = cms.double(30.0), #SharedSeedCheck = cms.bool(False) ) diff --git a/RecoTracker/CkfPattern/python/GroupedCkfTrajectoryBuilderESProducer_cfi.py b/RecoTracker/CkfPattern/python/GroupedCkfTrajectoryBuilderESProducer_cfi.py index 91a9cb0c08b8e..46208eb88bb17 100644 --- a/RecoTracker/CkfPattern/python/GroupedCkfTrajectoryBuilderESProducer_cfi.py +++ b/RecoTracker/CkfPattern/python/GroupedCkfTrajectoryBuilderESProducer_cfi.py @@ -2,7 +2,7 @@ GroupedCkfTrajectoryBuilder = cms.ESProducer("GroupedCkfTrajectoryBuilderESProducer", bestHitOnly = cms.bool(True), - propagatorAlong = cms.string('PropagatorWithMaterial'), + propagatorAlong = cms.string('PropagatorWithMaterialParabolicMf'), # Filter used on tracks at end of all tracking (in-out + out-in) trajectoryFilterName = cms.string('ckfBaseTrajectoryFilter'), # Filter used on tracks at end of in-out tracking phase @@ -29,7 +29,7 @@ requireSeedHitsInRebuild = cms.bool(True), keepOriginalIfRebuildFails = cms.bool(False), estimator = cms.string('Chi2'), - propagatorOpposite = cms.string('PropagatorWithMaterialOpposite'), + propagatorOpposite = cms.string('PropagatorWithMaterialParabolicMfOpposite'), # Out-in tracking will not be attempted unless this many hits # are on track after in-out tracking phase. minNrOfHitsForRebuild = cms.int32(5) diff --git a/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc b/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc index 6fa3b2624351c..62c1fd6f27f0c 100644 --- a/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc +++ b/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc @@ -119,7 +119,10 @@ namespace cms{ //services es.get().get( theGeomSearchTracker ); - es.get().get( theMagField ); + if (conf_.exists("SimpleMagneticField")) + es.get().get(conf_.getParameter("SimpleMagneticField"), theMagField ); + else + es.get().get(theMagField ); if (!theInitialState){ // constructor uses the EventSetup, it must be in the setEventSetup were it has a proper value. diff --git a/RecoTracker/IterativeTracking/python/PixelLessTripletStep_cff.py b/RecoTracker/IterativeTracking/python/PixelLessTripletStep_cff.py index 6188d4dd8193e..a6ffcb3b64b1e 100644 --- a/RecoTracker/IterativeTracking/python/PixelLessTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/PixelLessTripletStep_cff.py @@ -75,6 +75,7 @@ chi2_cuts = cms.vdouble(), maxChi2 = cms.double(4.0), extraPhiKDBox = cms.double(0.0), + SimpleMagneticField = cms.string('ParabolicMf'), refitHits = cms.bool(True), ClusterShapeHitFilterName = cms.string('ClusterShapeHitFilter'), debug = cms.bool(False), diff --git a/RecoTracker/IterativeTracking/python/PostLS1_PixelLessTripletStep_cff.py b/RecoTracker/IterativeTracking/python/PostLS1_PixelLessTripletStep_cff.py index 129b7e174991c..a044f359c5c50 100644 --- a/RecoTracker/IterativeTracking/python/PostLS1_PixelLessTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/PostLS1_PixelLessTripletStep_cff.py @@ -49,6 +49,7 @@ maxChi2 = cms.double(4.0),#3.0 in v3 refitHits = cms.bool(True), extraPhiKDBox = cms.double(0.), + SimpleMagneticField = cms.string('ParabolicMf'), ClusterShapeHitFilterName = cms.string('ClusterShapeHitFilter'), debug = cms.bool(False), detIdsToDebug = cms.vint32(0,0,0) @@ -125,6 +126,7 @@ chi2_cuts = cms.vdouble(), maxChi2 = cms.double(6.0),#5.0 in v3 #4.0 in v2 extraPhiKDBox = cms.double(0.), + SimpleMagneticField = cms.string('ParabolicMf'), refitHits = cms.bool(True), ClusterShapeHitFilterName = cms.string('ClusterShapeHitFilter'), debug = cms.bool(False), diff --git a/RecoTracker/IterativeTracking/python/PostLS1_TobTecHybridStep_cff.py b/RecoTracker/IterativeTracking/python/PostLS1_TobTecHybridStep_cff.py index 9c36f2741e04b..4e024dbc08c5a 100644 --- a/RecoTracker/IterativeTracking/python/PostLS1_TobTecHybridStep_cff.py +++ b/RecoTracker/IterativeTracking/python/PostLS1_TobTecHybridStep_cff.py @@ -72,6 +72,7 @@ chi2_cuts = cms.vdouble(), refitHits = cms.bool(True), extraPhiKDBox = cms.double(0.), + SimpleMagneticField = cms.string('ParabolicMf'), ClusterShapeHitFilterName = cms.string('ClusterShapeHitFilter'), debug = cms.bool(False), detIdsToDebug = cms.vint32(0,0,0) diff --git a/RecoTracker/IterativeTracking/python/TobTecHybridStep_cff.py b/RecoTracker/IterativeTracking/python/TobTecHybridStep_cff.py index ab1597a982e9d..81ff3ec5bae7c 100644 --- a/RecoTracker/IterativeTracking/python/TobTecHybridStep_cff.py +++ b/RecoTracker/IterativeTracking/python/TobTecHybridStep_cff.py @@ -72,6 +72,7 @@ chi2_cuts = cms.vdouble(),#2.5,3.5,3.5,3.5,3.5 refitHits = cms.bool(True), extraPhiKDBox = cms.double(0.), + SimpleMagneticField = cms.string('ParabolicMf'), ClusterShapeHitFilterName = cms.string('ClusterShapeHitFilter'), debug = cms.bool(False), detIdsToDebug = cms.vint32(0,0,0) diff --git a/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc b/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc index 2e0c34da2e6e3..7fdab77e00b71 100644 --- a/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc +++ b/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc @@ -6,7 +6,10 @@ NavigationSchoolESProducer::ReturnType CfgNavigationSchoolESProducer::produce(co // get the field edm::ESHandle field; - iRecord.getRecord().get(field); + if (theNavigationPSet.exists("SimpleMagneticField")) + iRecord.getRecord().get(theNavigationPSet.getParameter("SimpleMagneticField"), field); + else + iRecord.getRecord().get(field); //get the geometricsearch tracker geometry edm::ESHandle geometricSearchTracker; diff --git a/RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.cc b/RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.cc index dbd3136cf4c1a..316bcf4389180 100644 --- a/RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.cc +++ b/RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.cc @@ -38,7 +38,10 @@ NavigationSchoolESProducer::produce(const NavigationSchoolRecord& iRecord) // get the field edm::ESHandle field; - iRecord.getRecord().get(field); + if (theNavigationPSet.exists("SimpleMagneticField")) + iRecord.getRecord().get(theNavigationPSet.getParameter("SimpleMagneticField"), field); + else + iRecord.getRecord().get(field); //get the geometricsearch tracker geometry edm::ESHandle geometricSearchTracker; diff --git a/RecoTracker/TkNavigation/python/CfgNavigationSchool_cfi.py b/RecoTracker/TkNavigation/python/CfgNavigationSchool_cfi.py index 27e3ba60e34a5..6b8de311eb786 100644 --- a/RecoTracker/TkNavigation/python/CfgNavigationSchool_cfi.py +++ b/RecoTracker/TkNavigation/python/CfgNavigationSchool_cfi.py @@ -1,7 +1,9 @@ import FWCore.ParameterSet.Config as cms CfgNavigationSchoolESProducer = cms.ESProducer("CfgNavigationSchoolESProducer", - ComponentName = cms.string('CfgNavigationSchool')) + ComponentName = cms.string('CfgNavigationSchool'), + SimpleMagneticField = cms.string('ParabolicMf'), + ) _defaultPSetWithIn=cms.PSet(IN = cms.vstring(''),OUT = cms.vstring('')) _defaultPSetInverseRelation=cms.PSet(OUT = cms.vstring('')) diff --git a/RecoTracker/TkNavigation/python/NavigationSchoolESProducer_cfi.py b/RecoTracker/TkNavigation/python/NavigationSchoolESProducer_cfi.py index 164a9ecf8c05b..f79132685463f 100644 --- a/RecoTracker/TkNavigation/python/NavigationSchoolESProducer_cfi.py +++ b/RecoTracker/TkNavigation/python/NavigationSchoolESProducer_cfi.py @@ -1,7 +1,8 @@ import FWCore.ParameterSet.Config as cms navigationSchoolESProducer = cms.ESProducer("NavigationSchoolESProducer", - ComponentName = cms.string('SimpleNavigationSchool') + ComponentName = cms.string('SimpleNavigationSchool'), + SimpleMagneticField = cms.string('ParabolicMf') ) diff --git a/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc b/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc index bec0d9e21a943..ab0158771d404 100644 --- a/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc +++ b/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc @@ -75,6 +75,10 @@ MultiHitGeneratorFromChi2::MultiHitGeneratorFromChi2(const edm::ParameterSet& cf detIdsToDebug.push_back(0); detIdsToDebug.push_back(0); } + if (cfg.exists("SimpleMagneticField")) { + useSimpleMF = true; + mfName_ = cfg.getParameter("SimpleMagneticField"); + } bfield = 0; nomField = -1.; } @@ -114,7 +118,10 @@ void MultiHitGeneratorFromChi2::hitSets(const TrackingRegion& region, es.get().get(tracker); if (nomField<0 && bfield == 0) { edm::ESHandle bfield_h; - es.get().get(bfield_h); + if (useSimpleMF) + es.get().get(mfName_, bfield_h); + else + es.get().get(bfield_h); bfield = bfield_h.product(); nomField = bfield->nominalValue(); } diff --git a/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.h b/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.h index 5b051b8c43148..5ff35fb13ba56 100644 --- a/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.h +++ b/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.h @@ -67,7 +67,8 @@ typedef CombinedMultiHitGenerator::LayerCacheType LayerCacheType; bool debug; std::string filterName_; std::vector detIdsToDebug; - + bool useSimpleMF; + std::string mfName_; }; #endif diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc b/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc index e462a99f20b53..6c62418f1cfc8 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc @@ -32,7 +32,10 @@ void SeedFromConsecutiveHitsCreator::init(const TrackingRegion & iregion, // get propagator es.get().get(thePropagatorLabel, propagatorHandle); // mag field - es.get().get(bfield); + if (useSimpleMF) + es.get().get(mfName_, bfield); + else + es.get().get(bfield); nomField = bfield->nominalValue(); isBOFF = (0==nomField); } diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.h b/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.h index 9dc0c2a15b87f..78ec958bdc9ea 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.h +++ b/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.h @@ -20,13 +20,18 @@ class SeedFromConsecutiveHitsCreator : public SeedCreator { theBOFFMomentum(cfg.existsAs("SeedMomentumForBOFF") ? cfg.getParameter("SeedMomentumForBOFF") : 5.0), theOriginTransverseErrorMultiplier(cfg.existsAs("OriginTransverseErrorMultiplier") ? cfg.getParameter("OriginTransverseErrorMultiplier") : 1.0), theMinOneOverPtError(cfg.existsAs("MinOneOverPtError") ? cfg.getParameter("MinOneOverPtError") : 1.0) - {} + { + if (cfg.exists("SimpleMagneticField")) { + useSimpleMF = true; + mfName_ = cfg.getParameter("SimpleMagneticField"); + } + } SeedFromConsecutiveHitsCreator( const std::string & propagator = "PropagatorWithMaterial", double seedMomentumForBOFF = -5.0, double aOriginTransverseErrorMultiplier = 1.0, double aMinOneOverPtError = 1.0) : thePropagatorLabel(propagator), theBOFFMomentum(seedMomentumForBOFF), - theOriginTransverseErrorMultiplier(aOriginTransverseErrorMultiplier), theMinOneOverPtError(aMinOneOverPtError) { } + theOriginTransverseErrorMultiplier(aOriginTransverseErrorMultiplier), theMinOneOverPtError(aMinOneOverPtError), useSimpleMF(false) { } //dtor virtual ~SeedFromConsecutiveHitsCreator(); @@ -76,6 +81,7 @@ class SeedFromConsecutiveHitsCreator : public SeedCreator { edm::ESHandle bfield; float nomField; bool isBOFF = false; - + bool useSimpleMF; + std::string mfName_; }; #endif diff --git a/RecoTracker/TkSeedGenerator/python/SeedFromConsecutiveHitsCreator_cfi.py b/RecoTracker/TkSeedGenerator/python/SeedFromConsecutiveHitsCreator_cfi.py index 9a2ecdfe841af..f477c46a62884 100644 --- a/RecoTracker/TkSeedGenerator/python/SeedFromConsecutiveHitsCreator_cfi.py +++ b/RecoTracker/TkSeedGenerator/python/SeedFromConsecutiveHitsCreator_cfi.py @@ -2,8 +2,9 @@ SeedFromConsecutiveHitsCreator = cms.PSet( ComponentName = cms.string('SeedFromConsecutiveHitsCreator'), - propagator = cms.string('PropagatorWithMaterial'), + propagator = cms.string('PropagatorWithMaterialParabolicMf'), SeedMomentumForBOFF = cms.double(5.0), OriginTransverseErrorMultiplier = cms.double(1.0), - MinOneOverPtError = cms.double(1.0) + MinOneOverPtError = cms.double(1.0), + SimpleMagneticField = cms.string('ParabolicMf') ) diff --git a/RecoTracker/TkSeedGenerator/python/SeedFromConsecutiveHitsStraightLineCreator_cfi.py b/RecoTracker/TkSeedGenerator/python/SeedFromConsecutiveHitsStraightLineCreator_cfi.py index e0f9d12cc03de..2b6ed14ed99c4 100644 --- a/RecoTracker/TkSeedGenerator/python/SeedFromConsecutiveHitsStraightLineCreator_cfi.py +++ b/RecoTracker/TkSeedGenerator/python/SeedFromConsecutiveHitsStraightLineCreator_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms SeedFromConsecutiveHitsStraightLineCreator = cms.PSet( ComponentName = cms.string('SeedFromConsecutiveHitsStraightLineCreator'), - propagator = cms.string('PropagatorWithMaterial'), + propagator = cms.string('PropagatorWithMaterialParabolicMf'), OriginTransverseErrorMultiplier = cms.double(1.0), MinOneOverPtError = cms.double(1.0) ) diff --git a/RecoTracker/TkSeedGenerator/python/SeedFromConsecutiveHitsTripletOnlyCreator_cfi.py b/RecoTracker/TkSeedGenerator/python/SeedFromConsecutiveHitsTripletOnlyCreator_cfi.py index 15c8798eae5ac..91452b4524405 100644 --- a/RecoTracker/TkSeedGenerator/python/SeedFromConsecutiveHitsTripletOnlyCreator_cfi.py +++ b/RecoTracker/TkSeedGenerator/python/SeedFromConsecutiveHitsTripletOnlyCreator_cfi.py @@ -1,5 +1,5 @@ import FWCore.ParameterSet.Config as cms SeedFromConsecutiveHitsTripletOnlyCreator = cms.PSet( ComponentName = cms.string('SeedFromConsecutiveHitsTripletOnlyCreator'), - propagator = cms.string('PropagatorWithMaterial') + propagator = cms.string('PropagatorWithMaterialParabolicMf') ) diff --git a/RecoTracker/TkSeedGenerator/src/SeedFromProtoTrack.cc b/RecoTracker/TkSeedGenerator/src/SeedFromProtoTrack.cc index 521f38aa9bf3f..f090257c88be9 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedFromProtoTrack.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedFromProtoTrack.cc @@ -52,7 +52,7 @@ void SeedFromProtoTrack::init(const reco::Track & proto, const edm::EventSetup& const Propagator* propagator = &(*propagatorHandle); edm::ESHandle field; - es.get().get(field); + es.get().get(field);//fixme reco::TrackBase::Point vtx = proto.referencePoint(); reco::TrackBase::Vector mom = proto.momentum(); diff --git a/TrackingTools/KalmanUpdators/plugins/TrackingRecHitPropagatorESProducer.cc b/TrackingTools/KalmanUpdators/plugins/TrackingRecHitPropagatorESProducer.cc index 71bcd3548ca52..0a9b1dd56ee45 100644 --- a/TrackingTools/KalmanUpdators/plugins/TrackingRecHitPropagatorESProducer.cc +++ b/TrackingTools/KalmanUpdators/plugins/TrackingRecHitPropagatorESProducer.cc @@ -23,7 +23,10 @@ TrackingRecHitPropagatorESProducer::~TrackingRecHitPropagatorESProducer() {} boost::shared_ptr TrackingRecHitPropagatorESProducer::produce(const TrackingComponentsRecord& iRecord){ ESHandle magfield; - iRecord.getRecord().get(magfield ); + if (pset_.exists("SimpleMagneticField")) + iRecord.getRecord().get(pset_.getParameter("SimpleMagneticField"), magfield); + else + iRecord.getRecord().get(magfield); theHitPropagator= boost::shared_ptr(new TrackingRecHitPropagator(magfield.product())); return theHitPropagator; } diff --git a/TrackingTools/KalmanUpdators/python/TrackingRecHitPropagatorESProducer_cfi.py b/TrackingTools/KalmanUpdators/python/TrackingRecHitPropagatorESProducer_cfi.py index 4232801aae922..33bad87811edd 100644 --- a/TrackingTools/KalmanUpdators/python/TrackingRecHitPropagatorESProducer_cfi.py +++ b/TrackingTools/KalmanUpdators/python/TrackingRecHitPropagatorESProducer_cfi.py @@ -1,7 +1,8 @@ import FWCore.ParameterSet.Config as cms trackingRecHitPropagator = cms.ESProducer("TrackingRecHitPropagatorESProducer", - ComponentName = cms.string('trackingRecHitPropagator') + ComponentName = cms.string('trackingRecHitPropagator'), + SimpleMagneticField = cms.string('ParabolicMf') ) diff --git a/TrackingTools/MaterialEffects/plugins/PropagatorWithMaterialESProducer.cc b/TrackingTools/MaterialEffects/plugins/PropagatorWithMaterialESProducer.cc index f059d9e1a469d..cc1b64bda98cf 100644 --- a/TrackingTools/MaterialEffects/plugins/PropagatorWithMaterialESProducer.cc +++ b/TrackingTools/MaterialEffects/plugins/PropagatorWithMaterialESProducer.cc @@ -28,9 +28,6 @@ PropagatorWithMaterialESProducer::produce(const TrackingComponentsRecord & iReco // delete _propagator; // _propagator = 0; // } - ESHandle magfield; - iRecord.getRecord().get(magfield ); - std::string pdir = pset_.getParameter("PropagationDirection"); double mass = pset_.getParameter("Mass"); @@ -40,6 +37,13 @@ PropagatorWithMaterialESProducer::produce(const TrackingComponentsRecord & iReco pset_.getParameter("useOldAnalPropLogic") : true; double ptMin = pset_.existsAs("ptMin") ? pset_.getParameter("ptMin") : -1.0; + ESHandle magfield; + if (pset_.exists("SimpleMagneticField")) + iRecord.getRecord().get(pset_.getParameter("SimpleMagneticField"), magfield); + else + iRecord.getRecord().get(magfield); + //fixme check that useRK is false when using SimpleMagneticField + PropagationDirection dir = alongMomentum; if (pdir == "oppositeToMomentum") dir = oppositeToMomentum; diff --git a/TrackingTools/MaterialEffects/python/PropagatorsForLoopers_cff.py b/TrackingTools/MaterialEffects/python/PropagatorsForLoopers_cff.py index fb30e695171eb..a4f552960d8a9 100644 --- a/TrackingTools/MaterialEffects/python/PropagatorsForLoopers_cff.py +++ b/TrackingTools/MaterialEffects/python/PropagatorsForLoopers_cff.py @@ -13,7 +13,7 @@ # (By default, it is neglected). However, it will also be assumed that the track pt can't be below specified value, # to prevent this scattering angle becoming too big. ptMin = cms.double(-1), - + SimpleMagneticField = cms.string('ParabolicMf'), # Use new AnalyticalPropagator's logic for intersection between plane and helix (for loopers) useOldAnalPropLogic = cms.bool(False) ) @@ -29,7 +29,7 @@ # (By default, it is neglected). However, it will also be assumed that the track pt can't be below specified value, # to prevent this scattering angle becoming too big. ptMin = cms.double(-1), - + SimpleMagneticField = cms.string('ParabolicMf'), # Use new AnalyticalPropagator's logic for intersection between plane and helix (for loopers) useOldAnalPropLogic = cms.bool(False) ) diff --git a/TrackingTools/MaterialEffects/python/Propagators_cff.py b/TrackingTools/MaterialEffects/python/Propagators_cff.py index 28330baf62047..1709afeb43399 100644 --- a/TrackingTools/MaterialEffects/python/Propagators_cff.py +++ b/TrackingTools/MaterialEffects/python/Propagators_cff.py @@ -7,3 +7,5 @@ from TrackingTools.GeomPropagators.OppositeAnalyticalPropagator_cfi import * from TrackingTools.GeomPropagators.AnyDirectionAnalyticalPropagator_cfi import * from TrackingTools.MaterialEffects.PropagatorsForLoopers_cff import * +from TrackingTools.MaterialEffects.MaterialPropagatorParabolicMf_cff import * +from TrackingTools.GeomPropagators.AnalyticalPropagatorParabolicMf_cff import * diff --git a/TrackingTools/Producers/src/AnalyticalPropagatorESProducer.cc b/TrackingTools/Producers/src/AnalyticalPropagatorESProducer.cc index 763e72be70248..a79de3ae98d50 100644 --- a/TrackingTools/Producers/src/AnalyticalPropagatorESProducer.cc +++ b/TrackingTools/Producers/src/AnalyticalPropagatorESProducer.cc @@ -28,7 +28,10 @@ AnalyticalPropagatorESProducer::produce(const TrackingComponentsRecord & iRecord // _propagator = 0; // } ESHandle magfield; - iRecord.getRecord().get(magfield ); + if (pset_.exists("SimpleMagneticField")) + iRecord.getRecord().get(pset_.getParameter("SimpleMagneticField"), magfield); + else + iRecord.getRecord().get(magfield); std::string pdir = pset_.getParameter("PropagationDirection"); double dphiCut = pset_.getParameter("MaxDPhi"); From 5cccc4e0f3f5eaeb70da361170604709bf4bd861 Mon Sep 17 00:00:00 2001 From: Giuseppe Date: Thu, 12 Dec 2013 13:32:35 +0100 Subject: [PATCH 02/11] fix propagator in mixedTripletStep --- .../IterativeTracking/python/MixedTripletStep_cff.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/RecoTracker/IterativeTracking/python/MixedTripletStep_cff.py b/RecoTracker/IterativeTracking/python/MixedTripletStep_cff.py index 356d40fc5fd6e..1bf3cbac9af5b 100644 --- a/RecoTracker/IterativeTracking/python/MixedTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/MixedTripletStep_cff.py @@ -133,13 +133,12 @@ ) # Propagator taking into account momentum uncertainty in multiple scattering calculation. -import TrackingTools.MaterialEffects.MaterialPropagator_cfi -mixedTripletStepPropagator = TrackingTools.MaterialEffects.MaterialPropagator_cfi.MaterialPropagator.clone( +import TrackingTools.MaterialEffects.MaterialPropagatorParabolicMf_cff +mixedTripletStepPropagator = TrackingTools.MaterialEffects.MaterialPropagatorParabolicMf_cff.MaterialPropagatorParabolicMF.clone( ComponentName = 'mixedTripletStepPropagator', ptMin = 0.1 ) -import TrackingTools.MaterialEffects.OppositeMaterialPropagator_cfi -mixedTripletStepPropagatorOpposite = TrackingTools.MaterialEffects.OppositeMaterialPropagator_cfi.OppositeMaterialPropagator.clone( +mixedTripletStepPropagatorOpposite = TrackingTools.MaterialEffects.MaterialPropagatorParabolicMf_cff.OppositeMaterialPropagatorParabolicMF.clone( ComponentName = 'mixedTripletStepPropagatorOpposite', ptMin = 0.1 ) From d492a0d6e77e9a56fe48d4635c279b6ab103d985 Mon Sep 17 00:00:00 2001 From: Giuseppe Date: Fri, 13 Dec 2013 22:46:15 +0100 Subject: [PATCH 03/11] restore warning --- .../plugins/ParabolicParametrizedMagneticField.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MagneticField/ParametrizedEngine/plugins/ParabolicParametrizedMagneticField.cc b/MagneticField/ParametrizedEngine/plugins/ParabolicParametrizedMagneticField.cc index fed41d0d5fc56..6ffc193325e69 100644 --- a/MagneticField/ParametrizedEngine/plugins/ParabolicParametrizedMagneticField.cc +++ b/MagneticField/ParametrizedEngine/plugins/ParabolicParametrizedMagneticField.cc @@ -25,7 +25,7 @@ ParabolicParametrizedMagneticField::inTesla(const GlobalPoint& gp) const { if (isDefined(gp)) { return inTeslaUnchecked(gp); } else { - //edm::LogWarning("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of ParabolicParametrizedMagneticField"; + edm::LogWarning("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of ParabolicParametrizedMagneticField"; return GlobalVector(); } } From 35bd0681b27e7ed935c3a9af465e341aae151e5b Mon Sep 17 00:00:00 2001 From: Giuseppe Date: Mon, 16 Dec 2013 13:50:48 +0100 Subject: [PATCH 04/11] adding missing files --- .../AnalyticalPropagatorParabolicMf_cff.py | 13 +++++++++++++ .../python/MaterialPropagatorParabolicMf_cff.py | 16 ++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 TrackingTools/GeomPropagators/python/AnalyticalPropagatorParabolicMf_cff.py create mode 100644 TrackingTools/MaterialEffects/python/MaterialPropagatorParabolicMf_cff.py diff --git a/TrackingTools/GeomPropagators/python/AnalyticalPropagatorParabolicMf_cff.py b/TrackingTools/GeomPropagators/python/AnalyticalPropagatorParabolicMf_cff.py new file mode 100644 index 0000000000000..07e6a9a914836 --- /dev/null +++ b/TrackingTools/GeomPropagators/python/AnalyticalPropagatorParabolicMf_cff.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms + +from TrackingTools.GeomPropagators.AnalyticalPropagator_cfi import AnalyticalPropagator +AnalyticalPropagatorParabolicMF = AnalyticalPropagator.clone( + SimpleMagneticField = cms.string('ParabolicMf'), + ComponentName = cms.string('AnalyticalPropagatorParabolicMf') +) + +from TrackingTools.GeomPropagators.OppositeAnalyticalPropagator_cfi import OppositeAnalyticalPropagator +OppositeAnalyticalPropagatorParabolicMF = OppositeAnalyticalPropagator.clone( + SimpleMagneticField = cms.string('ParabolicMf'), + ComponentName = cms.string('AnalyticalPropagatorParabolicMfOpposite') +) diff --git a/TrackingTools/MaterialEffects/python/MaterialPropagatorParabolicMf_cff.py b/TrackingTools/MaterialEffects/python/MaterialPropagatorParabolicMf_cff.py new file mode 100644 index 0000000000000..0a8d58324e393 --- /dev/null +++ b/TrackingTools/MaterialEffects/python/MaterialPropagatorParabolicMf_cff.py @@ -0,0 +1,16 @@ +import FWCore.ParameterSet.Config as cms + +from TrackingTools.MaterialEffects.MaterialPropagator_cfi import MaterialPropagator +MaterialPropagatorParabolicMF = MaterialPropagator.clone( + SimpleMagneticField = cms.string('ParabolicMf'), + ComponentName = cms.string('PropagatorWithMaterialParabolicMf') +) + +from TrackingTools.MaterialEffects.OppositeMaterialPropagator_cfi import OppositeMaterialPropagator +OppositeMaterialPropagatorParabolicMF = OppositeMaterialPropagator.clone( + SimpleMagneticField = cms.string('ParabolicMf'), + ComponentName = cms.string('PropagatorWithMaterialParabolicMfOpposite') +) + +from MagneticField.ParametrizedEngine.ParabolicParametrizedField_cfi import ParametrizedMagneticFieldProducer +ParametrizedMagneticFieldProducerForTracking = ParametrizedMagneticFieldProducer.clone(label = "ParabolicMf") From 03da7a994fb5c77da1f2f11be67ab4fd7ecfce0e Mon Sep 17 00:00:00 2001 From: Giuseppe Date: Mon, 16 Dec 2013 13:50:48 +0100 Subject: [PATCH 05/11] adding missing files From 160ee6f257b1edd37a1e6b84c85fa34658175cc3 Mon Sep 17 00:00:00 2001 From: Giuseppe Date: Tue, 17 Dec 2013 19:36:18 +0100 Subject: [PATCH 06/11] add parabolic field for track building --- .../python/MagneticField_AutoFromDBCurrent_cff.py | 4 ++++ Configuration/StandardSequences/python/MagneticField_cff.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Configuration/StandardSequences/python/MagneticField_AutoFromDBCurrent_cff.py b/Configuration/StandardSequences/python/MagneticField_AutoFromDBCurrent_cff.py index 04f309afffe3f..5c689c21b07e3 100644 --- a/Configuration/StandardSequences/python/MagneticField_AutoFromDBCurrent_cff.py +++ b/Configuration/StandardSequences/python/MagneticField_AutoFromDBCurrent_cff.py @@ -4,4 +4,8 @@ # and loading the best map available for that current as specified in the file from MagneticField.Engine.autoMagneticFieldProducer_cfi import * +# Parabolic parametrized magnetic field used for track building +from MagneticField.ParametrizedEngine.ParabolicParametrizedField_cfi import ParametrizedMagneticFieldProducer as ParabolicParametrizedMagneticFieldProducer +ParabolicParametrizedMagneticFieldProducer.label = "ParabolicMf" + diff --git a/Configuration/StandardSequences/python/MagneticField_cff.py b/Configuration/StandardSequences/python/MagneticField_cff.py index 2492640040b7c..6debad13189d0 100644 --- a/Configuration/StandardSequences/python/MagneticField_cff.py +++ b/Configuration/StandardSequences/python/MagneticField_cff.py @@ -4,3 +4,7 @@ # Master configuration for the magnetic field # old mapping with 4T from Configuration.StandardSequences.MagneticField_38T_cff import * + +# Parabolic parametrized magnetic field used for track building +from MagneticField.ParametrizedEngine.ParabolicParametrizedField_cfi import ParametrizedMagneticFieldProducer as ParabolicParametrizedMagneticFieldProducer +ParabolicParametrizedMagneticFieldProducer.label = "ParabolicMf" From a8ac9a4712f8cf36498138bb5c1544b96bccdef4 Mon Sep 17 00:00:00 2001 From: Giuseppe Date: Tue, 17 Dec 2013 19:36:19 +0100 Subject: [PATCH 07/11] switch to LogDebug --- .../plugins/ParabolicParametrizedMagneticField.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MagneticField/ParametrizedEngine/plugins/ParabolicParametrizedMagneticField.cc b/MagneticField/ParametrizedEngine/plugins/ParabolicParametrizedMagneticField.cc index 6ffc193325e69..243e5a86a5492 100644 --- a/MagneticField/ParametrizedEngine/plugins/ParabolicParametrizedMagneticField.cc +++ b/MagneticField/ParametrizedEngine/plugins/ParabolicParametrizedMagneticField.cc @@ -25,7 +25,7 @@ ParabolicParametrizedMagneticField::inTesla(const GlobalPoint& gp) const { if (isDefined(gp)) { return inTeslaUnchecked(gp); } else { - edm::LogWarning("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of ParabolicParametrizedMagneticField"; + LogDebug("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of ParabolicParametrizedMagneticField"; return GlobalVector(); } } From bd9933c46569a1ecea0b567daad5c9dfacdfc6b8 Mon Sep 17 00:00:00 2001 From: Giuseppe Date: Tue, 17 Dec 2013 19:36:33 +0100 Subject: [PATCH 08/11] move parabolic field to standard includes --- .../MaterialEffects/python/MaterialPropagatorParabolicMf_cff.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/TrackingTools/MaterialEffects/python/MaterialPropagatorParabolicMf_cff.py b/TrackingTools/MaterialEffects/python/MaterialPropagatorParabolicMf_cff.py index 0a8d58324e393..310595b46d167 100644 --- a/TrackingTools/MaterialEffects/python/MaterialPropagatorParabolicMf_cff.py +++ b/TrackingTools/MaterialEffects/python/MaterialPropagatorParabolicMf_cff.py @@ -12,5 +12,3 @@ ComponentName = cms.string('PropagatorWithMaterialParabolicMfOpposite') ) -from MagneticField.ParametrizedEngine.ParabolicParametrizedField_cfi import ParametrizedMagneticFieldProducer -ParametrizedMagneticFieldProducerForTracking = ParametrizedMagneticFieldProducer.clone(label = "ParabolicMf") From 18c13ca82e7e8b85fe65a013f24a784e76732e58 Mon Sep 17 00:00:00 2001 From: Giuseppe Date: Wed, 18 Dec 2013 16:06:06 +0100 Subject: [PATCH 09/11] add parabolic MF --- .../StandardSequences/python/MagneticField_38T_cff.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Configuration/StandardSequences/python/MagneticField_38T_cff.py b/Configuration/StandardSequences/python/MagneticField_38T_cff.py index 6b3939158bb58..f7654b3bfb5d2 100644 --- a/Configuration/StandardSequences/python/MagneticField_38T_cff.py +++ b/Configuration/StandardSequences/python/MagneticField_38T_cff.py @@ -5,4 +5,8 @@ #Default is version 85l from MagneticField.Engine.volumeBasedMagneticField_090322_2pi_scaled_cfi import * +# Parabolic parametrized magnetic field used for track building +from MagneticField.ParametrizedEngine.ParabolicParametrizedField_cfi import ParametrizedMagneticFieldProducer as ParabolicParametrizedMagneticFieldProducer +ParabolicParametrizedMagneticFieldProducer.label = "ParabolicMf" + From 7e3ec421d9a12223c87cbc00ddc483ce35601782 Mon Sep 17 00:00:00 2001 From: Giuseppe Date: Wed, 18 Dec 2013 16:06:33 +0100 Subject: [PATCH 10/11] remove parabolic MF --- Configuration/StandardSequences/python/MagneticField_cff.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Configuration/StandardSequences/python/MagneticField_cff.py b/Configuration/StandardSequences/python/MagneticField_cff.py index 6debad13189d0..2492640040b7c 100644 --- a/Configuration/StandardSequences/python/MagneticField_cff.py +++ b/Configuration/StandardSequences/python/MagneticField_cff.py @@ -4,7 +4,3 @@ # Master configuration for the magnetic field # old mapping with 4T from Configuration.StandardSequences.MagneticField_38T_cff import * - -# Parabolic parametrized magnetic field used for track building -from MagneticField.ParametrizedEngine.ParabolicParametrizedField_cfi import ParametrizedMagneticFieldProducer as ParabolicParametrizedMagneticFieldProducer -ParabolicParametrizedMagneticFieldProducer.label = "ParabolicMf" From b122bdf1467a77b66ad51647175ed474bbbfae10 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 30 Jan 2014 17:29:32 +0100 Subject: [PATCH 11/11] parabolic in fitting --- .../TrackProducer/interface/TrackProducerBase.icc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/RecoTracker/TrackProducer/interface/TrackProducerBase.icc b/RecoTracker/TrackProducer/interface/TrackProducerBase.icc index 09ea0f7391bbd..ea066cf15aed9 100644 --- a/RecoTracker/TrackProducer/interface/TrackProducerBase.icc +++ b/RecoTracker/TrackProducer/interface/TrackProducerBase.icc @@ -56,7 +56,15 @@ TrackProducerBase::getFromES(const edm::EventSetup& setup, //get magnetic field // LogDebug("TrackProducer") << "get magnetic field" << "\n"; - setup.get().get(theMF); + bool simpleMF = false; + if (conf_.exists("useSimpleMF")) simpleMF = conf_.getParameter("useSimpleMF"); + if (simpleMF){ + std::string mfName_ = conf_.getParameter("SimpleMagneticField"); + setup.get().get(mfName_, theMF); + } + else + setup.get().get(theMF); + // // get the fitter from the ES //