33 template <
typename T1,
typename T2>
40 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
41 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
43 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
44 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
45 minDR_(iConfig.
template getParameter<double>(
"MinDR")),
46 maxDZ_(iConfig.
template getParameter<double>(
"MaxDZ")),
47 minPixHitsForDZ_(iConfig.
template getParameter<int>(
"MinPixHitsForDZ")),
48 min_N_(iConfig.
template getParameter<int>(
"MinN")),
49 checkSC_(iConfig.
template getParameter<bool>(
"checkSC")),
60 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
61 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
63 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
64 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
65 minDR_(iConfig.
template getParameter<double>(
"MinDR")),
66 maxDZ_(iConfig.
template getParameter<double>(
"MaxDZ")),
67 minPixHitsForDZ_(iConfig.
template getParameter<int>(
"MinPixHitsForDZ")),
68 min_N_(iConfig.
template getParameter<int>(
"MinN")),
69 checkSC_(iConfig.
template getParameter<bool>(
"checkSC")),
80 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
81 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
83 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
84 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
85 minDR_(iConfig.
template getParameter<double>(
"MinDR")),
86 maxDZ_(iConfig.
template getParameter<double>(
"MaxDZ")),
87 minPixHitsForDZ_(iConfig.
template getParameter<int>(
"MinPixHitsForDZ")),
88 min_N_(iConfig.
template getParameter<int>(
"MinN")),
89 checkSC_(iConfig.
template getParameter<bool>(
"checkSC")),
100 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
101 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
103 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
104 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
105 minDR_(iConfig.
template getParameter<double>(
"MinDR")),
106 maxDZ_(iConfig.
template getParameter<double>(
"MaxDZ")),
107 minPixHitsForDZ_(iConfig.
template getParameter<int>(
"MinPixHitsForDZ")),
108 min_N_(iConfig.
template getParameter<int>(
"MinN")),
109 checkSC_(iConfig.
template getParameter<bool>(
"checkSC")),
120 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
121 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
123 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
124 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
125 minDR_(iConfig.
template getParameter<double>(
"MinDR")),
126 maxDZ_(iConfig.
template getParameter<double>(
"MaxDZ")),
127 minPixHitsForDZ_(iConfig.
template getParameter<int>(
"MinPixHitsForDZ")),
128 min_N_(iConfig.
template getParameter<int>(
"MinN")),
129 checkSC_(iConfig.
template getParameter<bool>(
"checkSC")),
140 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
141 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
142 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
143 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
144 minDR_(iConfig.
template getParameter<double>(
"MinDR")),
145 maxDZ_(iConfig.
template getParameter<double>(
"MaxDZ")),
146 minPixHitsForDZ_(iConfig.
template getParameter<int>(
"MinPixHitsForDZ")),
147 min_N_(iConfig.
template getParameter<int>(
"MinN")),
148 checkSC_(iConfig.
template getParameter<bool>(
"checkSC")),
152 template <
typename T1,
typename T2>
155 template <
typename T1,
typename T2>
158 makeHLTFilterDescription(desc);
161 desc.
add<std::vector<edm::InputTag>>(
"originTag1",
originTag1);
162 desc.
add<std::vector<edm::InputTag>>(
"originTag2",
originTag2);
165 desc.
add<
int>(
"triggerType1", 0);
166 desc.
add<
int>(
"triggerType2", 0);
167 desc.
add<
double>(
"MinDR", -1.0);
168 desc.
add<
double>(
"MaxDZ", 0.2);
169 desc.
add<
int>(
"MinPixHitsForDZ", 0);
170 desc.
add<
bool>(
"checkSC",
false);
171 desc.
add<
int>(
"MinN", 1);
179 makeHLTFilterDescription(desc);
182 desc.
add<std::vector<edm::InputTag>>(
"originTag1",
originTag1);
183 desc.
add<std::vector<edm::InputTag>>(
"originTag2",
originTag2);
187 desc.
add<
int>(
"triggerType1", 0);
188 desc.
add<
int>(
"triggerType2", 0);
189 desc.
add<
double>(
"MinDR", -1.0);
190 desc.
add<
double>(
"MaxDZ", 0.2);
191 desc.
add<
int>(
"MinPixHitsForDZ", 0);
192 desc.
add<
bool>(
"checkSC",
false);
193 desc.
add<
int>(
"MinN", 1);
201 makeHLTFilterDescription(desc);
204 desc.
add<std::vector<edm::InputTag>>(
"originTag1",
originTag1);
205 desc.
add<std::vector<edm::InputTag>>(
"originTag2",
originTag2);
209 desc.
add<
int>(
"triggerType1", 0);
210 desc.
add<
int>(
"triggerType2", 0);
211 desc.
add<
double>(
"MinDR", -1.0);
212 desc.
add<
double>(
"MaxDZ", 0.2);
213 desc.
add<
int>(
"MinPixHitsForDZ", 0);
214 desc.
add<
bool>(
"checkSC",
false);
215 desc.
add<
int>(
"MinN", 1);
223 makeHLTFilterDescription(desc);
226 desc.
add<std::vector<edm::InputTag>>(
"originTag1",
originTag1);
227 desc.
add<std::vector<edm::InputTag>>(
"originTag2",
originTag2);
231 desc.
add<
int>(
"triggerType1", 0);
232 desc.
add<
int>(
"triggerType2", 0);
233 desc.
add<
double>(
"MinDR", -1.0);
234 desc.
add<
double>(
"MaxDZ", 0.2);
235 desc.
add<
int>(
"MinPixHitsForDZ", 0);
236 desc.
add<
bool>(
"checkSC",
false);
237 desc.
add<
int>(
"MinN", 1);
245 makeHLTFilterDescription(desc);
248 desc.
add<std::vector<edm::InputTag>>(
"originTag1",
originTag1);
249 desc.
add<std::vector<edm::InputTag>>(
"originTag2",
originTag2);
252 desc.
add<
int>(
"triggerType1", 0);
253 desc.
add<
int>(
"triggerType2", 0);
254 desc.
add<
double>(
"MinDR", -1.0);
255 desc.
add<
double>(
"MaxDZ", 0.2);
256 desc.
add<
int>(
"MinPixHitsForDZ", 0);
257 desc.
add<
bool>(
"checkSC",
false);
258 desc.
add<
int>(
"MinN", 1);
262 template <
typename T1,
typename T2>
266 std::vector<T1Ref>& coll1,
267 std::vector<T2Ref>& coll2,
272 handle1->getObjects(triggerType1_, coll1);
273 handle2->getObjects(triggerType2_, coll2);
279 for (
unsigned int i = 0;
i < originTag1_.size(); ++
i) {
290 if (tagOld.
encode() != tagNew.encode()) {
295 for (
unsigned int i = 0;
i < originTag2_.size(); ++
i) {
306 if (tagOld.
encode() != tagNew.encode()) {
318 template <
typename T1,
typename T2>
324 if (
std::abs(candidate1.
vz() - candidate2.
vz()) > maxDZ_)
335 iEvent.
getByToken(electronToken_, electronHandle_);
336 if (!electronHandle_.
isValid())
337 edm::LogError(
"HLTDoubletDZ") <<
"HLTDoubletDZ: Electron Handle not valid.";
342 for (
auto const& eleIt : *electronHandle_) {
343 if (eleIt.superCluster() == r1->superCluster())
349 if (minPixHitsForDZ_ > 0 && (e1.
gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_ ||
350 candidate2.
track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_))
352 if (!skipDZ &&
std::abs(e1.
vz() - candidate2.
vz()) > maxDZ_)
363 iEvent.
getByToken(electronToken_, electronHandle_);
364 if (!electronHandle_.
isValid())
365 edm::LogError(
"HLTDoubletDZ") <<
"HLTDoubletDZ: Electron Handle not valid.";
370 for (
auto const& eleIt : *electronHandle_) {
371 if (eleIt.superCluster() == r2->superCluster())
377 if (minPixHitsForDZ_ > 0 && (candidate1.
track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_ ||
378 e2.
gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_))
380 if (!skipDZ &&
std::abs(e2.
vz() - candidate1.
vz()) > maxDZ_)
391 iEvent.
getByToken(electronToken_, electronHandle_);
392 if (!electronHandle_.
isValid())
393 edm::LogError(
"HLTDoubletDZ") <<
"HLTDoubletDZ: Electron Handle not valid.";
398 for (
auto const& eleIt : *electronHandle_) {
399 if (eleIt.superCluster() == r2->superCluster())
401 if (eleIt.superCluster() == r1->superCluster())
406 if (minPixHitsForDZ_ > 0 && (e1.
gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_ ||
407 e2.
gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_))
424 if (minPixHitsForDZ_ > 0 && (candidate1.
track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_ ||
425 candidate2.
track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_))
427 if (!skipDZ &&
std::abs(candidate1.
vz() - candidate2.
vz()) > maxDZ_)
469 template <
typename T1,
typename T2>
478 std::vector<T1Ref> coll1;
479 std::vector<T2Ref> coll2;
481 if (getCollections(iEvent, coll1, coll2, filterproduct)) {
486 for (
unsigned int i1 = 0; i1 != coll1.size(); i1++) {
493 for (
unsigned int i2 = I; i2 != coll2.size(); i2++) {
497 if (r1->superCluster() == r2->superCluster())
502 if (!computeDZ(iEvent, r1, r2))
506 filterproduct.
addObject(triggerType1_, r1);
507 filterproduct.
addObject(triggerType2_, r2);
511 accept = accept || (n >= min_N_);
529 std::vector<l1t::TkMuonRef> coll1;
530 std::vector<l1t::TkMuonRef> coll2;
532 if (getCollections(iEvent, coll1, coll2, filterproduct)) {
537 for (
unsigned int i1 = 0; i1 != coll1.size(); i1++) {
543 for (
unsigned int i2 = I; i2 != coll2.size(); i2++) {
546 if (!computeDZ(iEvent, r1, r2))
550 filterproduct.
addObject(triggerType1_, r1);
551 filterproduct.
addObject(triggerType2_, r2);
555 accept = accept || (n >= min_N_);
573 std::vector<l1t::PFTauRef> coll1;
574 std::vector<l1t::PFTauRef> coll2;
576 if (getCollections(iEvent, coll1, coll2, filterproduct)) {
581 for (
unsigned int i1 = 0; i1 != coll1.size(); i1++) {
587 for (
unsigned int i2 = I; i2 != coll2.size(); i2++) {
590 if (!computeDZ(iEvent, r1, r2))
594 filterproduct.
addObject(triggerType1_, r1);
595 filterproduct.
addObject(triggerType2_, r2);
599 accept = accept || (n >= min_N_);
617 std::vector<l1t::HPSPFTauRef> coll1;
618 std::vector<l1t::HPSPFTauRef> coll2;
620 if (getCollections(iEvent, coll1, coll2, filterproduct)) {
625 for (
unsigned int i1 = 0; i1 != coll1.size(); i1++) {
631 for (
unsigned int i2 = I; i2 != coll2.size(); i2++) {
634 if (!computeDZ(iEvent, r1, r2))
638 filterproduct.
addObject(triggerType1_, r1);
639 filterproduct.
addObject(triggerType2_, r2);
643 accept = accept || (n >= min_N_);
HLTDoubletDZ< l1t::TkMuon, l1t::TkMuon > HLT2L1TkMuonL1TkMuonDZ
HLTDoubletDZ(const edm::ParameterSet &)
bool isNonnull() const
Checks for non-null.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const l1t::PFCandidateRef & leadChargedPFCand() const
double vz() const override
z coordinate of vertex position
static PFTauRenderPlugin instance
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::string defaultModuleLabel()
HLTDoubletDZ< l1t::PFTau, l1t::PFTau > HLT2L1PFTauL1PFTauDZ
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
bool getCollections(edm::Event &iEvent, std::vector< T1Ref > &coll1, std::vector< T2Ref > &coll2, trigger::TriggerFilterObjectWithRefs &filterproduct) const
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
bool computeDZ(edm::Event &iEvent, T1Ref &c1, T2Ref &c2) const
reco::TrackRef track() const override
reference to a track
reco::GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Abs< T >::type abs(const T &t)
const std::complex< double > I
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< Electron > ElectronCollection
collectin of Electron objects
bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
HLTDoubletDZ< reco::RecoChargedCandidate, reco::RecoChargedCandidate > HLT2MuonMuonDZ
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
HLTDoubletDZ< reco::Electron, reco::RecoChargedCandidate > HLT2ElectronMuonDZ
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLTDoubletDZ< reco::RecoChargedCandidate, reco::RecoEcalCandidate > HLT2MuonPhotonDZ
HLTDoubletDZ< reco::Electron, reco::Electron > HLT2ElectronElectronDZ
HLTDoubletDZ< l1t::HPSPFTau, l1t::HPSPFTau > HLT2L1HPSPFTauL1HPSPFTauDZ
virtual double vz() const =0
z coordinate of vertex position
StableProvenance const & getStableProvenance(BranchID const &theID) const
HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoEcalCandidate > HLT2PhotonPhotonDZ
HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoChargedCandidate > HLT2PhotonMuonDZ