CMS 3D CMS Logo

HLTMuonL2ToL1Map.h
Go to the documentation of this file.
1 #ifndef HLTMuonL2ToL1Map_h
2 #define HLTMuonL2ToL1Map_h
3 
21 
23 
24 typedef edm::AssociationMap<edm::OneToMany<std::vector<L2MuonTrajectorySeed>, std::vector<L2MuonTrajectorySeed> > >
26 
28 public:
31  const edm::EDGetTokenT<SeedMap> seedMapToken,
32  const edm::Event& iEvent) {
33  // get hold of muons that fired the previous level
35  iEvent.getByToken(previousCandToken, previousLevelCands);
36  previousLevelCands->getObjects(trigger::TriggerL1Mu, firedL1Muons_);
37 
38  // get hold of the seed map
39  iEvent.getByToken(seedMapToken, seedMapHandle_);
40  }
41 
43 
46  bool isTriggered = false;
48  (*seedMapHandle_)[l2muon->seedRef().castTo<edm::Ref<L2MuonTrajectorySeedCollection> >()];
49  for (size_t i = 0; i < seeds.size(); i++) {
50  if (find(firedL1Muons_.begin(), firedL1Muons_.end(), seeds[i]->l1Particle()) != firedL1Muons_.end()) {
51  isTriggered = true;
52  break;
53  }
54  }
55  return isTriggered;
56  }
57 
60  std::ostringstream ss;
62  (*seedMapHandle_)[l2muon->seedRef().castTo<edm::Ref<L2MuonTrajectorySeedCollection> >()];
63  for (size_t i = 0; i < seeds.size(); i++) {
64  ss << seeds[i]->l1Particle().key() << " ";
65  }
66  return ss.str();
67  }
68 
69 private:
71  std::vector<l1extra::L1MuonParticleRef> firedL1Muons_;
72 
75 };
76 
77 #endif //HLTMuonL2ToL1Map_h
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
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:19
int iEvent
Definition: GenABIO.cc:224
HLTMuonL2ToL1Map(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...
edm::AssociationMap< edm::OneToMany< std::vector< L2MuonTrajectorySeed >, std::vector< L2MuonTrajectorySeed > > > SeedMap
std::vector< l1extra::L1MuonParticleRef > firedL1Muons_
contains the vector of references to fired L1 candidates
std::string getL1Keys(reco::TrackRef &l2muon)
returns the indices of L1 seeds