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::ME0MuonConverter ( const edm::ParameterSet pas)
explicit

Constructor.

Definition at line 70 of file ME0MuonConverter.cc.

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

References OurMuonsToken_.

◆ ~ME0MuonConverter()

ME0MuonConverter::~ME0MuonConverter ( )
override

Destructor.

Definition at line 76 of file ME0MuonConverter.cc.

76 {}

Member Function Documentation

◆ produce()

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

Produce the converted collection.

Definition at line 78 of file ME0MuonConverter.cc.

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 }

References funct::abs(), PixelTestBeamValidation_cfi::Charge, ev, eostools::move(), OurMuonsToken_, p4, data-class-funcs::q, and badGlobalMuonTaggersAOD_cff::vtx.

Member Data Documentation

◆ OurMuonsToken_

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

Definition at line 67 of file ME0MuonConverter.cc.

Referenced by ME0MuonConverter(), and produce().

edm
HLT enums.
Definition: AlignableModifier.h:19
data-class-funcs.q
q
Definition: data-class-funcs.py:169
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref< TrackCollection >
Point
math::XYZPoint Point
Definition: TrackerDpgAnalysis.cc:107
ME0MuonConverter::OurMuonsToken_
edm::EDGetTokenT< ME0MuonCollection > OurMuonsToken_
Definition: ME0MuonConverter.cc:67
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
cand
Definition: decayParser.h:34
p4
double p4[4]
Definition: TauolaWrapper.h:92
reco::RecoChargedCandidate
Definition: RecoChargedCandidate.h:15
reco::JetExtendedAssociation::LorentzVector
math::PtEtaPhiELorentzVectorF LorentzVector
Definition: JetExtendedAssociation.h:25
eostools.move
def move(src, dest)
Definition: eostools.py:511
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
PixelTestBeamValidation_cfi.Charge
Charge
Definition: PixelTestBeamValidation_cfi.py:78
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::InputTag
Definition: InputTag.h:15