CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/RecoMuon/L3MuonProducer/src/L3TkMuonProducer.h

Go to the documentation of this file.
00001 #ifndef RecoMuon_L3MuonProducer_L3TkMuonProducer_H
00002 #define RecoMuon_L3MuonProducer_L3TkMuonProducer_H
00003 
00013 #include "FWCore/Framework/interface/EDProducer.h"
00014 #include "FWCore/Utilities/interface/InputTag.h"
00015 
00016 #include "DataFormats/TrackReco/interface/Track.h"
00017 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00018 #include "DataFormats/MuonSeed/interface/L3MuonTrajectorySeed.h"
00019 #include "DataFormats/MuonSeed/interface/L3MuonTrajectorySeedCollection.h"
00020 #include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
00021 
00022 
00023 namespace edm {class ParameterSet; class Event; class EventSetup;}
00024 
00025 class L3TkMuonProducer : public edm::EDProducer {
00026 
00027  public:
00028 
00030   L3TkMuonProducer(const edm::ParameterSet&);
00031   
00033   virtual ~L3TkMuonProducer(); 
00034   
00036   virtual void produce(edm::Event&, const edm::EventSetup&);
00037 
00038   typedef edm::Ref<L3MuonTrajectorySeedCollection> SeedRef;
00039   
00040  private:
00041   
00042   // L3/GLB Collection Label
00043   edm::InputTag theL3CollectionLabel; 
00044 
00045   //psuedo ref is L2 or L1 ref.
00046   typedef std::pair<unsigned int,unsigned int> pseudoRef;
00047   typedef std::map<pseudoRef, std::pair<reco::TrackRef,SeedRef> > LXtoL3sMap;
00048 
00049   pseudoRef makePseudoRef(const L3MuonTrajectorySeed& s){
00050     reco::TrackRef l2ref = s.l2Track();
00051     if (l2ref.isNull()){
00052       l1extra::L1MuonParticleRef l1ref = s.l1Particle();
00053       return std::make_pair(l1ref.id().id(),l1ref.key());
00054     }else return std::make_pair(l2ref.id().id(),l2ref.key());
00055   }
00056 
00057   bool sharedSeed(const L3MuonTrajectorySeed& s1,const L3MuonTrajectorySeed& s2);
00058 
00059 
00060   //ordering functions
00061   static  bool seedRefBypT(const SeedRef & s1, const SeedRef & s2){
00062     double pt1,pt2;
00063     reco::TrackRef l2ref1 = s1->l2Track();
00064     if (l2ref1.isNull()) pt1=s1->l1Particle()->pt();
00065     else pt1=l2ref1->pt();
00066     reco::TrackRef l2ref2 = s2->l2Track();
00067     if (l2ref2.isNull()) pt2=s2->l1Particle()->pt();
00068     else pt2=l2ref2->pt();
00069     return (pt1>pt2);
00070   }
00071   
00072   static bool trackRefBypT(const reco::TrackRef & t1,const reco::TrackRef & t2){
00073     return (t1->pt()>t2->pt());
00074   }
00075 
00076 
00077 
00078 };
00079 
00080 #endif