36 : srcTag_(iConfig.getParameter<
edm::
InputTag>(
"Src")),
38 previousCandTag_(iConfig.getParameter<
edm::
InputTag>(
"PreviousCandTag")),
40 matchToPrevious_(iConfig.getParameter<
bool>(
"matchToPrevious")),
41 maxEta_(iConfig.getParameter<double>(
"MaxEta")),
42 minPt_(iConfig.getParameter<double>(
"MinPt")),
43 minPtPair_(iConfig.getParameter<double>(
"MinPtPair")),
44 minInvMass_(iConfig.getParameter<double>(
"MinInvMass")),
45 maxInvMass_(iConfig.getParameter<double>(
"MaxInvMass")),
46 chargeOpt_(iConfig.getParameter<
int>(
"ChargeOpt")) {
47 produces<VertexCollection>();
56 desc.add<
bool>(
"matchToPrevious",
true);
57 desc.add<
double>(
"MaxEta", 2.5);
58 desc.add<
double>(
"MinPt", 0.0);
59 desc.add<
double>(
"MinPtPair", 0.0);
60 desc.add<
double>(
"MinInvMass", 1.0);
61 desc.add<
double>(
"MaxInvMass", 20.0);
62 desc.add<
int>(
"ChargeOpt", -1);
63 descriptions.
add(
"hltDisplacedmumuVtxProducer",
desc);
68 double const MuMass = 0.106;
69 double const MuMass2 = MuMass * MuMass;
85 RecoChargedCandidateCollection::const_iterator cand1;
86 RecoChargedCandidateCollection::const_iterator cand2;
93 vector<RecoChargedCandidateRef> vPrevCands;
97 for (cand1 = mucands->begin(); cand1 != mucands->end(); cand1++) {
99 LogDebug(
"HLTDisplacedMumuFilter") <<
" 1st muon in loop: q*pt= " << cand1->charge() * cand1->pt()
100 <<
", eta= " << cand1->eta() <<
", hits= " << tk1->numberOfValidHits();
107 if (fabs(cand1->eta()) >
maxEta_)
114 for (; cand2 != mucands->end(); cand2++) {
118 LogDebug(
"HLTDisplacedmumuVtxProducer")
119 <<
" 2nd muon in loop: q*pt= " << cand2->charge() * cand2->pt() <<
", eta= " << cand2->eta()
120 <<
", hits= " << tk2->numberOfValidHits() <<
", d0= " << tk2->d0();
126 if (fabs(cand2->eta()) >
maxEta_)
133 if (cand1->charge() * cand2->charge() > 0)
136 if (cand1->charge() * cand2->charge() < 0)
141 e1 =
sqrt(cand1->momentum().Mag2() + MuMass2);
142 e2 =
sqrt(cand2->momentum().Mag2() + MuMass2);
150 double invmass =
abs(
p.mass());
151 LogDebug(
"HLTDisplacedMumuFilter") <<
" ... 1-2 invmass= " << invmass;
159 vector<TransientTrack> t_tks;
162 t_tks.push_back(ttkp1);
163 t_tks.push_back(ttkp2);
165 if (t_tks.size() != 2)
184 const vector<RecoChargedCandidateRef>& refVect)
const {
186 for (
auto&
i : refVect) {