CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
HLTDoubletDZ< T1, T2 > Class Template Reference

#include <HLTDoubletDZ.h>

Inheritance diagram for HLTDoubletDZ< T1, T2 >:
HLTFilter edm::global::EDFilter<> edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

bool computeDZ (edm::Event &iEvent, T1Ref &c1, T2Ref &c2) const
 
template<>
bool computeDZ (edm::Event &iEvent, T1Ref &r1, T2Ref &r2) const
 
template<>
bool computeDZ (edm::Event &iEvent, T1Ref &r1, T2Ref &r2) const
 
template<>
bool computeDZ (edm::Event &iEvent, T1Ref &r1, T2Ref &r2) const
 
template<>
bool computeDZ (edm::Event &iEvent, T1Ref &r1, T2Ref &r2) const
 
template<>
void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
template<>
void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
template<>
void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
template<>
void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
bool getCollections (edm::Event &iEvent, std::vector< T1Ref > &coll1, std::vector< T2Ref > &coll2, trigger::TriggerFilterObjectWithRefs &filterproduct) const
 
 HLTDoubletDZ (const edm::ParameterSet &)
 
template<>
 HLTDoubletDZ (const edm::ParameterSet &iConfig)
 
template<>
 HLTDoubletDZ (const edm::ParameterSet &iConfig)
 
template<>
 HLTDoubletDZ (const edm::ParameterSet &iConfig)
 
template<>
 HLTDoubletDZ (const edm::ParameterSet &iConfig)
 
bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 
 ~HLTDoubletDZ () override
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module (edm::Event const &) const
 
const std::string * moduleLabel () const
 
int path (edm::Event const &) const
 
const std::string * pathName (edm::Event const &) const
 
std::pair< int, int > pmid (edm::Event const &) const
 
bool saveTags () const
 
 ~HLTFilter () override
 
- Public Member Functions inherited from edm::global::EDFilter<>
 EDFilter ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilterBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::global::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Types

typedef std::vector< T1 > T1Collection
 
typedef edm::Ref< T1CollectionT1Ref
 
typedef std::vector< T2 > T2Collection
 
typedef edm::Ref< T2CollectionT2Ref
 

Private Attributes

const bool checkSC_
 
edm::EDGetTokenT< reco::ElectronCollectionelectronToken_
 
const edm::InputTag inputTag1_
 
const edm::InputTag inputTag2_
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefsinputToken1_
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefsinputToken2_
 
const double maxDZ_
 
const int min_N_
 
const double minDR_
 
const int minPixHitsForDZ_
 
const std::vector< edm::InputTagoriginTag1_
 
const std::vector< edm::InputTagoriginTag2_
 
const bool same_
 
const int triggerType1_
 
const int triggerType2_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

template<typename T1, typename T2>
class HLTDoubletDZ< T1, T2 >

Definition at line 27 of file HLTDoubletDZ.h.

Member Typedef Documentation

◆ T1Collection

template<typename T1 , typename T2 >
typedef std::vector<T1> HLTDoubletDZ< T1, T2 >::T1Collection
private

Definition at line 28 of file HLTDoubletDZ.h.

◆ T1Ref

template<typename T1 , typename T2 >
typedef edm::Ref<T1Collection> HLTDoubletDZ< T1, T2 >::T1Ref
private

Definition at line 29 of file HLTDoubletDZ.h.

◆ T2Collection

template<typename T1 , typename T2 >
typedef std::vector<T2> HLTDoubletDZ< T1, T2 >::T2Collection
private

Definition at line 30 of file HLTDoubletDZ.h.

◆ T2Ref

template<typename T1 , typename T2 >
typedef edm::Ref<T2Collection> HLTDoubletDZ< T1, T2 >::T2Ref
private

Definition at line 31 of file HLTDoubletDZ.h.

Constructor & Destructor Documentation

◆ HLTDoubletDZ() [1/5]

template<typename T1 , typename T2 >
HLTDoubletDZ< T1, T2 >::HLTDoubletDZ ( const edm::ParameterSet iConfig)
explicit

Definition at line 29 of file HLTDoubletDZ.cc.

30  : HLTFilter(iConfig),
31  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag1")),
32  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag2")),
33  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
34  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
35  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
36  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
37  //electronToken_ (consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
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")),
45  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
46 {}

◆ ~HLTDoubletDZ()

template<typename T1 , typename T2 >
HLTDoubletDZ< T1, T2 >::~HLTDoubletDZ ( )
override

Definition at line 129 of file HLTDoubletDZ.cc.

129 {}

◆ HLTDoubletDZ() [2/5]

Definition at line 49 of file HLTDoubletDZ.cc.

50  : HLTFilter(iConfig),
51  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag1")),
52  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag2")),
53  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
54  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
55  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
56  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
57  electronToken_(consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
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")),
65  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
66 {}

◆ HLTDoubletDZ() [3/5]

Definition at line 69 of file HLTDoubletDZ.cc.

70  : HLTFilter(iConfig),
71  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag1")),
72  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag2")),
73  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
74  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
75  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
76  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
77  electronToken_(consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
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")),
85  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
86 {}

◆ HLTDoubletDZ() [4/5]

Definition at line 89 of file HLTDoubletDZ.cc.

90  : HLTFilter(iConfig),
91  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag1")),
92  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag2")),
93  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
94  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
95  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
96  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
97  electronToken_(consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
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")),
105  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
106 {}

◆ HLTDoubletDZ() [5/5]

Definition at line 109 of file HLTDoubletDZ.cc.

110  : HLTFilter(iConfig),
111  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag1")),
112  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag2")),
113  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
114  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
115  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
116  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
117  //electronToken_ (consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
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")),
125  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
126 {}

Member Function Documentation

◆ computeDZ() [1/5]

template<typename T1 , typename T2 >
bool HLTDoubletDZ< T1, T2 >::computeDZ ( edm::Event iEvent,
T1Ref c1,
T2Ref c2 
) const

Definition at line 293 of file HLTDoubletDZ.cc.

293  {
294  const reco::Candidate& candidate1(*r1);
295  const reco::Candidate& candidate2(*r2);
296  if (reco::deltaR(candidate1, candidate2) < minDR_)
297  return false;
298  if (std::abs(candidate1.vz() - candidate2.vz()) > maxDZ_)
299  return false;
300 
301  return true;
302 }

References funct::abs(), reco::deltaR(), diffTwoXMLs::r1, diffTwoXMLs::r2, and reco::Candidate::vz().

◆ computeDZ() [2/5]

template<>
bool HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoChargedCandidate >::computeDZ ( edm::Event iEvent,
T1Ref r1,
T2Ref r2 
) const

Definition at line 305 of file HLTDoubletDZ.cc.

307  {
309  iEvent.getByToken(electronToken_, electronHandle_);
310  if (!electronHandle_.isValid())
311  edm::LogError("HLTDoubletDZ") << "HLTDoubletDZ: Electron Handle not valid.";
312 
313  if (reco::deltaR(*r1, *r2) < minDR_)
314  return false;
316  for (auto const& eleIt : *electronHandle_) {
317  if (eleIt.superCluster() == r1->superCluster())
318  e1 = eleIt;
319  }
320 
321  const reco::RecoChargedCandidate& candidate2(*r2);
322  bool skipDZ = false;
323  if (minPixHitsForDZ_ > 0 && (e1.gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_ ||
324  candidate2.track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_))
325  skipDZ = true;
326  if (!skipDZ && std::abs(e1.vz() - candidate2.vz()) > maxDZ_)
327  return false;
328 
329  return true;
330 }

References funct::abs(), reco::deltaR(), StorageManager_cfg::e1, iEvent, edm::HandleBase::isValid(), diffTwoXMLs::r1, diffTwoXMLs::r2, reco::RecoChargedCandidate::track(), and reco::LeafCandidate::vz().

◆ computeDZ() [3/5]

template<>
bool HLTDoubletDZ< reco::RecoChargedCandidate, reco::RecoEcalCandidate >::computeDZ ( edm::Event iEvent,
T1Ref r1,
T2Ref r2 
) const

Definition at line 333 of file HLTDoubletDZ.cc.

335  {
337  iEvent.getByToken(electronToken_, electronHandle_);
338  if (!electronHandle_.isValid())
339  edm::LogError("HLTDoubletDZ") << "HLTDoubletDZ: Electron Handle not valid.";
340 
341  if (reco::deltaR(*r1, *r2) < minDR_)
342  return false;
343  reco::Electron e2;
344  for (auto const& eleIt : *electronHandle_) {
345  if (eleIt.superCluster() == r2->superCluster())
346  e2 = eleIt;
347  }
348 
349  const reco::RecoChargedCandidate& candidate1(*r1);
350  bool skipDZ = false;
351  if (minPixHitsForDZ_ > 0 && (candidate1.track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_ ||
352  e2.gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_))
353  skipDZ = true;
354  if (!skipDZ && std::abs(e2.vz() - candidate1.vz()) > maxDZ_)
355  return false;
356 
357  return true;
358 }

References funct::abs(), reco::deltaR(), reco::Electron::gsfTrack(), iEvent, edm::HandleBase::isValid(), diffTwoXMLs::r1, diffTwoXMLs::r2, reco::RecoChargedCandidate::track(), and reco::LeafCandidate::vz().

◆ computeDZ() [4/5]

template<>
bool HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoEcalCandidate >::computeDZ ( edm::Event iEvent,
T1Ref r1,
T2Ref r2 
) const

Definition at line 361 of file HLTDoubletDZ.cc.

363  {
365  iEvent.getByToken(electronToken_, electronHandle_);
366  if (!electronHandle_.isValid())
367  edm::LogError("HLTDoubletDZ") << "HLTDoubletDZ: Electron Handle not valid.";
368 
369  if (reco::deltaR(*r1, *r2) < minDR_)
370  return false;
371  reco::Electron e1, e2;
372  for (auto const& eleIt : *electronHandle_) {
373  if (eleIt.superCluster() == r2->superCluster())
374  e2 = eleIt;
375  if (eleIt.superCluster() == r1->superCluster())
376  e1 = eleIt;
377  }
378 
379  bool skipDZ = false;
380  if (minPixHitsForDZ_ > 0 && (e1.gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_ ||
381  e2.gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_))
382  skipDZ = true;
383  if (!skipDZ && std::abs(e2.vz() - e1.vz()) > maxDZ_)
384  return false;
385 
386  return true;
387 }

References funct::abs(), reco::deltaR(), StorageManager_cfg::e1, reco::Electron::gsfTrack(), iEvent, edm::HandleBase::isValid(), diffTwoXMLs::r1, diffTwoXMLs::r2, and reco::LeafCandidate::vz().

◆ computeDZ() [5/5]

template<>
bool HLTDoubletDZ< reco::RecoChargedCandidate, reco::RecoChargedCandidate >::computeDZ ( edm::Event iEvent,
T1Ref r1,
T2Ref r2 
) const

Definition at line 390 of file HLTDoubletDZ.cc.

392  {
393  const reco::RecoChargedCandidate& candidate1(*r1);
394  const reco::RecoChargedCandidate& candidate2(*r2);
395  if (reco::deltaR(candidate1, candidate2) < minDR_)
396  return false;
397  bool skipDZ = false;
398  if (minPixHitsForDZ_ > 0 && (candidate1.track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_ ||
399  candidate2.track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_))
400  skipDZ = true;
401  if (!skipDZ && std::abs(candidate1.vz() - candidate2.vz()) > maxDZ_)
402  return false;
403 
404  return true;
405 }

References funct::abs(), reco::deltaR(), diffTwoXMLs::r1, diffTwoXMLs::r2, reco::RecoChargedCandidate::track(), and reco::LeafCandidate::vz().

◆ fillDescriptions() [1/5]

template<typename T1 , typename T2 >
void HLTDoubletDZ< T1, T2 >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 132 of file HLTDoubletDZ.cc.

132  {
135  std::vector<edm::InputTag> originTag1(1, edm::InputTag("hltOriginal1"));
136  std::vector<edm::InputTag> originTag2(1, edm::InputTag("hltOriginal2"));
137  desc.add<std::vector<edm::InputTag>>("originTag1", originTag1);
138  desc.add<std::vector<edm::InputTag>>("originTag2", originTag2);
139  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
140  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
141  desc.add<int>("triggerType1", 0);
142  desc.add<int>("triggerType2", 0);
143  desc.add<double>("MinDR", -1.0);
144  desc.add<double>("MaxDZ", 0.2);
145  desc.add<int>("MinPixHitsForDZ", 0);
146  desc.add<bool>("checkSC", false);
147  desc.add<int>("MinN", 1);
149 }

References edm::ConfigurationDescriptions::add(), defaultModuleLabel(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, HLT_FULL_cff::originTag1, and HLT_FULL_cff::originTag2.

◆ fillDescriptions() [2/5]

template<>
void HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoEcalCandidate >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)

Definition at line 152 of file HLTDoubletDZ.cc.

153  {
156  std::vector<edm::InputTag> originTag1(1, edm::InputTag("hltOriginal1"));
157  std::vector<edm::InputTag> originTag2(1, edm::InputTag("hltOriginal2"));
158  desc.add<std::vector<edm::InputTag>>("originTag1", originTag1);
159  desc.add<std::vector<edm::InputTag>>("originTag2", originTag2);
160  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
161  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
162  desc.add<edm::InputTag>("electronTag", edm::InputTag("electronTag"));
163  desc.add<int>("triggerType1", 0);
164  desc.add<int>("triggerType2", 0);
165  desc.add<double>("MinDR", -1.0);
166  desc.add<double>("MaxDZ", 0.2);
167  desc.add<int>("MinPixHitsForDZ", 0);
168  desc.add<bool>("checkSC", false);
169  desc.add<int>("MinN", 1);
171 }

References edm::ConfigurationDescriptions::add(), defaultModuleLabel(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, HLT_FULL_cff::originTag1, and HLT_FULL_cff::originTag2.

◆ fillDescriptions() [3/5]

template<>
void HLTDoubletDZ< reco::RecoChargedCandidate, reco::RecoEcalCandidate >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)

Definition at line 174 of file HLTDoubletDZ.cc.

175  {
178  std::vector<edm::InputTag> originTag1(1, edm::InputTag("hltOriginal1"));
179  std::vector<edm::InputTag> originTag2(1, edm::InputTag("hltOriginal2"));
180  desc.add<std::vector<edm::InputTag>>("originTag1", originTag1);
181  desc.add<std::vector<edm::InputTag>>("originTag2", originTag2);
182  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
183  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
184  desc.add<edm::InputTag>("electronTag", edm::InputTag("electronTag"));
185  desc.add<int>("triggerType1", 0);
186  desc.add<int>("triggerType2", 0);
187  desc.add<double>("MinDR", -1.0);
188  desc.add<double>("MaxDZ", 0.2);
189  desc.add<int>("MinPixHitsForDZ", 0);
190  desc.add<bool>("checkSC", false);
191  desc.add<int>("MinN", 1);
193 }

References edm::ConfigurationDescriptions::add(), defaultModuleLabel(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, HLT_FULL_cff::originTag1, and HLT_FULL_cff::originTag2.

◆ fillDescriptions() [4/5]

template<>
void HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoChargedCandidate >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)

Definition at line 196 of file HLTDoubletDZ.cc.

197  {
200  std::vector<edm::InputTag> originTag1(1, edm::InputTag("hltOriginal1"));
201  std::vector<edm::InputTag> originTag2(1, edm::InputTag("hltOriginal2"));
202  desc.add<std::vector<edm::InputTag>>("originTag1", originTag1);
203  desc.add<std::vector<edm::InputTag>>("originTag2", originTag2);
204  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
205  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
206  desc.add<edm::InputTag>("electronTag", edm::InputTag("electronTag"));
207  desc.add<int>("triggerType1", 0);
208  desc.add<int>("triggerType2", 0);
209  desc.add<double>("MinDR", -1.0);
210  desc.add<double>("MaxDZ", 0.2);
211  desc.add<int>("MinPixHitsForDZ", 0);
212  desc.add<bool>("checkSC", false);
213  desc.add<int>("MinN", 1);
215 }

References edm::ConfigurationDescriptions::add(), defaultModuleLabel(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, HLT_FULL_cff::originTag1, and HLT_FULL_cff::originTag2.

◆ fillDescriptions() [5/5]

template<>
void HLTDoubletDZ< reco::RecoChargedCandidate, reco::RecoChargedCandidate >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)

Definition at line 218 of file HLTDoubletDZ.cc.

219  {
222  std::vector<edm::InputTag> originTag1(1, edm::InputTag("hltOriginal1"));
223  std::vector<edm::InputTag> originTag2(1, edm::InputTag("hltOriginal2"));
224  desc.add<std::vector<edm::InputTag>>("originTag1", originTag1);
225  desc.add<std::vector<edm::InputTag>>("originTag2", originTag2);
226  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
227  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
228  desc.add<int>("triggerType1", 0);
229  desc.add<int>("triggerType2", 0);
230  desc.add<double>("MinDR", -1.0);
231  desc.add<double>("MaxDZ", 0.2);
232  desc.add<int>("MinPixHitsForDZ", 0);
233  desc.add<bool>("checkSC", false);
234  desc.add<int>("MinN", 1);
236 }

References edm::ConfigurationDescriptions::add(), defaultModuleLabel(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, HLT_FULL_cff::originTag1, and HLT_FULL_cff::originTag2.

◆ getCollections()

template<typename T1 , typename T2 >
bool HLTDoubletDZ< T1, T2 >::getCollections ( edm::Event iEvent,
std::vector< T1Ref > &  coll1,
std::vector< T2Ref > &  coll2,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const

Definition at line 241 of file HLTDoubletDZ.cc.

244  {
246  if (iEvent.getByToken(inputToken1_, handle1) and iEvent.getByToken(inputToken2_, handle2)) {
247  // get hold of pre-filtered object collections
248  handle1->getObjects(triggerType1_, coll1);
249  handle2->getObjects(triggerType2_, coll2);
250  const trigger::size_type n1(coll1.size());
251  const trigger::size_type n2(coll2.size());
252 
253  if (saveTags()) {
254  edm::InputTag tagOld;
255  for (unsigned int i = 0; i < originTag1_.size(); ++i) {
256  filterproduct.addCollectionTag(originTag1_[i]);
257  }
258  tagOld = edm::InputTag();
259  for (trigger::size_type i1 = 0; i1 != n1; ++i1) {
260  const edm::ProductID pid(coll1[i1].id());
261  const std::string& label(iEvent.getProvenance(pid).moduleLabel());
262  const std::string& instance(iEvent.getProvenance(pid).productInstanceName());
263  const std::string& process(iEvent.getProvenance(pid).processName());
265  if (tagOld.encode() != tagNew.encode()) {
266  filterproduct.addCollectionTag(tagNew);
267  tagOld = tagNew;
268  }
269  }
270  for (unsigned int i = 0; i < originTag2_.size(); ++i) {
271  filterproduct.addCollectionTag(originTag2_[i]);
272  }
273  tagOld = edm::InputTag();
274  for (trigger::size_type i2 = 0; i2 != n2; ++i2) {
275  const edm::ProductID pid(coll2[i2].id());
276  const std::string& label(iEvent.getProvenance(pid).moduleLabel());
277  const std::string& instance(iEvent.getProvenance(pid).productInstanceName());
278  const std::string& process(iEvent.getProvenance(pid).processName());
280  if (tagOld.encode() != tagNew.encode()) {
281  filterproduct.addCollectionTag(tagNew);
282  tagOld = tagNew;
283  }
284  }
285  }
286 
287  return true;
288  } else
289  return false;
290 }

References trigger::TriggerFilterObjectWithRefs::addCollectionTag(), edm::InputTag::encode(), trigger::TriggerRefsCollections::getObjects(), mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, iEvent, HLT_FULL_cff::InputTag, instance, label, LaserDQM_cfg::process, BeamBkgSkim_cff::saveTags, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ hltFilter()

template<typename T1 , typename T2 >
bool HLTDoubletDZ< T1, T2 >::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 409 of file HLTDoubletDZ.cc.

411  {
412  // All HLT filters must create and fill an HLT filter object,
413  // recording any reconstructed physics objects satisfying (or not)
414  // this HLT filter, and place it in the Event.
415  bool accept(false);
416 
417  std::vector<T1Ref> coll1;
418  std::vector<T2Ref> coll2;
419 
420  if (getCollections(iEvent, coll1, coll2, filterproduct)) {
421  int n(0);
422  T1Ref r1;
423  T2Ref r2;
424 
425  for (unsigned int i1 = 0; i1 != coll1.size(); i1++) {
426  r1 = coll1[i1];
427  //const reco::Candidate& candidate1(*r1);
428  unsigned int I(0);
429  if (same_) {
430  I = i1 + 1;
431  }
432  for (unsigned int i2 = I; i2 != coll2.size(); i2++) {
433  r2 = coll2[i2];
434  if (checkSC_) {
435  if (r1->superCluster().isNonnull() && r2->superCluster().isNonnull()) {
436  if (r1->superCluster() == r2->superCluster())
437  continue;
438  }
439  }
440 
441  if (!computeDZ(iEvent, r1, r2))
442  continue;
443 
444  n++;
445  filterproduct.addObject(triggerType1_, r1);
446  filterproduct.addObject(triggerType2_, r2);
447  }
448  }
449 
450  accept = accept || (n >= min_N_);
451  }
452 
453  return accept;
454 }

References accept(), trigger::TriggerRefsCollections::addObject(), Exhume::I, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, iEvent, dqmiodumpmetadata::n, diffTwoXMLs::r1, and diffTwoXMLs::r2.

Member Data Documentation

◆ checkSC_

template<typename T1 , typename T2 >
const bool HLTDoubletDZ< T1, T2 >::checkSC_
private

Definition at line 61 of file HLTDoubletDZ.h.

◆ electronToken_

template<typename T1 , typename T2 >
edm::EDGetTokenT<reco::ElectronCollection> HLTDoubletDZ< T1, T2 >::electronToken_
private

Definition at line 54 of file HLTDoubletDZ.h.

◆ inputTag1_

template<typename T1 , typename T2 >
const edm::InputTag HLTDoubletDZ< T1, T2 >::inputTag1_
private

Definition at line 50 of file HLTDoubletDZ.h.

◆ inputTag2_

template<typename T1 , typename T2 >
const edm::InputTag HLTDoubletDZ< T1, T2 >::inputTag2_
private

Definition at line 51 of file HLTDoubletDZ.h.

◆ inputToken1_

template<typename T1 , typename T2 >
const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTDoubletDZ< T1, T2 >::inputToken1_
private

Definition at line 52 of file HLTDoubletDZ.h.

◆ inputToken2_

template<typename T1 , typename T2 >
const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTDoubletDZ< T1, T2 >::inputToken2_
private

Definition at line 53 of file HLTDoubletDZ.h.

◆ maxDZ_

template<typename T1 , typename T2 >
const double HLTDoubletDZ< T1, T2 >::maxDZ_
private

Definition at line 58 of file HLTDoubletDZ.h.

◆ min_N_

template<typename T1 , typename T2 >
const int HLTDoubletDZ< T1, T2 >::min_N_
private

Definition at line 60 of file HLTDoubletDZ.h.

◆ minDR_

template<typename T1 , typename T2 >
const double HLTDoubletDZ< T1, T2 >::minDR_
private

Definition at line 57 of file HLTDoubletDZ.h.

◆ minPixHitsForDZ_

template<typename T1 , typename T2 >
const int HLTDoubletDZ< T1, T2 >::minPixHitsForDZ_
private

Definition at line 59 of file HLTDoubletDZ.h.

◆ originTag1_

template<typename T1 , typename T2 >
const std::vector<edm::InputTag> HLTDoubletDZ< T1, T2 >::originTag1_
private

Definition at line 48 of file HLTDoubletDZ.h.

◆ originTag2_

template<typename T1 , typename T2 >
const std::vector<edm::InputTag> HLTDoubletDZ< T1, T2 >::originTag2_
private

Definition at line 49 of file HLTDoubletDZ.h.

◆ same_

template<typename T1 , typename T2 >
const bool HLTDoubletDZ< T1, T2 >::same_
private

Definition at line 62 of file HLTDoubletDZ.h.

◆ triggerType1_

template<typename T1 , typename T2 >
const int HLTDoubletDZ< T1, T2 >::triggerType1_
private

Definition at line 55 of file HLTDoubletDZ.h.

◆ triggerType2_

template<typename T1 , typename T2 >
const int HLTDoubletDZ< T1, T2 >::triggerType2_
private

Definition at line 56 of file HLTDoubletDZ.h.

trigger::TriggerRefsCollections::addObject
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
Definition: TriggerRefsCollections.h:235
HLTDoubletDZ::same_
const bool same_
Definition: HLTDoubletDZ.h:62
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
mps_fire.i
i
Definition: mps_fire.py:428
reco::Electron::gsfTrack
reco::GsfTrackRef gsfTrack() const override
reference to a GsfTrack
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
trigger::TriggerFilterObjectWithRefs::addCollectionTag
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
Definition: TriggerFilterObjectWithRefs.h:55
reco::LeafCandidate::vz
double vz() const override
z coordinate of vertex position
Definition: LeafCandidate.h:171
HLTDoubletDZ::getCollections
bool getCollections(edm::Event &iEvent, std::vector< T1Ref > &coll1, std::vector< T2Ref > &coll2, trigger::TriggerFilterObjectWithRefs &filterproduct) const
Definition: HLTDoubletDZ.cc:241
HLTDoubletDZ::triggerType1_
const int triggerType1_
Definition: HLTDoubletDZ.h:55
HLTDoubletDZ::inputToken1_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken1_
Definition: HLTDoubletDZ.h:52
HLTDoubletDZ
Definition: HLTDoubletDZ.h:27
reco::Electron
Definition: Electron.h:16
edm::Handle
Definition: AssociativeIterator.h:50
HLTFilter::HLTFilter
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
HLTDoubletDZ::originTag1_
const std::vector< edm::InputTag > originTag1_
Definition: HLTDoubletDZ.h:48
trigger::TriggerRefsCollections::getObjects
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Definition: TriggerRefsCollections.h:452
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
HLTDoubletDZ::inputTag2_
const edm::InputTag inputTag2_
Definition: HLTDoubletDZ.h:51
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
Exhume::I
const std::complex< double > I
Definition: I.h:8
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLTDoubletDZ::minDR_
const double minDR_
Definition: HLTDoubletDZ.h:57
HLTDoubletDZ::maxDZ_
const double maxDZ_
Definition: HLTDoubletDZ.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLTFilter::saveTags
bool saveTags() const
Definition: HLTFilter.h:46
defaultModuleLabel
std::string defaultModuleLabel()
Definition: defaultModuleLabel.h:16
HLTDoubletDZ::T2Ref
edm::Ref< T2Collection > T2Ref
Definition: HLTDoubletDZ.h:31
HLTDoubletDZ::inputTag1_
const edm::InputTag inputTag1_
Definition: HLTDoubletDZ.h:50
LaserDQM_cfg.process
process
Definition: LaserDQM_cfg.py:3
StorageManager_cfg.e1
e1
Definition: StorageManager_cfg.py:16
diffTwoXMLs.r2
r2
Definition: diffTwoXMLs.py:73
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
reco::RecoChargedCandidate
Definition: RecoChargedCandidate.h:15
instance
static PFTauRenderPlugin instance
Definition: PFTauRenderPlugin.cc:70
reco::Candidate
Definition: Candidate.h:27
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
HLTDoubletDZ::min_N_
const int min_N_
Definition: HLTDoubletDZ.h:60
diffTwoXMLs.r1
r1
Definition: diffTwoXMLs.py:53
HLT_FULL_cff.originTag2
originTag2
Definition: HLT_FULL_cff.py:19403
HLTDoubletDZ::minPixHitsForDZ_
const int minPixHitsForDZ_
Definition: HLTDoubletDZ.h:59
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
HLTDoubletDZ::electronToken_
edm::EDGetTokenT< reco::ElectronCollection > electronToken_
Definition: HLTDoubletDZ.h:54
HLTFilter::makeHLTFilterDescription
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:25
HLTDoubletDZ::checkSC_
const bool checkSC_
Definition: HLTDoubletDZ.h:61
HLTDoubletDZ::triggerType2_
const int triggerType2_
Definition: HLTDoubletDZ.h:56
HLT_FULL_cff.originTag1
originTag1
Definition: HLT_FULL_cff.py:19406
HLTDoubletDZ::computeDZ
bool computeDZ(edm::Event &iEvent, T1Ref &c1, T2Ref &c2) const
Definition: HLTDoubletDZ.cc:293
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
HLTDoubletDZ::originTag2_
const std::vector< edm::InputTag > originTag2_
Definition: HLTDoubletDZ.h:49
edm::Log
Definition: MessageLogger.h:70
HLTDoubletDZ::T1Ref
edm::Ref< T1Collection > T1Ref
Definition: HLTDoubletDZ.h:29
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
HLTDoubletDZ::inputToken2_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken2_
Definition: HLTDoubletDZ.h:53
edm::ProductID
Definition: ProductID.h:27