40 beamspotTag_ (iConfig.getParameter<
edm::
InputTag > (
"BeamSpotTag")),
42 candTag_ (iConfig.getParameter<
edm::
InputTag > (
"CandTag")),
44 previousCandTag_ (iConfig.getParameter<
InputTag > (
"PreviousCandTag")),
46 seedMapTag_( iConfig.getParameter<
InputTag >(
"SeedMapTag") ),
47 seedMapToken_(consumes<
SeedMap>(seedMapTag_)),
48 fast_Accept_ (iConfig.getParameter<
bool> (
"FastAccept")),
49 max_Eta_ (iConfig.getParameter<double> (
"MaxEta")),
50 min_Nhits_ (iConfig.getParameter<
int> (
"MinNhits")),
51 min_Nstations_(iConfig.getParameter<
int> (
"MinNstations")),
52 min_Nchambers_(iConfig.getParameter<
int> (
"MinNchambers")),
53 max_Dr_ (iConfig.getParameter<double> (
"MaxDr")),
54 max_Dz_ (iConfig.getParameter<double> (
"MaxDz")),
55 chargeOpt_ (iConfig.getParameter<
int> (
"ChargeOpt")),
56 min_PtPair_ (iConfig.getParameter<double> (
"MinPtPair")),
57 min_PtMax_ (iConfig.getParameter<double> (
"MinPtMax")),
58 min_PtMin_ (iConfig.getParameter<double> (
"MinPtMin")),
59 min_InvMass_ (iConfig.getParameter<double> (
"MinInvMass")),
60 max_InvMass_ (iConfig.getParameter<double> (
"MaxInvMass")),
61 min_Acop_ (iConfig.getParameter<double> (
"MinAcop")),
62 max_Acop_ (iConfig.getParameter<double> (
"MaxAcop")),
63 min_Angle_ (iConfig.getParameter<double> (
"MinAngle")),
64 max_Angle_ (iConfig.getParameter<double> (
"MaxAngle")),
65 min_PtBalance_ (iConfig.getParameter<double> (
"MinPtBalance")),
66 max_PtBalance_ (iConfig.getParameter<double> (
"MaxPtBalance")),
67 nsigma_Pt_ (iConfig.getParameter<double> (
"NSigmaPt"))
70 LogDebug(
"HLTMuonDimuonL2FromL1TFilter")
71 <<
" CandTag/MinN/MaxEta/MinNhits/MinNstations/MinNchambers/MaxDr/MaxDz/MinPt1/MinPt2/MinInvMass/MaxInvMass/MinAcop/MaxAcop/MinAngle/MaxAngle/MinPtBalance/MaxPtBalance/NSigmaPt : " 104 desc.
add<
bool>(
"FastAccept",
false);
105 desc.
add<
double>(
"MaxEta",2.5);
106 desc.
add<
int>(
"MinNhits",0);
107 desc.
add<
int>(
"MinNstations",0);
108 desc.
add<
int>(
"MinNchambers",2);
109 desc.
add<
double>(
"MaxDr",100.0);
110 desc.
add<
double>(
"MaxDz",9999.0);
111 desc.
add<
int>(
"ChargeOpt",0);
112 desc.
add<
double>(
"MinPtPair",0.0);
113 desc.
add<
double>(
"MinPtMax",3.0);
114 desc.
add<
double>(
"MinPtMin",3.0);
115 desc.
add<
double>(
"MinInvMass",1.6);
116 desc.
add<
double>(
"MaxInvMass",5.6);
117 desc.
add<
double>(
"MinAcop",-1.0);
118 desc.
add<
double>(
"MaxAcop",3.15);
119 desc.
add<
double>(
"MinAngle",-999.0);
120 desc.
add<
double>(
"MaxAngle",2.5);
121 desc.
add<
double>(
"MinPtBalance",-1.0);
122 desc.
add<
double>(
"MaxPtBalance",999999.0);
123 desc.
add<
double>(
"NSigmaPt",0.0);
124 descriptions.
add(
"hltMuonDimuonL2FromL1TFilter", desc);
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();
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();
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
bool isTriggeredByL1(reco::TrackRef &l2muon)
checks if a L2 muon was seeded by a fired L1
edm::Ref< RecoChargedCandidateCollection > RecoChargedCandidateRef
reference to an object in a collection of RecoChargedCandidate objects
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
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>)
bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
~HLTMuonDimuonL2FromL1TFilter() override
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
Abs< T >::type abs(const T &t)
T const * get() const
Returns C++ pointer to the item.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
HLTMuonDimuonL2FromL1TFilter(const edm::ParameterSet &)
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
void add(std::string const &label, ParameterSetDescription const &psetDescription)
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)