CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L3TkMuonProducer.h
Go to the documentation of this file.
1 #ifndef RecoMuon_L3MuonProducer_L3TkMuonProducer_H
2 #define RecoMuon_L3MuonProducer_L3TkMuonProducer_H
3 
15 
21 
22 
23 namespace edm {class ParameterSet; class Event; class EventSetup;}
24 
26 
27  public:
28 
31 
33  virtual ~L3TkMuonProducer();
34 
36  virtual void produce(edm::Event&, const edm::EventSetup&) override;
37 
39 
40  private:
41 
42  // L3/GLB Collection Label
45 
46 
47 
48  //psuedo ref is L2 or L1 ref.
49  typedef std::pair<unsigned int,unsigned int> pseudoRef;
50  typedef std::map<pseudoRef, std::pair<reco::TrackRef,SeedRef> > LXtoL3sMap;
51 
53  reco::TrackRef l2ref = s.l2Track();
54  if (l2ref.isNull()){
56  return std::make_pair(l1ref.id().id(),l1ref.key());
57  }else return std::make_pair(l2ref.id().id(),l2ref.key());
58  }
59 
61 
62 
63  //ordering functions
64  static bool seedRefBypT(const SeedRef & s1, const SeedRef & s2){
65  double pt1,pt2;
66  reco::TrackRef l2ref1 = s1->l2Track();
67  if (l2ref1.isNull()) pt1=s1->l1Particle()->pt();
68  else pt1=l2ref1->pt();
69  reco::TrackRef l2ref2 = s2->l2Track();
70  if (l2ref2.isNull()) pt2=s2->l1Particle()->pt();
71  else pt2=l2ref2->pt();
72  return (pt1>pt2);
73  }
74 
75  static bool trackRefBypT(const reco::TrackRef & t1,const reco::TrackRef & t2){
76  return (t1->pt()>t2->pt());
77  }
78 
79 
80 
81 };
82 
83 #endif
std::pair< unsigned int, unsigned int > pseudoRef
reco::TrackRef l2Track() const
Get L2 info.
key_type key() const
Accessor for product key.
Definition: Ref.h:266
ProductID id() const
Accessor for product ID.
Definition: Ref.h:256
tuple s2
Definition: indexGen.py:106
bool sharedSeed(const L3MuonTrajectorySeed &s1, const L3MuonTrajectorySeed &s2)
virtual 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:247
edm::Ref< L3MuonTrajectorySeedCollection > SeedRef
std::map< pseudoRef, std::pair< reco::TrackRef, SeedRef > > LXtoL3sMap
l1extra::L1MuonParticleRef l1Particle() const
Get L1 info.
virtual ~L3TkMuonProducer()
destructor
edm::EDGetTokenT< reco::TrackCollection > trackToken_
pseudoRef makePseudoRef(const L3MuonTrajectorySeed &s)
ProductIndex id() const
Definition: ProductID.h:38
edm::InputTag theL3CollectionLabel