CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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<>
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)
 
virtual bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 
 ~HLTDoubletDZ ()
 
- 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
 
virtual ~HLTFilter ()
 
- Public Member Functions inherited from edm::global::EDFilter<>
 EDFilter ()=default
 
- Public Member Functions inherited from edm::global::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilterBase ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::ElectronCollection
electronToken_
 
const edm::InputTag inputTag1_
 
const edm::InputTag inputTag2_
 
const edm::EDGetTokenT
< trigger::TriggerFilterObjectWithRefs
inputToken1_
 
const edm::EDGetTokenT
< trigger::TriggerFilterObjectWithRefs
inputToken2_
 
const double maxDZ_
 
const int min_N_
 
const double minDR_
 
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
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, 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

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

Definition at line 29 of file HLTDoubletDZ.h.

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

Definition at line 30 of file HLTDoubletDZ.h.

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

Definition at line 31 of file HLTDoubletDZ.h.

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

Definition at line 32 of file HLTDoubletDZ.h.

Constructor & Destructor Documentation

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

Definition at line 29 of file HLTDoubletDZ.cc.

29  :
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  min_N_ (iConfig.template getParameter<int>("MinN")),
43  checkSC_ (iConfig.template getParameter<bool>("checkSC")),
44  same_ (inputTag1_.encode()==inputTag2_.encode()) // same collections to be compared?
45 {}
const int triggerType1_
Definition: HLTDoubletDZ.h:52
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken1_
Definition: HLTDoubletDZ.h:49
const int triggerType2_
Definition: HLTDoubletDZ.h:53
const std::vector< edm::InputTag > originTag1_
Definition: HLTDoubletDZ.h:45
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken2_
Definition: HLTDoubletDZ.h:50
const std::vector< edm::InputTag > originTag2_
Definition: HLTDoubletDZ.h:46
const bool same_
Definition: HLTDoubletDZ.h:58
std::string encode() const
Definition: InputTag.cc:164
const edm::InputTag inputTag1_
Definition: HLTDoubletDZ.h:47
const edm::InputTag inputTag2_
Definition: HLTDoubletDZ.h:48
const int min_N_
Definition: HLTDoubletDZ.h:56
const double maxDZ_
Definition: HLTDoubletDZ.h:55
const double minDR_
Definition: HLTDoubletDZ.h:54
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
const bool checkSC_
Definition: HLTDoubletDZ.h:57
template<typename T1 , typename T2 >
HLTDoubletDZ< T1, T2 >::~HLTDoubletDZ ( )

Definition at line 105 of file HLTDoubletDZ.cc.

106 {}

Definition at line 48 of file HLTDoubletDZ.cc.

