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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 66 of file ME0MuonConverter.cc.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 84 of file ME0MuonConverter.cc.

References OurMuonsToken_.

84  {
85 
86  produces<std::vector<reco::RecoChargedCandidate> >();
87  edm::InputTag OurMuonsTag ("me0SegmentMatching");
88  OurMuonsToken_ = consumes<ME0MuonCollection>(OurMuonsTag);
89 
90 }
edm::EDGetTokenT< ME0MuonCollection > OurMuonsToken_
ME0MuonConverter::~ME0MuonConverter ( )
override

Destructor.

Definition at line 92 of file ME0MuonConverter.cc.

92 {}

Member Function Documentation

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

Produce the converted collection.

Definition at line 94 of file ME0MuonConverter.cc.

References funct::abs(), DEFINE_FWK_MODULE, edm::Event::getByToken(), eostools::move(), OurMuonsToken_, p4, sysUtil::pid, edm::Event::put(), lumiQueryAPI::q, reco::RecoChargedCandidate::setTrack(), and badGlobalMuonTaggersAOD_cff::vtx.

94  {
95 
96  using namespace edm;
97 
98  using namespace reco;
99 
100  // Handle <std::vector<ME0Muon> > OurMuons;
101  // ev.getByToken <std::vector<ME0Muon> > (OurMuonsToken_, OurMuons);
102 
103 
105  ev.getByToken(OurMuonsToken_, OurMuons);
106 
107  auto oc = std::make_unique<RecoChargedCandidateCollection>();
108 
109  for (std::vector<ME0Muon>::const_iterator thisMuon = OurMuons->begin();
110  thisMuon != OurMuons->end(); ++thisMuon){
111  TrackRef tkRef = thisMuon->innerTrack();
112 
113  Particle::Charge q = tkRef->charge();
114  Particle::LorentzVector p4(tkRef->px(), tkRef->py(), tkRef->pz(), tkRef->p());
115  Particle::Point vtx(tkRef->vx(),tkRef->vy(), tkRef->vz());
116 
117  int pid = 0;
118  if(abs(q)==1) pid = q < 0 ? 13 : -13;
120  cand.setTrack(thisMuon->innerTrack());
121  oc->push_back(cand);
122  }
123 
124  ev.put(std::move(oc));
125 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
std::pair< double, double > Point
Definition: CaloEllipse.h:18
double p4[4]
Definition: TauolaWrapper.h:92
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:510
math::PtEtaPhiELorentzVectorF LorentzVector

Member Data Documentation

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

Definition at line 80 of file ME0MuonConverter.cc.

Referenced by ME0MuonConverter(), and produce().