28 template<
typename T1,
typename T2>
31 originTag1_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag1")),
32 originTag2_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag2")),
35 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
36 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
38 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
39 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
40 minDR_ (iConfig.
template getParameter<double>(
"MinDR")),
41 maxDZ_ (iConfig.
template getParameter<double>(
"MaxDZ")),
42 min_N_ (iConfig.
template getParameter<int>(
"MinN")),
43 checkSC_ (iConfig.
template getParameter<bool>(
"checkSC")),
50 originTag1_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag1")),
51 originTag2_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag2")),
54 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
55 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
57 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
58 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
59 minDR_ (iConfig.
template getParameter<double>(
"MinDR")),
60 maxDZ_ (iConfig.
template getParameter<double>(
"MaxDZ")),
61 min_N_ (iConfig.
template getParameter<int>(
"MinN")),
62 checkSC_ (iConfig.
template getParameter<bool>(
"checkSC")),
69 originTag1_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag1")),
70 originTag2_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag2")),
73 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
74 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
76 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
77 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
78 minDR_ (iConfig.
template getParameter<double>(
"MinDR")),
79 maxDZ_ (iConfig.
template getParameter<double>(
"MaxDZ")),
80 min_N_ (iConfig.
template getParameter<int>(
"MinN")),
81 checkSC_ (iConfig.
template getParameter<bool>(
"checkSC")),
88 originTag1_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag1")),
89 originTag2_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag2")),
92 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
93 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
95 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
96 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
97 minDR_ (iConfig.
template getParameter<double>(
"MinDR")),
98 maxDZ_ (iConfig.
template getParameter<double>(
"MaxDZ")),
99 min_N_ (iConfig.
template getParameter<int>(
"MinN")),
100 checkSC_ (iConfig.
template getParameter<bool>(
"checkSC")),
104 template<
typename T1,
typename T2>
108 template<
typename T1,
typename T2>
112 makeHLTFilterDescription(desc);
115 desc.
add<std::vector<edm::InputTag> >(
"originTag1",
originTag1);
116 desc.
add<std::vector<edm::InputTag> >(
"originTag2",
originTag2);
119 desc.
add<
int>(
"triggerType1",0);
120 desc.
add<
int>(
"triggerType2",0);
121 desc.
add<
double>(
"MinDR",-1.0);
122 desc.
add<
double>(
"MaxDZ",0.2);
123 desc.
add<
bool>(
"checkSC",
false);
124 desc.
add<
int>(
"MinN",1);
132 makeHLTFilterDescription(desc);
135 desc.
add<std::vector<edm::InputTag> >(
"originTag1",
originTag1);
136 desc.
add<std::vector<edm::InputTag> >(
"originTag2",
originTag2);
140 desc.
add<
int>(
"triggerType1",0);
141 desc.
add<
int>(
"triggerType2",0);
142 desc.
add<
double>(
"MinDR",-1.0);
143 desc.
add<
double>(
"MaxDZ",0.2);
144 desc.
add<
bool>(
"checkSC",
false);
145 desc.
add<
int>(
"MinN",1);
153 makeHLTFilterDescription(desc);
156 desc.
add<std::vector<edm::InputTag> >(
"originTag1",
originTag1);
157 desc.
add<std::vector<edm::InputTag> >(
"originTag2",
originTag2);
161 desc.
add<
int>(
"triggerType1",0);
162 desc.
add<
int>(
"triggerType2",0);
163 desc.
add<
double>(
"MinDR",-1.0);
164 desc.
add<
double>(
"MaxDZ",0.2);
165 desc.
add<
bool>(
"checkSC",
false);
166 desc.
add<
int>(
"MinN",1);
174 makeHLTFilterDescription(desc);
177 desc.
add<std::vector<edm::InputTag> >(
"originTag1",
originTag1);
178 desc.
add<std::vector<edm::InputTag> >(
"originTag2",
originTag2);
182 desc.
add<
int>(
"triggerType1",0);
183 desc.
add<
int>(
"triggerType2",0);
184 desc.
add<
double>(
"MinDR",-1.0);
185 desc.
add<
double>(
"MaxDZ",0.2);
186 desc.
add<
bool>(
"checkSC",
false);
187 desc.
add<
int>(
"MinN",1);
191 template<
typename T1,
typename T2>
200 handle1->getObjects(triggerType1_, coll1);
201 handle2->getObjects(triggerType2_, coll2);
207 for (
unsigned int i=0;
i<originTag1_.size(); ++
i) {
217 if (tagOld.
encode()!=tagNew.encode()) {
222 for (
unsigned int i=0;
i<originTag2_.size(); ++
i) {
232 if (tagOld.
encode()!=tagNew.encode()) {
244 template<
typename T1,
typename T2>
253 if (
std::abs(candidate1.
vz()-candidate2.
vz()) > maxDZ_ )
264 iEvent.
getByToken(electronToken_, electronHandle_);
265 if (!electronHandle_.
isValid())
266 edm::LogError(
"HLTDoubletDZ") <<
"HLTDoubletDZ: Electron Handle not valid.";
271 for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
272 if (eleIt->superCluster() == r1->superCluster())
288 iEvent.
getByToken(electronToken_, electronHandle_);
289 if (!electronHandle_.
isValid())
290 edm::LogError(
"HLTDoubletDZ") <<
"HLTDoubletDZ: Electron Handle not valid.";
295 for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
296 if (eleIt->superCluster() == r2->superCluster())
312 iEvent.
getByToken(electronToken_, electronHandle_);
313 if (!electronHandle_.
isValid())
314 edm::LogError(
"HLTDoubletDZ") <<
"HLTDoubletDZ: Electron Handle not valid.";
319 for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
320 if (eleIt->superCluster() == r2->superCluster())
322 if (eleIt->superCluster() == r1->superCluster())
333 template<
typename T1,
typename T2>
343 std::vector<T1Ref> coll1;
344 std::vector<T2Ref> coll2;
346 if (getCollections(iEvent, coll1, coll2, filterproduct)) {
351 for (
unsigned int i1=0; i1!=coll1.size(); i1++) {
356 for (
unsigned int i2=I; i2!=coll2.size(); i2++) {
360 if (r1->superCluster() == r2->superCluster())
continue;
364 if (!computeDZ(iEvent, r1, r2))
368 filterproduct.
addObject(triggerType1_,r1);
369 filterproduct.
addObject(triggerType2_,r2);
373 accept = accept || (n>=min_N_);
std::string defaultModuleLabel()
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