From b7146fb278d154930804d4a82546d5dedd90933c Mon Sep 17 00:00:00 2001 From: Giuseppe Date: Mon, 9 Dec 2013 10:57:17 +0100 Subject: [PATCH 01/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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 // From ebcb9d94669d30f94ad7e3ed9e220cb186c4c637 Mon Sep 17 00:00:00 2001 From: Mia Date: Tue, 4 Feb 2014 15:44:16 +0100 Subject: [PATCH 12/16] add MagneticField_38T_PostLS1_cff --- .../StandardSequences/python/MagneticField_38T_PostLS1_cff.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py b/Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py index 50abf1ede9118..1f7c2283cf26c 100644 --- a/Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py +++ b/Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py @@ -5,4 +5,7 @@ #Default is version 85l from MagneticField.Engine.volumeBasedMagneticField_120812_largeYE4_cfi import * +# Parabolic parametrized magnetic field used for track building +from MagneticField.ParametrizedEngine.ParabolicParametrizedField_cfi import ParametrizedMagneticFieldProducer as ParabolicParametrizedMagneticFieldProducer +ParabolicParametrizedMagneticFieldProducer.label = "ParabolicMf" From c845d45621c98b54e29bdf16647284628f12bdd6 Mon Sep 17 00:00:00 2001 From: Mia Date: Thu, 6 Feb 2014 14:08:43 +0100 Subject: [PATCH 13/16] useSimpleMF and mfName_ default value is set now (to false and respectively) --- .../plugins/MultiHitGeneratorFromChi2.cc | 30 ++++++++++--------- .../plugins/MultiHitGeneratorFromChi2.h | 2 +- .../plugins/SeedFromConsecutiveHitsCreator.cc | 2 +- .../plugins/SeedFromConsecutiveHitsCreator.h | 23 ++++++++------ 4 files changed, 32 insertions(+), 25 deletions(-) diff --git a/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc b/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc index ab0158771d404..765a89b2839b8 100644 --- a/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc +++ b/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc @@ -47,18 +47,20 @@ namespace { } MultiHitGeneratorFromChi2::MultiHitGeneratorFromChi2(const edm::ParameterSet& cfg) - : thePairGenerator(0), - theLayerCache(0), - useFixedPreFiltering(cfg.getParameter("useFixedPreFiltering")), - extraHitRZtolerance(cfg.getParameter("extraHitRZtolerance")), - extraHitRPhitolerance(cfg.getParameter("extraHitRPhitolerance")), - extraPhiKDBox(cfg.getParameter("extraPhiKDBox")), - fnSigmaRZ(cfg.getParameter("fnSigmaRZ")), - chi2VsPtCut(cfg.getParameter("chi2VsPtCut")), - maxChi2(cfg.getParameter("maxChi2")), - refitHits(cfg.getParameter("refitHits")), - debug(cfg.getParameter("debug")), - filterName_(cfg.getParameter("ClusterShapeHitFilterName")) + : thePairGenerator(0) + , theLayerCache(0) + , useFixedPreFiltering (cfg.getParameter ("useFixedPreFiltering") ) + , extraHitRZtolerance (cfg.getParameter("extraHitRZtolerance") ) + , extraHitRPhitolerance(cfg.getParameter("extraHitRPhitolerance") ) + , extraPhiKDBox (cfg.getParameter("extraPhiKDBox") ) + , fnSigmaRZ (cfg.getParameter("fnSigmaRZ") ) + , chi2VsPtCut (cfg.getParameter ("chi2VsPtCut") ) + , maxChi2 (cfg.getParameter("maxChi2") ) + , refitHits (cfg.getParameter ("refitHits") ) + , debug (cfg.getParameter ("debug") ) + , filterName_ (cfg.getParameter("ClusterShapeHitFilterName")) + , useSimpleMF_ (false) + , mfName_ ("") { theMaxElement=cfg.getParameter("maxElement"); if (useFixedPreFiltering) @@ -76,7 +78,7 @@ MultiHitGeneratorFromChi2::MultiHitGeneratorFromChi2(const edm::ParameterSet& cf detIdsToDebug.push_back(0); } if (cfg.exists("SimpleMagneticField")) { - useSimpleMF = true; + useSimpleMF_ = true; mfName_ = cfg.getParameter("SimpleMagneticField"); } bfield = 0; @@ -118,7 +120,7 @@ void MultiHitGeneratorFromChi2::hitSets(const TrackingRegion& region, es.get().get(tracker); if (nomField<0 && bfield == 0) { edm::ESHandle bfield_h; - if (useSimpleMF) + if (useSimpleMF_) es.get().get(mfName_, bfield_h); else es.get().get(bfield_h); diff --git a/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.h b/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.h index 5ff35fb13ba56..7ea3726c7b1db 100644 --- a/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.h +++ b/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.h @@ -67,7 +67,7 @@ typedef CombinedMultiHitGenerator::LayerCacheType LayerCacheType; bool debug; std::string filterName_; std::vector detIdsToDebug; - bool useSimpleMF; + bool useSimpleMF_; std::string mfName_; }; #endif diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc b/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc index 6c62418f1cfc8..0e353ab26db17 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc @@ -32,7 +32,7 @@ void SeedFromConsecutiveHitsCreator::init(const TrackingRegion & iregion, // get propagator es.get().get(thePropagatorLabel, propagatorHandle); // mag field - if (useSimpleMF) + if (useSimpleMF_) es.get().get(mfName_, bfield); else es.get().get(bfield); diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.h b/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.h index 78ec958bdc9ea..246cb0c48af03 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.h +++ b/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.h @@ -15,14 +15,16 @@ class FreeTrajectoryState; class SeedFromConsecutiveHitsCreator : public SeedCreator { public: - SeedFromConsecutiveHitsCreator( const edm::ParameterSet & cfg): - thePropagatorLabel(cfg.getParameter("propagator")), - 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) + SeedFromConsecutiveHitsCreator( const edm::ParameterSet & cfg) + : thePropagatorLabel (cfg.getParameter("propagator")) + , 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) + , useSimpleMF_(false) + , mfName_("") { if (cfg.exists("SimpleMagneticField")) { - useSimpleMF = true; + useSimpleMF_ = true; mfName_ = cfg.getParameter("SimpleMagneticField"); } } @@ -30,8 +32,11 @@ class SeedFromConsecutiveHitsCreator : public SeedCreator { 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), useSimpleMF(false) { } + : thePropagatorLabel(propagator) + , theBOFFMomentum(seedMomentumForBOFF) + , theOriginTransverseErrorMultiplier(aOriginTransverseErrorMultiplier) + , theMinOneOverPtError(aMinOneOverPtError) + , useSimpleMF_(false) { } //dtor virtual ~SeedFromConsecutiveHitsCreator(); @@ -81,7 +86,7 @@ class SeedFromConsecutiveHitsCreator : public SeedCreator { edm::ESHandle bfield; float nomField; bool isBOFF = false; - bool useSimpleMF; + bool useSimpleMF_; std::string mfName_; }; #endif From 81ece8afd9b945cf3e9cc7f17fefde029a4baabe Mon Sep 17 00:00:00 2001 From: Mia Date: Tue, 11 Feb 2014 19:20:03 +0100 Subject: [PATCH 14/16] change function which loads magnetic field from get().get(bfield) to get().get(mfESInputTag, bfield) w/ mfESInputTag edm::ESInputTag which is constructed from the string parameter mfName. This parameter is set to "" as default value (in order to garuantee back-compatibility (i.e. standard magnetic field from DB) and it can be defined by config file as well --- .../plugins/MultiHitGeneratorFromChi2.cc | 12 ++++++---- .../plugins/SeedFromConsecutiveHitsCreator.cc | 8 +++---- .../plugins/SeedFromConsecutiveHitsCreator.h | 14 +++++++----- .../interface/TrackProducerBase.icc | 22 ++++++++++++------- 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc b/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc index 765a89b2839b8..062adb22dd5d7 100644 --- a/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc +++ b/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc @@ -3,6 +3,7 @@ #include "RecoPixelVertexing/PixelTriplets/interface/ThirdHitPredictionFromCircle.h" #include "RecoPixelVertexing/PixelTriplets/plugins/ThirdHitRZPrediction.h" #include "FWCore/Framework/interface/ESHandle.h" +#include #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" @@ -77,6 +78,10 @@ MultiHitGeneratorFromChi2::MultiHitGeneratorFromChi2(const edm::ParameterSet& cf detIdsToDebug.push_back(0); detIdsToDebug.push_back(0); } + // 2014/02/11 mia: + // we should get rid of the boolean parameter useSimpleMF, + // and use only a string magneticField [instead of SimpleMagneticField] + // or better an edm::ESInputTag (at the moment HLT does not handle ESInputTag) if (cfg.exists("SimpleMagneticField")) { useSimpleMF_ = true; mfName_ = cfg.getParameter("SimpleMagneticField"); @@ -120,10 +125,9 @@ void MultiHitGeneratorFromChi2::hitSets(const TrackingRegion& region, es.get().get(tracker); if (nomField<0 && bfield == 0) { edm::ESHandle bfield_h; - if (useSimpleMF_) - es.get().get(mfName_, bfield_h); - else - es.get().get(bfield_h); + edm::ESInputTag mfESInputTag(mfName_); + // es.get().get(mfName_, bfield_h); + es.get().get(mfESInputTag, bfield_h); bfield = bfield_h.product(); nomField = bfield->nominalValue(); } diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc b/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc index 0e353ab26db17..639e8f0abaffa 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc @@ -5,6 +5,7 @@ #include "RecoTracker/TkSeedGenerator/interface/FastHelix.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" #include "TrackingTools/Records/interface/TrackingComponentsRecord.h" #include "TrackingTools/Records/interface/TransientRecHitRecord.h" @@ -32,10 +33,9 @@ void SeedFromConsecutiveHitsCreator::init(const TrackingRegion & iregion, // get propagator es.get().get(thePropagatorLabel, propagatorHandle); // mag field - if (useSimpleMF_) - es.get().get(mfName_, bfield); - else - es.get().get(bfield); + edm::ESInputTag mfESInputTag(mfName_); + // es.get().get(mfName_, bfield); + es.get().get(mfESInputTag, bfield); nomField = bfield->nominalValue(); isBOFF = (0==nomField); } diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.h b/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.h index 246cb0c48af03..f533b2775193c 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.h +++ b/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.h @@ -20,14 +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) + // 2014/02/11 mia: + // we should get rid of the boolean parameter useSimpleMF, + // and use only a string magneticField [instead of SimpleMagneticField] + // or better an edm::ESInputTag (at the moment HLT does not handle ESInputTag) , useSimpleMF_(false) , mfName_("") - { - if (cfg.exists("SimpleMagneticField")) { - useSimpleMF_ = true; - mfName_ = cfg.getParameter("SimpleMagneticField"); - } + { + if (cfg.exists("SimpleMagneticField")) { + useSimpleMF_ = true; + mfName_ = cfg.getParameter("SimpleMagneticField"); } + } SeedFromConsecutiveHitsCreator( const std::string & propagator = "PropagatorWithMaterial", double seedMomentumForBOFF = -5.0, diff --git a/RecoTracker/TrackProducer/interface/TrackProducerBase.icc b/RecoTracker/TrackProducer/interface/TrackProducerBase.icc index ea066cf15aed9..85b0050020cee 100644 --- a/RecoTracker/TrackProducer/interface/TrackProducerBase.icc +++ b/RecoTracker/TrackProducer/interface/TrackProducerBase.icc @@ -4,6 +4,7 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include #include "MagneticField/Engine/interface/MagneticField.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" @@ -56,14 +57,19 @@ TrackProducerBase::getFromES(const edm::EventSetup& setup, //get magnetic field // LogDebug("TrackProducer") << "get magnetic field" << "\n"; - 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); + // 2014/02/11 mia: + // we should get rid of the boolean parameter useSimpleMF, + // and use only a string magneticField [instead of SimpleMagneticField] + // or better an edm::ESInputTag (at the moment HLT does not handle ESInputTag) + bool useSimpleMF = false; + if (conf_.exists("useSimpleMF")) useSimpleMF = conf_.getParameter("useSimpleMF"); + std::string mfName = ""; + if (useSimpleMF){ + mfName = conf_.getParameter("SimpleMagneticField"); + } + edm::ESInputTag mfESInputTag(mfName); + // setup.get().get(mfName, theMF); + setup.get().get(mfESInputTag, theMF); // // get the fitter from the ES From 7ad6cae7481f726f6d40533703825e7c4192cc02 Mon Sep 17 00:00:00 2001 From: Mia Date: Tue, 11 Feb 2014 19:57:38 +0100 Subject: [PATCH 15/16] use EventSetupRecord::get(ESInputTag const& iTag, HolderT& iHolder) --- RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc | 8 +++++--- .../plugins/CfgNavigationSchoolESProducer.cc | 8 +++++--- .../TkNavigation/plugins/NavigationSchoolESProducer.cc | 8 +++++--- .../plugins/TrackingRecHitPropagatorESProducer.cc | 9 +++++---- .../plugins/PropagatorWithMaterialESProducer.cc | 8 +++++--- .../Producers/src/AnalyticalPropagatorESProducer.cc | 8 +++++--- 6 files changed, 30 insertions(+), 19 deletions(-) diff --git a/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc b/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc index 62c1fd6f27f0c..0c24d7d54c63f 100644 --- a/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc +++ b/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc @@ -6,6 +6,7 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/isFinite.h" +#include #include "DataFormats/Common/interface/OwnVector.h" #include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h" @@ -119,10 +120,11 @@ namespace cms{ //services es.get().get( theGeomSearchTracker ); + std::string mfName = ""; if (conf_.exists("SimpleMagneticField")) - es.get().get(conf_.getParameter("SimpleMagneticField"), theMagField ); - else - es.get().get(theMagField ); + mfName = conf_.getParameter("SimpleMagneticField"); + edm::ESInputTag mfESInputTag(mfName); + es.get().get(mfESInputTag,theMagField ); if (!theInitialState){ // constructor uses the EventSetup, it must be in the setEventSetup were it has a proper value. diff --git a/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc b/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc index 7fdab77e00b71..8f175a5b88aba 100644 --- a/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc +++ b/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc @@ -1,3 +1,4 @@ +#include #include "RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.h" #include "RecoTracker/TkNavigation/interface/CfgNavigationSchool.h" @@ -6,10 +7,11 @@ NavigationSchoolESProducer::ReturnType CfgNavigationSchoolESProducer::produce(co // get the field edm::ESHandle field; + std::string mfName = ""; if (theNavigationPSet.exists("SimpleMagneticField")) - iRecord.getRecord().get(theNavigationPSet.getParameter("SimpleMagneticField"), field); - else - iRecord.getRecord().get(field); + mfName = theNavigationPSet.getParameter("SimpleMagneticField"); + edm::ESInputTag mfESInputTag(mfName); + iRecord.getRecord().get(mfESInputTag,field); //get the geometricsearch tracker geometry edm::ESHandle geometricSearchTracker; diff --git a/RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.cc b/RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.cc index 316bcf4389180..0f8ad14647cc0 100644 --- a/RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.cc +++ b/RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.cc @@ -1,3 +1,4 @@ +#include #include "RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.h" @@ -38,10 +39,11 @@ NavigationSchoolESProducer::produce(const NavigationSchoolRecord& iRecord) // get the field edm::ESHandle field; + std::string mfName = ""; if (theNavigationPSet.exists("SimpleMagneticField")) - iRecord.getRecord().get(theNavigationPSet.getParameter("SimpleMagneticField"), field); - else - iRecord.getRecord().get(field); + mfName = theNavigationPSet.getParameter("SimpleMagneticField"); + edm::ESInputTag mfESInputTag(mfName); + iRecord.getRecord().get(mfESInputTag,field); //get the geometricsearch tracker geometry edm::ESHandle geometricSearchTracker; diff --git a/TrackingTools/KalmanUpdators/plugins/TrackingRecHitPropagatorESProducer.cc b/TrackingTools/KalmanUpdators/plugins/TrackingRecHitPropagatorESProducer.cc index 0a9b1dd56ee45..46d7a5154e13f 100644 --- a/TrackingTools/KalmanUpdators/plugins/TrackingRecHitPropagatorESProducer.cc +++ b/TrackingTools/KalmanUpdators/plugins/TrackingRecHitPropagatorESProducer.cc @@ -4,7 +4,7 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/ModuleFactory.h" #include "FWCore/Framework/interface/ESProducer.h" - +#include #include #include @@ -23,10 +23,11 @@ TrackingRecHitPropagatorESProducer::~TrackingRecHitPropagatorESProducer() {} boost::shared_ptr TrackingRecHitPropagatorESProducer::produce(const TrackingComponentsRecord& iRecord){ ESHandle magfield; + std::string mfName = ""; if (pset_.exists("SimpleMagneticField")) - iRecord.getRecord().get(pset_.getParameter("SimpleMagneticField"), magfield); - else - iRecord.getRecord().get(magfield); + mfName = pset_.getParameter("SimpleMagneticField"); + edm::ESInputTag mfESInputTag(mfName); + iRecord.getRecord().get(mfESInputTag,magfield); theHitPropagator= boost::shared_ptr(new TrackingRecHitPropagator(magfield.product())); return theHitPropagator; } diff --git a/TrackingTools/MaterialEffects/plugins/PropagatorWithMaterialESProducer.cc b/TrackingTools/MaterialEffects/plugins/PropagatorWithMaterialESProducer.cc index cc1b64bda98cf..e88a6e8f03e7b 100644 --- a/TrackingTools/MaterialEffects/plugins/PropagatorWithMaterialESProducer.cc +++ b/TrackingTools/MaterialEffects/plugins/PropagatorWithMaterialESProducer.cc @@ -7,6 +7,7 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/ModuleFactory.h" #include "FWCore/Framework/interface/ESProducer.h" +#include #include #include @@ -38,10 +39,11 @@ PropagatorWithMaterialESProducer::produce(const TrackingComponentsRecord & iReco double ptMin = pset_.existsAs("ptMin") ? pset_.getParameter("ptMin") : -1.0; ESHandle magfield; + std::string mfName = ""; if (pset_.exists("SimpleMagneticField")) - iRecord.getRecord().get(pset_.getParameter("SimpleMagneticField"), magfield); - else - iRecord.getRecord().get(magfield); + mfName = pset_.getParameter("SimpleMagneticField"); + edm::ESInputTag mfESInputTag(mfName); + iRecord.getRecord().get(mfESInputTag,magfield); //fixme check that useRK is false when using SimpleMagneticField PropagationDirection dir = alongMomentum; diff --git a/TrackingTools/Producers/src/AnalyticalPropagatorESProducer.cc b/TrackingTools/Producers/src/AnalyticalPropagatorESProducer.cc index a79de3ae98d50..115d0607514df 100644 --- a/TrackingTools/Producers/src/AnalyticalPropagatorESProducer.cc +++ b/TrackingTools/Producers/src/AnalyticalPropagatorESProducer.cc @@ -6,6 +6,7 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/ModuleFactory.h" #include "FWCore/Framework/interface/ESProducer.h" +#include #include #include @@ -28,10 +29,11 @@ AnalyticalPropagatorESProducer::produce(const TrackingComponentsRecord & iRecord // _propagator = 0; // } ESHandle magfield; + std::string mfName = ""; if (pset_.exists("SimpleMagneticField")) - iRecord.getRecord().get(pset_.getParameter("SimpleMagneticField"), magfield); - else - iRecord.getRecord().get(magfield); + mfName = pset_.getParameter("SimpleMagneticField"); + edm::ESInputTag mfESInputTag(mfName); + iRecord.getRecord().get(mfESInputTag,magfield); std::string pdir = pset_.getParameter("PropagationDirection"); double dphiCut = pset_.getParameter("MaxDPhi"); From 48a9518a149e5a05268e4104e1b5404573d9e37a Mon Sep 17 00:00:00 2001 From: Mia Date: Wed, 12 Feb 2014 15:10:29 +0100 Subject: [PATCH 16/16] delete ESInputTag (it makes crashing some workflow because of conversionTrackCandidates (SimpleNavigationSchool) and hltGetConditions (MaterialPropagatorParabolicMF) ) --- RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc | 5 +++-- .../TkNavigation/plugins/CfgNavigationSchoolESProducer.cc | 5 +++-- .../TkNavigation/plugins/NavigationSchoolESProducer.cc | 5 +++-- .../TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc | 6 +++--- .../plugins/SeedFromConsecutiveHitsCreator.cc | 6 +++--- RecoTracker/TrackProducer/interface/TrackProducerBase.icc | 6 +++--- .../plugins/TrackingRecHitPropagatorESProducer.cc | 5 +++-- .../plugins/PropagatorWithMaterialESProducer.cc | 5 +++-- .../Producers/src/AnalyticalPropagatorESProducer.cc | 5 +++-- 9 files changed, 27 insertions(+), 21 deletions(-) diff --git a/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc b/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc index 0c24d7d54c63f..014ecb6c74369 100644 --- a/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc +++ b/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc @@ -123,8 +123,9 @@ namespace cms{ std::string mfName = ""; if (conf_.exists("SimpleMagneticField")) mfName = conf_.getParameter("SimpleMagneticField"); - edm::ESInputTag mfESInputTag(mfName); - es.get().get(mfESInputTag,theMagField ); + es.get().get(mfName,theMagField ); + // edm::ESInputTag mfESInputTag(mfName); + // es.get().get(mfESInputTag,theMagField ); if (!theInitialState){ // constructor uses the EventSetup, it must be in the setEventSetup were it has a proper value. diff --git a/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc b/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc index 8f175a5b88aba..746d52d9c9ee5 100644 --- a/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc +++ b/RecoTracker/TkNavigation/plugins/CfgNavigationSchoolESProducer.cc @@ -10,8 +10,9 @@ NavigationSchoolESProducer::ReturnType CfgNavigationSchoolESProducer::produce(co std::string mfName = ""; if (theNavigationPSet.exists("SimpleMagneticField")) mfName = theNavigationPSet.getParameter("SimpleMagneticField"); - edm::ESInputTag mfESInputTag(mfName); - iRecord.getRecord().get(mfESInputTag,field); + iRecord.getRecord().get(mfName,field); + // edm::ESInputTag mfESInputTag(mfName); + // iRecord.getRecord().get(mfESInputTag,field); //get the geometricsearch tracker geometry edm::ESHandle geometricSearchTracker; diff --git a/RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.cc b/RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.cc index 0f8ad14647cc0..a9a21427a5def 100644 --- a/RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.cc +++ b/RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.cc @@ -42,8 +42,9 @@ NavigationSchoolESProducer::produce(const NavigationSchoolRecord& iRecord) std::string mfName = ""; if (theNavigationPSet.exists("SimpleMagneticField")) mfName = theNavigationPSet.getParameter("SimpleMagneticField"); - edm::ESInputTag mfESInputTag(mfName); - iRecord.getRecord().get(mfESInputTag,field); + iRecord.getRecord().get(mfName,field); + // edm::ESInputTag mfESInputTag(mfName); + // iRecord.getRecord().get(mfESInputTag,field); //get the geometricsearch tracker geometry edm::ESHandle geometricSearchTracker; diff --git a/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc b/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc index 062adb22dd5d7..7ea25cd079d0f 100644 --- a/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc +++ b/RecoTracker/TkSeedGenerator/plugins/MultiHitGeneratorFromChi2.cc @@ -125,9 +125,9 @@ void MultiHitGeneratorFromChi2::hitSets(const TrackingRegion& region, es.get().get(tracker); if (nomField<0 && bfield == 0) { edm::ESHandle bfield_h; - edm::ESInputTag mfESInputTag(mfName_); - // es.get().get(mfName_, bfield_h); - es.get().get(mfESInputTag, bfield_h); + es.get().get(mfName_, bfield_h); + // edm::ESInputTag mfESInputTag(mfName_); + // es.get().get(mfESInputTag, bfield_h); bfield = bfield_h.product(); nomField = bfield->nominalValue(); } diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc b/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc index 639e8f0abaffa..54fe27e1cb144 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsCreator.cc @@ -33,9 +33,9 @@ void SeedFromConsecutiveHitsCreator::init(const TrackingRegion & iregion, // get propagator es.get().get(thePropagatorLabel, propagatorHandle); // mag field - edm::ESInputTag mfESInputTag(mfName_); - // es.get().get(mfName_, bfield); - es.get().get(mfESInputTag, bfield); + es.get().get(mfName_, bfield); + // edm::ESInputTag mfESInputTag(mfName_); + // es.get().get(mfESInputTag, bfield); nomField = bfield->nominalValue(); isBOFF = (0==nomField); } diff --git a/RecoTracker/TrackProducer/interface/TrackProducerBase.icc b/RecoTracker/TrackProducer/interface/TrackProducerBase.icc index 85b0050020cee..6e094433669fc 100644 --- a/RecoTracker/TrackProducer/interface/TrackProducerBase.icc +++ b/RecoTracker/TrackProducer/interface/TrackProducerBase.icc @@ -67,9 +67,9 @@ TrackProducerBase::getFromES(const edm::EventSetup& setup, if (useSimpleMF){ mfName = conf_.getParameter("SimpleMagneticField"); } - edm::ESInputTag mfESInputTag(mfName); - // setup.get().get(mfName, theMF); - setup.get().get(mfESInputTag, theMF); + setup.get().get(mfName, theMF); + // edm::ESInputTag mfESInputTag(mfName); + // setup.get().get(mfESInputTag, theMF); // // get the fitter from the ES diff --git a/TrackingTools/KalmanUpdators/plugins/TrackingRecHitPropagatorESProducer.cc b/TrackingTools/KalmanUpdators/plugins/TrackingRecHitPropagatorESProducer.cc index 46d7a5154e13f..b7ea2ac936a36 100644 --- a/TrackingTools/KalmanUpdators/plugins/TrackingRecHitPropagatorESProducer.cc +++ b/TrackingTools/KalmanUpdators/plugins/TrackingRecHitPropagatorESProducer.cc @@ -26,8 +26,9 @@ TrackingRecHitPropagatorESProducer::produce(const TrackingComponentsRecord& iRec std::string mfName = ""; if (pset_.exists("SimpleMagneticField")) mfName = pset_.getParameter("SimpleMagneticField"); - edm::ESInputTag mfESInputTag(mfName); - iRecord.getRecord().get(mfESInputTag,magfield); + iRecord.getRecord().get(mfName,magfield); + // edm::ESInputTag mfESInputTag(mfName); + // iRecord.getRecord().get(mfESInputTag,magfield); theHitPropagator= boost::shared_ptr(new TrackingRecHitPropagator(magfield.product())); return theHitPropagator; } diff --git a/TrackingTools/MaterialEffects/plugins/PropagatorWithMaterialESProducer.cc b/TrackingTools/MaterialEffects/plugins/PropagatorWithMaterialESProducer.cc index e88a6e8f03e7b..d9cb5937a98fc 100644 --- a/TrackingTools/MaterialEffects/plugins/PropagatorWithMaterialESProducer.cc +++ b/TrackingTools/MaterialEffects/plugins/PropagatorWithMaterialESProducer.cc @@ -42,8 +42,9 @@ PropagatorWithMaterialESProducer::produce(const TrackingComponentsRecord & iReco std::string mfName = ""; if (pset_.exists("SimpleMagneticField")) mfName = pset_.getParameter("SimpleMagneticField"); - edm::ESInputTag mfESInputTag(mfName); - iRecord.getRecord().get(mfESInputTag,magfield); + iRecord.getRecord().get(mfName,magfield); + // edm::ESInputTag mfESInputTag(mfName); + // iRecord.getRecord().get(mfESInputTag,magfield); //fixme check that useRK is false when using SimpleMagneticField PropagationDirection dir = alongMomentum; diff --git a/TrackingTools/Producers/src/AnalyticalPropagatorESProducer.cc b/TrackingTools/Producers/src/AnalyticalPropagatorESProducer.cc index 115d0607514df..e5ae43a844311 100644 --- a/TrackingTools/Producers/src/AnalyticalPropagatorESProducer.cc +++ b/TrackingTools/Producers/src/AnalyticalPropagatorESProducer.cc @@ -32,8 +32,9 @@ AnalyticalPropagatorESProducer::produce(const TrackingComponentsRecord & iRecord std::string mfName = ""; if (pset_.exists("SimpleMagneticField")) mfName = pset_.getParameter("SimpleMagneticField"); - edm::ESInputTag mfESInputTag(mfName); - iRecord.getRecord().get(mfESInputTag,magfield); + iRecord.getRecord().get(mfName,magfield); + // edm::ESInputTag mfESInputTag(mfName); + // iRecord.getRecord().get(mfESInputTag,magfield); std::string pdir = pset_.getParameter("PropagationDirection"); double dphiCut = pset_.getParameter("MaxDPhi");