CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ME0MuonTrackCollProducer Class Reference
Inheritance diagram for ME0MuonTrackCollProducer:
edm::stream::EDProducer<>

Public Member Functions

 ME0MuonTrackCollProducer (const edm::ParameterSet &)
 
 ~ME0MuonTrackCollProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::Handle< std::vector< reco::ME0Muon > > OurMuons
 
edm::InputTag OurMuonsTag
 
edm::EDGetTokenT< ME0MuonCollectionOurMuonsToken_
 
const edm::ParameterSet parset_
 
std::vector< std::string > selectionTags
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 29 of file ME0MuonTrackCollProducer.cc.

Constructor & Destructor Documentation

◆ ME0MuonTrackCollProducer()

ME0MuonTrackCollProducer::ME0MuonTrackCollProducer ( const edm::ParameterSet parset)
explicit

Definition at line 50 of file ME0MuonTrackCollProducer.cc.

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 }

References OurMuonsTag, and OurMuonsToken_.

◆ ~ME0MuonTrackCollProducer()

ME0MuonTrackCollProducer::~ME0MuonTrackCollProducer ( )
override

Definition at line 58 of file ME0MuonTrackCollProducer.cc.

58 {}

Member Function Documentation

◆ produce()

void ME0MuonTrackCollProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 60 of file ME0MuonTrackCollProducer.cc.

60  {
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 }

References iEvent, muon::isGoodMuon(), eostools::move(), OurMuons, OurMuonsToken_, TrackCollections2monitor_cff::selectedTracks, and muon::Tight.

Member Data Documentation

◆ OurMuons

edm::Handle<std::vector<reco::ME0Muon> > ME0MuonTrackCollProducer::OurMuons
private

Definition at line 37 of file ME0MuonTrackCollProducer.cc.

Referenced by produce().

◆ OurMuonsTag

edm::InputTag ME0MuonTrackCollProducer::OurMuonsTag
private

Definition at line 39 of file ME0MuonTrackCollProducer.cc.

Referenced by ME0MuonTrackCollProducer().

◆ OurMuonsToken_

edm::EDGetTokenT<ME0MuonCollection> ME0MuonTrackCollProducer::OurMuonsToken_
private

Definition at line 42 of file ME0MuonTrackCollProducer.cc.

Referenced by ME0MuonTrackCollProducer(), and produce().

◆ parset_

const edm::ParameterSet ME0MuonTrackCollProducer::parset_
private

Definition at line 41 of file ME0MuonTrackCollProducer.cc.

◆ selectionTags

std::vector<std::string> ME0MuonTrackCollProducer::selectionTags
private

Definition at line 40 of file ME0MuonTrackCollProducer.cc.

edm::RefProd< TrackCollection >
ME0MuonTrackCollProducer::OurMuonsToken_
edm::EDGetTokenT< ME0MuonCollection > OurMuonsToken_
Definition: ME0MuonTrackCollProducer.cc:42
edm
HLT enums.
Definition: AlignableModifier.h:19
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
ME0MuonTrackCollProducer::OurMuonsTag
edm::InputTag OurMuonsTag
Definition: ME0MuonTrackCollProducer.cc:39
edm::Ref< TrackCollection >
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
muon::Tight
Definition: ME0MuonSelector.h:17
ME0MuonTrackCollProducer::parset_
const edm::ParameterSet parset_
Definition: ME0MuonTrackCollProducer.cc:41
reco::Track
Definition: Track.h:27
ME0MuonTrackCollProducer::OurMuons
edm::Handle< std::vector< reco::ME0Muon > > OurMuons
Definition: ME0MuonTrackCollProducer.cc:37
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
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