diff --git a/SimTracker/TrackAssociation/BuildFile.xml b/SimTracker/TrackAssociation/BuildFile.xml
index 02d1515f48a5e..c5221961b06c2 100644
--- a/SimTracker/TrackAssociation/BuildFile.xml
+++ b/SimTracker/TrackAssociation/BuildFile.xml
@@ -2,6 +2,7 @@
+
@@ -10,8 +11,6 @@
-
-
diff --git a/SimTracker/TrackAssociation/interface/CosmicParametersDefinerForTP.h b/SimTracker/TrackAssociation/interface/CosmicParametersDefinerForTP.h
index 04d04da681f7b..f7ebe562c639e 100644
--- a/SimTracker/TrackAssociation/interface/CosmicParametersDefinerForTP.h
+++ b/SimTracker/TrackAssociation/interface/CosmicParametersDefinerForTP.h
@@ -7,6 +7,9 @@
* \author Boris Mangano (UCSD) 5/7/2009
*/
+#include "FWCore/Framework/interface/ConsumesCollector.h"
+#include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
+#include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
#include "SimTracker/TrackAssociation/interface/ParametersDefinerForTP.h"
#include
@@ -14,8 +17,8 @@
class CosmicParametersDefinerForTP : public ParametersDefinerForTP {
public:
- CosmicParametersDefinerForTP(){};
- ~CosmicParametersDefinerForTP() override{};
+ CosmicParametersDefinerForTP(edm::ConsumesCollector iC);
+ ~CosmicParametersDefinerForTP() override;
TrackingParticle::Vector momentum(const edm::Event &iEvent,
const edm::EventSetup &iSetup,
@@ -54,6 +57,7 @@ class CosmicParametersDefinerForTP : public ParametersDefinerForTP {
}
private:
+ const edm::ESGetToken geometryToken_;
edm::Handle simHitsTPAssoc;
};
diff --git a/SimTracker/TrackAssociation/interface/ParametersDefinerForTP.h b/SimTracker/TrackAssociation/interface/ParametersDefinerForTP.h
index 25acef866c87a..ae28eadd8ccf8 100644
--- a/SimTracker/TrackAssociation/interface/ParametersDefinerForTP.h
+++ b/SimTracker/TrackAssociation/interface/ParametersDefinerForTP.h
@@ -9,18 +9,20 @@
#include
+#include "DataFormats/BeamSpot/interface/BeamSpot.h"
#include "DataFormats/Candidate/interface/Candidate.h"
-#include "FWCore/Framework/interface/ESHandle.h"
+#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
+#include "MagneticField/Engine/interface/MagneticField.h"
+#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
#include "SimGeneral/TrackingAnalysis/interface/SimHitTPAssociationProducer.h"
#include
class ParametersDefinerForTP {
public:
- ParametersDefinerForTP(){};
- ParametersDefinerForTP(const edm::ParameterSet &iConfig);
- virtual ~ParametersDefinerForTP(){};
+ ParametersDefinerForTP(const edm::InputTag &beamspot, edm::ConsumesCollector iC);
+ virtual ~ParametersDefinerForTP();
typedef int Charge; ///< electric charge type
typedef math::XYZPointD Point; ///< point in the space
@@ -79,7 +81,9 @@ class ParametersDefinerForTP {
return std::make_unique(*this);
}
- edm::InputTag beamSpotInputTag_;
+protected:
+ const edm::EDGetTokenT bsToken_;
+ const edm::ESGetToken mfToken_;
};
#endif
diff --git a/SimTracker/TrackAssociation/plugins/CosmicParametersDefinerForTPESProducer.cc b/SimTracker/TrackAssociation/plugins/CosmicParametersDefinerForTPESProducer.cc
deleted file mode 100644
index 4f38cca4d9c6c..0000000000000
--- a/SimTracker/TrackAssociation/plugins/CosmicParametersDefinerForTPESProducer.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "FWCore/Framework/interface/ESProducer.h"
-#include "FWCore/ParameterSet/interface/ParameterSet.h"
-#include "SimTracker/Records/interface/TrackAssociatorRecord.h"
-#include "SimTracker/TrackAssociation/plugins/CosmicParametersDefinerForTPESProducer.h"
-
-// system include files
-#include
-
-#include "FWCore/Framework/interface/ESHandle.h"
-#include "FWCore/Framework/interface/ESProducer.h"
-#include "FWCore/Framework/interface/ModuleFactory.h"
-
-#include "FWCore/ParameterSet/interface/ParameterSet.h"
-#include "SimTracker/Records/interface/TrackAssociatorRecord.h"
-
-CosmicParametersDefinerForTPESProducer::CosmicParametersDefinerForTPESProducer(const edm::ParameterSet &iConfig) {
- // the following line is needed to tell the framework what
- // data is being produced
- std::string myName = iConfig.getParameter("ComponentName");
- setWhatProduced(this, myName);
-
- // now do what ever other initialization is needed
- // conf_=iConfig;
-}
-
-CosmicParametersDefinerForTPESProducer::~CosmicParametersDefinerForTPESProducer() {
- // do anything here that needs to be done at desctruction time
- // (e.g. close files, deallocate resources etc.)
-}
-
-//
-// member functions
-//
-
-// ------------ method called to produce the data ------------
-CosmicParametersDefinerForTPESProducer::ReturnType CosmicParametersDefinerForTPESProducer::produce(
- const TrackAssociatorRecord &iRecord) {
- return std::make_unique();
-}
-
-// define this as a plug-in
-DEFINE_FWK_EVENTSETUP_MODULE(CosmicParametersDefinerForTPESProducer);
diff --git a/SimTracker/TrackAssociation/plugins/CosmicParametersDefinerForTPESProducer.h b/SimTracker/TrackAssociation/plugins/CosmicParametersDefinerForTPESProducer.h
deleted file mode 100644
index a97da1c8f435e..0000000000000
--- a/SimTracker/TrackAssociation/plugins/CosmicParametersDefinerForTPESProducer.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef TrackAssociation_CosmicParametersDefinerForTPESProducer_h
-#define TrackAssociation_CosmicParametersDefinerForTPESProducer_h
-
-#include "SimTracker/Records/interface/TrackAssociatorRecord.h"
-#include "SimTracker/TrackAssociation/interface/CosmicParametersDefinerForTP.h"
-
-#include "FWCore/Framework/interface/ESProducer.h"
-#include "FWCore/ParameterSet/interface/ParameterSet.h"
-
-#include
-
-class CosmicParametersDefinerForTPESProducer : public edm::ESProducer {
- typedef std::unique_ptr ReturnType;
-
-public:
- CosmicParametersDefinerForTPESProducer(const edm::ParameterSet &p);
- ~CosmicParametersDefinerForTPESProducer() override;
- std::unique_ptr produce(const TrackAssociatorRecord &);
-};
-
-#endif
diff --git a/SimTracker/TrackAssociation/plugins/ParametersDefinerForTPESProducer.cc b/SimTracker/TrackAssociation/plugins/ParametersDefinerForTPESProducer.cc
deleted file mode 100644
index f2b7fbae166b1..0000000000000
--- a/SimTracker/TrackAssociation/plugins/ParametersDefinerForTPESProducer.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "FWCore/Framework/interface/ESProducer.h"
-#include "FWCore/ParameterSet/interface/ParameterSet.h"
-#include "SimTracker/Records/interface/TrackAssociatorRecord.h"
-#include "SimTracker/TrackAssociation/plugins/ParametersDefinerForTPESProducer.h"
-
-// system include files
-#include
-
-#include "FWCore/Framework/interface/ESHandle.h"
-#include "FWCore/Framework/interface/ESProducer.h"
-#include "FWCore/Framework/interface/ModuleFactory.h"
-
-#include "FWCore/ParameterSet/interface/ParameterSet.h"
-#include "SimTracker/Records/interface/TrackAssociatorRecord.h"
-
-ParametersDefinerForTPESProducer::ParametersDefinerForTPESProducer(const edm::ParameterSet &iConfig) : pset_(iConfig) {
- // the following line is needed to tell the framework what
- // data is being produced
- std::string myName = iConfig.getParameter("ComponentName");
- setWhatProduced(this, myName);
-
- // now do what ever other initialization is needed
- // conf_=iConfig;
-}
-
-ParametersDefinerForTPESProducer::~ParametersDefinerForTPESProducer() {
- // do anything here that needs to be done at desctruction time
- // (e.g. close files, deallocate resources etc.)
-}
-
-//
-// member functions
-//
-
-// ------------ method called to produce the data ------------
-ParametersDefinerForTPESProducer::ReturnType ParametersDefinerForTPESProducer::produce(
- const TrackAssociatorRecord &iRecord) {
- return std::make_unique(pset_);
-}
-
-// define this as a plug-in
-DEFINE_FWK_EVENTSETUP_MODULE(ParametersDefinerForTPESProducer);
diff --git a/SimTracker/TrackAssociation/plugins/ParametersDefinerForTPESProducer.h b/SimTracker/TrackAssociation/plugins/ParametersDefinerForTPESProducer.h
deleted file mode 100644
index 8c3a9ca1e7463..0000000000000
--- a/SimTracker/TrackAssociation/plugins/ParametersDefinerForTPESProducer.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef TrackAssociation_ParametersDefinerForTPESProducer_h
-#define TrackAssociation_ParametersDefinerForTPESProducer_h
-
-#include "SimTracker/Records/interface/TrackAssociatorRecord.h"
-#include "SimTracker/TrackAssociation/interface/ParametersDefinerForTP.h"
-
-#include "FWCore/Framework/interface/ESProducer.h"
-#include "FWCore/ParameterSet/interface/ParameterSet.h"
-
-#include
-
-class ParametersDefinerForTPESProducer : public edm::ESProducer {
- typedef std::unique_ptr ReturnType;
-
-public:
- ParametersDefinerForTPESProducer(const edm::ParameterSet &p);
- ~ParametersDefinerForTPESProducer() override;
- std::unique_ptr produce(const TrackAssociatorRecord &);
-
- edm::ParameterSet pset_;
-};
-
-#endif
diff --git a/SimTracker/TrackAssociation/python/CosmicParametersDefinerForTP_cfi.py b/SimTracker/TrackAssociation/python/CosmicParametersDefinerForTP_cfi.py
deleted file mode 100644
index 14a9cc14e62a5..0000000000000
--- a/SimTracker/TrackAssociation/python/CosmicParametersDefinerForTP_cfi.py
+++ /dev/null
@@ -1,5 +0,0 @@
-import FWCore.ParameterSet.Config as cms
-
-CosmicParametersDefinerForTP = cms.ESProducer("CosmicParametersDefinerForTPESProducer",
-ComponentName = cms.string('CosmicParametersDefinerForTP')
-)
diff --git a/SimTracker/TrackAssociation/python/LhcParametersDefinerForTP_cfi.py b/SimTracker/TrackAssociation/python/LhcParametersDefinerForTP_cfi.py
deleted file mode 100644
index c294d39b79ab4..0000000000000
--- a/SimTracker/TrackAssociation/python/LhcParametersDefinerForTP_cfi.py
+++ /dev/null
@@ -1,6 +0,0 @@
-import FWCore.ParameterSet.Config as cms
-
-LhcParametersDefinerForTP = cms.ESProducer("ParametersDefinerForTPESProducer",
- ComponentName = cms.string('LhcParametersDefinerForTP'),
- beamSpot = cms.untracked.InputTag('offlineBeamSpot')
-)
diff --git a/SimTracker/TrackAssociation/src/CosmicParametersDefinerForTP.cc b/SimTracker/TrackAssociation/src/CosmicParametersDefinerForTP.cc
index a9db15efa708e..7477ff205906e 100644
--- a/SimTracker/TrackAssociation/src/CosmicParametersDefinerForTP.cc
+++ b/SimTracker/TrackAssociation/src/CosmicParametersDefinerForTP.cc
@@ -2,24 +2,20 @@
#include "DataFormats/GeometryVector/interface/GlobalVector.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
-#include "FWCore/Utilities/interface/typelookup.h"
-#include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
-#include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
-#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
-#include "MagneticField/Engine/interface/MagneticField.h"
-#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
#include "SimTracker/TrackAssociation/interface/CosmicParametersDefinerForTP.h"
#include "TrackingTools/PatternTools/interface/TSCBLBuilderNoMaterial.h"
#include "TrackingTools/PatternTools/interface/TSCPBuilderNoMaterial.h"
#include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
#include
#include
-#include
#include
-#include
class TrajectoryStateClosestToBeamLineBuilder;
+CosmicParametersDefinerForTP::CosmicParametersDefinerForTP(edm::ConsumesCollector iC)
+ : ParametersDefinerForTP(edm::InputTag("offlineBeamSpot"), iC), geometryToken_(iC.esConsumes()) {}
+CosmicParametersDefinerForTP::~CosmicParametersDefinerForTP() = default;
+
TrackingParticle::Vector CosmicParametersDefinerForTP::momentum(const edm::Event &iEvent,
const edm::EventSetup &iSetup,
const TrackingParticleRef &tpr) const {
@@ -29,16 +25,9 @@ TrackingParticle::Vector CosmicParametersDefinerForTP::momentum(const edm::Event
using namespace std;
using namespace reco;
- ESHandle tracker;
- iSetup.get().get(tracker);
- edm::ESHandle theGeometry;
- iSetup.get().get(theGeometry);
-
- edm::ESHandle theMF;
- iSetup.get().get(theMF);
-
- edm::Handle bs;
- iEvent.getByLabel(InputTag("offlineBeamSpot"), bs);
+ auto const &bs = iEvent.get(bsToken_);
+ auto const &geometry = iSetup.getData(geometryToken_);
+ auto const &mf = iSetup.getData(mfToken_);
GlobalVector finalGV(0, 0, 0);
GlobalPoint finalGP(0, 0, 0);
@@ -64,7 +53,7 @@ TrackingParticle::Vector CosmicParametersDefinerForTP::momentum(const edm::Event
SimHitTPAssociationProducer::simHitTPAssociationListGreater);
for (auto ip = range.first; ip != range.second; ++ip) {
TrackPSimHitRef it = ip->second;
- const GeomDet *tmpDet = theGeometry->idToDet(DetId(it->detUnitId()));
+ const GeomDet *tmpDet = geometry.idToDet(DetId(it->detUnitId()));
if (!tmpDet) {
edm::LogVerbatim("CosmicParametersDefinerForTP")
<< "***WARNING in CosmicParametersDefinerForTP::momentum: no GeomDet "
@@ -98,10 +87,10 @@ TrackingParticle::Vector CosmicParametersDefinerForTP::momentum(const edm::Event
<< "\t \t FINAL State at InnerMost Hit: pt = " << finalGV.perp() << ", pz = " << finalGV.z();
if (found) {
- FreeTrajectoryState ftsAtProduction(finalGP, finalGV, TrackCharge(tpr->charge()), theMF.product());
+ FreeTrajectoryState ftsAtProduction(finalGP, finalGV, TrackCharge(tpr->charge()), &mf);
TSCBLBuilderNoMaterial tscblBuilder;
TrajectoryStateClosestToBeamLine tsAtClosestApproach =
- tscblBuilder(ftsAtProduction, *bs); // as in TrackProducerAlgorithm
+ tscblBuilder(ftsAtProduction, bs); // as in TrackProducerAlgorithm
if (tsAtClosestApproach.isValid()) {
GlobalVector p = tsAtClosestApproach.trackStateAtPCA().momentum();
@@ -135,16 +124,9 @@ TrackingParticle::Point CosmicParametersDefinerForTP::vertex(const edm::Event &i
using namespace std;
using namespace reco;
- ESHandle tracker;
- iSetup.get().get(tracker);
- edm::ESHandle theGeometry;
- iSetup.get().get(theGeometry);
-
- edm::ESHandle theMF;
- iSetup.get().get(theMF);
-
- edm::Handle bs;
- iEvent.getByLabel(InputTag("offlineBeamSpot"), bs);
+ auto const &bs = iEvent.get(bsToken_);
+ auto const &geometry = iSetup.getData(geometryToken_);
+ auto const &mf = iSetup.getData(mfToken_);
GlobalVector finalGV(0, 0, 0);
GlobalPoint finalGP(0, 0, 0);
@@ -172,7 +154,7 @@ TrackingParticle::Point CosmicParametersDefinerForTP::vertex(const edm::Event &i
SimHitTPAssociationProducer::simHitTPAssociationListGreater);
for (auto ip = range.first; ip != range.second; ++ip) {
TrackPSimHitRef it = ip->second;
- const GeomDet *tmpDet = theGeometry->idToDet(DetId(it->detUnitId()));
+ const GeomDet *tmpDet = geometry.idToDet(DetId(it->detUnitId()));
if (!tmpDet) {
edm::LogVerbatim("CosmicParametersDefinerForTP")
<< "***WARNING in CosmicParametersDefinerForTP::vertex: no GeomDet "
@@ -202,10 +184,10 @@ TrackingParticle::Point CosmicParametersDefinerForTP::vertex(const edm::Event &i
<< "\t \t FINAL State at InnerMost Hit: radius = " << finalGP.perp() << ", z = " << finalGP.z();
if (found) {
- FreeTrajectoryState ftsAtProduction(finalGP, finalGV, TrackCharge(tpr->charge()), theMF.product());
+ FreeTrajectoryState ftsAtProduction(finalGP, finalGV, TrackCharge(tpr->charge()), &mf);
TSCBLBuilderNoMaterial tscblBuilder;
TrajectoryStateClosestToBeamLine tsAtClosestApproach =
- tscblBuilder(ftsAtProduction, *bs); // as in TrackProducerAlgorithm
+ tscblBuilder(ftsAtProduction, bs); // as in TrackProducerAlgorithm
if (tsAtClosestApproach.isValid()) {
GlobalPoint v = tsAtClosestApproach.trackStateAtPCA().position();
@@ -213,7 +195,7 @@ TrackingParticle::Point CosmicParametersDefinerForTP::vertex(const edm::Event &i
} else {
// to preserve old behaviour
// would be better to flag this somehow to allow ignoring in downstream
- vertex = TrackingParticle::Point(bs->x0(), bs->y0(), bs->z0());
+ vertex = TrackingParticle::Point(bs.x0(), bs.y0(), bs.z0());
edm::LogVerbatim("CosmicParametersDefinerForTP") << "*** WARNING in CosmicParametersDefinerForTP::vertex: "
"tsAtClosestApproach is not valid."
<< "\n";
@@ -234,5 +216,3 @@ TrackingParticle::Point CosmicParametersDefinerForTP::vertex(const edm::Event &i
return vertex;
}
-
-TYPELOOKUP_DATA_REG(CosmicParametersDefinerForTP);
diff --git a/SimTracker/TrackAssociation/src/ParametersDefinerForTP.cc b/SimTracker/TrackAssociation/src/ParametersDefinerForTP.cc
index f6db59790e482..08f87e3dc8b87 100644
--- a/SimTracker/TrackAssociation/src/ParametersDefinerForTP.cc
+++ b/SimTracker/TrackAssociation/src/ParametersDefinerForTP.cc
@@ -1,7 +1,6 @@
#include "DataFormats/GeometryVector/interface/GlobalPoint.h"
#include "DataFormats/GeometryVector/interface/GlobalVector.h"
#include "FWCore/Framework/interface/Event.h"
-#include "FWCore/Utilities/interface/typelookup.h"
#include "MagneticField/Engine/interface/MagneticField.h"
#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
#include "SimTracker/TrackAssociation/interface/ParametersDefinerForTP.h"
@@ -11,8 +10,10 @@
#include
class TrajectoryStateClosestToBeamLineBuilder;
-ParametersDefinerForTP::ParametersDefinerForTP(const edm::ParameterSet &iConfig)
- : beamSpotInputTag_(iConfig.getUntrackedParameter("beamSpot", edm::InputTag("offlineBeamSpot"))) {}
+ParametersDefinerForTP::ParametersDefinerForTP(const edm::InputTag &beamspot, edm::ConsumesCollector iC)
+ : bsToken_(iC.consumes(beamspot)), mfToken_(iC.esConsumes()) {}
+
+ParametersDefinerForTP::~ParametersDefinerForTP() = default;
TrackingParticle::Vector ParametersDefinerForTP::momentum(const edm::Event &iEvent,
const edm::EventSetup &iSetup,
@@ -24,22 +25,17 @@ TrackingParticle::Vector ParametersDefinerForTP::momentum(const edm::Event &iEve
using namespace edm;
- edm::ESHandle theMF;
- iSetup.get().get(theMF);
-
- edm::Handle bs;
- iEvent.getByLabel(beamSpotInputTag_, bs);
+ auto const &bs = iEvent.get(bsToken_);
+ auto const &mf = iSetup.getData(mfToken_);
TrackingParticle::Vector momentum(0, 0, 0);
- FreeTrajectoryState ftsAtProduction(GlobalPoint(vtx.x(), vtx.y(), vtx.z()),
- GlobalVector(lv.x(), lv.y(), lv.z()),
- TrackCharge(charge),
- theMF.product());
+ FreeTrajectoryState ftsAtProduction(
+ GlobalPoint(vtx.x(), vtx.y(), vtx.z()), GlobalVector(lv.x(), lv.y(), lv.z()), TrackCharge(charge), &mf);
TSCBLBuilderNoMaterial tscblBuilder;
TrajectoryStateClosestToBeamLine tsAtClosestApproach =
- tscblBuilder(ftsAtProduction, *bs); // as in TrackProducerAlgorithm
+ tscblBuilder(ftsAtProduction, bs); // as in TrackProducerAlgorithm
if (tsAtClosestApproach.isValid()) {
GlobalVector p = tsAtClosestApproach.trackStateAtPCA().momentum();
momentum = TrackingParticle::Vector(p.x(), p.y(), p.z());
@@ -56,29 +52,24 @@ TrackingParticle::Point ParametersDefinerForTP::vertex(const edm::Event &iEvent,
// the base class:
using namespace edm;
- edm::ESHandle theMF;
- iSetup.get().get(theMF);
-
- edm::Handle bs;
- iEvent.getByLabel(beamSpotInputTag_, bs);
+ auto const &bs = iEvent.get(bsToken_);
+ auto const &mf = iSetup.getData(mfToken_);
TrackingParticle::Point vertex(0, 0, 0);
- FreeTrajectoryState ftsAtProduction(GlobalPoint(vtx.x(), vtx.y(), vtx.z()),
- GlobalVector(lv.x(), lv.y(), lv.z()),
- TrackCharge(charge),
- theMF.product());
+ FreeTrajectoryState ftsAtProduction(
+ GlobalPoint(vtx.x(), vtx.y(), vtx.z()), GlobalVector(lv.x(), lv.y(), lv.z()), TrackCharge(charge), &mf);
TSCBLBuilderNoMaterial tscblBuilder;
TrajectoryStateClosestToBeamLine tsAtClosestApproach =
- tscblBuilder(ftsAtProduction, *bs); // as in TrackProducerAlgorithm
+ tscblBuilder(ftsAtProduction, bs); // as in TrackProducerAlgorithm
if (tsAtClosestApproach.isValid()) {
GlobalPoint v = tsAtClosestApproach.trackStateAtPCA().position();
vertex = TrackingParticle::Point(v.x(), v.y(), v.z());
} else {
// to preserve old behaviour
// would be better to flag this somehow to allow ignoring in downstream
- vertex = TrackingParticle::Point(bs->x0(), bs->y0(), bs->z0());
+ vertex = TrackingParticle::Point(bs.x0(), bs.y0(), bs.z0());
}
return vertex;
}
@@ -91,23 +82,18 @@ std::tuple ParametersDefinerF
const LorentzVector &lv) const {
using namespace edm;
- edm::ESHandle theMF;
- iSetup.get().get(theMF);
+ auto const &bs = iEvent.get(bsToken_);
+ auto const &mf = iSetup.getData(mfToken_);
- edm::Handle bs;
- iEvent.getByLabel(beamSpotInputTag_, bs);
-
- TrackingParticle::Point vertex(bs->x0(), bs->y0(), bs->z0());
+ TrackingParticle::Point vertex(bs.x0(), bs.y0(), bs.z0());
TrackingParticle::Vector momentum(0, 0, 0);
- FreeTrajectoryState ftsAtProduction(GlobalPoint(vtx.x(), vtx.y(), vtx.z()),
- GlobalVector(lv.x(), lv.y(), lv.z()),
- TrackCharge(charge),
- theMF.product());
+ FreeTrajectoryState ftsAtProduction(
+ GlobalPoint(vtx.x(), vtx.y(), vtx.z()), GlobalVector(lv.x(), lv.y(), lv.z()), TrackCharge(charge), &mf);
TSCBLBuilderNoMaterial tscblBuilder;
TrajectoryStateClosestToBeamLine tsAtClosestApproach =
- tscblBuilder(ftsAtProduction, *bs); // as in TrackProducerAlgorithm
+ tscblBuilder(ftsAtProduction, bs); // as in TrackProducerAlgorithm
if (tsAtClosestApproach.isValid()) {
GlobalPoint v = tsAtClosestApproach.trackStateAtPCA().position();
vertex = TrackingParticle::Point(v.x(), v.y(), v.z());
@@ -118,5 +104,3 @@ std::tuple ParametersDefinerF
return std::make_tuple(momentum, vertex);
}
-
-TYPELOOKUP_DATA_REG(ParametersDefinerForTP);
diff --git a/Validation/RecoMuon/plugins/MuonTrackValidator.cc b/Validation/RecoMuon/plugins/MuonTrackValidator.cc
index b5dc020838ff1..a97faafe11f35 100644
--- a/Validation/RecoMuon/plugins/MuonTrackValidator.cc
+++ b/Validation/RecoMuon/plugins/MuonTrackValidator.cc
@@ -8,7 +8,6 @@
#include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h"
#include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h"
-#include "SimTracker/Records/interface/TrackAssociatorRecord.h"
#include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
#include "TrackingTools/PatternTools/interface/TSCBLBuilderNoMaterial.h"
#include "SimTracker/TrackAssociation/interface/TrackingParticleIP.h"
@@ -367,13 +366,7 @@ void MuonTrackValidator::analyze(const edm::Event& event, const edm::EventSetup&
edm::Handle > puinfoH;
int PU_NumInteractions(-1);
- edm::ESHandle Lhc_parametersDefinerTP;
- edm::ESHandle _Cosmic_parametersDefinerTP;
- std::unique_ptr Cosmic_parametersDefinerTP;
-
if (parametersDefiner == "LhcParametersDefinerForTP") {
- Lhc_parametersDefinerTP = setup.getHandle(tpDefinerEsToken);
-
// PileupSummaryInfo is contained only in collision events
event.getByToken(pileupinfo_Token, puinfoH);
for (std::vector::const_iterator puInfoIt = puinfoH->begin(); puInfoIt != puinfoH->end();
@@ -385,20 +378,11 @@ void MuonTrackValidator::analyze(const edm::Event& event, const edm::EventSetup&
}
} else if (parametersDefiner == "CosmicParametersDefinerForTP") {
- //setup.get().get(parametersDefiner, _Cosmic_parametersDefinerTP);
- _Cosmic_parametersDefinerTP = setup.getHandle(cosmictpDefinerEsToken);
-
- //Since we modify the object, we must clone it
- Cosmic_parametersDefinerTP = _Cosmic_parametersDefinerTP->clone();
-
edm::Handle simHitsTPAssoc;
//warning: make sure the TP collection used in the map is the same used here
event.getByToken(_simHitTpMapTag, simHitsTPAssoc);
- Cosmic_parametersDefinerTP->initEvent(simHitsTPAssoc);
+ cosmicParametersDefinerTP_->initEvent(simHitsTPAssoc);
cosmictpSelector.initEvent(simHitsTPAssoc);
- } else {
- edm::LogError("MuonTrackValidator") << "Unexpected label: parametersDefiner = " << parametersDefiner.c_str()
- << "\n";
}
TrackingParticleRefVector TPrefV;
@@ -512,8 +496,8 @@ void MuonTrackValidator::analyze(const edm::Event& event, const edm::EventSetup&
continue;
momentumTP = tp.momentum();
vertexTP = tp.vertex();
- TrackingParticle::Vector momentum = Lhc_parametersDefinerTP->momentum(event, setup, tpr);
- TrackingParticle::Point vertex = Lhc_parametersDefinerTP->vertex(event, setup, tpr);
+ TrackingParticle::Vector momentum = lhcParametersDefinerTP_->momentum(event, setup, tpr);
+ TrackingParticle::Point vertex = lhcParametersDefinerTP_->vertex(event, setup, tpr);
dxySim = TrackingParticleIP::dxy(vertex, momentum, bs.position());
dzSim = TrackingParticleIP::dz(vertex, momentum, bs.position());
}
@@ -522,8 +506,8 @@ void MuonTrackValidator::analyze(const edm::Event& event, const edm::EventSetup&
edm::LogVerbatim("MuonTrackValidator") << "TrackingParticle " << i;
if (!cosmictpSelector(tpr, &bs, event, setup))
continue;
- momentumTP = Cosmic_parametersDefinerTP->momentum(event, setup, tpr);
- vertexTP = Cosmic_parametersDefinerTP->vertex(event, setup, tpr);
+ momentumTP = cosmicParametersDefinerTP_->momentum(event, setup, tpr);
+ vertexTP = cosmicParametersDefinerTP_->vertex(event, setup, tpr);
dxySim = TrackingParticleIP::dxy(vertexTP, momentumTP, bs.position());
dzSim = TrackingParticleIP::dz(vertexTP, momentumTP, bs.position());
}
@@ -794,16 +778,16 @@ void MuonTrackValidator::analyze(const edm::Event& event, const edm::EventSetup&
if (!(Track_is_matched && tpSelector(*tpp)))
continue;
else {
- momentumTP = Lhc_parametersDefinerTP->momentum(event, setup, tpr);
- vertexTP = Lhc_parametersDefinerTP->vertex(event, setup, tpr);
+ momentumTP = lhcParametersDefinerTP_->momentum(event, setup, tpr);
+ vertexTP = lhcParametersDefinerTP_->vertex(event, setup, tpr);
}
} else if (parametersDefiner == "CosmicParametersDefinerForTP") {
// following reco plots are made only from tracks associated to selected signal TPs
if (!(Track_is_matched && cosmictpSelector(tpr, &bs, event, setup)))
continue;
else {
- momentumTP = Cosmic_parametersDefinerTP->momentum(event, setup, tpr);
- vertexTP = Cosmic_parametersDefinerTP->vertex(event, setup, tpr);
+ momentumTP = cosmicParametersDefinerTP_->momentum(event, setup, tpr);
+ vertexTP = cosmicParametersDefinerTP_->vertex(event, setup, tpr);
}
}
diff --git a/Validation/RecoMuon/plugins/MuonTrackValidator.h b/Validation/RecoMuon/plugins/MuonTrackValidator.h
index c4d2693cd1d30..a8a43bf300d03 100644
--- a/Validation/RecoMuon/plugins/MuonTrackValidator.h
+++ b/Validation/RecoMuon/plugins/MuonTrackValidator.h
@@ -26,12 +26,7 @@
class MuonTrackValidator : public DQMEDAnalyzer, protected MuonTrackValidatorBase {
public:
/// Constructor
- MuonTrackValidator(const edm::ParameterSet& pset)
- : MuonTrackValidatorBase(pset),
- tpDefinerEsToken(
- esConsumes(edm::ESInputTag("", parametersDefiner))),
- cosmictpDefinerEsToken(
- esConsumes(edm::ESInputTag("", parametersDefiner))) {
+ MuonTrackValidator(const edm::ParameterSet& pset) : MuonTrackValidatorBase(pset) {
dirName_ = pset.getParameter("dirName");
associatormap = pset.getParameter("associatormap");
UseAssociators = pset.getParameter("UseAssociators");
@@ -78,6 +73,14 @@ class MuonTrackValidator : public DQMEDAnalyzer, protected MuonTrackValidatorBas
simToRecoCollection_Token = consumes(associatormap);
recoToSimCollection_Token = consumes(associatormap);
+ if (parametersDefiner == "LhcParametersDefinerForTP") {
+ lhcParametersDefinerTP_ = std::make_unique(bsSrc, consumesCollector());
+ } else if (parametersDefiner == "CosmicParametersDefinerForTP") {
+ cosmicParametersDefinerTP_ = std::make_unique(consumesCollector());
+ } else {
+ throw cms::Exception("Configuration") << "Unexpected label: parametersDefiner = " << parametersDefiner;
+ }
+
_simHitTpMapTag = mayConsume(
pset.getParameter("simHitTpMapTag"));
@@ -167,8 +170,8 @@ class MuonTrackValidator : public DQMEDAnalyzer, protected MuonTrackValidatorBas
edm::EDGetTokenT recoToSimCollection_Token;
edm::EDGetTokenT _simHitTpMapTag;
- const edm::ESGetToken tpDefinerEsToken;
- const edm::ESGetToken cosmictpDefinerEsToken;
+ std::unique_ptr lhcParametersDefinerTP_;
+ std::unique_ptr cosmicParametersDefinerTP_;
bool UseAssociators;
bool useGEMs_;
diff --git a/Validation/RecoMuon/python/MuonTrackValidator_cfi.py b/Validation/RecoMuon/python/MuonTrackValidator_cfi.py
index 4785a51f4cb74..9a5cffece8e4d 100644
--- a/Validation/RecoMuon/python/MuonTrackValidator_cfi.py
+++ b/Validation/RecoMuon/python/MuonTrackValidator_cfi.py
@@ -1,7 +1,5 @@
import FWCore.ParameterSet.Config as cms
-from SimTracker.TrackAssociation.LhcParametersDefinerForTP_cfi import *
-from SimTracker.TrackAssociation.CosmicParametersDefinerForTP_cfi import *
from Validation.RecoMuon.selectors_cff import *
from Validation.RecoMuon.histoParameters_cff import *
diff --git a/Validation/RecoMuon/python/muonValidation_cff.py b/Validation/RecoMuon/python/muonValidation_cff.py
index 315e6b118c09c..b3f715e0fcb26 100644
--- a/Validation/RecoMuon/python/muonValidation_cff.py
+++ b/Validation/RecoMuon/python/muonValidation_cff.py
@@ -8,9 +8,6 @@
from Validation.RecoMuon.associators_cff import *
from Validation.RecoMuon.histoParameters_cff import *
-from SimTracker.TrackAssociation.LhcParametersDefinerForTP_cfi import *
-from SimTracker.TrackAssociation.CosmicParametersDefinerForTP_cfi import *
-
from Validation.RecoMuon.RecoMuonValidator_cff import *
import Validation.RecoMuon.MuonTrackValidator_cfi
diff --git a/Validation/RecoMuon/python/tabp_muonValidation_cff.py b/Validation/RecoMuon/python/tabp_muonValidation_cff.py
index 24dc0a8bacfab..bb284dbd10295 100644
--- a/Validation/RecoMuon/python/tabp_muonValidation_cff.py
+++ b/Validation/RecoMuon/python/tabp_muonValidation_cff.py
@@ -7,9 +7,6 @@
from Validation.RecoMuon.associators_cff import *
import Validation.RecoMuon.MuonTrackValidator_cfi
-from SimTracker.TrackAssociation.LhcParametersDefinerForTP_cfi import *
-from SimTracker.TrackAssociation.CosmicParametersDefinerForTP_cfi import *
-
trkMuonTrackVTrackAssoc = Validation.RecoMuon.MuonTrackValidator_cfi.muonTrackValidator.clone()
trkMuonTrackVTrackAssoc.associatormap = 'tpToTkmuTrackAssociation'
trkMuonTrackVTrackAssoc.associators = ('trackAssociatorByHits',)
diff --git a/Validation/RecoTrack/interface/MultiTrackValidator.h b/Validation/RecoTrack/interface/MultiTrackValidator.h
index 607ae67e7b90a..af85f02708fe6 100644
--- a/Validation/RecoTrack/interface/MultiTrackValidator.h
+++ b/Validation/RecoTrack/interface/MultiTrackValidator.h
@@ -20,7 +20,6 @@
#include "CommonTools/RecoAlgos/interface/CosmicTrackingParticleSelector.h"
#include "SimTracker/Common/interface/TrackingParticleSelector.h"
#include "CommonTools/RecoAlgos/interface/RecoTrackSelectorBase.h"
-#include "SimTracker/Records/interface/TrackAssociatorRecord.h"
#include "SimTracker/TrackAssociation/interface/ParametersDefinerForTP.h"
#include "CommonTools/Utils/interface/DynArray.h"
#include "DataFormats/Common/interface/ValueMap.h"
@@ -56,8 +55,7 @@ class MultiTrackValidator : public DQMGlobalEDAnalyzer tTopoEsToken;
- std::string parametersDefiner;
- const edm::ESGetToken tpDefinerEsToken;
+ std::unique_ptr parametersDefinerTP_;
const bool parametersDefinerIsCosmic_;
//these are used by MTVGenPs
@@ -104,7 +102,6 @@ class MultiTrackValidator : public DQMGlobalEDAnalyzer("parametersDefiner")),
- tpDefinerEsToken(esConsumes(edm::ESInputTag("", parametersDefiner))),
- parametersDefinerIsCosmic_(parametersDefiner == "CosmicParametersDefinerForTP"),
+ parametersDefinerIsCosmic_(pset.getParameter("parametersDefiner") == "CosmicParametersDefinerForTP"),
associators(pset.getUntrackedParameter>("associators")),
label(pset.getParameter>("label")),
ignoremissingtkcollection_(pset.getUntrackedParameter("ignoremissingtrackcollection", false)),
@@ -116,6 +115,12 @@ MultiTrackValidator::MultiTrackValidator(const edm::ParameterSet& pset)
edm::InputTag beamSpotTag = pset.getParameter("beamSpot");
bsSrc = consumes(beamSpotTag);
+ if (parametersDefinerIsCosmic_) {
+ parametersDefinerTP_ = std::make_unique(consumesCollector());
+ } else {
+ parametersDefinerTP_ = std::make_unique(beamSpotTag, consumesCollector());
+ }
+
ParameterSet psetForHistoProducerAlgo = pset.getParameter("histoProducerAlgoBlock");
histoProducerAlgo_ = std::make_unique(psetForHistoProducerAlgo, doSeedPlots_);
@@ -418,7 +423,6 @@ const reco::Vertex::Point* MultiTrackValidator::getRecoPVPosition(
void MultiTrackValidator::tpParametersAndSelection(
const Histograms& histograms,
const TrackingParticleRefVector& tPCeff,
- const ParametersDefinerForTP& parametersDefinerTP,
const edm::Event& event,
const edm::EventSetup& setup,
const reco::BeamSpot& bs,
@@ -431,7 +435,7 @@ void MultiTrackValidator::tpParametersAndSelection(
for (size_t j = 0; j < tPCeff.size(); ++j) {
const TrackingParticleRef& tpr = tPCeff[j];
- auto const& rec = parametersDefinerTP.momentumAndVertex(event, setup, tpr);
+ auto const& rec = parametersDefinerTP_->momentumAndVertex(event, setup, tpr);
TrackingParticle::Vector const& momentum = std::get<0>(rec);
TrackingParticle::Point const& vertex = std::get<1>(rec);
if (doSimPlots_) {
@@ -464,7 +468,7 @@ void MultiTrackValidator::tpParametersAndSelection(
if (tpSelector(tp)) {
selected_tPCeff.push_back(j);
- momVert_tPCeff.emplace_back(parametersDefinerTP.momentumAndVertex(event, setup, tpr));
+ momVert_tPCeff.emplace_back(parametersDefinerTP_->momentumAndVertex(event, setup, tpr));
}
++j;
}
@@ -587,10 +591,6 @@ void MultiTrackValidator::dqmAnalyze(const edm::Event& event,
<< "====================================================\n"
<< "\n";
- const auto& parametersDefinerTPHandle = setup.getHandle(tpDefinerEsToken);
- //Since we modify the object, we must clone it
- auto parametersDefinerTP = parametersDefinerTPHandle->clone();
-
const TrackerTopology& ttopo = setup.getData(tTopoEsToken);
// FIXME: we really need to move to edm::View for reading the
@@ -641,7 +641,7 @@ void MultiTrackValidator::dqmAnalyze(const edm::Event& event,
edm::Handle simHitsTPAssoc;
//warning: make sure the TP collection used in the map is the same used in the MTV!
event.getByToken(_simHitTpMapTag, simHitsTPAssoc);
- parametersDefinerTP->initEvent(simHitsTPAssoc);
+ parametersDefinerTP_->initEvent(simHitsTPAssoc);
cosmictpSelector.initEvent(simHitsTPAssoc);
}
@@ -717,7 +717,7 @@ void MultiTrackValidator::dqmAnalyze(const edm::Event& event,
// for "efficiency" TPs.
std::vector selected_tPCeff;
std::vector> momVert_tPCeff;
- tpParametersAndSelection(histograms, tPCeff, *parametersDefinerTP, event, setup, bs, momVert_tPCeff, selected_tPCeff);
+ tpParametersAndSelection(histograms, tPCeff, event, setup, bs, momVert_tPCeff, selected_tPCeff);
//calculate dR for TPs
declareDynArray(float, tPCeff.size(), dR_tPCeff);
@@ -1165,8 +1165,8 @@ void MultiTrackValidator::dqmAnalyze(const edm::Event& event,
if (doResolutionPlots_[www]) {
//Get tracking particle parameters at point of closest approach to the beamline
TrackingParticleRef tpr = tpFound->val.begin()->first;
- TrackingParticle::Vector momentumTP = parametersDefinerTP->momentum(event, setup, tpr);
- TrackingParticle::Point vertexTP = parametersDefinerTP->vertex(event, setup, tpr);
+ TrackingParticle::Vector momentumTP = parametersDefinerTP_->momentum(event, setup, tpr);
+ TrackingParticle::Point vertexTP = parametersDefinerTP_->vertex(event, setup, tpr);
int chargeTP = tpr->charge();
histoProducerAlgo_->fill_ResoAndPull_recoTrack_histos(
diff --git a/Validation/RecoTrack/plugins/MultiTrackValidatorGenPs.cc b/Validation/RecoTrack/plugins/MultiTrackValidatorGenPs.cc
index b3948d9b8c0b4..5bf7d80e0b0e5 100644
--- a/Validation/RecoTrack/plugins/MultiTrackValidatorGenPs.cc
+++ b/Validation/RecoTrack/plugins/MultiTrackValidatorGenPs.cc
@@ -72,7 +72,6 @@ void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event,
<< "====================================================\n"
<< "\n";
- const auto& parametersDefinerTP = &setup.getData(tpDefinerEsToken);
const TrackerTopology& ttopo = setup.getData(tTopoEsToken);
edm::Handle TPCollectionHeff;
@@ -199,8 +198,8 @@ void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event,
momentumTP = tp->momentum();
vertexTP = tp->vertex();
//Calcualte the impact parameters w.r.t. PCA
- TrackingParticle::Vector momentum = parametersDefinerTP->momentum(event, setup, *tp);
- TrackingParticle::Point vertex = parametersDefinerTP->vertex(event, setup, *tp);
+ TrackingParticle::Vector momentum = parametersDefinerTP_->momentum(event, setup, *tp);
+ TrackingParticle::Point vertex = parametersDefinerTP_->vertex(event, setup, *tp);
dxyGen = (-vertex.x() * sin(momentum.phi()) + vertex.y() * cos(momentum.phi()));
dzGen = vertex.z() - (vertex.x() * momentum.x() + vertex.y() * momentum.y()) / sqrt(momentum.perp2()) *
momentum.z() / sqrt(momentum.perp2());
@@ -208,8 +207,8 @@ void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event,
//If the GenParticle is comics, get the momentum and vertex at PCA
else {
//if(! cosmictpSelector(*tp,&bs,event,setup)) continue;
- momentumTP = parametersDefinerTP->momentum(event, setup, *tp);
- vertexTP = parametersDefinerTP->vertex(event, setup, *tp);
+ momentumTP = parametersDefinerTP_->momentum(event, setup, *tp);
+ vertexTP = parametersDefinerTP_->vertex(event, setup, *tp);
dxyGen = (-vertexTP.x() * sin(momentumTP.phi()) + vertexTP.y() * cos(momentumTP.phi()));
dzGen = vertexTP.z() - (vertexTP.x() * momentumTP.x() + vertexTP.y() * momentumTP.y()) /
sqrt(momentumTP.perp2()) * momentumTP.z() / sqrt(momentumTP.perp2());
@@ -385,8 +384,8 @@ void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event,
*/
//Get tracking particle parameters at point of closest approach to the beamline
- TrackingParticle::Vector momentumTP = parametersDefinerTP->momentum(event, setup, *(tpr.get()));
- TrackingParticle::Point vertexTP = parametersDefinerTP->vertex(event, setup, *(tpr.get()));
+ TrackingParticle::Vector momentumTP = parametersDefinerTP_->momentum(event, setup, *(tpr.get()));
+ TrackingParticle::Point vertexTP = parametersDefinerTP_->vertex(event, setup, *(tpr.get()));
int chargeTP = tpr->charge();
histoProducerAlgo_->fill_ResoAndPull_recoTrack_histos(
diff --git a/Validation/RecoTrack/plugins/TrackingNtuple.cc b/Validation/RecoTrack/plugins/TrackingNtuple.cc
index c63c095ea321a..237ae41e31ec0 100644
--- a/Validation/RecoTrack/plugins/TrackingNtuple.cc
+++ b/Validation/RecoTrack/plugins/TrackingNtuple.cc
@@ -637,7 +637,6 @@ class TrackingNtuple : public edm::one::EDAnalyzer {
const edm::ESGetToken ttrhToken_;
const edm::ESGetToken tTopoToken_;
const edm::ESGetToken tGeomToken_;
- const edm::ESGetToken paramsDefineToken_;
std::vector>> seedTokens_;
std::vector>> seedStopInfoTokens_;
@@ -669,7 +668,6 @@ class TrackingNtuple : public edm::one::EDAnalyzer {
std::vector>> stripUseMaskTokens_;
std::string builderName_;
- std::string parametersDefinerName_;
const bool includeSeeds_;
const bool addSeedCurvCov_;
const bool includeAllHits_;
@@ -681,6 +679,7 @@ class TrackingNtuple : public edm::one::EDAnalyzer {
const bool simHitBySignificance_;
HistoryBase tracer_;
+ ParametersDefinerForTP parametersDefiner_;
TTree* t;
@@ -1305,8 +1304,6 @@ TrackingNtuple::TrackingNtuple(const edm::ParameterSet& iConfig)
ttrhToken_(esConsumes(edm::ESInputTag("", iConfig.getUntrackedParameter("TTRHBuilder")))),
tTopoToken_(esConsumes()),
tGeomToken_(esConsumes()),
- paramsDefineToken_(
- esConsumes(edm::ESInputTag("", iConfig.getUntrackedParameter("parametersDefiner")))),
trackToken_(consumes>(iConfig.getUntrackedParameter("tracks"))),
clusterTPMapToken_(consumes(iConfig.getUntrackedParameter("clusterTPMap"))),
simHitTPMapToken_(consumes(
@@ -1349,7 +1346,8 @@ TrackingNtuple::TrackingNtuple(const edm::ParameterSet& iConfig)
includeOOT_(iConfig.getUntrackedParameter("includeOOT")),
keepEleSimHits_(iConfig.getUntrackedParameter("keepEleSimHits")),
saveSimHitsP3_(iConfig.getUntrackedParameter("saveSimHitsP3")),
- simHitBySignificance_(iConfig.getUntrackedParameter("simHitBySignificance")) {
+ simHitBySignificance_(iConfig.getUntrackedParameter("simHitBySignificance")),
+ parametersDefiner_(iConfig.getUntrackedParameter("beamSpot"), consumesCollector()) {
if (includeSeeds_) {
seedTokens_ =
edm::vector_transform(iConfig.getUntrackedParameter>("seedTracks"),
@@ -3694,8 +3692,6 @@ void TrackingNtuple::fillTrackingParticles(const edm::Event& iEvent,
const reco::TrackToTrackingParticleAssociator& associatorByHits,
const std::vector& tpHitList,
const TrackingParticleRefKeyToCount& tpKeyToClusterCount) {
- const ParametersDefinerForTP* parametersDefiner = &iSetup.getData(paramsDefineToken_);
-
// Number of 3D layers for TPs
edm::Handle> tpNLayersH;
iEvent.getByToken(tpNLayersToken_, tpNLayersH);
@@ -3765,8 +3761,8 @@ void TrackingNtuple::fillTrackingParticles(const edm::Event& iEvent,
sim_decayVtxIdx.push_back(decayIdx);
//Calcualte the impact parameters w.r.t. PCA
- TrackingParticle::Vector momentum = parametersDefiner->momentum(iEvent, iSetup, tp);
- TrackingParticle::Point vertex = parametersDefiner->vertex(iEvent, iSetup, tp);
+ TrackingParticle::Vector momentum = parametersDefiner_.momentum(iEvent, iSetup, tp);
+ TrackingParticle::Point vertex = parametersDefiner_.vertex(iEvent, iSetup, tp);
auto dxySim = TrackingParticleIP::dxy(vertex, momentum, bs.position());
auto dzSim = TrackingParticleIP::dz(vertex, momentum, bs.position());
const double lambdaSim = M_PI / 2 - momentum.theta();
@@ -4003,7 +3999,6 @@ void TrackingNtuple::fillDescriptions(edm::ConfigurationDescriptions& descriptio
desc.addUntracked("trackingParticleNstripstereolayers",
edm::InputTag("trackingParticleNumberOfLayersProducer", "stripStereoLayers"));
desc.addUntracked("TTRHBuilder", "WithTrackAngle");
- desc.addUntracked("parametersDefiner", "LhcParametersDefinerForTP");
desc.addUntracked("includeSeeds", false);
desc.addUntracked("addSeedCurvCov", false);
desc.addUntracked("includeAllHits", false);
diff --git a/Validation/RecoTrack/python/HLTmultiTrackValidator_cfi.py b/Validation/RecoTrack/python/HLTmultiTrackValidator_cfi.py
index f0fe65b025298..f17cacbeac8a6 100644
--- a/Validation/RecoTrack/python/HLTmultiTrackValidator_cfi.py
+++ b/Validation/RecoTrack/python/HLTmultiTrackValidator_cfi.py
@@ -1,10 +1,5 @@
import FWCore.ParameterSet.Config as cms
-from SimTracker.TrackAssociation.LhcParametersDefinerForTP_cfi import *
-hltLhcParametersDefinerForTP = LhcParametersDefinerForTP.clone()
-hltLhcParametersDefinerForTP.ComponentName = cms.string('hltLhcParametersDefinerForTP')
-hltLhcParametersDefinerForTP.beamSpot = cms.untracked.InputTag('hltOnlineBeamSpot')
-
from Validation.RecoTrack.associators_cff import *
from Validation.RecoTrack.MultiTrackValidator_cfi import *
diff --git a/Validation/RecoTrack/python/MultiTrackValidatorGenPs_cfi.py b/Validation/RecoTrack/python/MultiTrackValidatorGenPs_cfi.py
index 4c5ae57ca169a..3e26b1199089c 100644
--- a/Validation/RecoTrack/python/MultiTrackValidatorGenPs_cfi.py
+++ b/Validation/RecoTrack/python/MultiTrackValidatorGenPs_cfi.py
@@ -2,8 +2,6 @@
from Validation.RecoTrack.TrackingParticleSelectionForEfficiency_cfi import *
from Validation.RecoTrack.GenParticleSelectionsForEfficiency_cff import *
-from SimTracker.TrackAssociation.LhcParametersDefinerForTP_cfi import *
-from SimTracker.TrackAssociation.CosmicParametersDefinerForTP_cfi import *
from Validation.RecoTrack.MTVHistoProducerAlgoForTrackerBlock_cfi import *
from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
diff --git a/Validation/RecoTrack/python/MultiTrackValidator_cff.py b/Validation/RecoTrack/python/MultiTrackValidator_cff.py
index bc7ee7d8b3a55..b224c2bd67441 100644
--- a/Validation/RecoTrack/python/MultiTrackValidator_cff.py
+++ b/Validation/RecoTrack/python/MultiTrackValidator_cff.py
@@ -2,6 +2,4 @@
from DQMServices.Core.DQM_cfg import *
from Validation.RecoTrack.MultiTrackValidator_cfi import *
-from SimTracker.TrackAssociation.LhcParametersDefinerForTP_cfi import *
-from SimTracker.TrackAssociation.CosmicParametersDefinerForTP_cfi import *
diff --git a/Validation/RecoTrack/python/MultiTrackValidator_cfi.py b/Validation/RecoTrack/python/MultiTrackValidator_cfi.py
index 1b452537c835f..4598b999fba83 100644
--- a/Validation/RecoTrack/python/MultiTrackValidator_cfi.py
+++ b/Validation/RecoTrack/python/MultiTrackValidator_cfi.py
@@ -1,8 +1,6 @@
import FWCore.ParameterSet.Config as cms
from Validation.RecoTrack.TrackingParticleSelectionForEfficiency_cfi import *
-from SimTracker.TrackAssociation.LhcParametersDefinerForTP_cfi import *
-from SimTracker.TrackAssociation.CosmicParametersDefinerForTP_cfi import *
from Validation.RecoTrack.MTVHistoProducerAlgoForTrackerBlock_cfi import *
from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
diff --git a/Validation/RecoTrack/python/TrackValidation_cff.py b/Validation/RecoTrack/python/TrackValidation_cff.py
index 5190b7cd4328f..0b3b973da0d53 100644
--- a/Validation/RecoTrack/python/TrackValidation_cff.py
+++ b/Validation/RecoTrack/python/TrackValidation_cff.py
@@ -6,8 +6,6 @@
from SimTracker.TrackAssociation.trackingParticleRecoTrackAsssociation_cfi import *
import Validation.RecoTrack.MultiTrackValidator_cfi
from Validation.RecoTrack.trajectorySeedTracks_cfi import trajectorySeedTracks as _trajectorySeedTracks
-from SimTracker.TrackAssociation.LhcParametersDefinerForTP_cfi import *
-from SimTracker.TrackAssociation.CosmicParametersDefinerForTP_cfi import *
from Validation.RecoTrack.PostProcessorTracker_cfi import *
import Validation.RecoTrack.cutsRecoTracks_cfi as cutsRecoTracks_cfi
#from . import cutsRecoTracks_cfi