187 vector<RecoChargedCandidateRef> vl2cands;
196 std::map<reco::TrackRef, std::vector<RecoChargedCandidateRef> > L2toL3s;
198 std::map<unsigned int, RecoChargedCandidateRef > MuonToL3s;
201 if (mucands->empty())
return false;
202 auto const &tk = (*mucands)[0].track();
205 if (tk->seedRef().isNonnull()){
207 useL3MTS =
a !=
nullptr;
212 unsigned int maxI = mucands->size();
213 for (
unsigned int i=0;
i!=
maxI;
i++){
214 const TrackRef &tk = (*mucands)[
i].track();
217 TrackRef staTrack = l3seedRef->l2Track();
231 std::vector<l1t::MuonRef> vl1cands;
233 bool check_l1match =
true;
236 for(
unsigned int i(0);
i < mucands->size(); ++
i){
245 check_l1match =
true;
246 for(
auto const & link : *links){
250 const reco::Track& trackerTrack = *link.trackerTrack();
251 if (tk->pt()==0
or trackerTrack.
pt()==0)
continue;
253 float dR2 =
deltaR2(tk->eta(),tk->phi(),trackerTrack.
eta(),trackerTrack.
phi());
254 float dPt =
std::abs(tk->pt() - trackerTrack.
pt())/tk->pt();
256 if (dR2 < 0.02*0.02 and dPt < 0.001) {
257 const TrackRef staTrack = link.standAloneTrack();
259 check_l1match =
false;
266 const unsigned int nL1Muons(vl1cands.size());
267 for (
unsigned int il1=0; il1!=nL1Muons; ++il1) {
285 auto L2toL3s_it1 = L2toL3s.begin();
286 auto L2toL3s_end = L2toL3s.end();
287 bool atLeastOnePair=
false;
288 for (; L2toL3s_it1!=L2toL3s_end; ++L2toL3s_it1){
294 unsigned int maxItk1=L2toL3s_it1->second.size();
295 for (; iTk1!=maxItk1; iTk1++){
296 bool thisL3Index1isDone=
false;
300 LogDebug(
"HLTMuonDimuonL3Filter") <<
" 1st muon in loop: q*pt= " << tk1->charge()*tk1->pt()
301 <<
" (" << cand1->charge()*cand1->pt()<<
") " <<
", eta= " << tk1->eta()
302 <<
" (" << cand1->eta() <<
") " <<
", hits= " << tk1->numberOfValidHits();
309 LogDebug(
"HLTMuonDimuonL3Filter") <<
" ... 1st muon in loop, pt1= " << cand1->pt();
312 auto L2toL3s_it2 = L2toL3s_it1;
314 for (; L2toL3s_it2!=L2toL3s_end; ++L2toL3s_it2){
319 unsigned int maxItk2=L2toL3s_it2->second.size();
320 for (; iTk2!=maxItk2; iTk2++){
324 LogDebug(
"HLTMuonDimuonL3Filter") <<
" 2nd muon in loop: q*pt= " << tk2->charge()*tk2->pt()
325 <<
" (" << cand2->charge()*cand2->pt() <<
") " <<
", eta= " << tk2->eta()
326 <<
" (" << cand2->eta() <<
") " <<
", hits= " << tk2->numberOfValidHits() <<
", d0= " << tk2->d0() ;
333 LogDebug(
"HLTMuonDimuonL3Filter") <<
" ... 2nd muon in loop, pt2= " << cand2->pt();
340 LogDebug(
"HLTMuonDimuonL3Filter") <<
" Track1 passing filter: pt= " << cand1->pt() <<
", eta: " << cand1->eta();
341 LogDebug(
"HLTMuonDimuonL3Filter") <<
" Track2 passing filter: pt= " << cand2->pt() <<
", eta: " << cand2->eta();
345 vector<RecoChargedCandidateRef> vref;
347 for (
auto &
i : vref) {
350 if (tktmp==tk1) i1done =
true;
351 else if (tktmp==tk2) i2done =
true;
352 if (i1done && i2done)
break;
358 thisL3Index1isDone=
true;
367 if (thisL3Index1isDone)
break;
370 auto MuonToL3s_it1 = MuonToL3s.begin();
371 auto MuonToL3s_end = MuonToL3s.end();
372 for (; MuonToL3s_it1!=MuonToL3s_end; ++MuonToL3s_it1){
380 LogDebug(
"HLTMuonDimuonL3Filter") <<
" L3FromL2 Track1 passing filter: pt= " << cand1->pt() <<
", eta: " << cand1->eta();
381 LogDebug(
"HLTMuonDimuonL3Filter") <<
" L3FromL1 Track2 passing filter: pt= " << cand2->pt() <<
", eta: " << cand2->eta();
385 vector<RecoChargedCandidateRef> vref;
387 for (
auto &
i : vref) {
390 if (tktmp==tk1) i1done =
true;
391 else if (tktmp==tk2) i2done =
true;
392 if (i1done && i2done)
break;
398 thisL3Index1isDone=
true;
404 if (thisL3Index1isDone)
break;
413 auto MuonToL3s_it1 = MuonToL3s.begin();
414 auto MuonToL3s_end = MuonToL3s.end();
415 for (; MuonToL3s_it1!=MuonToL3s_end; ++MuonToL3s_it1){
416 bool thisL3Index1isDone=
false;
422 auto MuonToL3s_it2 = MuonToL3s_it1;
423 for (; MuonToL3s_it2!=MuonToL3s_end; ++MuonToL3s_it2){
432 LogDebug(
"HLTMuonDimuonL3Filter") <<
" L3FromL1 Track1 passing filter: pt= " << cand1->pt() <<
", eta: " << cand1->eta();
433 LogDebug(
"HLTMuonDimuonL3Filter") <<
" L3FromL1 Track2 passing filter: pt= " << cand2->pt() <<
", eta: " << cand2->eta();
437 vector<RecoChargedCandidateRef> vref;
439 for (
auto &
i : vref) {
442 if (tktmp==tk1) i1done =
true;
443 else if (tktmp==tk2) i2done =
true;
444 if (i1done && i2done)
break;
450 thisL3Index1isDone=
true;
457 if (thisL3Index1isDone)
break;
464 LogDebug(
"HLTMuonDimuonL3Filter") <<
" >>>>> Result of HLTMuonDimuonL3Filter is "<<
accept <<
", number of muon pairs passing thresholds= " <<
n;
bool applyDiMuonSelection(const reco::RecoChargedCandidateRef &, const reco::RecoChargedCandidateRef &, const reco::BeamSpot &, const edm::ESHandle< MagneticField > &) const
std::vector< double > max_PtPair_
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
std::vector< double > max_PtMin_
std::vector< double > max_InvMass_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
enum start value shifted to 81 so as to avoid clashes with PDG codes
std::vector< double > min_InvMass_
edm::Ref< RecoChargedCandidateCollection > RecoChargedCandidateRef
reference to an object in a collection of RecoChargedCandidate objects
double phi() const
azimuthal angle of momentum vector
bool applyMuonSelection(const reco::RecoChargedCandidateRef &, const reco::BeamSpot &) const
std::vector< double > min_PtPair_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
const edm::InputTag l1CandTag_
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
const bool matchPreviousCand_
double eta() const
pseudorapidity of momentum vector
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > l1CandToken_
double pt() const
track transverse momentum
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Abs< T >::type abs(const T &t)
T const * get() const
Returns C++ pointer to the item.
std::vector< double > min_PtMin_
std::vector< double > min_PtMax_
const edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > candToken_
const edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkToken_
static bool triggeredByLevel2(reco::TrackRef const &track, std::vector< reco::RecoChargedCandidateRef > const &vcands)
const edm::InputTag candTag_
const double L1MatchingdR_