CMS 3D CMS Logo

HLTMuonL2ToL1Map.h
Go to the documentation of this file.
1 #ifndef HLTMuonL2ToL1Map_h
2 #define HLTMuonL2ToL1Map_h
3 
21 
23 
25 
27 
28  public:
31  // get hold of muons that fired the previous level
33  iEvent.getByToken(previousCandToken, previousLevelCands);
34  previousLevelCands->getObjects(trigger::TriggerL1Mu, firedL1Muons_);
35 
36  // get hold of the seed map
37  iEvent.getByToken(seedMapToken, seedMapHandle_);
38  }
39 
41  }
42 
45  bool isTriggered = false;
46  const edm::RefVector<L2MuonTrajectorySeedCollection>& seeds = (*seedMapHandle_)[l2muon->seedRef().castTo<edm::Ref<L2MuonTrajectorySeedCollection> >()];
47  for(size_t i=0; i<seeds.size(); i++){
48  if(find(firedL1Muons_.begin(), firedL1Muons_.end(), seeds[i]->l1Particle()) != firedL1Muons_.end()){
49  isTriggered = true;
50  break;
51  }
52  }
53  return isTriggered;
54  }
55 
58  std::ostringstream ss;
59  const edm::RefVector<L2MuonTrajectorySeedCollection>& seeds = (*seedMapHandle_)[l2muon->seedRef().castTo<edm::Ref<L2MuonTrajectorySeedCollection> >()];
60  for(size_t i=0; i<seeds.size(); i++){
61  ss<<seeds[i]->l1Particle().key()<<" ";
62  }
63  return ss.str();
64  }
65 
66  private:
68  std::vector<l1extra::L1MuonParticleRef> firedL1Muons_;
69 
72 };
73 
74 #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
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
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:20
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
size_type size() const
Size of the RefVector.
Definition: RefVector.h:107
std::string getL1Keys(reco::TrackRef &l2muon)
returns the indices of L1 seeds