37 srcTag_ (iConfig.getParameter<
edm::
InputTag>(
"Src")),
39 previousCandTag_(iConfig.getParameter<
edm::
InputTag>(
"PreviousCandTag")),
41 maxEta_ (iConfig.getParameter<double>(
"MaxEta")),
42 minPt_ (iConfig.getParameter<double>(
"MinPt")),
43 minPtPair_ (iConfig.getParameter<double>(
"MinPtPair")),
44 minInvMass_ (iConfig.getParameter<double>(
"MinInvMass")),
45 maxInvMass_ (iConfig.getParameter<double>(
"MaxInvMass")),
46 chargeOpt_ (iConfig.getParameter<
int>(
"ChargeOpt"))
48 produces<VertexCollection>();
59 desc.
add<
double>(
"MaxEta",2.5);
60 desc.
add<
double>(
"MinPt",0.0);
61 desc.
add<
double>(
"MinPtPair",0.0);
62 desc.
add<
double>(
"MinInvMass",1.0);
63 desc.
add<
double>(
"MaxInvMass",20.0);
64 desc.
add<
int>(
"ChargeOpt",-1);
65 descriptions.
add(
"hltDisplacedmumuVtxProducer", desc);
83 double const MuMass = 0.106;
84 double const MuMass2 = MuMass*MuMass;
101 RecoChargedCandidateCollection::const_iterator cand1;
102 RecoChargedCandidateCollection::const_iterator cand2;
108 vector<RecoChargedCandidateRef> vPrevCands;
111 for (cand1=mucands->begin(); cand1!=mucands->end(); cand1++) {
113 LogDebug(
"HLTDisplacedMumuFilter") <<
" 1st muon in loop: q*pt= " << cand1->charge()*cand1->pt() <<
", eta= " << cand1->eta() <<
", hits= " << tk1->numberOfValidHits();
119 if (fabs(cand1->eta())>
maxEta_)
continue;
120 if (cand1->pt() <
minPt_)
continue;
122 cand2 = cand1; cand2++;
123 for (; cand2!=mucands->end(); cand2++) {
127 LogDebug(
"HLTDisplacedmumuVtxProducer") <<
" 2nd muon in loop: q*pt= " << cand2->charge()*cand2->pt() <<
", eta= " << cand2->eta() <<
", hits= " << tk2->numberOfValidHits() <<
", d0= " << tk2->d0();
132 if (fabs(cand2->eta())>
maxEta_)
continue;
133 if (cand2->pt() <
minPt_)
continue;
137 if (cand1->charge()*cand2->charge()>0)
continue;
139 if (cand1->charge()*cand2->charge()<0)
continue;
143 e1 =
sqrt(cand1->momentum().Mag2()+MuMass2);
144 e2 =
sqrt(cand2->momentum().Mag2()+MuMass2);
152 double invmass =
abs(p.mass());
153 LogDebug(
"HLTDisplacedMumuFilter") <<
" ... 1-2 invmass= " << invmass;
159 vector<TransientTrack> t_tks;
162 t_tks.push_back(ttkp1);
163 t_tks.push_back(ttkp2);
166 if (t_tks.size()!=2)
continue;
176 vertexCollection->push_back(vertex);
186 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:
bool checkPreviousCand(const reco::TrackRef &trackref, std::vector< reco::RecoChargedCandidateRef > &ref2)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
HLTDisplacedmumuVtxProducer(const edm::ParameterSet &)
std::vector< Vertex > VertexCollection
collection of Vertex objects
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
Abs< T >::type abs(const T &t)
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
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)
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
~HLTDisplacedmumuVtxProducer() override
math::PtEtaPhiELorentzVectorF LorentzVector