CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTMuonL2ToL1Map.h
Go to the documentation of this file.
1 #ifndef HLTMuonL2ToL1Map_h
2 #define HLTMuonL2ToL1Map_h
3 
21 
23 
25 
26  public:
28  explicit HLTMuonL2ToL1Map(edm::InputTag& previousCandTag, edm::InputTag& seedMapTag, edm::Event& iEvent){
29  // get hold of muons that fired the previous level
31  iEvent.getByLabel(previousCandTag, previousLevelCands);
32  previousLevelCands->getObjects(trigger::TriggerL1Mu, firedL1Muons_);
33 
34  // get hold of the seed map
35  iEvent.getByLabel(seedMapTag, seedMapHandle_);
36  }
37 
39  }
40 
43  bool isTriggered = false;
44  const edm::RefVector<L2MuonTrajectorySeedCollection>& seeds = (*seedMapHandle_)[l2muon->seedRef().castTo<edm::Ref<L2MuonTrajectorySeedCollection> >()];
45  for(size_t i=0; i<seeds.size(); i++){
46  if(find(firedL1Muons_.begin(), firedL1Muons_.end(), seeds[i]->l1Particle()) != firedL1Muons_.end()){
47  isTriggered = true;
48  break;
49  }
50  }
51  return isTriggered;
52  }
53 
55  std::string getL1Keys(reco::TrackRef& l2muon){
56  std::ostringstream ss;
57  const edm::RefVector<L2MuonTrajectorySeedCollection>& seeds = (*seedMapHandle_)[l2muon->seedRef().castTo<edm::Ref<L2MuonTrajectorySeedCollection> >()];
58  for(size_t i=0; i<seeds.size(); i++){
59  ss<<seeds[i]->l1Particle().key()<<" ";
60  }
61  return ss.str();
62  }
63 
64  private:
66  std::vector<l1extra::L1MuonParticleRef> firedL1Muons_;
67 
70 };
71 
72 #endif //HLTMuonL2ToL1Map_h
int i
Definition: DBlmapReader.cc:9
bool isTriggeredByL1(reco::TrackRef &l2muon)
checks if a L2 muon was seeded by a fired L1
enum start value shifted to 81 so as to avoid clashes with PDG codes
edm::Handle< SeedMap > seedMapHandle_
containes the map from a L2 seed to its sister seeds the track of which has been cleaned ...
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
int iEvent
Definition: GenABIO.cc:243
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
edm::AssociationMap< edm::OneToMany< std::vector< L2MuonTrajectorySeed >, std::vector< L2MuonTrajectorySeed > > > SeedMap
HLTMuonL2ToL1Map(edm::InputTag &previousCandTag, edm::InputTag &seedMapTag, edm::Event &iEvent)
construct with the InputTag of the L1 filter object, the InputTag of the L2 seed map (&quot;hltL2Muons&quot;) a...
std::vector< l1extra::L1MuonParticleRef > firedL1Muons_
contains the vector of references to fired L1 candidates
size_type size() const
Size of the RefVector.
Definition: RefVector.h:85
std::string getL1Keys(reco::TrackRef &l2muon)
returns the indices of L1 seeds