27 template<
typename T1,
typename T2>
30 originTag1_(iConfig.
template getParameter<std::vector<edm::InputTag> >(
"originTag1")),
31 originTag2_(iConfig.
template getParameter<std::vector<edm::InputTag> >(
"originTag2")),
32 inputTag1_(iConfig.
template getParameter<edm::InputTag>(
"inputTag1")),
33 inputTag2_(iConfig.
template getParameter<edm::InputTag>(
"inputTag2")),
34 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
35 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
37 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
38 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
39 minDR_ (iConfig.
template getParameter<double>(
"MinDR")),
40 maxDZ_ (iConfig.
template getParameter<double>(
"MaxDZ")),
41 min_N_ (iConfig.
template getParameter<int>(
"MinN")),
42 checkSC_ (iConfig.
template getParameter<bool>(
"checkSC")),
49 originTag1_(iConfig.
template getParameter<std::vector<edm::InputTag> >(
"originTag1")),
50 originTag2_(iConfig.
template getParameter<std::vector<edm::InputTag> >(
"originTag2")),
51 inputTag1_(iConfig.
template getParameter<edm::InputTag>(
"inputTag1")),
52 inputTag2_(iConfig.
template getParameter<edm::InputTag>(
"inputTag2")),
53 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
54 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
56 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
57 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
58 minDR_ (iConfig.
template getParameter<double>(
"MinDR")),
59 maxDZ_ (iConfig.
template getParameter<double>(
"MaxDZ")),
60 min_N_ (iConfig.
template getParameter<int>(
"MinN")),
61 checkSC_ (iConfig.
template getParameter<bool>(
"checkSC")),
68 originTag1_(iConfig.
template getParameter<std::vector<edm::InputTag> >(
"originTag1")),
69 originTag2_(iConfig.
template getParameter<std::vector<edm::InputTag> >(
"originTag2")),
70 inputTag1_(iConfig.
template getParameter<edm::InputTag>(
"inputTag1")),
71 inputTag2_(iConfig.
template getParameter<edm::InputTag>(
"inputTag2")),
72 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
73 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
75 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
76 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
77 minDR_ (iConfig.
template getParameter<double>(
"MinDR")),
78 maxDZ_ (iConfig.
template getParameter<double>(
"MaxDZ")),
79 min_N_ (iConfig.
template getParameter<int>(
"MinN")),
80 checkSC_ (iConfig.
template getParameter<bool>(
"checkSC")),
87 originTag1_(iConfig.
template getParameter<std::vector<edm::InputTag> >(
"originTag1")),
88 originTag2_(iConfig.
template getParameter<std::vector<edm::InputTag> >(
"originTag2")),
89 inputTag1_(iConfig.
template getParameter<edm::InputTag>(
"inputTag1")),
90 inputTag2_(iConfig.
template getParameter<edm::InputTag>(
"inputTag2")),
91 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
92 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
94 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
95 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
96 minDR_ (iConfig.
template getParameter<double>(
"MinDR")),
97 maxDZ_ (iConfig.
template getParameter<double>(
"MaxDZ")),
98 min_N_ (iConfig.
template getParameter<int>(
"MinN")),
99 checkSC_ (iConfig.
template getParameter<bool>(
"checkSC")),
103 template<
typename T1,
typename T2>
107 template<
typename T1,
typename T2>
111 makeHLTFilterDescription(desc);
112 std::vector<edm::InputTag> originTag1(1,
edm::InputTag(
"hltOriginal1"));
113 std::vector<edm::InputTag> originTag2(1,
edm::InputTag(
"hltOriginal2"));
114 desc.
add<std::vector<edm::InputTag> >(
"originTag1",originTag1);
115 desc.
add<std::vector<edm::InputTag> >(
"originTag2",originTag2);
118 desc.
add<
int>(
"triggerType1",0);
119 desc.
add<
int>(
"triggerType2",0);
120 desc.
add<
double>(
"MinDR",-1.0);
121 desc.
add<
double>(
"MaxDZ",0.2);
122 desc.
add<
bool>(
"checkSC",
false);
123 desc.
add<
int>(
"MinN",1);
131 makeHLTFilterDescription(desc);
132 std::vector<edm::InputTag> originTag1(1,
edm::InputTag(
"hltOriginal1"));
133 std::vector<edm::InputTag> originTag2(1,
edm::InputTag(
"hltOriginal2"));
134 desc.
add<std::vector<edm::InputTag> >(
"originTag1",originTag1);
135 desc.
add<std::vector<edm::InputTag> >(
"originTag2",originTag2);
139 desc.
add<
int>(
"triggerType1",0);
140 desc.
add<
int>(
"triggerType2",0);
141 desc.
add<
double>(
"MinDR",-1.0);
142 desc.
add<
double>(
"MaxDZ",0.2);
143 desc.
add<
bool>(
"checkSC",
false);
144 desc.
add<
int>(
"MinN",1);
152 makeHLTFilterDescription(desc);
153 std::vector<edm::InputTag> originTag1(1,
edm::InputTag(
"hltOriginal1"));
154 std::vector<edm::InputTag> originTag2(1,
edm::InputTag(
"hltOriginal2"));
155 desc.
add<std::vector<edm::InputTag> >(
"originTag1",originTag1);
156 desc.
add<std::vector<edm::InputTag> >(
"originTag2",originTag2);
160 desc.
add<
int>(
"triggerType1",0);
161 desc.
add<
int>(
"triggerType2",0);
162 desc.
add<
double>(
"MinDR",-1.0);
163 desc.
add<
double>(
"MaxDZ",0.2);
164 desc.
add<
bool>(
"checkSC",
false);
165 desc.
add<
int>(
"MinN",1);
173 makeHLTFilterDescription(desc);
174 std::vector<edm::InputTag> originTag1(1,
edm::InputTag(
"hltOriginal1"));
175 std::vector<edm::InputTag> originTag2(1,
edm::InputTag(
"hltOriginal2"));
176 desc.
add<std::vector<edm::InputTag> >(
"originTag1",originTag1);
177 desc.
add<std::vector<edm::InputTag> >(
"originTag2",originTag2);
181 desc.
add<
int>(
"triggerType1",0);
182 desc.
add<
int>(
"triggerType2",0);
183 desc.
add<
double>(
"MinDR",-1.0);
184 desc.
add<
double>(
"MaxDZ",0.2);
185 desc.
add<
bool>(
"checkSC",
false);
186 desc.
add<
int>(
"MinN",1);
190 template<
typename T1,
typename T2>
199 handle1->getObjects(triggerType1_, coll1);
200 handle2->getObjects(triggerType2_, coll2);
206 for (
unsigned int i=0;
i<originTag1_.size(); ++
i) {
216 if (tagOld.
encode()!=tagNew.encode()) {
221 for (
unsigned int i=0;
i<originTag2_.size(); ++
i) {
231 if (tagOld.
encode()!=tagNew.encode()) {
243 template<
typename T1,
typename T2>
252 if (
std::abs(candidate1.
vz()-candidate2.
vz()) > maxDZ_ )
263 iEvent.
getByToken(electronToken_, electronHandle_);
264 if (!electronHandle_.
isValid())
265 edm::LogError(
"HLTDoubletDZ") <<
"HLTDoubletDZ: Electron Handle not valid.";
270 for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
271 if (eleIt->superCluster() == r1->superCluster())
287 iEvent.
getByToken(electronToken_, electronHandle_);
288 if (!electronHandle_.
isValid())
289 edm::LogError(
"HLTDoubletDZ") <<
"HLTDoubletDZ: Electron Handle not valid.";
294 for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
295 if (eleIt->superCluster() == r2->superCluster())
311 iEvent.
getByToken(electronToken_, electronHandle_);
312 if (!electronHandle_.
isValid())
313 edm::LogError(
"HLTDoubletDZ") <<
"HLTDoubletDZ: Electron Handle not valid.";
318 for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
319 if (eleIt->superCluster() == r2->superCluster())
321 if (eleIt->superCluster() == r1->superCluster())
332 template<
typename T1,
typename T2>
342 std::vector<T1Ref> coll1;
343 std::vector<T2Ref> coll2;
345 if (getCollections(iEvent, coll1, coll2, filterproduct)) {
350 for (
unsigned int i1=0; i1!=coll1.size(); i1++) {
355 for (
unsigned int i2=I; i2!=coll2.size(); i2++) {
359 if (r1->superCluster() == r2->superCluster())
continue;
363 if (!computeDZ(iEvent, r1, r2))
367 filterproduct.
addObject(triggerType1_,r1);
368 filterproduct.
addObject(triggerType2_,r2);
372 accept = accept || (n>=min_N_);
HLTDoubletDZ(const edm::ParameterSet &)
bool isNonnull() const
Checks for non-null.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static PFTauRenderPlugin instance
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoChargedCandidate > HLT2PhotonMuonDZ
HLTDoubletDZ< reco::Electron, reco::Electron > HLT2ElectronElectronDZ
double deltaR(const T1 &t1, const T2 &t2)
std::string const & processName() const
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
Abs< T >::type abs(const T &t)
const std::complex< double > I
ParameterDescriptionBase * add(U const &iLabel, T const &value)
virtual double vz() const
z coordinate of vertex position
std::vector< Electron > ElectronCollection
collectin of Electron objects
virtual bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
HLTDoubletDZ< reco::RecoChargedCandidate, reco::RecoChargedCandidate > HLT2MuonMuonDZ
HLTDoubletDZ< reco::Electron, reco::RecoChargedCandidate > HLT2ElectronMuonDZ
HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoEcalCandidate > HLT2PhotonPhotonDZ
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::string const & moduleLabel() const
HLTDoubletDZ< reco::RecoChargedCandidate, reco::RecoEcalCandidate > HLT2MuonPhotonDZ
virtual double vz() const =0
z coordinate of vertex position
std::string const & productInstanceName() const
Provenance getProvenance(BranchID const &theID) const