48  :
49  HLTFilter(iConfig),
50  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag1")),
51  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag2")),
52  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
53  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
54  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
55  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
56  electronToken_ (consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
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")),
63  same_ (inputTag1_.encode()==inputTag2_.encode()) // same collections to be compared?
64 {}
const int triggerType1_
Definition: HLTDoubletDZ.h:52
edm::EDGetTokenT< reco::ElectronCollection > electronToken_
Definition: HLTDoubletDZ.h:51
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken1_
Definition: HLTDoubletDZ.h:49
const int triggerType2_
Definition: HLTDoubletDZ.h:53
const std::vector< edm::InputTag > originTag1_
Definition: HLTDoubletDZ.h:45
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken2_
Definition: HLTDoubletDZ.h:50
const std::vector< edm::InputTag > originTag2_
Definition: HLTDoubletDZ.h:46
const bool same_
Definition: HLTDoubletDZ.h:58
std::string encode() const
Definition: InputTag.cc:164
const edm::InputTag inputTag1_
Definition: HLTDoubletDZ.h:47
const edm::InputTag inputTag2_
Definition: HLTDoubletDZ.h:48
const int min_N_
Definition: HLTDoubletDZ.h:56
const double maxDZ_
Definition: HLTDoubletDZ.h:55
const double minDR_
Definition: HLTDoubletDZ.h:54
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
const bool checkSC_
Definition: HLTDoubletDZ.h:57

Definition at line 67 of file HLTDoubletDZ.cc.

67  :
68  HLTFilter(iConfig),
69  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag1")),
70  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag2")),
71  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
72  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
73  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
74  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
75  electronToken_ (consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
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")),
82  same_ (inputTag1_.encode()==inputTag2_.encode()) // same collections to be compared?
83 {}
const int triggerType1_
Definition: HLTDoubletDZ.h:52
edm::EDGetTokenT< reco::ElectronCollection > electronToken_
Definition: HLTDoubletDZ.h:51
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken1_
Definition: HLTDoubletDZ.h:49
const int triggerType2_
Definition: HLTDoubletDZ.h:53
const std::vector< edm::InputTag > originTag1_
Definition: HLTDoubletDZ.h:45
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken2_
Definition: HLTDoubletDZ.h:50
const std::vector< edm::InputTag > originTag2_
Definition: HLTDoubletDZ.h:46
const bool same_
Definition: HLTDoubletDZ.h:58
std::string encode() const
Definition: InputTag.cc:164
const edm::InputTag inputTag1_
Definition: HLTDoubletDZ.h:47
const edm::InputTag inputTag2_
Definition: HLTDoubletDZ.h:48
const int min_N_
Definition: HLTDoubletDZ.h:56
const double maxDZ_
Definition: HLTDoubletDZ.h:55
const double minDR_
Definition: HLTDoubletDZ.h:54
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
const bool checkSC_
Definition: HLTDoubletDZ.h:57

Definition at line 86 of file HLTDoubletDZ.cc.

86  :
87  HLTFilter(iConfig),
88  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag1")),
89  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag2")),
90  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
91  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
92  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
93  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
94  electronToken_ (consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
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")),
101  same_ (inputTag1_.encode()==inputTag2_.encode()) // same collections to be compared?
102 {}
const int triggerType1_
Definition: HLTDoubletDZ.h:52
edm::EDGetTokenT< reco::ElectronCollection > electronToken_
Definition: HLTDoubletDZ.h:51
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken1_
Definition: HLTDoubletDZ.h:49
const int triggerType2_
Definition: HLTDoubletDZ.h:53
const std::vector< edm::InputTag > originTag1_
Definition: HLTDoubletDZ.h:45
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken2_
Definition: HLTDoubletDZ.h:50
const std::vector< edm::InputTag > originTag2_
Definition: HLTDoubletDZ.h:46
const bool same_
Definition: HLTDoubletDZ.h:58
std::string encode() const
Definition: InputTag.cc:164
const edm::InputTag inputTag1_
Definition: HLTDoubletDZ.h:47
const edm::InputTag inputTag2_
Definition: HLTDoubletDZ.h:48
const int min_N_
Definition: HLTDoubletDZ.h:56
const double maxDZ_
Definition: HLTDoubletDZ.h:55
const double minDR_
Definition: HLTDoubletDZ.h:54
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
const bool checkSC_
Definition: HLTDoubletDZ.h:57

Member Function Documentation

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

Definition at line 246 of file HLTDoubletDZ.cc.

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

247 {
248 
249  const reco::Candidate& candidate1(*r1);
250  const reco::Candidate& candidate2(*r2);
251  if ( reco::deltaR(candidate1, candidate2) < minDR_ )
252  return false;
253  if ( std::abs(candidate1.vz()-candidate2.vz()) > maxDZ_ )
254  return false;
255 
256  return true;
257 }
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const double maxDZ_
Definition: HLTDoubletDZ.h:55
const double minDR_
Definition: HLTDoubletDZ.h:54
template<>
bool HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoChargedCandidate >::computeDZ ( edm::Event iEvent,
T1Ref r1,
T2Ref r2 
) const

Definition at line 261 of file HLTDoubletDZ.cc.

References funct::abs(), reco::deltaR(), edm::Event::getByToken(), edm::HandleBase::isValid(), reco::Candidate::vz(), and reco::LeafCandidate::vz().

262 {
264  iEvent.getByToken(electronToken_, electronHandle_);
265  if (!electronHandle_.isValid())
266  edm::LogError("HLTDoubletDZ") << "HLTDoubletDZ: Electron Handle not valid.";
267 
268  if ( reco::deltaR(*r1, *r2) < minDR_ )
269  return false;
270  reco::Electron e1;
271  for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
272  if (eleIt->superCluster() == r1->superCluster())
273  e1 = *(eleIt);
274  }
275 
276  const reco::Candidate& candidate2(*r2);
277  if ( std::abs(e1.vz()-candidate2.vz()) > maxDZ_ )
278  return false;
279 
280  return true;
281 }
edm::EDGetTokenT< reco::ElectronCollection > electronToken_
Definition: HLTDoubletDZ.h:51
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:75
virtual double vz() const
z coordinate of vertex position
const double maxDZ_
Definition: HLTDoubletDZ.h:55
const double minDR_
Definition: HLTDoubletDZ.h:54
template<>
bool HLTDoubletDZ< reco::RecoChargedCandidate, reco::RecoEcalCandidate >::computeDZ ( edm::Event iEvent,
T1Ref r1,
T2Ref r2 
) const

Definition at line 285 of file HLTDoubletDZ.cc.

References funct::abs(), reco::deltaR(), edm::Event::getByToken(), edm::HandleBase::isValid(), reco::Candidate::vz(), and reco::LeafCandidate::vz().

286 {
288  iEvent.getByToken(electronToken_, electronHandle_);
289  if (!electronHandle_.isValid())
290  edm::LogError("HLTDoubletDZ") << "HLTDoubletDZ: Electron Handle not valid.";
291 
292  if ( reco::deltaR(*r1, *r2) < minDR_ )
293  return false;
294  reco::Electron e2;
295  for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
296  if (eleIt->superCluster() == r2->superCluster())
297  e2 = *(eleIt);
298  }
299 
300  const reco::Candidate& candidate1(*r1);
301  if ( std::abs(e2.vz()-candidate1.vz()) > maxDZ_ )
302  return false;
303 
304  return true;
305 }
edm::EDGetTokenT< reco::ElectronCollection > electronToken_
Definition: HLTDoubletDZ.h:51
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:75
virtual double vz() const
z coordinate of vertex position
const double maxDZ_
Definition: HLTDoubletDZ.h:55
const double minDR_
Definition: HLTDoubletDZ.h:54
template<>
bool HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoEcalCandidate >::computeDZ ( edm::Event iEvent,
T1Ref r1,
T2Ref r2 
) const

Definition at line 309 of file HLTDoubletDZ.cc.

References funct::abs(), reco::deltaR(), edm::Event::getByToken(), edm::HandleBase::isValid(), and reco::LeafCandidate::vz().

310 {
312  iEvent.getByToken(electronToken_, electronHandle_);
313  if (!electronHandle_.isValid())
314  edm::LogError("HLTDoubletDZ") << "HLTDoubletDZ: Electron Handle not valid.";
315 
316  if ( reco::deltaR(*r1, *r2) < minDR_ )
317  return false;
318  reco::Electron e1, e2;
319  for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
320  if (eleIt->superCluster() == r2->superCluster())
321  e2 = *(eleIt);
322  if (eleIt->superCluster() == r1->superCluster())
323  e1 = *(eleIt);
324  }
325 
326  if ( std::abs(e2.vz()-e1.vz()) > maxDZ_ )
327  return false;
328 
329  return true;
330 }
edm::EDGetTokenT< reco::ElectronCollection > electronToken_
Definition: HLTDoubletDZ.h:51
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:75
virtual double vz() const
z coordinate of vertex position
const double maxDZ_
Definition: HLTDoubletDZ.h:55
const double minDR_
Definition: HLTDoubletDZ.h:54
template<typename T1 , typename T2 >
void HLTDoubletDZ< T1, T2 >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 110 of file HLTDoubletDZ.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), defaultModuleLabel(), HLT_25ns14e33_v1_cff::InputTag, HLT_25ns14e33_v1_cff::originTag1, and HLT_25ns14e33_v1_cff::originTag2.

