36 : srcTag_(iConfig.getParameter<
edm::
InputTag>(
"Src")),
38 previousCandTag_(iConfig.getParameter<
edm::
InputTag>(
"PreviousCandTag")),
40 maxEta_(iConfig.getParameter<double>(
"MaxEta")),
41 minPt_(iConfig.getParameter<double>(
"MinPt")),
42 minPtPair_(iConfig.getParameter<double>(
"MinPtPair")),
43 minInvMass_(iConfig.getParameter<double>(
"MinInvMass")),
44 maxInvMass_(iConfig.getParameter<double>(
"MaxInvMass")),
45 chargeOpt_(iConfig.getParameter<
int>(
"ChargeOpt")) {
46 produces<VertexCollection>();
55 desc.
add<
double>(
"MaxEta", 2.5);
56 desc.
add<
double>(
"MinPt", 0.0);
57 desc.
add<
double>(
"MinPtPair", 0.0);
58 desc.
add<
double>(
"MinInvMass", 1.0);
59 desc.
add<
double>(
"MaxInvMass", 20.0);
60 desc.
add<
int>(
"ChargeOpt", -1);
61 descriptions.
add(
"hltDisplacedmumuVtxProducer", desc);
66 double const MuMass = 0.106;
67 double const MuMass2 = MuMass * MuMass;
83 RecoChargedCandidateCollection::const_iterator cand1;
84 RecoChargedCandidateCollection::const_iterator cand2;
90 vector<RecoChargedCandidateRef> vPrevCands;
93 for (cand1 = mucands->begin(); cand1 != mucands->end(); cand1++) {
95 LogDebug(
"HLTDisplacedMumuFilter") <<
" 1st muon in loop: q*pt= " << cand1->charge() * cand1->pt()
96 <<
", eta= " << cand1->eta() <<
", hits= " << tk1->numberOfValidHits();
103 if (fabs(cand1->eta()) >
maxEta_)
110 for (; cand2 != mucands->end(); cand2++) {
114 LogDebug(
"HLTDisplacedmumuVtxProducer")
115 <<
" 2nd muon in loop: q*pt= " << cand2->charge() * cand2->pt() <<
", eta= " << cand2->eta()
116 <<
", hits= " << tk2->numberOfValidHits() <<
", d0= " << tk2->d0();
122 if (fabs(cand2->eta()) >
maxEta_)
129 if (cand1->charge() * cand2->charge() > 0)
132 if (cand1->charge() * cand2->charge() < 0)
137 e1 =
sqrt(cand1->momentum().Mag2() + MuMass2);
138 e2 =
sqrt(cand2->momentum().Mag2() + MuMass2);
146 double invmass =
abs(
p.mass());
147 LogDebug(
"HLTDisplacedMumuFilter") <<
" ... 1-2 invmass= " << invmass;
155 vector<TransientTrack> t_tks;
158 t_tks.push_back(ttkp1);
159 t_tks.push_back(ttkp2);
161 if (t_tks.size() != 2)
180 const vector<RecoChargedCandidateRef>& refVect)
const {
182 for (
auto&
i : refVect) {