39 using namespace trigger;
45 beamspotTag_ (iConfig.getParameter< edm::
InputTag > (
"BeamSpotTag")),
46 candTag_ (iConfig.getParameter< edm::
InputTag > (
"CandTag")),
47 previousCandTag_ (iConfig.getParameter<
InputTag > (
"PreviousCandTag")),
48 fast_Accept_ (iConfig.getParameter<bool> (
"FastAccept")),
49 max_Eta_ (iConfig.getParameter<double> (
"MaxEta")),
50 min_Nhits_ (iConfig.getParameter<int> (
"MinNhits")),
51 max_Dr_ (iConfig.getParameter<double> (
"MaxDr")),
52 max_Dz_ (iConfig.getParameter<double> (
"MaxDz")),
53 chargeOpt_ (iConfig.getParameter<int> (
"ChargeOpt")),
54 min_PtTriplet_ (iConfig.getParameter<double> (
"MinPtTriplet")),
55 min_PtMax_ (iConfig.getParameter<double> (
"MinPtMax")),
56 min_PtMin_ (iConfig.getParameter<double> (
"MinPtMin")),
57 min_InvMass_ (iConfig.getParameter<double> (
"MinInvMass")),
58 max_InvMass_ (iConfig.getParameter<double> (
"MaxInvMass")),
59 min_Acop_ (iConfig.getParameter<double> (
"MinAcop")),
60 max_Acop_ (iConfig.getParameter<double> (
"MaxAcop")),
61 min_PtBalance_ (iConfig.getParameter<double> (
"MinPtBalance")),
62 max_PtBalance_ (iConfig.getParameter<double> (
"MaxPtBalance")),
63 nsigma_Pt_ (iConfig.getParameter<double> (
"NSigmaPt")),
64 max_DCAMuMu_ (iConfig.getParameter<double>(
"MaxDCAMuMu")),
65 max_YTriplet_ (iConfig.getParameter<double>(
"MaxRapidityTriplet"))
69 <<
" CandTag/MinN/MaxEta/MinNhits/MaxDr/MaxDz/MinPt1/MinPt2/MinInvMass/MaxInvMass/MinAcop/MaxAcop/MinPtBalance/MaxPtBalance/NSigmaPt/MaxDzMuMu/MaxRapidityTriplet : "
96 desc.
add<
bool>(
"FastAccept",
false);
97 desc.
add<
double>(
"MaxEta",2.5);
98 desc.
add<
int>(
"MinNhits",0);
99 desc.
add<
double>(
"MaxDr",2.0);
100 desc.
add<
double>(
"MaxDz",9999.0);
101 desc.
add<
int>(
"ChargeOpt",0);
102 desc.
add<
double>(
"MinPtTriplet",0.0);
103 desc.
add<
double>(
"MinPtMax",3.0);
104 desc.
add<
double>(
"MinPtMin",3.0);
105 desc.
add<
double>(
"MinInvMass",2.8);
106 desc.
add<
double>(
"MaxInvMass",3.4);
107 desc.
add<
double>(
"MinAcop",-1.0);
108 desc.
add<
double>(
"MaxAcop",3.15);
109 desc.
add<
double>(
"MinPtBalance",-1.0);
110 desc.
add<
double>(
"MaxPtBalance",999999.0);
111 desc.
add<
double>(
"NSigmaPt",0.0);
112 desc.
add<
bool>(
"saveTags",
false);
113 desc.
add<
double>(
"MaxDCAMuMu",99999.9);
114 desc.
add<
double>(
"MaxRapidityTriplet",999999.0);
115 descriptions.
add(
"hltMuonTrimuonL3Filter",desc);
127 double const MuMass = 0.106;
128 double const MuMass2 = MuMass*MuMass;
138 std::map<reco::TrackRef, std::vector<RecoChargedCandidateRef> > L2toL3s;
139 unsigned int maxI = mucands->size();
140 for (
unsigned int i=0;
i!=
maxI;
i++){
143 TrackRef staTrack = l3seedRef->l2Track();
152 beamSpot = *recoBeamSpotHandle;
159 vector<RecoChargedCandidateRef> vl2cands;
160 previousLevelCands->getObjects(
TriggerMuon,vl2cands);
167 std::map<reco::TrackRef, std::vector<RecoChargedCandidateRef> > ::iterator L2toL3s_it1 = L2toL3s.begin();
168 std::map<reco::TrackRef, std::vector<RecoChargedCandidateRef> > ::iterator L2toL3s_end = L2toL3s.end();
169 bool atLeastOneTriplet=
false;
170 for (; L2toL3s_it1!=L2toL3s_end; ++L2toL3s_it1){
176 unsigned int maxItk1=L2toL3s_it1->second.size();
177 for (; iTk1!=maxItk1; iTk1++){
178 bool thisL3Index1isDone=
false;
182 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" 1st muon in loop: q*pt= "
183 << tk1->charge()*tk1->pt() <<
" (" << cand1->charge()*cand1->pt()<<
") " <<
", eta= " << tk1->eta() <<
" (" << cand1->eta() <<
") " <<
", hits= " << tk1->numberOfValidHits();
185 if (fabs(cand1->eta())>
max_Eta_)
continue;
188 if (tk1->numberOfValidHits()<
min_Nhits_)
continue;
192 if (fabs( (- (cand1->vx()-beamSpot.
x0()) * cand1->py() + (cand1->vy()-beamSpot.
y0()) * cand1->px() ) / cand1->pt() ) >
max_Dr_)
continue;
195 if (fabs((cand1->vz()-beamSpot.
z0()) - ((cand1->vx()-beamSpot.
x0())*cand1->px()+(cand1->vy()-beamSpot.
y0())*cand1->py())/cand1->pt() * cand1->pz()/cand1->pt())>
max_Dz_)
continue;
198 double pt1 = cand1->pt();
203 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" ... 1st muon in loop, pt1= "
204 << pt1 <<
", ptLx1= " << ptLx1;
205 std::map<reco::TrackRef, std::vector<RecoChargedCandidateRef> > ::iterator L2toL3s_it2 = L2toL3s_it1;
207 for (; L2toL3s_it2!=L2toL3s_end; ++L2toL3s_it2){
212 unsigned int maxItk2=L2toL3s_it2->second.size();
213 for (; iTk2!=maxItk2; iTk2++){
218 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" 2nd muon in loop: q*pt= " << tk2->charge()*tk2->pt() <<
" (" << cand2->charge()*cand2->pt() <<
") " <<
", eta= " << tk2->eta() <<
" (" << cand2->eta() <<
") " <<
", hits= " << tk2->numberOfValidHits() <<
", d0= " << tk2->d0() ;
219 if (fabs(cand2->eta())>
max_Eta_)
continue;
222 if (tk2->numberOfValidHits()<
min_Nhits_)
continue;
226 if (fabs( (- (cand2->vx()-beamSpot.
x0()) * cand2->py() + (cand2->vy()-beamSpot.
y0()) * cand2->px() ) / cand2->pt() ) >
max_Dr_)
continue;
229 if (fabs((cand2->vz()-beamSpot.
z0()) - ((cand2->vx()-beamSpot.
x0())*cand2->px()+(cand2->vy()-beamSpot.
y0())*cand2->py())/cand2->pt() * cand2->pz()/cand2->pt())>
max_Dz_)
continue;
232 double pt2 = cand2->pt();
237 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" ... 2nd muon in loop, pt2= "
238 << pt2 <<
", ptLx2= " << ptLx2;
240 std::map<reco::TrackRef, std::vector<RecoChargedCandidateRef> > ::iterator L2toL3s_it3 = L2toL3s_it2;
242 for (; L2toL3s_it3!=L2toL3s_end; ++L2toL3s_it3){
248 unsigned int maxItk3=L2toL3s_it3->second.size();
249 for (; iTk3!=maxItk3; iTk3++){
253 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" 3rd muon in loop: q*pt= "
254 << tk3->charge()*tk3->pt() <<
" (" << cand3->charge()*cand3->pt()<<
") " <<
", eta= " << tk3->eta() <<
" (" << cand3->eta() <<
") " <<
", hits= " << tk3->numberOfValidHits();
256 if (fabs(cand3->eta())>
max_Eta_)
continue;
259 if (tk3->numberOfValidHits()<
min_Nhits_)
continue;
263 if (fabs( (- (cand3->vx()-beamSpot.
x0()) * cand3->py() + (cand3->vy()-beamSpot.
y0()) * cand3->px() ) / cand3->pt() ) >
max_Dr_)
continue;
266 if (fabs((cand3->vz()-beamSpot.
z0()) - ((cand3->vx()-beamSpot.
x0())*cand3->px()+(cand3->vy()-beamSpot.
y0())*cand3->py())/cand3->pt() * cand3->pz()/cand3->pt())>
max_Dz_)
continue;
269 double pt3 = cand3->pt();
274 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" ... 3rd muon in loop, pt3= "
275 << pt3 <<
", ptLx3= " << ptLx3;
277 if (ptLx1>ptLx2 && ptLx1>ptLx3 && ptLx1<
min_PtMax_)
continue;
278 else if (ptLx2>ptLx1 && ptLx2>ptLx3 && ptLx2<
min_PtMax_)
continue;
279 else if (ptLx3<ptLx2 && ptLx3>ptLx1 && ptLx3<
min_PtMax_)
continue;
281 if (ptLx1<ptLx2 && ptLx1<ptLx3 && ptLx1<
min_PtMin_)
continue;
282 else if (ptLx2<ptLx1 && ptLx2<ptLx3 && ptLx2<
min_PtMin_)
continue;
283 else if (ptLx3<ptLx2 && ptLx3<ptLx1 && ptLx3<
min_PtMin_)
continue;
286 if (
abs (cand1->charge()+cand2->charge()+cand3->charge()) !=
chargeOpt_)
continue;
290 double acop = fabs(cand1->phi()-cand2->phi());
291 if (acop>
M_PI) acop = 2*
M_PI - acop;
293 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" ... 1-2 acop= " << acop;
297 acop = fabs(cand1->phi()-cand3->phi());
298 if (acop>
M_PI) acop = 2*
M_PI - acop;
300 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" ... 1-3 acop= " << acop;
304 acop = fabs(cand3->phi()-cand2->phi());
305 if (acop>
M_PI) acop = 2*
M_PI - acop;
307 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" ... 3-2 acop= " << acop;
312 double ptbalance = fabs(cand1->pt()-cand2->pt());
315 ptbalance = fabs(cand1->pt()-cand3->pt());
318 ptbalance = fabs(cand3->pt()-cand2->pt());
323 e1 =
sqrt(cand1->momentum().Mag2()+MuMass2);
324 e2 =
sqrt(cand2->momentum().Mag2()+MuMass2);
325 e3 =
sqrt(cand3->momentum().Mag2()+MuMass2);
331 double pt123 = p.pt();
332 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" ... 1-2 pt123= " << pt123;
335 double invmass =
abs(p.mass());
337 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" ... 1-2 invmass= " << invmass;
366 double rapidity = fabs(p.Rapidity());
371 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" Track1 passing filter: pt= " << cand1->pt() <<
", eta: " << cand1->eta();
372 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" Track2 passing filter: pt= " << cand2->pt() <<
", eta: " << cand2->eta();
373 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" Track2 passing filter: pt= " << cand3->pt() <<
", eta: " << cand3->eta();
374 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" Invmass= " << invmass;
379 vector<RecoChargedCandidateRef> vref;
381 for (
unsigned int i=0;
i<vref.size();
i++) {
386 }
else if (tktmp==tk2) {
388 }
else if (tktmp==tk3) {
391 if (i1done && i2done && i3done)
break;
405 thisL3Index1isDone=
true;
406 atLeastOneTriplet=
true;
420 if (thisL3Index1isDone)
break;
427 const bool accept (n >= 1);
429 LogDebug(
"HLTMuonTrimuonL3Filter") <<
" >>>>> Result of HLTMuonTrimuonL3Filter is "<< accept <<
", number of muon triplets passing thresholds= " <<
n;
439 for (
unsigned int i=0;
i<vcands.size();
i++) {
440 if ( vcands[
i]->get<TrackRef>() == staTrack ) {
442 LogDebug(
"HLTMuonL3PreFilter") <<
"The L2 track triggered";
double z0() const
z coordinate
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
HLTMuonTrimuonL3Filter(const edm::ParameterSet &)
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
TrajectoryStateClosestToPoint impactPointTSCP() const
const FreeTrajectoryState & theState() const
bool triggeredByLevel2(const reco::TrackRef &track, std::vector< reco::RecoChargedCandidateRef > &vcands)
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)
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
edm::InputTag previousCandTag_
edm::InputTag beamspotTag_
~HLTMuonTrimuonL3Filter()
virtual bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb)
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
void add(std::string const &label, ParameterSetDescription const &psetDescription)
double y0() const
y coordinate
T const * get() const
Returns C++ pointer to the item.
virtual float distance() const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
virtual bool status() const
math::PtEtaPhiELorentzVectorF LorentzVector
double x0() const
x coordinate