CMS 3D CMS Logo

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

Public Member Functions

 ME0MuonConverter (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 Produce the converted collection. More...
 
 ~ME0MuonConverter () override
 Destructor. More...
 
- 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 Attributes

edm::EDGetTokenT< ME0MuonCollectionOurMuonsToken_
 

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

Produces a collection of ME0Segment's in endcap muon ME0s.

Author
David Nash

Definition at line 56 of file ME0MuonConverter.cc.

Constructor & Destructor Documentation

ME0MuonConverter::ME0MuonConverter ( const edm::ParameterSet pas)
explicit

Constructor.

Definition at line 70 of file ME0MuonConverter.cc.

References OurMuonsToken_.

70  {
71  produces<std::vector<reco::RecoChargedCandidate> >();
72  edm::InputTag OurMuonsTag("me0SegmentMatching");
73  OurMuonsToken_ = consumes<ME0MuonCollection>(OurMuonsTag);
74 }
edm::EDGetTokenT< ME0MuonCollection > OurMuonsToken_
ME0MuonConverter::~ME0MuonConverter ( )
override

Destructor.

Definition at line 76 of file ME0MuonConverter.cc.

76 {}

Member Function Documentation

void ME0MuonConverter::produce ( edm::Event ev,
const edm::EventSetup setup 
)
override

Produce the converted collection.

Definition at line 78 of file ME0MuonConverter.cc.

References funct::abs(), DEFINE_FWK_MODULE, edm::Event::getByToken(), eostools::move(), OurMuonsToken_, p4, edm::Event::put(), data-class-funcs::q, reco::RecoChargedCandidate::setTrack(), and badGlobalMuonTaggersAOD_cff::vtx.

78  {
79  using namespace edm;
80 
81  using namespace reco;
82 
83  // Handle <std::vector<ME0Muon> > OurMuons;
84  // ev.getByToken <std::vector<ME0Muon> > (OurMuonsToken_, OurMuons);
85 
87  ev.getByToken(OurMuonsToken_, OurMuons);
88 
89  auto oc = std::make_unique<RecoChargedCandidateCollection>();
90 
91  for (std::vector<ME0Muon>::const_iterator thisMuon = OurMuons->begin(); thisMuon != OurMuons->end(); ++thisMuon) {
92  TrackRef tkRef = thisMuon->innerTrack();
93 
94  Particle::Charge q = tkRef->charge();
95  Particle::LorentzVector p4(tkRef->px(), tkRef->py(), tkRef->pz(), tkRef->p());
96  Particle::Point vtx(tkRef->vx(), tkRef->vy(), tkRef->vz());
97 
98  int pid = 0;
99  if (abs(q) == 1)
100  pid = q < 0 ? 13 : -13;
102  cand.setTrack(thisMuon->innerTrack());
103  oc->push_back(cand);
104  }
105 
106  ev.put(std::move(oc));
107 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
double p4[4]
Definition: TauolaWrapper.h:92
math::XYZPoint Point
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< ME0MuonCollection > OurMuonsToken_
fixed size matrix
HLT enums.
def move(src, dest)
Definition: eostools.py:511
math::PtEtaPhiELorentzVectorF LorentzVector

Member Data Documentation

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

Definition at line 67 of file ME0MuonConverter.cc.

Referenced by ME0MuonConverter(), and produce().