CMS 3D CMS Logo

L3TkMuonProducer.h
Go to the documentation of this file.
1 #ifndef RecoMuon_L3MuonProducer_L3TkMuonProducer_H
2 #define RecoMuon_L3MuonProducer_L3TkMuonProducer_H
3 
14 
20 
21 namespace edm {
22  class ParameterSet;
23  class Event;
24  class EventSetup;
25 } // namespace edm
26 
28 public:
31 
33  ~L3TkMuonProducer() override;
34 
36  void produce(edm::Event&, const edm::EventSetup&) override;
37 
39 
40 private:
41  // L3/GLB Collection Label
44 
45  //psuedo ref is L2 or L1 ref.
46  typedef std::pair<unsigned int, unsigned int> pseudoRef;
47  typedef std::map<pseudoRef, std::pair<reco::TrackRef, SeedRef> > LXtoL3sMap;
48 
50  reco::TrackRef l2ref = s.l2Track();
51  if (l2ref.isNull()) {
52  l1extra::L1MuonParticleRef l1ref = s.l1Particle();
53  return std::make_pair(l1ref.id().id(), l1ref.key());
54  } else
55  return std::make_pair(l2ref.id().id(), l2ref.key());
56  }
57 
58  bool sharedSeed(const L3MuonTrajectorySeed& s1, const L3MuonTrajectorySeed& s2);
59 
60  //ordering functions
61  static bool seedRefBypT(const SeedRef& s1, const SeedRef& s2) {
62  double pt1, pt2;
63  reco::TrackRef l2ref1 = s1->l2Track();
64  if (l2ref1.isNull())
65  pt1 = s1->l1Particle()->pt();
66  else
67  pt1 = l2ref1->pt();
68  reco::TrackRef l2ref2 = s2->l2Track();
69  if (l2ref2.isNull())
70  pt2 = s2->l1Particle()->pt();
71  else
72  pt2 = l2ref2->pt();
73  return (pt1 > pt2);
74  }
75 
76  static bool trackRefBypT(const reco::TrackRef& t1, const reco::TrackRef& t2) { return (t1->pt() > t2->pt()); }
77 };
78 
79 #endif
ProductID id() const
Accessor for product ID.
Definition: Ref.h:244
key_type key() const
Accessor for product key.
Definition: Ref.h:250
bool sharedSeed(const L3MuonTrajectorySeed &s1, const L3MuonTrajectorySeed &s2)
std::map< pseudoRef, std::pair< reco::TrackRef, SeedRef > > LXtoL3sMap
void produce(edm::Event &, const edm::EventSetup &) override
produce candidates
static bool trackRefBypT(const reco::TrackRef &t1, const reco::TrackRef &t2)
static bool seedRefBypT(const SeedRef &s1, const SeedRef &s2)
L3TkMuonProducer(const edm::ParameterSet &)
constructor with config
bool isNull() const
Checks for null.
Definition: Ref.h:235
edm::Ref< L3MuonTrajectorySeedCollection > SeedRef
ProductIndex id() const
Definition: ProductID.h:35
std::pair< unsigned int, unsigned int > pseudoRef
edm::EDGetTokenT< reco::TrackCollection > trackToken_
~L3TkMuonProducer() override
destructor
HLT enums.
pseudoRef makePseudoRef(const L3MuonTrajectorySeed &s)
edm::InputTag theL3CollectionLabel