-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36825 from mmusich/getRidDeprecationWarningsFastS…
…imulationTrack remove deprecation warnings from `FastSimulation/Track*`
- Loading branch information
Showing
3 changed files
with
45 additions
and
55 deletions.
There are no files selected for viewing
38 changes: 24 additions & 14 deletions
38
FastSimulation/TrackerSetup/plugins/TrackerInteractionGeometryESProducer.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,36 @@ | ||
#include "FastSimulation/TrackerSetup/plugins/TrackerInteractionGeometryESProducer.h" | ||
#include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" | ||
|
||
#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 "FastSimulation/TrackerSetup/interface/TrackerInteractionGeometry.h" | ||
#include "FastSimulation/TrackerSetup/interface/TrackerInteractionGeometryRecord.h" | ||
#include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
TrackerInteractionGeometryESProducer::TrackerInteractionGeometryESProducer(const edm::ParameterSet& p) { | ||
setWhatProduced(this); | ||
_label = p.getUntrackedParameter<std::string>("trackerGeometryLabel", ""); | ||
class TrackerInteractionGeometryESProducer : public edm::ESProducer { | ||
public: | ||
TrackerInteractionGeometryESProducer(const edm::ParameterSet& p); | ||
~TrackerInteractionGeometryESProducer() override = default; | ||
std::unique_ptr<TrackerInteractionGeometry> produce(const TrackerInteractionGeometryRecord&); | ||
|
||
theTrackerMaterial = p.getParameter<edm::ParameterSet>("TrackerMaterial"); | ||
} | ||
private: | ||
edm::ESGetToken<GeometricSearchTracker, TrackerRecoGeometryRecord> geoSearchToken_; | ||
std::string label_; | ||
edm::ParameterSet theTrackerMaterial_; | ||
}; | ||
|
||
TrackerInteractionGeometryESProducer::~TrackerInteractionGeometryESProducer() {} | ||
TrackerInteractionGeometryESProducer::TrackerInteractionGeometryESProducer(const edm::ParameterSet& p) { | ||
auto cc = setWhatProduced(this); | ||
label_ = p.getUntrackedParameter<std::string>("trackerGeometryLabel", ""); | ||
geoSearchToken_ = cc.consumes(edm::ESInputTag("", label_)); | ||
theTrackerMaterial_ = p.getParameter<edm::ParameterSet>("TrackerMaterial"); | ||
} | ||
|
||
std::unique_ptr<TrackerInteractionGeometry> TrackerInteractionGeometryESProducer::produce( | ||
const TrackerInteractionGeometryRecord& iRecord) { | ||
edm::ESHandle<GeometricSearchTracker> theGeomSearchTracker; | ||
|
||
iRecord.getRecord<TrackerRecoGeometryRecord>().get(_label, theGeomSearchTracker); | ||
return std::make_unique<TrackerInteractionGeometry>(theTrackerMaterial, &(*theGeomSearchTracker)); | ||
const GeometricSearchTracker* theGeomSearchTracker = &iRecord.get(geoSearchToken_); | ||
return std::make_unique<TrackerInteractionGeometry>(theTrackerMaterial_, theGeomSearchTracker); | ||
} | ||
|
||
DEFINE_FWK_EVENTSETUP_MODULE(TrackerInteractionGeometryESProducer); |
22 changes: 0 additions & 22 deletions
22
FastSimulation/TrackerSetup/plugins/TrackerInteractionGeometryESProducer.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters