31 srcTag_(iConfig.getParameter<
edm::
InputTag>(
"Src")),
33 previousCandTag_(iConfig.getParameter<
edm::
InputTag>(
"PreviousCandTag")),
35 matchToPrevious_(iConfig.getParameter<
bool>(
"matchToPrevious")),
36 maxEta_(iConfig.getParameter<double>(
"MaxEta")),
37 minPt_(iConfig.getParameter<double>(
"MinPt")),
38 minPtPair_(iConfig.getParameter<double>(
"MinPtPair")),
39 minInvMass_(iConfig.getParameter<double>(
"MinInvMass")),
40 maxInvMass_(iConfig.getParameter<double>(
"MaxInvMass")),
41 chargeOpt_(iConfig.getParameter<
int>(
"ChargeOpt")) {
42 produces<VertexCollection>();
51 desc.add<
bool>(
"matchToPrevious",
true);
52 desc.add<
double>(
"MaxEta", 2.5);
53 desc.add<
double>(
"MinPt", 0.0);
54 desc.add<
double>(
"MinPtPair", 0.0);
55 desc.add<
double>(
"MinInvMass", 1.0);
56 desc.add<
double>(
"MaxInvMass", 20.0);
57 desc.add<
int>(
"ChargeOpt", -1);
58 descriptions.
add(
"hltDisplacedmumuVtxProducer",
desc);
63 double const MuMass = 0.106;
64 double const MuMass2 = MuMass * MuMass;
79 RecoChargedCandidateCollection::const_iterator cand1;
80 RecoChargedCandidateCollection::const_iterator cand2;
87 vector<RecoChargedCandidateRef> vPrevCands;
91 for (cand1 = mucands->begin(); cand1 != mucands->end(); cand1++) {
93 LogDebug(
"HLTDisplacedMumuFilter") <<
" 1st muon in loop: q*pt= " << cand1->charge() * cand1->pt()
94 <<
", eta= " << cand1->eta() <<
", hits= " << tk1->numberOfValidHits();
101 if (fabs(cand1->eta()) >
maxEta_)
108 for (; cand2 != mucands->end(); cand2++) {
112 LogDebug(
"HLTDisplacedmumuVtxProducer")
113 <<
" 2nd muon in loop: q*pt= " << cand2->charge() * cand2->pt() <<
", eta= " << cand2->eta()
114 <<
", hits= " << tk2->numberOfValidHits() <<
", d0= " << tk2->d0();
120 if (fabs(cand2->eta()) >
maxEta_)
127 if (cand1->charge() * cand2->charge() > 0)
130 if (cand1->charge() * cand2->charge() < 0)
135 e1 =
sqrt(cand1->momentum().Mag2() + MuMass2);
136 e2 =
sqrt(cand2->momentum().Mag2() + MuMass2);
144 double invmass =
abs(
p.mass());
145 LogDebug(
"HLTDisplacedMumuFilter") <<
" ... 1-2 invmass= " << invmass;
153 vector<TransientTrack> t_tks;
156 t_tks.push_back(ttkp1);
157 t_tks.push_back(ttkp2);
159 if (t_tks.size() != 2)
178 const vector<RecoChargedCandidateRef>& refVect)
const {
180 for (
auto&
i : refVect) {
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
HLTDisplacedmumuVtxProducer(const edm::ParameterSet &)
std::vector< Vertex > VertexCollection
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
bool checkPreviousCand(const reco::TrackRef &trackref, const std::vector< reco::RecoChargedCandidateRef > &ref2) const
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
const bool matchToPrevious_
Abs< T >::type abs(const T &t)
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
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
T const * get() const
Returns C++ pointer to the item.
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transientTrackRecordToken_
math::PtEtaPhiELorentzVectorF LorentzVector