CMS 3D CMS Logo

ME0MuonConverter.cc
Go to the documentation of this file.
1 
8 
12 
14 
20 
21 #include "TLorentzVector.h"
22 
25 
27 
30 
44 
47 
50 
52 
55 
57 public:
59  explicit ME0MuonConverter(const edm::ParameterSet&);
61  ~ME0MuonConverter() override;
63  void produce(edm::Event&, const edm::EventSetup&) override;
64 
65 private:
66  //edm::EDGetTokenT<std::vector<reco::ME0Muon>> OurMuonsToken_;
68 };
69 
71  produces<std::vector<reco::RecoChargedCandidate> >();
72  edm::InputTag OurMuonsTag("me0SegmentMatching");
73  OurMuonsToken_ = consumes<ME0MuonCollection>(OurMuonsTag);
74 }
75 
77 
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 }
108 
Propagator.h
TrajectoryStateOnSurface.h
Handle.h
MessageLogger.h
EDProducer.h
ESHandle.h
edm::EDGetTokenT< ME0MuonCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
ME0SegmentCollection.h
data-class-funcs.q
q
Definition: data-class-funcs.py:169
EDProducer.h
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
edm::Ref< TrackCollection >
MakerMacros.h
Point
math::XYZPoint Point
Definition: TrackerDpgAnalysis.cc:107
Track.h
TrackFwd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ME0MuonConverter::OurMuonsToken_
edm::EDGetTokenT< ME0MuonCollection > OurMuonsToken_
Definition: ME0MuonConverter.cc:67
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
ME0MuonConverter::~ME0MuonConverter
~ME0MuonConverter() override
Destructor.
Definition: ME0MuonConverter.cc:76
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
cand
Definition: decayParser.h:34
ModuleDef.h
p4
double p4[4]
Definition: TauolaWrapper.h:92
edm::stream::EDProducer
Definition: EDProducer.h:38
reco::RecoChargedCandidate
Definition: RecoChargedCandidate.h:15
edm::EventSetup
Definition: EventSetup.h:57
ME0Muon.h
InputTag.h
PropagationDirection.h
reco::JetExtendedAssociation::LorentzVector
math::PtEtaPhiELorentzVectorF LorentzVector
Definition: JetExtendedAssociation.h:25
ME0MuonConverter
Definition: ME0MuonConverter.cc:56
eostools.move
def move(src, dest)
Definition: eostools.py:511
RecoChargedCandidate.h
Frameworkfwd.h
TrackingComponentsRecord.h
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
PixelTestBeamValidation_cfi.Charge
Charge
Definition: PixelTestBeamValidation_cfi.py:78
GlobalVector.h
EventSetup.h
ME0MuonCollection.h
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ParameterSet.h
MuonGeometryRecord.h
edm::Event
Definition: Event.h:73
RecoChargedCandidateFwd.h
ME0MuonConverter::ME0MuonConverter
ME0MuonConverter(const edm::ParameterSet &)
Constructor.
Definition: ME0MuonConverter.cc:70
GlobalPoint.h
edm::InputTag
Definition: InputTag.h:15
ME0MuonConverter::produce
void produce(edm::Event &, const edm::EventSetup &) override
Produce the converted collection.
Definition: ME0MuonConverter.cc:78