28 muCandTag_(iConfig.getParameter<
edm::
InputTag>(
"MuCand")),
30 trkCandTag_(iConfig.getParameter<
edm::
InputTag>(
"TrackCand")),
32 previousCandTag_(iConfig.getParameter<
edm::
InputTag>(
"PreviousCandTag")),
34 mfName_(iConfig.getParameter<
std::
string>(
"SimpleMagneticField")),
36 thirdTrackMass_(iConfig.getParameter<double>(
"ThirdTrackMass")),
37 fourthTrackMass_(iConfig.getParameter<double>(
"FourthTrackMass")),
38 maxEta_(iConfig.getParameter<double>(
"MaxEta")),
39 minPt_(iConfig.getParameter<double>(
"MinPt")),
40 minInvMass_(iConfig.getParameter<double>(
"MinInvMass")),
41 maxInvMass_(iConfig.getParameter<double>(
"MaxInvMass")),
42 minTrkTrkMass_(iConfig.getParameter<double>(
"MinTrkTrkMass")),
43 maxTrkTrkMass_(iConfig.getParameter<double>(
"MaxTrkTrkMass")),
44 minD0Significance_(iConfig.getParameter<double>(
"MinD0Significance")),
45 oppositeSign_(iConfig.getParameter<
bool>(
"OppositeSign")),
47 overlapDR2_(iConfig.getParameter<double>(
"OverlapDR") *
std::
abs(iConfig.getParameter<double>(
"OverlapDR"))),
48 beamSpotTag_(iConfig.getParameter<
edm::
InputTag>(
"BeamSpotTag")),
50 produces<VertexCollection>();
59 desc.add<
double>(
"ThirdTrackMass", 0.493677);
60 desc.add<
double>(
"FourthTrackMass", 0.493677);
61 desc.add<
double>(
"MaxEta", 2.5);
62 desc.add<
double>(
"MinPt", 0.0);
63 desc.add<
double>(
"MinInvMass", 0.0);
64 desc.add<
double>(
"MaxInvMass", 99999.);
65 desc.add<
double>(
"MinTrkTrkMass", 0.0);
66 desc.add<
double>(
"MaxTrkTrkMass", 99999.);
67 desc.add<
double>(
"MinD0Significance", 0.0);
68 desc.add<
bool>(
"OppositeSign",
false);
69 desc.add<
double>(
"OverlapDR", 0.001);
71 descriptions.
add(
"HLTmumutktkVtxProducer",
desc);
75 const double MuMass(0.106);
76 const double MuMass2(MuMass * MuMass);
108 double e1, e2, e3_m3, e3_m4, e4_m3, e4_m4;
111 if (mucands->size() < 2)
113 if (trkcands->size() < 2)
116 RecoChargedCandidateCollection::const_iterator mucand1;
117 RecoChargedCandidateCollection::const_iterator mucand2;
118 RecoChargedCandidateCollection::const_iterator trkcand1;
119 RecoChargedCandidateCollection::const_iterator trkcand2;
125 vector<RecoChargedCandidateRef> vPrevCands;
128 for (mucand1 = mucands->begin(); mucand1 != mucands->end(); ++mucand1) {
130 LogDebug(
"HLTmumutktkVtxProducer") <<
" 1st muon: q*pt= " << trk1->charge() * trk1->pt() <<
", eta= " << trk1->eta()
131 <<
", hits= " << trk1->numberOfValidHits();
137 if (fabs(trk1->eta()) >
maxEta_)
144 for (; mucand2 != mucands->end(); mucand2++) {
149 LogDebug(
"HLTDisplacedMumukFilter") <<
" 2nd muon: q*pt= " << trk2->charge() * trk2->pt()
150 <<
", eta= " << trk2->eta() <<
", hits= " << trk2->numberOfValidHits();
156 if (fabs(trk2->eta()) >
maxEta_)
162 for (trkcand1 = trkcands->begin(); trkcand1 != trkcands->end(); ++trkcand1) {
170 LogDebug(
"HLTDisplacedMumukFilter") <<
" 3rd track: q*pt= " << trk3->charge() * trk3->pt()
171 <<
", eta= " << trk3->eta() <<
", hits= " << trk3->numberOfValidHits();
174 if (fabs(trk3->eta()) >
maxEta_)
186 for (trkcand2 = trkcands->begin(); trkcand2 != trkcands->end(); ++trkcand2) {
190 if (trk3->charge() * trk4->charge() != -1)
200 LogDebug(
"HLTDisplacedMumukFilter") <<
" 4th track: q*pt= " << trk4->charge() * trk4->pt()
201 <<
", eta= " << trk4->eta() <<
", hits= " << trk4->numberOfValidHits();
204 if (fabs(trk4->eta()) >
maxEta_)
216 e1 =
sqrt(trk1->momentum().Mag2() + MuMass2);
217 e2 =
sqrt(trk2->momentum().Mag2() + MuMass2);
218 e3_m3 =
sqrt(trk3->momentum().Mag2() + thirdTrackMass2);
219 e3_m4 =
sqrt(trk3->momentum().Mag2() + fourthTrackMass2);
220 e4_m3 =
sqrt(trk4->momentum().Mag2() + thirdTrackMass2);
221 e4_m4 =
sqrt(trk4->momentum().Mag2() + fourthTrackMass2);
230 p =
p1 +
p2 + p3_m3 + p4_m4;
231 pBar =
p1 +
p2 + p3_m4 + p4_m3;
232 p_m3m4 = p3_m3 + p4_m4;
233 p_m4m3 = p3_m4 + p4_m3;
244 vector<TransientTrack> t_tks;
245 t_tks.push_back((*theB).build(&trk1));
246 t_tks.push_back((*theB).build(&trk2));
247 t_tks.push_back((*theB).build(&trk3));
248 t_tks.push_back((*theB).build(&trk4));
249 if (t_tks.size() != 4)
281 const vector<RecoChargedCandidateRef>& refVect)
const {
283 for (
auto&
i : refVect) {
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool checkPreviousCand(const reco::TrackRef &trackref, const std::vector< reco::RecoChargedCandidateRef > &ref2) const
void produce(edm::Event &, const edm::EventSetup &) override
bool overlap(const reco::TrackRef &trackref1, const reco::TrackRef &trackref2)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< Vertex > VertexCollection
static FreeTrajectoryState initialFreeState(const reco::Track &, const MagneticField *)
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > trkCandToken_
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > muCandToken_
int charge() const
track electric charge
CovarianceMatrix covariance() const
return track covariance matrix
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transientTrackRecordToken_
const edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Abs< T >::type abs(const T &t)
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Measurement1D transverseImpactParameter() const
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
HLTmumutktkVtxProducer(const edm::ParameterSet &)
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > idealMagneticFieldRecordToken_
const double minTrkTrkMass_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const double fourthTrackMass_
const Vector & momentum() const
track momentum vector
double significance() const
const double thirdTrackMass_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
T const * get() const
Returns C++ pointer to the item.
const double minD0Significance_
const double maxTrkTrkMass_
math::PtEtaPhiELorentzVectorF LorentzVector