CMS 3D CMS Logo

HLTMuonL2ToL1TMap.h
Go to the documentation of this file.
1 #ifndef HLTMuonL2ToL1TMap_h
2 #define HLTMuonL2ToL1TMap_h
3 
21 
24 
26 
28 
29  public:
32  // get hold of muons that fired the previous level
34  iEvent.getByToken(previousCandToken, previousLevelCands);
35  previousLevelCands->getObjects(trigger::TriggerL1Mu, firedL1Muons_);
36 
37  // get hold of the seed map
38  iEvent.getByToken(seedMapToken, seedMapHandle_);
39  }
40 
42  }
43 
46  bool isTriggered = false;
47  const edm::RefVector<L2MuonTrajectorySeedCollection>& seeds = (*seedMapHandle_)[l2muon->seedRef().castTo<edm::Ref<L2MuonTrajectorySeedCollection> >()];
48  for(size_t i=0; i<seeds.size(); i++){
49  if(find(firedL1Muons_.begin(), firedL1Muons_.end(), seeds[i]->l1tParticle()) != firedL1Muons_.end()){
50  isTriggered = true;
51  break;
52  }
53  }
54  return isTriggered;
55  }
56 
59  std::ostringstream ss;
60  const edm::RefVector<L2MuonTrajectorySeedCollection>& seeds = (*seedMapHandle_)[l2muon->seedRef().castTo<edm::Ref<L2MuonTrajectorySeedCollection> >()];
61  for(size_t i=0; i<seeds.size(); i++){
62  ss<<seeds[i]->l1tParticle().key()<<" ";
63  }
64  return ss.str();
65  }
66 
67  private:
69  std::vector<l1t::MuonRef> firedL1Muons_;
70 
73 };
74 
75 #endif //HLTMuonL2ToL1TMap_h
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
enum start value shifted to 81 so as to avoid clashes with PDG codes
bool isTriggeredByL1(reco::TrackRef &l2muon)
checks if a L2 muon was seeded by a fired L1
HLTMuonL2ToL1TMap(const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > &previousCandToken, const edm::EDGetTokenT< SeedMap > seedMapToken, const edm::Event &iEvent)
construct with the Token of the L1 filter object, the Token of the L2 seed map ("hltL2Muons") and the...
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
int iEvent
Definition: GenABIO.cc:230
edm::AssociationMap< edm::OneToMany< std::vector< L2MuonTrajectorySeed >, std::vector< L2MuonTrajectorySeed > > > SeedMap
std::string getL1Keys(reco::TrackRef &l2muon)
returns the indices of L1 seeds
std::vector< l1t::MuonRef > firedL1Muons_
contains the vector of references to fired L1 candidates
size_type size() const
Size of the RefVector.
Definition: RefVector.h:107
edm::Handle< SeedMap > seedMapHandle_
containes the map from a L2 seed to its sister seeds the track of which has been cleaned ...