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 minPixHitsForDZ_ (iConfig.
template getParameter<int>(
"MinPixHitsForDZ")),
43 min_N_ (iConfig.
template getParameter<int>(
"MinN")),
44 checkSC_ (iConfig.
template getParameter<bool>(
"checkSC")),
51 originTag1_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag1")),
52 originTag2_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag2")),
55 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
56 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
58 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
59 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
60 minDR_ (iConfig.
template getParameter<double>(
"MinDR")),
61 maxDZ_ (iConfig.
template getParameter<double>(
"MaxDZ")),
62 minPixHitsForDZ_ (iConfig.
template getParameter<int>(
"MinPixHitsForDZ")),
63 min_N_ (iConfig.
template getParameter<int>(
"MinN")),
64 checkSC_ (iConfig.
template getParameter<bool>(
"checkSC")),
71 originTag1_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag1")),
72 originTag2_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag2")),
75 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
76 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
78 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
79 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
80 minDR_ (iConfig.
template getParameter<double>(
"MinDR")),
81 maxDZ_ (iConfig.
template getParameter<double>(
"MaxDZ")),
82 minPixHitsForDZ_ (iConfig.
template getParameter<int>(
"MinPixHitsForDZ")),
83 min_N_ (iConfig.
template getParameter<int>(
"MinN")),
84 checkSC_ (iConfig.
template getParameter<bool>(
"checkSC")),
91 originTag1_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag1")),
92 originTag2_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag2")),
95 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
96 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
98 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
99 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
100 minDR_ (iConfig.
template getParameter<double>(
"MinDR")),
101 maxDZ_ (iConfig.
template getParameter<double>(
"MaxDZ")),
102 minPixHitsForDZ_ (iConfig.
template getParameter<int>(
"MinPixHitsForDZ")),
103 min_N_ (iConfig.
template getParameter<int>(
"MinN")),
104 checkSC_ (iConfig.
template getParameter<bool>(
"checkSC")),
111 originTag1_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag1")),
112 originTag2_(iConfig.
template getParameter<std::vector<edm::
InputTag> >(
"originTag2")),
115 inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
116 inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
118 triggerType1_(iConfig.
template getParameter<int>(
"triggerType1")),
119 triggerType2_(iConfig.
template getParameter<int>(
"triggerType2")),
120 minDR_ (iConfig.
template getParameter<double>(
"MinDR")),
121 maxDZ_ (iConfig.
template getParameter<double>(
"MaxDZ")),
122 minPixHitsForDZ_ (iConfig.
template getParameter<int>(
"MinPixHitsForDZ")),
123 min_N_ (iConfig.
template getParameter<int>(
"MinN")),
124 checkSC_ (iConfig.
template getParameter<bool>(
"checkSC")),
128 template<
typename T1,
typename T2>
132 template<
typename T1,
typename T2>
136 makeHLTFilterDescription(desc);
139 desc.
add<std::vector<edm::InputTag> >(
"originTag1",
originTag1);
140 desc.
add<std::vector<edm::InputTag> >(
"originTag2",
originTag2);
143 desc.
add<
int>(
"triggerType1",0);
144 desc.
add<
int>(
"triggerType2",0);
145 desc.
add<
double>(
"MinDR",-1.0);
146 desc.
add<
double>(
"MaxDZ",0.2);
147 desc.
add<
int>(
"MinPixHitsForDZ",0);
148 desc.
add<
bool>(
"checkSC",
false);
149 desc.
add<
int>(
"MinN",1);
157 makeHLTFilterDescription(desc);
160 desc.
add<std::vector<edm::InputTag> >(
"originTag1",
originTag1);
161 desc.
add<std::vector<edm::InputTag> >(
"originTag2",
originTag2);
165 desc.
add<
int>(
"triggerType1",0);
166 desc.
add<
int>(
"triggerType2",0);
167 desc.
add<
double>(
"MinDR",-1.0);
168 desc.
add<
double>(
"MaxDZ",0.2);
169 desc.
add<
int>(
"MinPixHitsForDZ",0);
170 desc.
add<
bool>(
"checkSC",
false);
171 desc.
add<
int>(
"MinN",1);
179 makeHLTFilterDescription(desc);
182 desc.
add<std::vector<edm::InputTag> >(
"originTag1",
originTag1);
183 desc.
add<std::vector<edm::InputTag> >(
"originTag2",
originTag2);
187 desc.
add<
int>(
"triggerType1",0);
188 desc.
add<
int>(
"triggerType2",0);
189 desc.
add<
double>(
"MinDR",-1.0);
190 desc.
add<
double>(
"MaxDZ",0.2);
191 desc.
add<
int>(
"MinPixHitsForDZ",0);
192 desc.
add<
bool>(
"checkSC",
false);
193 desc.
add<
int>(
"MinN",1);
201 makeHLTFilterDescription(desc);
204 desc.
add<std::vector<edm::InputTag> >(
"originTag1",
originTag1);
205 desc.
add<std::vector<edm::InputTag> >(
"originTag2",
originTag2);
209 desc.
add<
int>(
"triggerType1",0);
210 desc.
add<
int>(
"triggerType2",0);
211 desc.
add<
double>(
"MinDR",-1.0);
212 desc.
add<
double>(
"MaxDZ",0.2);
213 desc.
add<
int>(
"MinPixHitsForDZ",0);
214 desc.
add<
bool>(
"checkSC",
false);
215 desc.
add<
int>(
"MinN",1);
223 makeHLTFilterDescription(desc);
226 desc.
add<std::vector<edm::InputTag> >(
"originTag1",
originTag1);
227 desc.
add<std::vector<edm::InputTag> >(
"originTag2",
originTag2);
230 desc.
add<
int>(
"triggerType1",0);
231 desc.
add<
int>(
"triggerType2",0);
232 desc.
add<
double>(
"MinDR",-1.0);
233 desc.
add<
double>(
"MaxDZ",0.2);
234 desc.
add<
int>(
"MinPixHitsForDZ",0);
235 desc.
add<
bool>(
"checkSC",
false);
236 desc.
add<
int>(
"MinN",1);
240 template<
typename T1,
typename T2>
249 handle1->getObjects(triggerType1_, coll1);
250 handle2->getObjects(triggerType2_, coll2);
256 for (
unsigned int i=0;
i<originTag1_.size(); ++
i) {
266 if (tagOld.
encode()!=tagNew.encode()) {
271 for (
unsigned int i=0;
i<originTag2_.size(); ++
i) {
281 if (tagOld.
encode()!=tagNew.encode()) {
293 template<
typename T1,
typename T2>
302 if (
std::abs(candidate1.
vz()-candidate2.
vz()) > maxDZ_ )
313 iEvent.
getByToken(electronToken_, electronHandle_);
314 if (!electronHandle_.
isValid())
315 edm::LogError(
"HLTDoubletDZ") <<
"HLTDoubletDZ: Electron Handle not valid.";
320 for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
321 if (eleIt->superCluster() == r1->superCluster())
327 if ( minPixHitsForDZ_ > 0 &&
328 (e1.
gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_
329 || candidate2.
track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_) )
331 if ( !skipDZ &&
std::abs(e1.
vz()-candidate2.
vz()) > maxDZ_ )
342 iEvent.
getByToken(electronToken_, electronHandle_);
343 if (!electronHandle_.
isValid())
344 edm::LogError(
"HLTDoubletDZ") <<
"HLTDoubletDZ: Electron Handle not valid.";
349 for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
350 if (eleIt->superCluster() == r2->superCluster())
356 if ( minPixHitsForDZ_ > 0 &&
357 (candidate1.
track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_
358 || e2.
gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_) )
360 if ( !skipDZ &&
std::abs(e2.
vz()-candidate1.
vz()) > maxDZ_ )
371 iEvent.
getByToken(electronToken_, electronHandle_);
372 if (!electronHandle_.
isValid())
373 edm::LogError(
"HLTDoubletDZ") <<
"HLTDoubletDZ: Electron Handle not valid.";
378 for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
379 if (eleIt->superCluster() == r2->superCluster())
381 if (eleIt->superCluster() == r1->superCluster())
386 if ( minPixHitsForDZ_ > 0 &&
387 (e1.
gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_
388 || e2.
gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_) )
406 if ( minPixHitsForDZ_ > 0 &&
407 (candidate1.
track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_
408 || candidate2.
track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_) )
410 if ( !skipDZ &&
std::abs(candidate1.
vz()-candidate2.
vz()) > maxDZ_ )
417 template<
typename T1,
typename T2>
427 std::vector<T1Ref> coll1;
428 std::vector<T2Ref> coll2;
430 if (getCollections(iEvent, coll1, coll2, filterproduct)) {
435 for (
unsigned int i1=0; i1!=coll1.size(); i1++) {
440 for (
unsigned int i2=I; i2!=coll2.size(); i2++) {
444 if (r1->superCluster() == r2->superCluster())
continue;
448 if (!computeDZ(iEvent, r1, r2))
452 filterproduct.
addObject(triggerType1_,r1);
453 filterproduct.
addObject(triggerType2_,r2);
457 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)
virtual reco::GsfTrackRef gsfTrack() const
reference to a GsfTrack
HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoChargedCandidate > HLT2PhotonMuonDZ
HLTDoubletDZ< reco::Electron, reco::Electron > HLT2ElectronElectronDZ
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)
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
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
virtual reco::TrackRef track() const
reference to a track
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