132 double const MuMass = 0.106;
133 double const MuMass2 = MuMass*MuMass;
150 beamSpot = *recoBeamSpotHandle;
160 RecoChargedCandidateCollection::const_iterator cand1;
161 RecoChargedCandidateCollection::const_iterator cand2;
162 for (cand1=mucands->begin(); cand1!=mucands->end(); cand1++) {
165 LogDebug(
"HLTMuonDimuonL2FromL1TFilter") <<
" 1st muon in loop: q*pt= " 166 << tk1->charge()*tk1->pt() <<
", eta= " << tk1->eta() <<
", hits= " << tk1->numberOfValidHits();
168 if (!mapL2ToL1.isTriggeredByL1(tk1))
continue;
170 if (fabs(tk1->eta())>
max_Eta_)
continue;
173 if (tk1->numberOfValidHits()<
min_Nhits_)
continue;
176 if (tk1->hitPattern().muonStationsWithAnyHits() <
min_Nstations_)
continue;
179 if(tk1->hitPattern().dtStationsWithAnyHits() +
180 tk1->hitPattern().cscStationsWithAnyHits() <
min_Nchambers_)
continue;
187 if (fabs(tk1->dz())>
max_Dz_)
continue;
190 double pt1 = tk1->pt();
191 double err1 = tk1->error(0);
192 double abspar1 = fabs(tk1->parameter(0));
196 LogDebug(
"HLTMuonDimuonL2FromL1TFilter") <<
" ... 1st muon in loop, pt1= " 197 << pt1 <<
", ptLx1= " << ptLx1;
199 cand2 = cand1; cand2++;
200 for (; cand2!=mucands->end(); cand2++) {
204 LogDebug(
"HLTMuonDimuonL2FromL1TFilter") <<
" 2nd muon in loop: q*pt= " << tk2->charge()*tk2->pt() <<
", eta= " << tk2->eta() <<
", hits= " << tk2->numberOfValidHits() <<
", d0= " << tk2->d0();
205 if (!mapL2ToL1.isTriggeredByL1(tk2))
continue;
207 if (fabs(tk2->eta())>
max_Eta_)
continue;
210 if (tk2->numberOfValidHits()<
min_Nhits_)
continue;
213 if (tk2->hitPattern().muonStationsWithAnyHits() <
min_Nstations_)
continue;
216 if(tk2->hitPattern().dtStationsWithAnyHits() +
217 tk2->hitPattern().cscStationsWithAnyHits() <
min_Nchambers_)
continue;
224 if (fabs(tk2->dz())>
max_Dz_)
continue;
227 double pt2 = tk2->pt();
228 double err2 = tk2->error(0);
229 double abspar2 = fabs(tk2->parameter(0));
233 LogDebug(
"HLTMuonDimuonL2FromL1TFilter") <<
" ... 2nd muon in loop, pt2= " 234 << pt2 <<
", ptLx2= " << ptLx2;
245 if (tk1->charge()*tk2->charge()>0)
continue;
247 if (tk1->charge()*tk2->charge()<0)
continue;
251 double acop = fabs(tk1->phi()-tk2->phi());
252 if (acop>
M_PI) acop = 2*
M_PI - acop;
254 LogDebug(
"HLTMuonDimuonL2FromL1TFilter") <<
" ... 1-2 acop= " << acop;
259 double angle = acos((tk1->px()*tk2->px() + tk1->py()*tk2->py() + tk1->pz()*tk2->pz())/(tk1->p()*tk2->p()));
260 LogDebug(
"HLTMuonDimuonL2FromL1TFilter") <<
" ... 1-2 angle= " <<
angle;
265 double ptbalance = fabs(tk1->pt()-tk2->pt());
270 e1 =
sqrt(tk1->momentum().Mag2()+MuMass2);
271 e2 =
sqrt(tk2->momentum().Mag2()+MuMass2);
276 double pt12 = p.pt();
277 LogDebug(
"HLTMuonDimuonL2FromL1TFilter") <<
" ... 1-2 pt12= " << pt12;
280 double invmass =
abs(p.mass());
282 LogDebug(
"HLTMuonDimuonL2FromL1TFilter") <<
" ... 1-2 invmass= " << invmass;
288 LogDebug(
"HLTMuonDimuonL2FromL1TFilter") <<
" Track1 passing filter: pt= " << tk1->pt() <<
", eta: " << tk1->eta();
289 LogDebug(
"HLTMuonDimuonL2FromL1TFilter") <<
" Track2 passing filter: pt= " << tk2->pt() <<
", eta: " << tk2->eta();
290 LogDebug(
"HLTMuonDimuonL2FromL1TFilter") <<
" Invmass= " << invmass;
294 vector<RecoChargedCandidateRef> vref;
296 for (
auto &
i : vref) {
301 }
else if (tktmp==tk2) {
304 if (i1done && i2done)
break;
322 const bool accept (n >= 1);
324 LogDebug(
"HLTMuonDimuonL2FromL1TFilter") <<
" >>>>> Result of HLTMuonDimuonL2FromL1TFilter is "<<
accept <<
", number of muon pairs passing thresholds= " <<
n;
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::Ref< RecoChargedCandidateCollection > RecoChargedCandidateRef
reference to an object in a collection of RecoChargedCandidate objects
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > candToken_
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
Abs< T >::type abs(const T &t)
T const * get() const
Returns C++ pointer to the item.
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
const Point & position() const
position
edm::EDGetTokenT< SeedMap > seedMapToken_
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
math::PtEtaPhiELorentzVectorF LorentzVector
T angle(T x1, T y1, T z1, T x2, T y2, T z2)