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")),
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")),
61 same_(l1GTAlgoName1_ == l1GTAlgoName2_)
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_)),
115 electronToken_(consumes(iConfig.getParameter<
edm::
InputTag>(
"electronTag"))),
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")),
122 minPixHitsForDZ_(iConfig.getParameter<
int>(
"MinPixHitsForDZ")),
123 checkSC_(iConfig.getParameter<
bool>(
"checkSC")),
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")),
174 inputTag1_(iConfig.getParameter<
edm::
InputTag>(
"inputTag1")),
175 inputTag2_(iConfig.getParameter<
edm::
InputTag>(
"inputTag2")),
176 inputToken1_(consumes(inputTag1_)),
177 inputToken2_(consumes(inputTag2_)),
179 triggerType1_(iConfig.getParameter<
int>(
"triggerType1")),
180 triggerType2_(iConfig.getParameter<
int>(
"triggerType2")),
181 minDR_(iConfig.getParameter<double>(
"MinDR")),
182 minDR2_(minDR_ * minDR_),
183 maxDZ_(iConfig.getParameter<double>(
"MaxDZ")),
184 min_N_(iConfig.getParameter<
int>(
"MinN")),
194 makeHLTFilterDescription(
desc);
195 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
196 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
200 desc.add<
int>(
"triggerType1", 0);
201 desc.add<
int>(
"triggerType2", 0);
202 desc.add<
double>(
"MinDR", -1.0);
203 desc.add<
double>(
"MaxDZ", 0.2);
204 desc.add<
int>(
"MinPixHitsForDZ", 0);
205 desc.add<
bool>(
"checkSC",
false);
206 desc.add<
int>(
"MinN", 1);
210 template <
typename T1,
typename T2>
213 makeHLTFilterDescription(
desc);
214 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
215 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
218 desc.add<
int>(
"triggerType1", 0);
219 desc.add<
int>(
"triggerType2", 0);
220 desc.add<
double>(
"MinDR", -1.0);
221 desc.add<
double>(
"MaxDZ", 0.2);
222 desc.add<
int>(
"MinN", 1);
223 desc.add<
int>(
"MinPixHitsForDZ", 0);
224 desc.add<
bool>(
"checkSC",
false);
232 makeHLTFilterDescription(
desc);
233 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
234 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
238 desc.add<
int>(
"triggerType1", 0);
239 desc.add<
int>(
"triggerType2", 0);
240 desc.add<
double>(
"MinDR", -1.0);
241 desc.add<
double>(
"MaxDZ", 0.2);
242 desc.add<
int>(
"MinN", 1);
243 desc.add<
int>(
"MinPixHitsForDZ", 0);
244 desc.add<
bool>(
"checkSC",
false);
252 makeHLTFilterDescription(
desc);
253 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
254 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
258 desc.add<
int>(
"triggerType1", 0);
259 desc.add<
int>(
"triggerType2", 0);
260 desc.add<
double>(
"MinDR", -1.0);
261 desc.add<
double>(
"MaxDZ", 0.2);
262 desc.add<
int>(
"MinN", 1);
263 desc.add<
int>(
"MinPixHitsForDZ", 0);
264 desc.add<
bool>(
"checkSC",
false);
272 makeHLTFilterDescription(
desc);
273 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
274 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
278 desc.add<
int>(
"triggerType1", 0);
279 desc.add<
int>(
"triggerType2", 0);
280 desc.add<
double>(
"MinDR", -1.0);
281 desc.add<
double>(
"MaxDZ", 0.2);
282 desc.add<
int>(
"MinN", 1);
283 desc.add<
int>(
"MinPixHitsForDZ", 0);
284 desc.add<
bool>(
"checkSC",
false);
291 makeHLTFilterDescription(
desc);
292 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
293 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
296 desc.add<
int>(
"triggerType1", 0);
297 desc.add<
int>(
"triggerType2", 0);
298 desc.add<
double>(
"MinDR", -1.0);
299 desc.add<
double>(
"MaxDZ", 0.2);
300 desc.add<
int>(
"MinN", 1);
307 makeHLTFilterDescription(
desc);
308 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
309 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
312 desc.add<
int>(
"triggerType1", 0);
313 desc.add<
int>(
"triggerType2", 0);
314 desc.add<
double>(
"MinDR", -1.0);
315 desc.add<
double>(
"MaxDZ", 0.2);
316 desc.add<
int>(
"MinN", 1);
323 makeHLTFilterDescription(
desc);
324 desc.add<std::vector<edm::InputTag>>(
"originTag1", {
edm::InputTag(
"hltOriginal1")});
325 desc.add<std::vector<edm::InputTag>>(
"originTag2", {
edm::InputTag(
"hltOriginal2")});
328 desc.add<
int>(
"triggerType1", 0);
329 desc.add<
int>(
"triggerType2", 0);
330 desc.add<
double>(
"MinDR", -1.0);
331 desc.add<
double>(
"MaxDZ", 0.2);
332 desc.add<
int>(
"MinN", 1);
336 template <
typename T1,
typename T2>
338 std::vector<T1Ref>& coll1,
339 std::vector<T2Ref>& coll2,
342 if (
iEvent.getByToken(inputToken1_, handle1) and
iEvent.getByToken(inputToken2_, handle2)) {
351 for (
unsigned int i = 0;
i < originTag1_.size(); ++
i) {
357 const auto& prov =
iEvent.getStableProvenance(pid);
362 if (tagOld.
encode() != tagNew.encode()) {
367 for (
unsigned int i = 0;
i < originTag2_.size(); ++
i) {
373 const auto& prov =
iEvent.getStableProvenance(pid);
378 if (tagOld.
encode() != tagNew.encode()) {
394 std::vector<l1t::P2GTCandidateRef>& coll1,
395 std::vector<l1t::P2GTCandidateRef>& coll2,
399 if (!
algos.empty()) {
400 if (
algos.count(l1GTAlgoName1_) > 0 &&
algos.at(l1GTAlgoName1_).decisionBeforeBxMaskAndPrescale()) {
406 coll1.push_back(
obj);
411 if (
algos.count(l1GTAlgoName2_) > 0 &&
algos.at(l1GTAlgoName2_).decisionBeforeBxMaskAndPrescale()) {
417 coll2.push_back(
obj);
423 if (!coll1.empty() && !coll2.empty()) {
429 for (
unsigned int i = 0;
i < originTag1_.size(); ++
i) {
435 const auto& prov =
iEvent.getStableProvenance(pid);
440 if (tagOld.
encode() != tagNew.encode()) {
445 for (
unsigned int i = 0;
i < originTag2_.size(); ++
i) {
451 const auto& prov =
iEvent.getStableProvenance(pid);
456 if (tagOld.
encode() != tagNew.encode()) {
468 template <
typename T1,
typename T2>
470 return (
c1.superCluster().isNonnull() and c2.superCluster().isNonnull() and (
c1.superCluster() == c2.superCluster()));
490 template <
typename C1,
typename C2>
504 return (minDR_ < 0
or reco::deltaR2(m1.phEta(), m1.phPhi(),
m2.phEta(),
m2.phPhi()) >= minDR2_);
510 if (minPixHitsForValidVZ > 0) {
512 if (not(
track.isNonnull() and
track.isAvailable() and
513 track->hitPattern().numberOfValidPixelHits() >= minPixHitsForValidVZ)) {
525 int const minPixHitsForValidVZ,
529 if (elec.superCluster() ==
cand.superCluster()) {
534 if (elec_ptr ==
nullptr) {
540 if (minPixHitsForValidVZ > 0) {
542 if (not(
track.isNonnull() and
track.isAvailable() and
543 track->hitPattern().numberOfValidPixelHits() >= minPixHitsForValidVZ)) {
550 return elec_ptr->
vz();
554 auto const& leadChargedPFCand =
cand.leadChargedPFCand();
555 if (leadChargedPFCand.isNonnull() and leadChargedPFCand.isAvailable()) {
556 auto const& pfTrack = leadChargedPFCand->pfTrack();
557 if (pfTrack.isNonnull() and pfTrack.isAvailable()) {
559 return pfTrack->vertex().z();
569 template <
typename T1,
typename T2>
571 return ((
std::abs(
c1.vz() - c2.vz()) <= maxDZ_) and passCutMinDeltaR(
c1, c2));
578 if (maxDZ_ > 0 &&
std::abs(
c1.vz() - c2.
vz()) > maxDZ_) {
582 if (not passCutMinDeltaR(
c1, c2)) {
592 if (not passCutMinDeltaR(
c1, c2))
595 bool hasValidVZ2 =
false;
596 auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_);
600 bool hasValidVZ1 =
false;
602 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1, minPixHitsForDZ_,
electrons);
606 return (
std::abs(vz1 - vz2) <= maxDZ_);
612 if (not passCutMinDeltaR(
c1, c2))
615 bool hasValidVZ1 =
false;
616 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1, minPixHitsForDZ_);
620 bool hasValidVZ2 =
false;
622 auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_,
electrons);
626 return (
std::abs(vz1 - vz2) <= maxDZ_);
632 if (not passCutMinDeltaR(
c1, c2))
637 bool hasValidVZ1 =
false;
638 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1, minPixHitsForDZ_,
electrons);
642 bool hasValidVZ2 =
false;
643 auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_,
electrons);
647 return (
std::abs(vz1 - vz2) <= maxDZ_);
653 if (not passCutMinDeltaR(
c1, c2))
656 bool hasValidVZ1 =
false;
657 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1, minPixHitsForDZ_);
661 bool hasValidVZ2 =
false;
662 auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_);
666 return (
std::abs(vz1 - vz2) <= maxDZ_);
673 return ((
std::abs(
c1.phZ0() - c2.
phZ0()) <= maxDZ_) and passCutMinDeltaR(
c1, c2));
680 if (not passCutMinDeltaR(
c1, c2))
683 bool hasValidVZ1 =
false;
684 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1);
688 bool hasValidVZ2 =
false;
689 auto const vz2 = getCandidateVZ(c2, hasValidVZ2);
693 return (
std::abs(vz1 - vz2) <= maxDZ_);
696 template <
typename T1,
typename T2>
703 std::vector<T1Ref> coll1;
704 std::vector<T2Ref> coll2;
706 if (getCollections(
iEvent, coll1, coll2, filterproduct)) {
711 for (
unsigned int i1 = 0;
i1 < coll1.size(); ++
i1) {
713 unsigned int const I = same_ ?
i1 + 1 : 0;
714 for (
unsigned int i2 =
I;
i2 < coll2.size(); ++
i2) {
717 if (checkSC_ and haveSameSuperCluster(*
r1, *
r2)) {
731 return (
n >= min_N_);
745 std::vector<l1t::P2GTCandidateRef> coll1;
746 std::vector<l1t::P2GTCandidateRef> coll2;
748 if (getCollections(
iEvent, coll1, coll2, filterproduct)) {
753 for (
unsigned int i1 = 0;
i1 != coll1.size();
i1++) {
759 for (
unsigned int i2 =
I;
i2 != coll2.size();
i2++) {
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
std::map< std::string, P2GTAlgoBlock > P2GTAlgoBlockMap
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
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
def template(fileName, svg, replaceme="REPLACEME")
#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
std::vector< P2GTCandidateRef > P2GTCandidateVectorRef
bool hltFilter(edm::Event &iEvent, edm::EventSetup const &iSetup, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
HLTDoubletDZ(edm::ParameterSet const &)
const double phZ0() const