Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Sep 23, 2015
1 parent da296d8 commit 8b36e33
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
8 changes: 5 additions & 3 deletions RecoLocalMuon/RPCRecHit/interface/CSCSegtoRPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
#include "DataFormats/RPCRecHit/interface/RPCRecHit.h"
#include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h"

#include <memory>

class CSCSegtoRPC {
public:
explicit CSCSegtoRPC(edm::Handle<CSCSegmentCollection> allCSCSegments,const edm::EventSetup& iSetup, const edm::Event& iEvent, bool debug, double eyr);
CSCSegtoRPC(CSCSegmentCollection const* allCSCSegments, edm::EventSetup const& iSetup, bool debug, double eyr);
~CSCSegtoRPC();
RPCRecHitCollection* thePoints(){return _ThePoints;}
std::unique_ptr<RPCRecHitCollection> && thePoints(){ return std::move(_ThePoints); }

private:
RPCRecHitCollection* _ThePoints;
std::unique_ptr<RPCRecHitCollection> _ThePoints;
edm::OwnVector<RPCRecHit> RPCPointVector;
bool inclcsc;
double MaxD;
Expand Down
8 changes: 5 additions & 3 deletions RecoLocalMuon/RPCRecHit/interface/DTSegtoRPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
#include "DataFormats/RPCRecHit/interface/RPCRecHit.h"
#include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h"

#include <memory>

class DTSegtoRPC {
public:
explicit DTSegtoRPC(edm::Handle<DTRecSegment4DCollection> all4DSegments,const edm::EventSetup& iSetup, const edm::Event& iEvent,bool debug, double eyr);
DTSegtoRPC(DTRecSegment4DCollection const* all4DSegments, edm::EventSetup const& iSetup, bool debug, double eyr);
~DTSegtoRPC();
RPCRecHitCollection* thePoints(){return _ThePoints;}
std::unique_ptr<RPCRecHitCollection> && thePoints(){ return std::move(_ThePoints); }

private:
RPCRecHitCollection* _ThePoints;
std::unique_ptr<RPCRecHitCollection> _ThePoints;
edm::OwnVector<RPCRecHit> RPCPointVector;
bool incldt;
bool incldtMB4;
Expand Down
13 changes: 6 additions & 7 deletions RecoLocalMuon/RPCRecHit/interface/TracktoRPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,22 @@
#include "TrackingTools/TrackRefitter/interface/TrackTransformerBase.h"
#include "TrackingTools/TrackRefitter/interface/TrackTransformer.h"

#include <memory>

using reco::MuonCollection;
using reco::TrackCollection;
typedef std::vector<Trajectory> Trajectories;

class TracktoRPC {
public:


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);

TracktoRPC(reco::TrackCollection const* alltracks, edm::EventSetup const& iSetup, bool debug, const edm::ParameterSet& iConfig, const edm::InputTag & tracklabel);
~TracktoRPC();
RPCRecHitCollection* thePoints(){return _ThePoints;}
bool ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const edm::EventSetup& iSetup);
std::unique_ptr<RPCRecHitCollection> && thePoints(){ return std::move(_ThePoints); }

private:
RPCRecHitCollection* _ThePoints;
bool ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const edm::EventSetup& iSetup);

std::unique_ptr<RPCRecHitCollection> _ThePoints;
edm::OwnVector<RPCRecHit> RPCPointVector;
double MaxD;

Expand Down
4 changes: 2 additions & 2 deletions RecoLocalMuon/RPCRecHit/src/CSCSegtoRPC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "RecoLocalMuon/RPCRecHit/src/CSCStationIndex.h"
#include "RecoLocalMuon/RPCRecHit/src/CSCObjectMap.h"

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

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

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

_ThePoints = new RPCRecHitCollection();
_ThePoints.reset(new RPCRecHitCollection());

if(allCSCSegments->size()==0){
if(debug) std::cout<<"CSC 0 segments skiping event"<<std::endl;
Expand Down
4 changes: 2 additions & 2 deletions RecoLocalMuon/RPCRecHit/src/DTSegtoRPC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int distwheel(int wheel1,int wheel2){
return distance;
}

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

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

_ThePoints = new RPCRecHitCollection();
_ThePoints.reset(new RPCRecHitCollection());

if(all4DSegments->size()>8){
if(debug) std::cout<<"Too many segments in this event we are not doing the extrapolation"<<std::endl;
Expand Down
17 changes: 7 additions & 10 deletions RecoLocalMuon/RPCRecHit/src/RPCPointProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ void RPCPointProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::Eve
edm::Handle<DTRecSegment4DCollection> all4DSegments;
iEvent.getByToken(dt4DSegments, all4DSegments);
if(all4DSegments.isValid()){
DTSegtoRPC DTClass(all4DSegments,iSetup,iEvent,debug,ExtrapolatedRegion);
std::auto_ptr<RPCRecHitCollection> TheDTPoints(DTClass.thePoints());
iEvent.put(TheDTPoints,"RPCDTExtrapolatedPoints");
DTSegtoRPC DTClass(all4DSegments.product(), iSetup, debug, ExtrapolatedRegion);
iEvent.put(DTClass.thePoints(), "RPCDTExtrapolatedPoints");
}else{
if(debug) std::cout<<"RPCHLT Invalid DTSegments collection"<<std::endl;
}
Expand All @@ -62,9 +61,8 @@ void RPCPointProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::Eve
edm::Handle<CSCSegmentCollection> allCSCSegments;
iEvent.getByToken(cscSegments, allCSCSegments);
if(allCSCSegments.isValid()){
CSCSegtoRPC CSCClass(allCSCSegments,iSetup,iEvent,debug,ExtrapolatedRegion);
std::auto_ptr<RPCRecHitCollection> TheCSCPoints(CSCClass.thePoints());
iEvent.put(TheCSCPoints,"RPCCSCExtrapolatedPoints");
CSCSegtoRPC CSCClass(allCSCSegments.product(), iSetup, debug, ExtrapolatedRegion);
iEvent.put(CSCClass.thePoints(), "RPCCSCExtrapolatedPoints");
}else{
if(debug) std::cout<<"RPCHLT Invalid CSCSegments collection"<<std::endl;
}
Expand All @@ -73,11 +71,10 @@ void RPCPointProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::Eve
edm::Handle<reco::TrackCollection> alltracks;
iEvent.getByToken(tracks,alltracks);
if(!(alltracks->empty())){
TracktoRPC TrackClass(alltracks,iSetup,iEvent,debug,trackTransformerParam,tracks_);
std::auto_ptr<RPCRecHitCollection> TheTrackPoints(TrackClass.thePoints());
iEvent.put(TheTrackPoints,"RPCTrackExtrapolatedPoints");
TracktoRPC TrackClass(alltracks.product(), iSetup, debug, trackTransformerParam, tracks_);
iEvent.put(TrackClass.thePoints(), "RPCTrackExtrapolatedPoints");
}else{
std::cout<<"RPCHLT Invalid Tracks collection"<<std::endl;
if(debug) std::cout<<"RPCHLT Invalid Tracks collection"<<std::endl;
}
}

Expand Down
4 changes: 2 additions & 2 deletions RecoLocalMuon/RPCRecHit/src/TracktoRPC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ bool TracktoRPC::ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const edm::E
} else return false;
}

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){
TracktoRPC::TracktoRPC(const reco::TrackCollection * alltracks, const edm::EventSetup& iSetup, bool debug,const edm::ParameterSet& iConfig, const edm::InputTag& tracklabel){

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

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

0 comments on commit 8b36e33

Please sign in to comment.