24 using namespace trigger;
30 srcTag_(iConfig.getParameter<edm::
InputTag>(
"Src")),
32 previousCandTag_(iConfig.getParameter<edm::
InputTag>(
"PreviousCandTag")),
34 maxEta_(iConfig.getParameter<double>(
"MaxEta")),
35 minPt_(iConfig.getParameter<double>(
"MinPt")),
36 minPtTriplet_(iConfig.getParameter<double>(
"MinPtTriplet")),
37 minInvMass_(iConfig.getParameter<double>(
"MinInvMass")),
38 maxInvMass_(iConfig.getParameter<double>(
"MaxInvMass")),
39 chargeOpt_(iConfig.getParameter<int>(
"ChargeOpt")) {
40 produces<VertexCollection>();
49 desc.
add<
double>(
"MaxEta", 2.5);
50 desc.
add<
double>(
"MinPt", 0.0);
51 desc.
add<
double>(
"MinPtTriplet", 0.0);
52 desc.
add<
double>(
"MinInvMass", 1.0);
53 desc.
add<
double>(
"MaxInvMass", 20.0);
54 desc.
add<
int>(
"ChargeOpt", -1);
55 descriptions.
add(
"hltDisplacedmumumuVtxProducer", desc);
60 double const MuMass = 0.106;
61 double const MuMass2 = MuMass * MuMass;
76 RecoChargedCandidateCollection::const_iterator cand1;
77 RecoChargedCandidateCollection::const_iterator cand2;
78 RecoChargedCandidateCollection::const_iterator cand3;
84 vector<RecoChargedCandidateRef> vPrevCands;
87 for (cand1 = mucands->begin(); cand1 != mucands->end(); cand1++) {
89 LogDebug(
"HLTDisplacedMumumuFilter") <<
" 1st muon in loop: q*pt= " << cand1->charge() * cand1->pt()
90 <<
", eta= " << cand1->eta() <<
", hits= " << tk1->numberOfValidHits();
97 if (fabs(cand1->eta()) >
maxEta_)
104 for (; cand2 != mucands->end(); cand2++) {
108 LogDebug(
"HLTMuonDimuonFilter") <<
" 2nd muon in loop: q*pt= " << cand2->charge() * cand2->pt()
109 <<
", eta= " << cand2->eta() <<
", hits= " << tk2->numberOfValidHits()
110 <<
", d0= " << tk2->d0();
116 if (fabs(cand2->eta()) >
maxEta_)
123 for (; cand3 != mucands->end(); cand3++) {
127 LogDebug(
"HLTMuonDimuonFilter") <<
" 3rd muon in loop: q*pt= " << cand3->charge() * cand3->pt()
128 <<
", eta= " << cand3->eta() <<
", hits= " << tk3->numberOfValidHits()
129 <<
", d0= " << tk3->d0();
135 if (fabs(cand3->eta()) >
maxEta_)
142 if (fabs(cand1->charge() + cand2->charge() + cand3->charge()) !=
chargeOpt_)
147 e1 =
sqrt(cand1->momentum().Mag2() + MuMass2);
148 e2 =
sqrt(cand2->momentum().Mag2() + MuMass2);
149 e3 =
sqrt(cand3->momentum().Mag2() + MuMass2);
158 double invmass =
abs(p.mass());
159 LogDebug(
"HLTDisplacedMumumuFilter") <<
" ... 1-2 invmass= " << invmass;
167 vector<TransientTrack> t_tks;
171 t_tks.push_back(ttkp1);
172 t_tks.push_back(ttkp2);
173 t_tks.push_back(ttkp3);
175 if (t_tks.size() != 3)
187 vertexCollection->push_back(vertex);
195 const vector<RecoChargedCandidateRef>& refVect)
const {
197 for (
auto&
i : refVect) {
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
HLTDisplacedmumumuVtxProducer(const edm::ParameterSet &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
std::vector< Vertex > VertexCollection
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transientTrackRecordToken_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
Abs< T >::type abs(const T &t)
const double minPtTriplet_
T const * get() const
Returns C++ pointer to the item.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool checkPreviousCand(const reco::TrackRef &trackref, const std::vector< reco::RecoChargedCandidateRef > &ref2) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
~HLTDisplacedmumumuVtxProducer() override
math::PtEtaPhiELorentzVectorF LorentzVector