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")),
54 produces<VertexCollection>();
67 desc.
add<
double>(
"ThirdTrackMass",0.493677);
68 desc.
add<
double>(
"FourthTrackMass",0.493677);
69 desc.
add<
double>(
"MaxEta",2.5);
70 desc.
add<
double>(
"MinPt",0.0);
71 desc.
add<
double>(
"MinInvMass",0.0);
72 desc.
add<
double>(
"MaxInvMass",99999.);
73 desc.
add<
double>(
"MinTrkTrkMass",0.0);
74 desc.
add<
double>(
"MaxTrkTrkMass",99999.);
75 desc.
add<
double>(
"MinD0Significance",0.0);
76 desc.
add<
bool>(
"OppositeSign",
false);
77 desc.
add<
double>(
"OverlapDR",0.001);
79 descriptions.
add(
"HLTmumutktkVtxProducer",desc);
85 const double MuMass(0.106);
86 const double MuMass2(MuMass*MuMass);
120 double e1,
e2, e3_m3, e3_m4, e4_m3, e4_m4;
123 if ( mucands->size() < 2 )
return;
124 if ( trkcands->size() < 2 )
return;
126 RecoChargedCandidateCollection::const_iterator mucand1 ;
127 RecoChargedCandidateCollection::const_iterator mucand2 ;
128 RecoChargedCandidateCollection::const_iterator trkcand1;
129 RecoChargedCandidateCollection::const_iterator trkcand2;
135 vector<RecoChargedCandidateRef> vPrevCands;
138 for (mucand1=mucands->begin(); mucand1!=mucands->end(); ++mucand1) {
140 LogDebug(
"HLTmumutktkVtxProducer") <<
" 1st muon: q*pt= " << trk1->charge()*trk1->pt()
141 <<
", eta= " << trk1->eta()
142 <<
", hits= " << trk1->numberOfValidHits();
147 if (fabs(trk1->eta()) >
maxEta_)
continue;
148 if (trk1->pt() <
minPt_ )
continue;
150 mucand2 = mucand1; ++mucand2;
151 for (; mucand2!=mucands->end(); mucand2++) {
153 if(
overlap( trk1, trk2) )
continue;
155 LogDebug(
"HLTDisplacedMumukFilter") <<
" 2nd muon: q*pt= " << trk2->charge()*trk2->pt()
156 <<
", eta= " << trk2->eta()
157 <<
", hits= " << trk2->numberOfValidHits();
162 if (fabs(trk2->eta()) >
maxEta_)
continue;
163 if (trk2->pt() <
minPt_ )
continue;
166 for ( trkcand1 = trkcands->begin(); trkcand1 !=trkcands->end(); ++trkcand1) {
169 if(
overlap( trk1, trk3) )
continue;
170 if(
overlap( trk2, trk3) )
continue;
172 LogDebug(
"HLTDisplacedMumukFilter") <<
" 3rd track: q*pt= " << trk3->charge()*trk3->pt()
173 <<
", eta= " << trk3->eta()
174 <<
", hits= " << trk3->numberOfValidHits();
177 if (fabs(trk3->eta()) >
maxEta_)
continue;
178 if (trk3->pt() <
minPt_ )
continue;
186 for ( trkcand2 = trkcands->begin(); trkcand2 !=trkcands->end(); ++trkcand2) {
190 if (trk3->charge()*trk4->charge() != -1)
continue;
192 if(
overlap( trk1, trk4) )
continue;
193 if(
overlap( trk2, trk4) )
continue;
194 if(
overlap( trk3, trk4) )
continue;
197 LogDebug(
"HLTDisplacedMumukFilter") <<
" 4th track: q*pt= " << trk4->charge()*trk4->pt()
198 <<
", eta= " << trk4->eta()
199 <<
", hits= " << trk4->numberOfValidHits();
202 if (fabs(trk4->eta()) >
maxEta_)
continue;
203 if (trk4->pt() <
minPt_ )
continue;
211 e1 =
sqrt(trk1->momentum().Mag2() + MuMass2 );
212 e2 =
sqrt(trk2->momentum().Mag2() + MuMass2 );
213 e3_m3 =
sqrt(trk3->momentum().Mag2() + thirdTrackMass2 );
214 e3_m4 =
sqrt(trk3->momentum().Mag2() + fourthTrackMass2 );
215 e4_m3 =
sqrt(trk4->momentum().Mag2() + thirdTrackMass2 );
216 e4_m4 =
sqrt(trk4->momentum().Mag2() + fourthTrackMass2 );
225 p = p1 + p2 + p3_m3 + p4_m4;
226 pBar = p1 + p2 + p3_m4 + p4_m3;
227 p_m3m4 = p3_m3 + p4_m4;
228 p_m4m3 = p3_m4 + p4_m3;
235 vector<TransientTrack> t_tks;
236 t_tks.push_back((*theB).build(&trk1));
237 t_tks.push_back((*theB).build(&trk2));
238 t_tks.push_back((*theB).build(&trk3));
239 t_tks.push_back((*theB).build(&trk4));
240 if (t_tks.size()!=4)
continue;
247 vertexCollection -> push_back(vertex);
267 if (
deltaR(trackref1->eta(), trackref1->phi(), trackref2->eta(), trackref2->phi()) <
overlapDR_)
return true;
273 for (
auto &
i : refVect) {
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Measurement1D transverseImpactParameter() const
void produce(edm::Event &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool overlap(const reco::TrackRef &trackref1, const reco::TrackRef &trackref2)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< Vertex > VertexCollection
collection of Vertex objects
const Vector & momentum() const
track momentum vector
static FreeTrajectoryState initialFreeState(const reco::Track &, const MagneticField *)
~HLTmumutktkVtxProducer() override
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > trkCandToken_
bool checkPreviousCand(const reco::TrackRef &trackref, std::vector< reco::RecoChargedCandidateRef > &ref2)
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > muCandToken_
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
CovarianceMatrix covariance() const
return track covariance matrix
const edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
T const * get() const
Returns C++ pointer to the item.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const std::string mfName_
double deltaR(double eta1, double eta2, double phi1, double phi2)
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
double significance() const
HLTmumutktkVtxProducer(const edm::ParameterSet &)
const double minTrkTrkMass_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const double fourthTrackMass_
const double thirdTrackMass_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
const double minD0Significance_
int charge() const
track electric charge
T const * product() const
const double maxTrkTrkMass_
math::PtEtaPhiELorentzVectorF LorentzVector