110  {
113  std::vector<edm::InputTag> originTag1(1,edm::InputTag("hltOriginal1"));
114  std::vector<edm::InputTag> originTag2(1,edm::InputTag("hltOriginal2"));
115  desc.add<std::vector<edm::InputTag> >("originTag1",originTag1);
116  desc.add<std::vector<edm::InputTag> >("originTag2",originTag2);
117  desc.add<edm::InputTag>("inputTag1",edm::InputTag("hltFiltered1"));
118  desc.add<edm::InputTag>("inputTag2",edm::InputTag("hltFiltered2"));
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);
125  descriptions.add(defaultModuleLabel<HLTDoubletDZ<T1,T2>>(), desc);
126 }
std::string defaultModuleLabel()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:29
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<>
void HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoEcalCandidate >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)

Definition at line 130 of file HLTDoubletDZ.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), defaultModuleLabel(), HLT_25ns14e33_v1_cff::InputTag, HLT_25ns14e33_v1_cff::originTag1, and HLT_25ns14e33_v1_cff::originTag2.

130  {
133  std::vector<edm::InputTag> originTag1(1,edm::InputTag("hltOriginal1"));
134  std::vector<edm::InputTag> originTag2(1,edm::InputTag("hltOriginal2"));
135  desc.add<std::vector<edm::InputTag> >("originTag1",originTag1);
136  desc.add<std::vector<edm::InputTag> >("originTag2",originTag2);
137  desc.add<edm::InputTag>("inputTag1",edm::InputTag("hltFiltered1"));
138  desc.add<edm::InputTag>("inputTag2",edm::InputTag("hltFiltered2"));
139  desc.add<edm::InputTag>("electronTag",edm::InputTag("electronTag"));
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);
147 }
std::string defaultModuleLabel()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:29
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<>
void HLTDoubletDZ< reco::RecoChargedCandidate, reco::RecoEcalCandidate >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)

