Skip to content

Commit d2fa10a

Browse files
committed
more cleanup
1 parent a0c1b57 commit d2fa10a

File tree

7 files changed

+29
-29
lines changed

7 files changed

+29
-29
lines changed

RecoLocalMuon/RPCRecHit/interface/CSCSegtoRPC.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
#include "DataFormats/RPCRecHit/interface/RPCRecHit.h"
88
#include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h"
99

10+
#include <memory>
11+
1012
class CSCSegtoRPC {
1113
public:
12-
explicit CSCSegtoRPC(edm::Handle<CSCSegmentCollection> allCSCSegments,const edm::EventSetup& iSetup, const edm::Event& iEvent, bool debug, double eyr);
14+
CSCSegtoRPC(CSCSegmentCollection const* allCSCSegments, edm::EventSetup const& iSetup, bool debug, double eyr);
1315
~CSCSegtoRPC();
14-
RPCRecHitCollection* thePoints(){return _ThePoints;}
16+
std::unique_ptr<RPCRecHitCollection> && thePoints(){ return std::move(_ThePoints); }
1517

1618
private:
17-
RPCRecHitCollection* _ThePoints;
19+
std::unique_ptr<RPCRecHitCollection> _ThePoints;
1820
edm::OwnVector<RPCRecHit> RPCPointVector;
1921
bool inclcsc;
2022
double MaxD;

RecoLocalMuon/RPCRecHit/interface/DTSegtoRPC.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
#include "DataFormats/RPCRecHit/interface/RPCRecHit.h"
88
#include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h"
99

10+
#include <memory>
11+
1012
class DTSegtoRPC {
1113
public:
12-
explicit DTSegtoRPC(edm::Handle<DTRecSegment4DCollection> all4DSegments,const edm::EventSetup& iSetup, const edm::Event& iEvent,bool debug, double eyr);
14+
DTSegtoRPC(DTRecSegment4DCollection const* all4DSegments, edm::EventSetup const& iSetup, bool debug, double eyr);
1315
~DTSegtoRPC();
14-
RPCRecHitCollection* thePoints(){return _ThePoints;}
16+
std::unique_ptr<RPCRecHitCollection> && thePoints(){ return std::move(_ThePoints); }
1517

1618
private:
17-
RPCRecHitCollection* _ThePoints;
19+
std::unique_ptr<RPCRecHitCollection> _ThePoints;
1820
edm::OwnVector<RPCRecHit> RPCPointVector;
1921
bool incldt;
2022
bool incldtMB4;

RecoLocalMuon/RPCRecHit/interface/TracktoRPC.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,22 @@
5050
#include "TrackingTools/TrackRefitter/interface/TrackTransformerBase.h"
5151
#include "TrackingTools/TrackRefitter/interface/TrackTransformer.h"
5252

53+
#include <memory>
5354

5455
using reco::MuonCollection;
5556
using reco::TrackCollection;
5657
typedef std::vector<Trajectory> Trajectories;
5758

5859
class TracktoRPC {
5960
public:
60-
61-
62-
explicit TracktoRPC(edm::Handle<reco::TrackCollection> alltracks,const edm::EventSetup& iSetup, const edm::Event& iEvent,bool debug, const edm::ParameterSet& iConfig, const edm::InputTag & tracklabel);
63-
61+
TracktoRPC(reco::TrackCollection const* alltracks, edm::EventSetup const& iSetup, bool debug, const edm::ParameterSet& iConfig, const edm::InputTag & tracklabel);
6462
~TracktoRPC();
65-
RPCRecHitCollection* thePoints(){return _ThePoints;}
66-
bool ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const edm::EventSetup& iSetup);
63+
std::unique_ptr<RPCRecHitCollection> && thePoints(){ return std::move(_ThePoints); }
6764

6865
private:
69-
RPCRecHitCollection* _ThePoints;
66+
bool ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const edm::EventSetup& iSetup);
67+
68+
std::unique_ptr<RPCRecHitCollection> _ThePoints;
7069
edm::OwnVector<RPCRecHit> RPCPointVector;
7170
double MaxD;
7271

RecoLocalMuon/RPCRecHit/src/CSCSegtoRPC.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "RecoLocalMuon/RPCRecHit/src/CSCStationIndex.h"
1313
#include "RecoLocalMuon/RPCRecHit/src/CSCObjectMap.h"
1414

15-
CSCSegtoRPC::CSCSegtoRPC(edm::Handle<CSCSegmentCollection> allCSCSegments, const edm::EventSetup& iSetup,const edm::Event& iEvent, bool debug, double eyr){
15+
CSCSegtoRPC::CSCSegtoRPC(const CSCSegmentCollection * allCSCSegments, const edm::EventSetup& iSetup, bool debug, double eyr){
1616

1717
edm::ESHandle<RPCGeometry> rpcGeo;
1818
edm::ESHandle<CSCGeometry> cscGeo;
@@ -26,7 +26,7 @@ CSCSegtoRPC::CSCSegtoRPC(edm::Handle<CSCSegmentCollection> allCSCSegments, const
2626

2727
if(debug) std::cout<<"CSC \t Number of CSC Segments in this event = "<<allCSCSegments->size()<<std::endl;
2828

29-
_ThePoints = new RPCRecHitCollection();
29+
_ThePoints.reset(new RPCRecHitCollection());
3030

3131
if(allCSCSegments->size()==0){
3232
if(debug) std::cout<<"CSC 0 segments skiping event"<<std::endl;

RecoLocalMuon/RPCRecHit/src/DTSegtoRPC.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int distwheel(int wheel1,int wheel2){
3131
return distance;
3232
}
3333

34-
DTSegtoRPC::DTSegtoRPC(edm::Handle<DTRecSegment4DCollection> all4DSegments, const edm::EventSetup& iSetup,const edm::Event& iEvent,bool debug,double eyr){
34+
DTSegtoRPC::DTSegtoRPC(const DTRecSegment4DCollection * all4DSegments, const edm::EventSetup& iSetup, bool debug,double eyr){
3535

3636
/*
3737
MinCosAng=iConfig.getUntrackedParameter<double>("MinCosAng",0.95);
@@ -61,7 +61,7 @@ DTSegtoRPC::DTSegtoRPC(edm::Handle<DTRecSegment4DCollection> all4DSegments, cons
6161
clock_gettime(CLOCK_REALTIME, &start_time);
6262
*/
6363

64-
_ThePoints = new RPCRecHitCollection();
64+
_ThePoints.reset(new RPCRecHitCollection());
6565

6666
if(all4DSegments->size()>8){
6767
if(debug) std::cout<<"Too many segments in this event we are not doing the extrapolation"<<std::endl;

RecoLocalMuon/RPCRecHit/src/RPCPointProducer.cc

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ void RPCPointProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::Eve
5050
edm::Handle<DTRecSegment4DCollection> all4DSegments;
5151
iEvent.getByToken(dt4DSegments, all4DSegments);
5252
if(all4DSegments.isValid()){
53-
DTSegtoRPC DTClass(all4DSegments,iSetup,iEvent,debug,ExtrapolatedRegion);
54-
std::auto_ptr<RPCRecHitCollection> TheDTPoints(DTClass.thePoints());
55-
iEvent.put(TheDTPoints,"RPCDTExtrapolatedPoints");
53+
DTSegtoRPC DTClass(all4DSegments.product(), iSetup, debug, ExtrapolatedRegion);
54+
iEvent.put(DTClass.thePoints(), "RPCDTExtrapolatedPoints");
5655
}else{
5756
if(debug) std::cout<<"RPCHLT Invalid DTSegments collection"<<std::endl;
5857
}
@@ -62,9 +61,8 @@ void RPCPointProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::Eve
6261
edm::Handle<CSCSegmentCollection> allCSCSegments;
6362
iEvent.getByToken(cscSegments, allCSCSegments);
6463
if(allCSCSegments.isValid()){
65-
CSCSegtoRPC CSCClass(allCSCSegments,iSetup,iEvent,debug,ExtrapolatedRegion);
66-
std::auto_ptr<RPCRecHitCollection> TheCSCPoints(CSCClass.thePoints());
67-
iEvent.put(TheCSCPoints,"RPCCSCExtrapolatedPoints");
64+
CSCSegtoRPC CSCClass(allCSCSegments.product(), iSetup, debug, ExtrapolatedRegion);
65+
iEvent.put(CSCClass.thePoints(), "RPCCSCExtrapolatedPoints");
6866
}else{
6967
if(debug) std::cout<<"RPCHLT Invalid CSCSegments collection"<<std::endl;
7068
}
@@ -73,11 +71,10 @@ void RPCPointProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::Eve
7371
edm::Handle<reco::TrackCollection> alltracks;
7472
iEvent.getByToken(tracks,alltracks);
7573
if(!(alltracks->empty())){
76-
TracktoRPC TrackClass(alltracks,iSetup,iEvent,debug,trackTransformerParam,tracks_);
77-
std::auto_ptr<RPCRecHitCollection> TheTrackPoints(TrackClass.thePoints());
78-
iEvent.put(TheTrackPoints,"RPCTrackExtrapolatedPoints");
74+
TracktoRPC TrackClass(alltracks.product(), iSetup, debug, trackTransformerParam, tracks_);
75+
iEvent.put(TrackClass.thePoints(), "RPCTrackExtrapolatedPoints");
7976
}else{
80-
std::cout<<"RPCHLT Invalid Tracks collection"<<std::endl;
77+
if(debug) std::cout<<"RPCHLT Invalid Tracks collection"<<std::endl;
8178
}
8279
}
8380

RecoLocalMuon/RPCRecHit/src/TracktoRPC.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ bool TracktoRPC::ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const edm::E
5151
} else return false;
5252
}
5353

54-
TracktoRPC::TracktoRPC(edm::Handle<reco::TrackCollection> alltracks, const edm::EventSetup& iSetup,const edm::Event& iEvent,bool debug,const edm::ParameterSet& iConfig, const edm::InputTag& tracklabel){
54+
TracktoRPC::TracktoRPC(const reco::TrackCollection * alltracks, const edm::EventSetup& iSetup, bool debug,const edm::ParameterSet& iConfig, const edm::InputTag& tracklabel){
5555

56-
_ThePoints = new RPCRecHitCollection();
56+
_ThePoints.reset(new RPCRecHitCollection());
5757
// if(alltracks->empty()) return;
5858

5959
if(tracklabel.label().find("cosmic")==0) theTrackTransformer = new TrackTransformerForCosmicMuons(iConfig);

0 commit comments

Comments
 (0)