Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up ME0MuonTrackCollProducer #31386

Merged
merged 4 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CommonTools/RecoAlgos/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<use name="DataFormats/RecoCandidate"/>
<use name="DataFormats/Candidate"/>
<use name="DataFormats/VertexReco"/>
<use name="RecoMuon/MuonIdentification"/>
<use name="TrackingTools/IPTools"/>
<use name="TrackingTools/TransientTrack"/>
<use name="Geometry/TrackerGeometryBuilder"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,24 @@

#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/MuonDetId/interface/CSCDetId.h"
#include "DataFormats/MuonDetId/interface/DTChamberId.h"
#include "DataFormats/MuonDetId/interface/MuonSubdetId.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"
#include "DataFormats/MuonReco/interface/Muon.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/MuonReco/interface/ME0Muon.h"
#include "DataFormats/MuonReco/interface/ME0MuonCollection.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "RecoMuon/MuonIdentification/interface/ME0MuonSelector.h"
#include "FWCore/Framework/interface/ESHandle.h"

#include <sstream>

#include <memory>
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/MuonReco/interface/MuonFwd.h"
#include "DataFormats/MuonReco/interface/ME0Muon.h"
#include "DataFormats/MuonReco/interface/ME0MuonCollection.h"
#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"

class ME0MuonTrackCollProducer : public edm::stream::EDProducer<> {
public:
explicit ME0MuonTrackCollProducer(const edm::ParameterSet&);
//std::vector<double> findSimVtx(edm::Event& iEvent);
~ME0MuonTrackCollProducer() override;
~ME0MuonTrackCollProducer() override = default;

private:
void produce(edm::Event&, const edm::EventSetup&) override;
edm::Handle<std::vector<reco::ME0Muon> > OurMuons;
//edm::Handle<reco::ME0MuonCollection> muonCollectionH;
edm::InputTag OurMuonsTag;
std::vector<std::string> selectionTags;
const edm::ParameterSet parset_;
edm::EDGetTokenT<ME0MuonCollection> OurMuonsToken_;
};
Expand All @@ -48,15 +29,10 @@ class ME0MuonTrackCollProducer : public edm::stream::EDProducer<> {
DEFINE_FWK_MODULE(ME0MuonTrackCollProducer);

ME0MuonTrackCollProducer::ME0MuonTrackCollProducer(const edm::ParameterSet& parset)
: OurMuonsTag(parset.getParameter<edm::InputTag>("me0MuonTag")),
selectionTags(parset.getParameter<std::vector<std::string> >("selectionTags")),
parset_(parset) {
: parset_(parset), OurMuonsToken_(consumes<ME0MuonCollection>(parset.getParameter<edm::InputTag>("me0MuonTag"))) {
produces<reco::TrackCollection>();
OurMuonsToken_ = consumes<ME0MuonCollection>(OurMuonsTag);
}

ME0MuonTrackCollProducer::~ME0MuonTrackCollProducer() {}

void ME0MuonTrackCollProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
using namespace reco;
using namespace edm;
Expand All @@ -77,11 +53,7 @@ void ME0MuonTrackCollProducer::produce(edm::Event& iEvent, const edm::EventSetup
trackref = thismuon->innerTrack();

const reco::Track* trk = &(*trackref);
// pointer to old track:
//reco::Track* newTrk = new reco::Track(*trk);

selectedTracks->push_back(*trk);
//selectedTrackExtras->push_back( *newExtra );
}
iEvent.put(std::move(selectedTracks));
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#----------ME0Muon Collection Production for association by chi2
me0muon = cms.EDProducer("ME0MuonTrackCollProducer",
me0MuonTag = cms.InputTag("me0SegmentMatching"),
selectionTags = cms.vstring('All'),
)
#--------------------
me0muonColl_seq = cms.Sequence(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
)


from CommonTools.RecoAlgos.me0Associator import *
from RecoMuon.MuonIdentification.me0Associator import *

#process.me0MuonSel = cms.Sequence(
# me0muonColl_seq
Expand Down