Definition at line 151 of file HLTDoubletDZ.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), defaultModuleLabel(), HLT_25ns14e33_v1_cff::InputTag, HLT_25ns14e33_v1_cff::originTag1, and HLT_25ns14e33_v1_cff::originTag2.

151  {
154  std::vector<edm::InputTag> originTag1(1,edm::InputTag("hltOriginal1"));
155  std::vector<edm::InputTag> originTag2(1,edm::InputTag("hltOriginal2"));
156  desc.add<std::vector<edm::InputTag> >("originTag1",originTag1);
157  desc.add<std::vector<edm::InputTag> >("originTag2",originTag2);
158  desc.add<edm::InputTag>("inputTag1",edm::InputTag("hltFiltered1"));
159  desc.add<edm::InputTag>("inputTag2",edm::InputTag("hltFiltered2"));
160  desc.add<edm::InputTag>("electronTag",edm::InputTag("electronTag"));
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);
168 }
std::string defaultModuleLabel()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:29
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<>
void HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoChargedCandidate >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)

Definition at line 172 of file HLTDoubletDZ.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), defaultModuleLabel(), HLT_25ns14e33_v1_cff::InputTag, HLT_25ns14e33_v1_cff::originTag1, and HLT_25ns14e33_v1_cff::originTag2.

172  {
175  std::vector<edm::InputTag> originTag1(1,edm::InputTag("hltOriginal1"));
176  std::vector<edm::InputTag> originTag2(1,edm::InputTag("hltOriginal2"));
177  desc.add<std::vector<edm::InputTag> >("originTag1",originTag1);
178  desc.add<std::vector<edm::InputTag> >("originTag2",originTag2);
179  desc.add<edm::InputTag>("inputTag1",edm::InputTag("hltFiltered1"));
180  desc.add<edm::InputTag>("inputTag2",edm::InputTag("hltFiltered2"));
181  desc.add<edm::InputTag>("electronTag",edm::InputTag("electronTag"));
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);
189 }
std::string defaultModuleLabel()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:29
void add(std::string const &label, ParameterSetDescription const &psetDescription)
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 194 of file HLTDoubletDZ.cc.

References trigger::TriggerFilterObjectWithRefs::addCollectionTag(), edm::InputTag::encode(), edm::Event::getByToken(), edm::Event::getProvenance(), i, HLT_25ns14e33_v1_cff::InputTag, instance, diffTwoXMLs::label, edm::Provenance::moduleLabel(), sysUtil::pid, LaserDQM_cfg::process, edm::Provenance::processName(), edm::Provenance::productInstanceName(), CommPDSkim_cfg::saveTags, and AlCaHLTBitMon_QueryRunRegistry::string.

194  {
195 
197  if (iEvent.getByToken(inputToken1_, handle1) and iEvent.getByToken(inputToken2_, handle2)) {
198 
199  // get hold of pre-filtered object collections
200  handle1->getObjects(triggerType1_, coll1);
201  handle2->getObjects(triggerType2_, coll2);
202  const trigger::size_type n1(coll1.size());
203  const trigger::size_type n2(coll2.size());
204 
205  if (saveTags()) {
206  edm::InputTag tagOld;
207  for (unsigned int i=0; i<originTag1_.size(); ++i) {
208  filterproduct.addCollectionTag(originTag1_[i]);
209  }
210  tagOld=edm::InputTag();
211  for (trigger::size_type i1=0; i1!=n1; ++i1) {
212  const edm::ProductID pid(coll1[i1].id());
213  const std::string& label(iEvent.getProvenance(pid).moduleLabel());
215  const std::string& process(iEvent.getProvenance(pid).processName());
217  if (tagOld.encode()!=tagNew.encode()) {
218  filterproduct.addCollectionTag(tagNew);
219  tagOld=tagNew;
220  }
221  }
222  for (unsigned int i=0; i<originTag2_.size(); ++i) {
223  filterproduct.addCollectionTag(originTag2_[i]);
224  }
225  tagOld=edm::InputTag();
226  for (trigger::size_type i2=0; i2!=n2; ++i2) {
227  const edm::ProductID pid(coll2[i2].id());
228  const std::string& label(iEvent.getProvenance(pid).moduleLabel());
230  const std::string& process(iEvent.getProvenance(pid).processName());
232  if (tagOld.encode()!=tagNew.encode()) {
233  filterproduct.addCollectionTag(tagNew);
234  tagOld=tagNew;
235  }
236  }
237  }
238 
239  return true;
240  } else
241  return false;
242 }
int i
Definition: DBlmapReader.cc:9
const int triggerType1_
Definition: HLTDoubletDZ.h:52
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken1_
Definition: HLTDoubletDZ.h:49
const int triggerType2_
Definition: HLTDoubletDZ.h:53
const std::vector< edm::InputTag > originTag1_
Definition: HLTDoubletDZ.h:45
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken2_
Definition: HLTDoubletDZ.h:50
const std::vector< edm::InputTag > originTag2_
Definition: HLTDoubletDZ.h:46
static PFTauRenderPlugin instance
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
std::string const & processName() const
Definition: Provenance.h:61
uint16_t size_type
std::string encode() const
Definition: InputTag.cc:164
tuple pid
Definition: sysUtil.py:22
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
std::string const & moduleLabel() const
Definition: Provenance.h:60
bool saveTags() const
Definition: HLTFilter.h:45
std::string const & productInstanceName() const
Definition: Provenance.h:62
tuple process
Definition: LaserDQM_cfg.py:3
Provenance getProvenance(BranchID const &theID) const
Definition: Event.cc:73
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 335 of file HLTDoubletDZ.cc.

