CMS 3D CMS Logo

ME0MuonTrackCollProducer.cc
Go to the documentation of this file.
1 
15 
16 #include <sstream>
17 
18 #include <memory>
28 
30 public:
32  //std::vector<double> findSimVtx(edm::Event& iEvent);
33  ~ME0MuonTrackCollProducer() override;
34 
35 private:
36  void produce(edm::Event&, const edm::EventSetup&) override;
38  //edm::Handle<reco::ME0MuonCollection> muonCollectionH;
40  std::vector<std::string> selectionTags;
43 };
44 
47 
49 
51  : OurMuonsTag(parset.getParameter<edm::InputTag>("me0MuonTag")),
52  selectionTags(parset.getParameter<std::vector<std::string> >("selectionTags")),
53  parset_(parset) {
54  produces<reco::TrackCollection>();
55  OurMuonsToken_ = consumes<ME0MuonCollection>(OurMuonsTag);
56 }
57 
59 
61  using namespace reco;
62  using namespace edm;
64  iEvent.getByToken(OurMuonsToken_, OurMuons);
65 
66  std::unique_ptr<reco::TrackCollection> selectedTracks(new reco::TrackCollection);
67 
68  reco::TrackRefProd rTracks = iEvent.getRefBeforePut<reco::TrackCollection>();
69 
70  for (std::vector<reco::ME0Muon>::const_iterator thismuon = OurMuons->begin(); thismuon != OurMuons->end();
71  ++thismuon) {
72  if (!muon::isGoodMuon(*thismuon, muon::Tight))
73  continue;
74  reco::TrackRef trackref;
75 
76  if (thismuon->innerTrack().isNonnull())
77  trackref = thismuon->innerTrack();
78 
79  const reco::Track* trk = &(*trackref);
80  // pointer to old track:
81  //reco::Track* newTrk = new reco::Track(*trk);
82 
83  selectedTracks->push_back(*trk);
84  //selectedTrackExtras->push_back( *newExtra );
85  }
87 }
edm::RefProd< TrackCollection >
ME0MuonTrackCollProducer::OurMuonsToken_
edm::EDGetTokenT< ME0MuonCollection > OurMuonsToken_
Definition: ME0MuonTrackCollProducer.cc:42
ME0MuonTrackCollProducer
Definition: ME0MuonTrackCollProducer.cc:29
Muon.h
MessageLogger.h
ESHandle.h
MonitorTrackInnerTrackMuons_cff.selectionTags
selectionTags
Definition: MonitorTrackInnerTrackMuons_cff.py:22
edm::EDGetTokenT< ME0MuonCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
EDProducer.h
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
ME0MuonTrackCollProducer::OurMuonsTag
edm::InputTag OurMuonsTag
Definition: ME0MuonTrackCollProducer.cc:39
CSCDetId.h
edm::Ref< TrackCollection >
ME0MuonTrackCollProducer::ME0MuonTrackCollProducer
ME0MuonTrackCollProducer(const edm::ParameterSet &)
Definition: ME0MuonTrackCollProducer.cc:50
GenParticle.h
MakerMacros.h
muon::isGoodMuon
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
Definition: MuonSelectors.cc:664
ME0MuonTrackCollProducer::selectionTags
std::vector< std::string > selectionTags
Definition: ME0MuonTrackCollProducer.cc:40
ME0MuonSelector.cc
Track.h
TrackFwd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
MuonFwd.h
muon::Tight
Definition: ME0MuonSelector.h:17
ME0MuonTrackCollProducer::parset_
const edm::ParameterSet parset_
Definition: ME0MuonTrackCollProducer.cc:41
reco::Track
Definition: Track.h:27
DTChamberId.h
ME0MuonTrackCollProducer::OurMuons
edm::Handle< std::vector< reco::ME0Muon > > OurMuons
Definition: ME0MuonTrackCollProducer.cc:37
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
ModuleDef.h
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:57
ME0Muon.h
MuonSubdetId.h
VertexFwd.h
ME0MuonTrackCollProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: ME0MuonTrackCollProducer.cc:60
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
ME0MuonCollection.h
ParameterSet.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
TrackCollections2monitor_cff.selectedTracks
selectedTracks
Definition: TrackCollections2monitor_cff.py:32
DTRecSegment4DCollection.h
ME0MuonTrackCollProducer::~ME0MuonTrackCollProducer
~ME0MuonTrackCollProducer() override
Definition: ME0MuonTrackCollProducer.cc:58
CSCSegmentCollection.h