28 using namespace trigger;
32 muCandTag_ (iConfig.getParameter<edm::
InputTag>(
"MuCand")),
34 trkCandTag_ (iConfig.getParameter<edm::
InputTag>(
"TrackCand")),
36 previousCandTag_(iConfig.getParameter<edm::
InputTag>(
"PreviousCandTag")),
38 mfName_(iConfig.getParameter<std::
string>(
"SimpleMagneticField")),
39 thirdTrackMass_(iConfig.getParameter<double>(
"ThirdTrackMass")),
40 maxEta_(iConfig.getParameter<double>(
"MaxEta")),
41 minPt_(iConfig.getParameter<double>(
"MinPt")),
42 minInvMass_(iConfig.getParameter<double>(
"MinInvMass")),
43 maxInvMass_(iConfig.getParameter<double>(
"MaxInvMass")),
44 minD0Significance_(iConfig.getParameter<double>(
"MinD0Significance")),
45 overlapDR_(iConfig.getParameter<double>(
"OverlapDR")),
46 beamSpotTag_ (iConfig.getParameter<edm::
InputTag> (
"BeamSpotTag")),
49 produces<VertexCollection>();
62 desc.
add<
double>(
"ThirdTrackMass",0.493677);
63 desc.
add<
double>(
"MaxEta",2.5);
64 desc.
add<
double>(
"MinPt",3.0);
65 desc.
add<
double>(
"MinInvMass",0.0);
66 desc.
add<
double>(
"MaxInvMass",99999.);
67 desc.
add<
double>(
"MinD0Significance",0.0);
68 desc.
add<
double>(
"OverlapDR",1.44e-4);
70 descriptions.
add(
"HLTmumutkVtxProducer",desc);
76 const double MuMass(0.106);
77 const double MuMass2(MuMass*MuMass);
112 if ( mucands->size() < 2 )
return;
113 if ( trkcands->size() < 1 )
return;
115 RecoChargedCandidateCollection::const_iterator mucand1;
116 RecoChargedCandidateCollection::const_iterator mucand2;
117 RecoChargedCandidateCollection::const_iterator trkcand;
123 vector<RecoChargedCandidateRef> vPrevCands;
126 for (mucand1=mucands->begin(); mucand1!=mucands->end(); ++mucand1) {
128 LogDebug(
"HLTmumutkVtxProducer") <<
" 1st muon: q*pt= " << trk1->charge()*trk1->pt()
129 <<
", eta= " << trk1->eta()
130 <<
", hits= " << trk1->numberOfValidHits();
136 if (fabs(trk1->eta()) >
maxEta_)
continue;
137 if (trk1->pt() <
minPt_ )
continue;
139 mucand2 = mucand1; ++mucand2;
140 for (; mucand2!=mucands->end(); mucand2++) {
143 LogDebug(
"HLTDisplacedMumukFilter") <<
" 2nd muon: q*pt= " << trk2->charge()*trk2->pt()
144 <<
", eta= " << trk2->eta()
145 <<
", hits= " << trk2->numberOfValidHits();
150 if (fabs(trk2->eta()) >
maxEta_)
continue;
151 if (trk2->pt() <
minPt_ )
continue;
154 for ( trkcand = trkcands->begin(); trkcand !=trkcands->end(); ++trkcand) {
156 if(
overlap( trk1, trk3) )
continue;
157 if(
overlap( trk2, trk3) )
continue;
159 LogDebug(
"HLTDisplacedMumukFilter") <<
" 3rd track: q*pt= " << trk3->charge()*trk3->pt()
160 <<
", eta= " << trk3->eta()
161 <<
", hits= " << trk3->numberOfValidHits();
164 if (fabs(trk3->eta()) >
maxEta_)
continue;
165 if (trk3->pt() <
minPt_ )
continue;
168 e1 =
sqrt(trk1->momentum().Mag2() + MuMass2 );
169 e2 =
sqrt(trk2->momentum().Mag2() + MuMass2 );
170 e3 =
sqrt(trk3->momentum().Mag2() + thirdTrackMass2);
179 double invmass =
abs(p.mass());
180 LogDebug(
"HLTDisplacedMumukFilter") <<
" Invmass= " << invmass;
185 vector<TransientTrack> t_tks;
186 t_tks.push_back((*theB).build(&trk1));
187 t_tks.push_back((*theB).build(&trk2));
188 t_tks.push_back((*theB).build(&trk3));
189 if (t_tks.size()!=3)
continue;
202 vertexCollection->push_back(vertex);
206 iEvent.
put(vertexCollection);
221 if (
deltaR(trackref1->eta(), trackref1->phi(),trackref2->eta(), trackref2->phi()) <
overlapDR_)
return 1;
227 for (
unsigned int i=0;
i<refVect.size();
i++) {
228 if ( refVect[
i]->get<TrackRef>() == trackref ) {
static FreeTrajectoryState initialFreeState(const reco::Track &, const MagneticField *)
const std::string mfName_
Measurement1D transverseImpactParameter() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const
std::vector< Vertex > VertexCollection
collection of Vertex objects
const Vector & momentum() const
track momentum vector
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
bool overlap(const reco::TrackRef &trackref1, const reco::TrackRef &trackref2)
HLTmumutkVtxProducer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
const double thirdTrackMass_
CovarianceMatrix covariance() const
return track covariance matrix
bool checkPreviousCand(const reco::TrackRef &trackref, std::vector< reco::RecoChargedCandidateRef > &ref2)
const double minD0Significance_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > trkCandToken_
Abs< T >::type abs(const T &t)
T const * get() const
Returns C++ pointer to the item.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > muCandToken_
double deltaR(double eta1, double eta2, double phi1, double phi2)
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
double significance() const
T const * product() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
int charge() const
track electric charge
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
const edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
virtual void produce(edm::Event &, const edm::EventSetup &)
math::PtEtaPhiELorentzVectorF LorentzVector
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)