File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
RecoLocalMuon/DTRecHit/test Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ DTRecHitReader::DTRecHitReader(const ParameterSet& pset) {
4848 hRHitZ_W1 = new H1DRecHit (" RZ_W1" );
4949 hRHitZ_W2 = new H1DRecHit (" RZ_W2" );
5050 hRHitZ_All = new H1DRecHit (" RZ_All" );
51+
52+ dtGeomToken_ = esConsumes ();
5153}
5254
5355// Destructor
@@ -69,8 +71,8 @@ DTRecHitReader::~DTRecHitReader() {
6971void DTRecHitReader::analyze (const Event& event, const EventSetup& eventSetup) {
7072 cout << " --- [DTRecHitReader] Event analysed #Run: " << event.id ().run () << " #Event: " << event.id ().event () << endl;
7173 // Get the DT Geometry
72- ESHandle<DTGeometry> dtGeom;
73- eventSetup. get <MuonGeometryRecord>(). get (dtGeom) ;
74+ ESHandle<DTGeometry> dtGeom = eventSetup. getHandle (dtGeomToken_) ;
75+ ;
7476
7577 // Get the rechit collection from the event
7678 Handle<DTRecHitCollection> dtRecHits;
Original file line number Diff line number Diff line change 88 * \author G. Cerminara - INFN Torino
99 */
1010
11- #include " FWCore/Framework/interface/EDAnalyzer.h"
11+ #include " FWCore/Framework/interface/one/ EDAnalyzer.h"
1212#include " DataFormats/Common/interface/Handle.h"
1313
1414#include " SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
@@ -32,18 +32,21 @@ class TFile;
3232class DTLayer ;
3333class DTWireId ;
3434
35- class DTRecHitReader : public edm ::EDAnalyzer {
35+ class DTGeometry ;
36+ class MuonGeometryRecord ;
37+
38+ class DTRecHitReader : public edm ::one::EDAnalyzer<> {
3639public:
3740 // / Constructor
3841 DTRecHitReader (const edm::ParameterSet& pset);
3942
4043 // / Destructor
41- virtual ~DTRecHitReader ();
44+ ~DTRecHitReader () override ;
4245
4346 // Operations
4447
4548 // / Perform the real analysis
46- void analyze (const edm::Event& event, const edm::EventSetup& eventSetup);
49+ void analyze (const edm::Event& event, const edm::EventSetup& eventSetup) override ;
4750
4851protected:
4952private:
@@ -74,6 +77,8 @@ class DTRecHitReader : public edm::EDAnalyzer {
7477 std::string rootFileName;
7578 std::string simHitLabel;
7679 std::string recHitLabel;
80+
81+ edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
7782};
7883
7984#endif
You can’t perform that action at this time.
0 commit comments