22 template <
typename T1,
typename T2>
27 inputTag1_(iConfig.getParameter<
edm::
InputTag>(
"inputTag1")),
28 inputTag2_(iConfig.getParameter<
edm::
InputTag>(
"inputTag2")),
29 inputToken1_(consumes(inputTag1_)),
30 inputToken2_(consumes(inputTag2_)),
32 triggerType1_(iConfig.getParameter<
int>(
"triggerType1")),
33 triggerType2_(iConfig.getParameter<
int>(
"triggerType2")),
34 minDR_(iConfig.getParameter<double>(
"MinDR")),
35 minDR2_(minDR_ * minDR_),
36 maxDZ_(iConfig.getParameter<double>(
"MaxDZ")),
37 min_N_(iConfig.getParameter<
int>(
"MinN")),
38 minPixHitsForDZ_(iConfig.getParameter<
int>(
"MinPixHitsForDZ")),
39 checkSC_(iConfig.getParameter<
bool>(
"checkSC")),
48 inputTag1_(iConfig.getParameter<
edm::
InputTag>(
"inputTag1")),
49 inputTag2_(iConfig.getParameter<
edm::
InputTag>(
"inputTag2")),
50 inputToken1_(consumes(inputTag1_)),
51 inputToken2_(consumes(inputTag2_)),
52 electronToken_(consumes(iConfig.getParameter<
edm::
InputTag>(
"electronTag"))),
53 triggerType1_(iConfig.getParameter<
int>(
"triggerType1")),
54 triggerType2_(iConfig.getParameter<
int>(
"triggerType2")),
55 minDR_(iConfig.getParameter<double>(
"MinDR")),
56 minDR2_(minDR_ * minDR_),
57 maxDZ_(iConfig.getParameter<double>(
"MaxDZ")),
58 min_N_(iConfig.getParameter<
int>(
"MinN")),
59 minPixHitsForDZ_(iConfig.getParameter<
int>(
"MinPixHitsForDZ")),
60 checkSC_(iConfig.getParameter<
bool>(
"checkSC")),
69 inputTag1_(iConfig.getParameter<
edm::
InputTag>(
"inputTag1")),
70 inputTag2_(iConfig.getParameter<
edm::
InputTag>(
"inputTag2")),
71 inputToken1_(consumes(inputTag1_)),
72 inputToken2_(consumes(inputTag2_)),
73 electronToken_(consumes(iConfig.getParameter<
edm::
InputTag>(
"electronTag"))),
74 triggerType1_(iConfig.getParameter<
int>(
"triggerType1")),
75 triggerType2_(iConfig.getParameter<
int>(
"triggerType2")),
76 minDR_(iConfig.getParameter<double>(
"MinDR")),
77 minDR2_(minDR_ * minDR_),
78 maxDZ_(iConfig.getParameter<double>(
"MaxDZ")),
79 min_N_(iConfig.getParameter<
int>(
"MinN")),
80 minPixHitsForDZ_(iConfig.getParameter<
int>(
"MinPixHitsForDZ")),
81 checkSC_(iConfig.getParameter<
bool>(
"checkSC")),
90 inputTag1_(iConfig.getParameter<
edm::
InputTag>(
"inputTag1")),
91 inputTag2_(iConfig.getParameter<
edm::
InputTag>(
"inputTag2")),
92 inputToken1_(consumes(inputTag1_)),
93 inputToken2_(consumes(inputTag2_)),
94 electronToken_(consumes(iConfig.getParameter<
edm::
InputTag>(
"electronTag"))),
95 triggerType1_(iConfig.getParameter<
int>(
"triggerType1")),
96 triggerType2_(iConfig.getParameter<
int>(
"triggerType2")),
97 minDR_(iConfig.getParameter<double>(
"MinDR")),
98 minDR2_(minDR_ * minDR_),
99 maxDZ_(iConfig.getParameter<double>(
"MaxDZ")),
100 min_N_(iConfig.getParameter<
int>(
"MinN")),
101 minPixHitsForDZ_(iConfig.getParameter<
int>(
"MinPixHitsForDZ")),
102 checkSC_(iConfig.getParameter<
bool>(
"checkSC")),
111 inputTag1_(iConfig.getParameter<
edm::
InputTag>(
"inputTag1")),
112 inputTag2_(iConfig.getParameter<
edm::
InputTag>(
"inputTag2")),
113 inputToken1_(consumes(inputTag1_)),
114 inputToken2_(consumes(inputTag2_)),
116 triggerType1_(iConfig.getParameter<
int>(
"triggerType1")),
117 triggerType2_(iConfig.getParameter<
int>(
"triggerType2")),
118 minDR_(iConfig.getParameter<double>(
"MinDR")),
119 minDR2_(minDR_ * minDR_),
120 maxDZ_(iConfig.getParameter<double>(
"MaxDZ")),
121 min_N_(iConfig.getParameter<
int>(
"MinN")),
132 inputTag1_(iConfig.getParameter<
edm::
InputTag>(
"inputTag1")),
133 inputTag2_(iConfig.getParameter<
edm::
InputTag>(
"inputTag2")),
134 inputToken1_(consumes(inputTag1_)),
135 inputToken2_(consumes(inputTag2_)),
137 triggerType1_(iConfig.getParameter<
int>(
"triggerType1")),
138 triggerType2_(iConfig.getParameter<
int>(
"triggerType2")),
139 minDR_(iConfig.getParameter<double>(
"MinDR")),
140 minDR2_(minDR_ * minDR_),
141 maxDZ_(iConfig.getParameter<double>(
"MaxDZ")),
142 min_N_(iConfig.getParameter<
int>(
"MinN")),
153 inputTag1_(iConfig.getParameter<
edm::
InputTag>(
"inputTag1")),
154 inputTag2_(iConfig.getParameter<
edm::
InputTag>(
"inputTag2")),
155 inputToken1_(consumes(inputTag1_)),
156 inputToken2_(consumes(inputTag2_)),
158 triggerType1_(iConfig.getParameter<
int>(
"triggerType1")),
159 triggerType2_(iConfig.getParameter<
int>(
"triggerType2")),
160 minDR_(iConfig.getParameter<double>(
"MinDR")),
161 minDR2_(minDR_ * minDR_),
162 maxDZ_(iConfig.getParameter<double>(
"MaxDZ")),
163 min_N_(iConfig.getParameter<
int>(
"MinN")),
169 template <
typename T1,
typename T2>
172 makeHLTFilterDescription(
desc);
173 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
174 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
177 desc.add<
int>(
"triggerType1", 0);
178 desc.add<
int>(
"triggerType2", 0);
179 desc.add<
double>(
"MinDR", -1.0);
180 desc.add<
double>(
"MaxDZ", 0.2);
181 desc.add<
int>(
"MinN", 1);
182 desc.add<
int>(
"MinPixHitsForDZ", 0);
183 desc.add<
bool>(
"checkSC",
false);
191 makeHLTFilterDescription(
desc);
192 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
193 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
197 desc.add<
int>(
"triggerType1", 0);
198 desc.add<
int>(
"triggerType2", 0);
199 desc.add<
double>(
"MinDR", -1.0);
200 desc.add<
double>(
"MaxDZ", 0.2);
201 desc.add<
int>(
"MinN", 1);
202 desc.add<
int>(
"MinPixHitsForDZ", 0);
203 desc.add<
bool>(
"checkSC",
false);
211 makeHLTFilterDescription(
desc);
212 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
213 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
217 desc.add<
int>(
"triggerType1", 0);
218 desc.add<
int>(
"triggerType2", 0);
219 desc.add<
double>(
"MinDR", -1.0);
220 desc.add<
double>(
"MaxDZ", 0.2);
221 desc.add<
int>(
"MinN", 1);
222 desc.add<
int>(
"MinPixHitsForDZ", 0);
223 desc.add<
bool>(
"checkSC",
false);
231 makeHLTFilterDescription(
desc);
232 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
233 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
237 desc.add<
int>(
"triggerType1", 0);
238 desc.add<
int>(
"triggerType2", 0);
239 desc.add<
double>(
"MinDR", -1.0);
240 desc.add<
double>(
"MaxDZ", 0.2);
241 desc.add<
int>(
"MinN", 1);
242 desc.add<
int>(
"MinPixHitsForDZ", 0);
243 desc.add<
bool>(
"checkSC",
false);
250 makeHLTFilterDescription(
desc);
251 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
252 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
255 desc.add<
int>(
"triggerType1", 0);
256 desc.add<
int>(
"triggerType2", 0);
257 desc.add<
double>(
"MinDR", -1.0);
258 desc.add<
double>(
"MaxDZ", 0.2);
259 desc.add<
int>(
"MinN", 1);
266 makeHLTFilterDescription(
desc);
267 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
268 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
271 desc.add<
int>(
"triggerType1", 0);
272 desc.add<
int>(
"triggerType2", 0);
273 desc.add<
double>(
"MinDR", -1.0);
274 desc.add<
double>(
"MaxDZ", 0.2);
275 desc.add<
int>(
"MinN", 1);
282 makeHLTFilterDescription(
desc);
283 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
284 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
287 desc.add<
int>(
"triggerType1", 0);
288 desc.add<
int>(
"triggerType2", 0);
289 desc.add<
double>(
"MinDR", -1.0);
290 desc.add<
double>(
"MaxDZ", 0.2);
291 desc.add<
int>(
"MinN", 1);
295 template <
typename T1,
typename T2>
297 std::vector<T1Ref>& coll1,
298 std::vector<T2Ref>& coll2,
301 if (
iEvent.getByToken(inputToken1_, handle1) and
iEvent.getByToken(inputToken2_, handle2)) {
310 for (
unsigned int i = 0;
i < originTag1_.size(); ++
i) {
316 const auto& prov =
iEvent.getStableProvenance(pid);
321 if (tagOld.
encode() != tagNew.encode()) {
326 for (
unsigned int i = 0;
i < originTag2_.size(); ++
i) {
332 const auto& prov =
iEvent.getStableProvenance(pid);
337 if (tagOld.
encode() != tagNew.encode()) {
350 template <
typename T1,
typename T2>
352 return (
c1.superCluster().isNonnull() and c2.superCluster().isNonnull() and (
c1.superCluster() == c2.superCluster()));
372 template <
typename C1,
typename C2>
380 return (minDR_ < 0
or reco::deltaR2(m1.phEta(), m1.phPhi(),
m2.phEta(),
m2.phPhi()) >= minDR2_);
386 if (minPixHitsForValidVZ > 0) {
388 if (not(
track.isNonnull() and
track.isAvailable() and
389 track->hitPattern().numberOfValidPixelHits() >= minPixHitsForValidVZ)) {
401 int const minPixHitsForValidVZ,
405 if (elec.superCluster() ==
cand.superCluster()) {
410 if (elec_ptr ==
nullptr) {
416 if (minPixHitsForValidVZ > 0) {
418 if (not(
track.isNonnull() and
track.isAvailable() and
419 track->hitPattern().numberOfValidPixelHits() >= minPixHitsForValidVZ)) {
426 return elec_ptr->
vz();
430 auto const& leadChargedPFCand =
cand.leadChargedPFCand();
431 if (leadChargedPFCand.isNonnull() and leadChargedPFCand.isAvailable()) {
432 auto const&
pfTrack = leadChargedPFCand->pfTrack();
445 template <
typename T1,
typename T2>
447 return ((
std::abs(
c1.vz() - c2.vz()) <= maxDZ_) and passCutMinDeltaR(
c1, c2));
453 if (not passCutMinDeltaR(
c1, c2))
456 bool hasValidVZ2 =
false;
457 auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_);
461 bool hasValidVZ1 =
false;
463 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1, minPixHitsForDZ_,
electrons);
467 return (
std::abs(vz1 - vz2) <= maxDZ_);
473 if (not passCutMinDeltaR(
c1, c2))
476 bool hasValidVZ1 =
false;
477 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1, minPixHitsForDZ_);
481 bool hasValidVZ2 =
false;
483 auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_,
electrons);
487 return (
std::abs(vz1 - vz2) <= maxDZ_);
493 if (not passCutMinDeltaR(
c1, c2))
498 bool hasValidVZ1 =
false;
499 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1, minPixHitsForDZ_,
electrons);
503 bool hasValidVZ2 =
false;
504 auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_,
electrons);
508 return (
std::abs(vz1 - vz2) <= maxDZ_);
514 if (not passCutMinDeltaR(
c1, c2))
517 bool hasValidVZ1 =
false;
518 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1, minPixHitsForDZ_);
522 bool hasValidVZ2 =
false;
523 auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_);
527 return (
std::abs(vz1 - vz2) <= maxDZ_);
534 return ((
std::abs(
c1.phZ0() - c2.
phZ0()) <= maxDZ_) and passCutMinDeltaR(
c1, c2));
541 if (not passCutMinDeltaR(
c1, c2))
544 bool hasValidVZ1 =
false;
545 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1);
549 bool hasValidVZ2 =
false;
550 auto const vz2 = getCandidateVZ(c2, hasValidVZ2);
554 return (
std::abs(vz1 - vz2) <= maxDZ_);
557 template <
typename T1,
typename T2>
564 std::vector<T1Ref> coll1;
565 std::vector<T2Ref> coll2;
567 if (getCollections(
iEvent, coll1, coll2, filterproduct)) {
572 for (
unsigned int i1 = 0;
i1 < coll1.size(); ++
i1) {
574 unsigned int const I = same_ ?
i1 + 1 : 0;
575 for (
unsigned int i2 =
I;
i2 < coll2.size(); ++
i2) {
578 if (checkSC_ and haveSameSuperCluster(*
r1, *
r2)) {
592 return (
n >= min_N_);
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool computeDZ(edm::Event const &iEvent, T1 const &c1, T2 const &c2) const
double vz() const override
z coordinate of vertex position
static PFTauRenderPlugin instance
bool passCutMinDeltaR(T1 const &c1, T2 const &c2) const
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
bool getCollections(edm::Event const &iEvent, std::vector< T1Ref > &coll1, std::vector< T2Ref > &coll2, trigger::TriggerFilterObjectWithRefs &filterproduct) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
reco::GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Abs< T >::type abs(const T &t)
const std::complex< double > I
#define DEFINE_FWK_MODULE(type)
bool haveSameSuperCluster(T1 const &c1, T2 const &c2) const
std::vector< Electron > ElectronCollection
collectin of Electron objects
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
bool hltFilter(edm::Event &iEvent, edm::EventSetup const &iSetup, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
HLTDoubletDZ(edm::ParameterSet const &)
const double phZ0() const