References accept(), trigger::TriggerRefsCollections::addObject(), Exhume::I, edm::Ref< C, T, F >::isNonnull(), gen::n, diffTwoXMLs::r1, and diffTwoXMLs::r2.

336 {
337 
338  // All HLT filters must create and fill an HLT filter object,
339  // recording any reconstructed physics objects satisfying (or not)
340  // this HLT filter, and place it in the Event.
341  bool accept(false);
342 
343  std::vector<T1Ref> coll1;
344  std::vector<T2Ref> coll2;
345 
346  if (getCollections(iEvent, coll1, coll2, filterproduct)) {
347  int n(0);
348  T1Ref r1;
349  T2Ref r2;
350 
351  for (unsigned int i1=0; i1!=coll1.size(); i1++) {
352  r1=coll1[i1];
353  //const reco::Candidate& candidate1(*r1);
354  unsigned int I(0);
355  if (same_) {I=i1+1;}
356  for (unsigned int i2=I; i2!=coll2.size(); i2++) {
357  r2=coll2[i2];
358  if (checkSC_) {
359  if (r1->superCluster().isNonnull() && r2->superCluster().isNonnull()) {
360  if (r1->superCluster() == r2->superCluster()) continue;
361  }
362  }
363 
364  if (!computeDZ(iEvent, r1, r2))
365  continue;
366 
367  n++;
368  filterproduct.addObject(triggerType1_,r1);
369  filterproduct.addObject(triggerType2_,r2);
370  }
371  }
372 
373  accept = accept || (n>=min_N_);
374  }
375 
376  return accept;
377 }
const int triggerType1_
Definition: HLTDoubletDZ.h:52
const int triggerType2_
Definition: HLTDoubletDZ.h:53
const bool same_
Definition: HLTDoubletDZ.h:58
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:25
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&lt;C&gt;)
bool computeDZ(edm::Event &iEvent, T1Ref &c1, T2Ref &c2) const
const std::complex< double > I
Definition: I.h:8
const int min_N_
Definition: HLTDoubletDZ.h:56
edm::Ref< T2Collection > T2Ref
Definition: HLTDoubletDZ.h:32
edm::Ref< T1Collection > T1Ref
Definition: HLTDoubletDZ.h:30
const bool checkSC_
Definition: HLTDoubletDZ.h:57

Member Data Documentation

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

Definition at line 57 of file HLTDoubletDZ.h.

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

Definition at line 51 of file HLTDoubletDZ.h.

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

Definition at line 47 of file HLTDoubletDZ.h.

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

Definition at line 48 of file HLTDoubletDZ.h.

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

Definition at line 49 of file HLTDoubletDZ.h.

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

Definition at line 50 of file HLTDoubletDZ.h.

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

Definition at line 55 of file HLTDoubletDZ.h.

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

Definition at line 56 of file HLTDoubletDZ.h.

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

Definition at line 54 of file HLTDoubletDZ.h.

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

Definition at line 45 of file HLTDoubletDZ.h.

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

Definition at line 46 of file HLTDoubletDZ.h.

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

Definition at line 58 of file HLTDoubletDZ.h.

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

Definition at line 52 of file HLTDoubletDZ.h.

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

Definition at line 53 of file HLTDoubletDZ.h.