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")),
50 algoBlockToken_(consumes<
std::
vector<
l1t::P2GTAlgoBlock>>(l1GTAlgoBlockTag_)),
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,
397 const std::vector<l1t::P2GTAlgoBlock>&
algos =
iEvent.get(algoBlockToken_);
399 if (!
algos.empty()) {
401 if (
algo.algoName() == l1GTAlgoName1_ &&
algo.decisionBeforeBxMaskAndPrescale()) {
407 coll1.push_back(
obj);
411 if (
algo.algoName() == l1GTAlgoName2_ &&
algo.decisionBeforeBxMaskAndPrescale()) {
417 coll2.push_back(
obj);
424 if (!coll1.empty() && !coll2.empty()) {
430 for (
unsigned int i = 0;
i < originTag1_.size(); ++
i) {
436 const auto& prov =
iEvent.getStableProvenance(pid);
441 if (tagOld.
encode() != tagNew.encode()) {
446 for (
unsigned int i = 0;
i < originTag2_.size(); ++
i) {
452 const auto& prov =
iEvent.getStableProvenance(pid);
457 if (tagOld.
encode() != tagNew.encode()) {
469 template <
typename T1,
typename T2>
471 return (
c1.superCluster().isNonnull() and c2.superCluster().isNonnull() and (
c1.superCluster() == c2.superCluster()));
491 template <
typename C1,
typename C2>
505 return (minDR_ < 0
or reco::deltaR2(m1.phEta(), m1.phPhi(),
m2.phEta(),
m2.phPhi()) >= minDR2_);
511 if (minPixHitsForValidVZ > 0) {
513 if (not(
track.isNonnull() and
track.isAvailable() and
514 track->hitPattern().numberOfValidPixelHits() >= minPixHitsForValidVZ)) {
526 int const minPixHitsForValidVZ,
530 if (elec.superCluster() ==
cand.superCluster()) {
535 if (elec_ptr ==
nullptr) {
541 if (minPixHitsForValidVZ > 0) {
543 if (not(
track.isNonnull() and
track.isAvailable() and
544 track->hitPattern().numberOfValidPixelHits() >= minPixHitsForValidVZ)) {
551 return elec_ptr->
vz();
555 auto const& leadChargedPFCand =
cand.leadChargedPFCand();
556 if (leadChargedPFCand.isNonnull() and leadChargedPFCand.isAvailable()) {
557 auto const&
pfTrack = leadChargedPFCand->pfTrack();
570 template <
typename T1,
typename T2>
572 return ((
std::abs(
c1.vz() - c2.vz()) <= maxDZ_) and passCutMinDeltaR(
c1, c2));
579 if (maxDZ_ > 0 &&
std::abs(
c1.vz() - c2.
vz()) > maxDZ_) {
583 if (not passCutMinDeltaR(
c1, c2)) {
593 if (not passCutMinDeltaR(
c1, c2))
596 bool hasValidVZ2 =
false;
597 auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_);
601 bool hasValidVZ1 =
false;
603 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1, minPixHitsForDZ_,
electrons);
607 return (
std::abs(vz1 - vz2) <= maxDZ_);
613 if (not passCutMinDeltaR(
c1, c2))
616 bool hasValidVZ1 =
false;
617 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1, minPixHitsForDZ_);
621 bool hasValidVZ2 =
false;
623 auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_,
electrons);
627 return (
std::abs(vz1 - vz2) <= maxDZ_);
633 if (not passCutMinDeltaR(
c1, c2))
638 bool hasValidVZ1 =
false;
639 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1, minPixHitsForDZ_,
electrons);
643 bool hasValidVZ2 =
false;
644 auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_,
electrons);
648 return (
std::abs(vz1 - vz2) <= maxDZ_);
654 if (not passCutMinDeltaR(
c1, c2))
657 bool hasValidVZ1 =
false;
658 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1, minPixHitsForDZ_);
662 bool hasValidVZ2 =
false;
663 auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_);
667 return (
std::abs(vz1 - vz2) <= maxDZ_);
674 return ((
std::abs(
c1.phZ0() - c2.
phZ0()) <= maxDZ_) and passCutMinDeltaR(
c1, c2));
681 if (not passCutMinDeltaR(
c1, c2))
684 bool hasValidVZ1 =
false;
685 auto const vz1 = getCandidateVZ(
c1, hasValidVZ1);
689 bool hasValidVZ2 =
false;
690 auto const vz2 = getCandidateVZ(c2, hasValidVZ2);
694 return (
std::abs(vz1 - vz2) <= maxDZ_);
697 template <
typename T1,
typename T2>
704 std::vector<T1Ref> coll1;
705 std::vector<T2Ref> coll2;
707 if (getCollections(
iEvent, coll1, coll2, filterproduct)) {
712 for (
unsigned int i1 = 0;
i1 < coll1.size(); ++
i1) {
714 unsigned int const I = same_ ?
i1 + 1 : 0;
715 for (
unsigned int i2 =
I;
i2 < coll2.size(); ++
i2) {
718 if (checkSC_ and haveSameSuperCluster(*
r1, *
r2)) {
732 return (
n >= min_N_);
746 std::vector<l1t::P2GTCandidateRef> coll1;
747 std::vector<l1t::P2GTCandidateRef> coll2;
749 if (getCollections(
iEvent, coll1, coll2, filterproduct)) {
754 for (
unsigned int i1 = 0;
i1 != coll1.size();
i1++) {
760 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
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