31 using namespace trigger;
36 src_ (iConfig.getParameter<edm::
InputTag>(
"Src")),
37 previousCandTag_(iConfig.getParameter<edm::
InputTag>(
"PreviousCandTag")),
38 maxEta_ (iConfig.getParameter<double>(
"MaxEta")),
39 minPt_ (iConfig.getParameter<double>(
"MinPt")),
40 minPtPair_ (iConfig.getParameter<double>(
"MinPtPair")),
41 minInvMass_ (iConfig.getParameter<double>(
"MinInvMass")),
42 maxInvMass_ (iConfig.getParameter<double>(
"MaxInvMass")),
43 chargeOpt_ (iConfig.getParameter<int>(
"ChargeOpt"))
45 produces<VertexCollection>();
70 double const MuMass = 0.106;
71 double const MuMass2 = MuMass*MuMass;
88 RecoChargedCandidateCollection::const_iterator cand1;
89 RecoChargedCandidateCollection::const_iterator cand2;
95 vector<RecoChargedCandidateRef> vPrevCands;
98 for (cand1=mucands->begin(); cand1!=mucands->end(); cand1++) {
100 LogDebug(
"HLTDisplacedMumuFilter") <<
" 1st muon in loop: q*pt= " << cand1->charge()*cand1->pt() <<
", eta= " << cand1->eta() <<
", hits= " << tk1->numberOfValidHits();
106 if (fabs(cand1->eta())>
maxEta_)
continue;
107 if (cand1->pt() <
minPt_)
continue;
109 cand2 = cand1; cand2++;
110 for (; cand2!=mucands->end(); cand2++) {
114 LogDebug(
"HLTDisplacedmumuVtxProducer") <<
" 2nd muon in loop: q*pt= " << cand2->charge()*cand2->pt() <<
", eta= " << cand2->eta() <<
", hits= " << tk2->numberOfValidHits() <<
", d0= " << tk2->d0();
119 if (fabs(cand2->eta())>
maxEta_)
continue;
120 if (cand2->pt() <
minPt_)
continue;
124 if (cand1->charge()*cand2->charge()>0)
continue;
126 if (cand1->charge()*cand2->charge()<0)
continue;
130 e1 =
sqrt(cand1->momentum().Mag2()+MuMass2);
131 e2 =
sqrt(cand2->momentum().Mag2()+MuMass2);
139 double invmass =
abs(p.mass());
140 LogDebug(
"HLTDisplacedMumuFilter") <<
" ... 1-2 invmass= " << invmass;
146 vector<TransientTrack> t_tks;
149 t_tks.push_back(ttkp1);
150 t_tks.push_back(ttkp2);
153 if (t_tks.size()!=2)
continue;
163 vertexCollection->push_back(vertex);
166 iEvent.
put(vertexCollection);
173 for (
unsigned int i=0;
i<refVect.size();
i++) {
174 if ( refVect[
i]->get<TrackRef>() == trackref ) {
bool checkPreviousCand(const reco::TrackRef &trackref, std::vector< reco::RecoChargedCandidateRef > &ref2)
HLTDisplacedmumuVtxProducer(const edm::ParameterSet &)
virtual CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const
std::vector< Vertex > VertexCollection
collection of Vertex objects
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
~HLTDisplacedmumuVtxProducer()
virtual void produce(edm::Event &, const edm::EventSetup &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T const * get() const
Returns C++ pointer to the item.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
edm::InputTag previousCandTag_
math::PtEtaPhiELorentzVectorF LorentzVector