33 : muCandTag_(iConfig.getParameter<
edm::
InputTag>(
"MuCand")),
35 trkCandTag_(iConfig.getParameter<
edm::
InputTag>(
"TrackCand")),
37 previousCandTag_(iConfig.getParameter<
edm::
InputTag>(
"PreviousCandTag")),
39 mfName_(iConfig.getParameter<
std::
string>(
"SimpleMagneticField")),
40 thirdTrackMass_(iConfig.getParameter<double>(
"ThirdTrackMass")),
41 fourthTrackMass_(iConfig.getParameter<double>(
"FourthTrackMass")),
42 maxEta_(iConfig.getParameter<double>(
"MaxEta")),
43 minPt_(iConfig.getParameter<double>(
"MinPt")),
44 minInvMass_(iConfig.getParameter<double>(
"MinInvMass")),
45 maxInvMass_(iConfig.getParameter<double>(
"MaxInvMass")),
46 minTrkTrkMass_(iConfig.getParameter<double>(
"MinTrkTrkMass")),
47 maxTrkTrkMass_(iConfig.getParameter<double>(
"MaxTrkTrkMass")),
48 minD0Significance_(iConfig.getParameter<double>(
"MinD0Significance")),
49 oppositeSign_(iConfig.getParameter<
bool>(
"OppositeSign")),
50 overlapDR_(iConfig.getParameter<double>(
"OverlapDR")),
51 beamSpotTag_(iConfig.getParameter<
edm::
InputTag>(
"BeamSpotTag")),
53 produces<VertexCollection>();
65 desc.
add<
double>(
"ThirdTrackMass", 0.493677);
66 desc.
add<
double>(
"FourthTrackMass", 0.493677);
67 desc.
add<
double>(
"MaxEta", 2.5);
68 desc.
add<
double>(
"MinPt", 0.0);
69 desc.
add<
double>(
"MinInvMass", 0.0);
70 desc.
add<
double>(
"MaxInvMass", 99999.);
71 desc.
add<
double>(
"MinTrkTrkMass", 0.0);
72 desc.
add<
double>(
"MaxTrkTrkMass", 99999.);
73 desc.
add<
double>(
"MinD0Significance", 0.0);
74 desc.
add<
bool>(
"OppositeSign",
false);
75 desc.
add<
double>(
"OverlapDR", 0.001);
77 descriptions.
add(
"HLTmumutktkVtxProducer", desc);
82 const double MuMass(0.106);
83 const double MuMass2(MuMass * MuMass);
117 double e1, e2, e3_m3, e3_m4, e4_m3, e4_m4;
120 if (mucands->size() < 2)
122 if (trkcands->size() < 2)
125 RecoChargedCandidateCollection::const_iterator mucand1;
126 RecoChargedCandidateCollection::const_iterator mucand2;
127 RecoChargedCandidateCollection::const_iterator trkcand1;
128 RecoChargedCandidateCollection::const_iterator trkcand2;
134 vector<RecoChargedCandidateRef> vPrevCands;
137 for (mucand1 = mucands->begin(); mucand1 != mucands->end(); ++mucand1) {
139 LogDebug(
"HLTmumutktkVtxProducer") <<
" 1st muon: q*pt= " << trk1->charge() * trk1->pt() <<
", eta= " << trk1->eta()
140 <<
", hits= " << trk1->numberOfValidHits();
146 if (fabs(trk1->eta()) >
maxEta_)
153 for (; mucand2 != mucands->end(); mucand2++) {
158 LogDebug(
"HLTDisplacedMumukFilter") <<
" 2nd muon: q*pt= " << trk2->charge() * trk2->pt()
159 <<
", eta= " << trk2->eta() <<
", hits= " << trk2->numberOfValidHits();
165 if (fabs(trk2->eta()) >
maxEta_)
171 for (trkcand1 = trkcands->begin(); trkcand1 != trkcands->end(); ++trkcand1) {
179 LogDebug(
"HLTDisplacedMumukFilter") <<
" 3rd track: q*pt= " << trk3->charge() * trk3->pt()
180 <<
", eta= " << trk3->eta() <<
", hits= " << trk3->numberOfValidHits();
183 if (fabs(trk3->eta()) >
maxEta_)
195 for (trkcand2 = trkcands->begin(); trkcand2 != trkcands->end(); ++trkcand2) {
199 if (trk3->charge() * trk4->charge() != -1)
209 LogDebug(
"HLTDisplacedMumukFilter") <<
" 4th track: q*pt= " << trk4->charge() * trk4->pt()
210 <<
", eta= " << trk4->eta() <<
", hits= " << trk4->numberOfValidHits();
213 if (fabs(trk4->eta()) >
maxEta_)
225 e1 =
sqrt(trk1->momentum().Mag2() + MuMass2);
226 e2 =
sqrt(trk2->momentum().Mag2() + MuMass2);
227 e3_m3 =
sqrt(trk3->momentum().Mag2() + thirdTrackMass2);
228 e3_m4 =
sqrt(trk3->momentum().Mag2() + fourthTrackMass2);
229 e4_m3 =
sqrt(trk4->momentum().Mag2() + thirdTrackMass2);
230 e4_m4 =
sqrt(trk4->momentum().Mag2() + fourthTrackMass2);
239 p =
p1 +
p2 + p3_m3 + p4_m4;
240 pBar =
p1 +
p2 + p3_m4 + p4_m3;
241 p_m3m4 = p3_m3 + p4_m4;
242 p_m4m3 = p3_m4 + p4_m3;
253 vector<TransientTrack> t_tks;
254 t_tks.push_back((*theB).build(&trk1));
255 t_tks.push_back((*theB).build(&trk2));
256 t_tks.push_back((*theB).build(&trk3));
257 t_tks.push_back((*theB).build(&trk4));
258 if (t_tks.size() != 4)
286 if (
deltaR(trackref1->eta(), trackref1->phi(), trackref2->eta(), trackref2->phi()) <
overlapDR_)
292 const vector<RecoChargedCandidateRef>& refVect)
const {
294 for (
auto&
i : refVect) {