CommonTools
RecoAlgos
plugins
ME0MuonTrackCollProducer.cc
Go to the documentation of this file.
1
2
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
3
#include "
DataFormats/TrackReco/interface/TrackFwd.h
"
4
#include "
DataFormats/TrackReco/interface/Track.h
"
5
#include "
DataFormats/MuonDetId/interface/CSCDetId.h
"
6
#include "
DataFormats/MuonDetId/interface/DTChamberId.h
"
7
#include "
DataFormats/MuonDetId/interface/MuonSubdetId.h
"
8
#include "
DataFormats/VertexReco/interface/Vertex.h
"
9
#include "
DataFormats/VertexReco/interface/VertexFwd.h
"
10
#include "
DataFormats/MuonReco/interface/Muon.h
"
11
#include "
DataFormats/TrackReco/interface/Track.h
"
12
#include "
DataFormats/TrackReco/interface/TrackFwd.h
"
13
#include "
RecoMuon/MuonIdentification/plugins/ME0MuonSelector.cc
"
14
#include "
FWCore/Framework/interface/ESHandle.h
"
15
16
#include <sstream>
17
18
#include <memory>
19
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
20
#include "
FWCore/Framework/interface/Event.h
"
21
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
22
#include "
DataFormats/MuonReco/interface/MuonFwd.h
"
23
#include "
DataFormats/MuonReco/interface/ME0Muon.h
"
24
#include "
DataFormats/MuonReco/interface/ME0MuonCollection.h
"
25
#include "
DataFormats/CSCRecHit/interface/CSCSegmentCollection.h
"
26
#include "
DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h
"
27
#include "
DataFormats/HepMCCandidate/interface/GenParticle.h
"
28
29
class
ME0MuonTrackCollProducer
:
public
edm::stream::EDProducer
<> {
30
public
:
31
explicit
ME0MuonTrackCollProducer
(
const
edm::ParameterSet
&);
32
//std::vector<double> findSimVtx(edm::Event& iEvent);
33
~ME0MuonTrackCollProducer
()
override
;
34
35
private
:
36
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
37
edm::Handle<std::vector<reco::ME0Muon>
>
OurMuons
;
38
//edm::Handle<reco::ME0MuonCollection> muonCollectionH;
39
edm::InputTag
OurMuonsTag
;
40
std::vector<std::string>
selectionTags
;
41
const
edm::ParameterSet
parset_
;
42
edm::EDGetTokenT<ME0MuonCollection>
OurMuonsToken_
;
43
};
44
45
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
46
#include "
FWCore/Framework/interface/MakerMacros.h
"
47
48
DEFINE_FWK_MODULE
(
ME0MuonTrackCollProducer
);
49
50
ME0MuonTrackCollProducer::ME0MuonTrackCollProducer
(
const
edm::ParameterSet
& parset)
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
58
ME0MuonTrackCollProducer::~ME0MuonTrackCollProducer
() {}
59
60
void
ME0MuonTrackCollProducer::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
61
using namespace
reco
;
62
using namespace
edm
;
63
Handle<ME0MuonCollection>
OurMuons
;
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
}
86
iEvent
.put(
std::move
(
selectedTracks
));
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
Generated for CMSSW Reference Manual by
1.8.16