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
 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
 
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 28 of file HLTDoubletDZ.cc.

28  :
29  HLTFilter(iConfig),
30  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag1")),
31  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag2")),
32  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
33  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
34  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
35  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
36  //electronToken_ (consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
37  triggerType1_(iConfig.template getParameter<int>("triggerType1")),
38  triggerType2_(iConfig.template getParameter<int>("triggerType2")),
39  minDR_ (iConfig.template getParameter<double>("MinDR")),
40  maxDZ_ (iConfig.template getParameter<double>("MaxDZ")),
41  min_N_ (iConfig.template getParameter<int>("MinN")),
42  checkSC_ (iConfig.template getParameter<bool>("checkSC")),
43  same_ (inputTag1_.encode()==inputTag2_.encode()) // same collections to be compared?
44 {}
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 104 of file HLTDoubletDZ.cc.

105 {}

Definition at line 47 of file HLTDoubletDZ.cc.

47  :
48  HLTFilter(iConfig),
49  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag1")),
50  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag2")),
51  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
52  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
53  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
54  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
55  electronToken_ (consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
56  triggerType1_(iConfig.template getParameter<int>("triggerType1")),
57  triggerType2_(iConfig.template getParameter<int>("triggerType2")),
58  minDR_ (iConfig.template getParameter<double>("MinDR")),
59  maxDZ_ (iConfig.template getParameter<double>("MaxDZ")),
60  min_N_ (iConfig.template getParameter<int>("MinN")),
61  checkSC_ (iConfig.template getParameter<bool>("checkSC")),
62  same_ (inputTag1_.encode()==inputTag2_.encode()) // same collections to be compared?
63 {}
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 66 of file HLTDoubletDZ.cc.

66  :
67  HLTFilter(iConfig),
68  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag1")),
69  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag2")),
70  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
71  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
72  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
73  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
74  electronToken_ (consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
75  triggerType1_(iConfig.template getParameter<int>("triggerType1")),
76  triggerType2_(iConfig.template getParameter<int>("triggerType2")),
77  minDR_ (iConfig.template getParameter<double>("MinDR")),
78  maxDZ_ (iConfig.template getParameter<double>("MaxDZ")),
79  min_N_ (iConfig.template getParameter<int>("MinN")),
80  checkSC_ (iConfig.template getParameter<bool>("checkSC")),
81  same_ (inputTag1_.encode()==inputTag2_.encode()) // same collections to be compared?
82 {}
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 85 of file HLTDoubletDZ.cc.

85  :
86  HLTFilter(iConfig),
87  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag1")),
88  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag2")),
89  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
90  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
91  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
92  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
93  electronToken_ (consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
94  triggerType1_(iConfig.template getParameter<int>("triggerType1")),
95  triggerType2_(iConfig.template getParameter<int>("triggerType2")),
96  minDR_ (iConfig.template getParameter<double>("MinDR")),
97  maxDZ_ (iConfig.template getParameter<double>("MaxDZ")),
98  min_N_ (iConfig.template getParameter<int>("MinN")),
99  checkSC_ (iConfig.template getParameter<bool>("checkSC")),
100  same_ (inputTag1_.encode()==inputTag2_.encode()) // same collections to be compared?
101 {}
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 245 of file HLTDoubletDZ.cc.

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

246 {
247 
248  const reco::Candidate& candidate1(*r1);
249  const reco::Candidate& candidate2(*r2);
250  if ( reco::deltaR(candidate1, candidate2) < minDR_ )
251  return false;
252  if ( std::abs(candidate1.vz()-candidate2.vz()) > maxDZ_ )
253  return false;
254 
255  return true;
256 }
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 260 of file HLTDoubletDZ.cc.

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

261 {
263  iEvent.getByToken(electronToken_, electronHandle_);
264  if (!electronHandle_.isValid())
265  edm::LogError("HLTDoubletDZ") << "HLTDoubletDZ: Electron Handle not valid.";
266 
267  if ( reco::deltaR(*r1, *r2) < minDR_ )
268  return false;
269  reco::Electron e1;
270  for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
271  if (eleIt->superCluster() == r1->superCluster())
272  e1 = *(eleIt);
273  }
274 
275  const reco::Candidate& candidate2(*r2);
276  if ( std::abs(e1.vz()-candidate2.vz()) > maxDZ_ )
277  return false;
278 
279  return true;
280 }
edm::EDGetTokenT< reco::ElectronCollection > electronToken_
Definition: HLTDoubletDZ.h:51
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
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:76
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 284 of file HLTDoubletDZ.cc.

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

285 {
287  iEvent.getByToken(electronToken_, electronHandle_);
288  if (!electronHandle_.isValid())
289  edm::LogError("HLTDoubletDZ") << "HLTDoubletDZ: Electron Handle not valid.";
290 
291  if ( reco::deltaR(*r1, *r2) < minDR_ )
292  return false;
293  reco::Electron e2;
294  for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
295  if (eleIt->superCluster() == r2->superCluster())
296  e2 = *(eleIt);
297  }
298 
299  const reco::Candidate& candidate1(*r1);
300  if ( std::abs(e2.vz()-candidate1.vz()) > maxDZ_ )
301  return false;
302 
303  return true;
304 }
edm::EDGetTokenT< reco::ElectronCollection > electronToken_
Definition: HLTDoubletDZ.h:51
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
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:76
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 308 of file HLTDoubletDZ.cc.

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

309 {
311  iEvent.getByToken(electronToken_, electronHandle_);
312  if (!electronHandle_.isValid())
313  edm::LogError("HLTDoubletDZ") << "HLTDoubletDZ: Electron Handle not valid.";
314 
315  if ( reco::deltaR(*r1, *r2) < minDR_ )
316  return false;
317  reco::Electron e1, e2;
318  for(reco::ElectronCollection::const_iterator eleIt = electronHandle_->begin(); eleIt != electronHandle_->end(); eleIt++) {
319  if (eleIt->superCluster() == r2->superCluster())
320  e2 = *(eleIt);
321  if (eleIt->superCluster() == r1->superCluster())
322  e1 = *(eleIt);
323  }
324 
325  if ( std::abs(e2.vz()-e1.vz()) > maxDZ_ )
326  return false;
327 
328  return true;
329 }
edm::EDGetTokenT< reco::ElectronCollection > electronToken_
Definition: HLTDoubletDZ.h:51
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
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:76
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 109 of file HLTDoubletDZ.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

109  {
112  std::vector<edm::InputTag> originTag1(1,edm::InputTag("hltOriginal1"));
113  std::vector<edm::InputTag> originTag2(1,edm::InputTag("hltOriginal2"));
114  desc.add<std::vector<edm::InputTag> >("originTag1",originTag1);
115  desc.add<std::vector<edm::InputTag> >("originTag2",originTag2);
116  desc.add<edm::InputTag>("inputTag1",edm::InputTag("hltFiltered1"));
117  desc.add<edm::InputTag>("inputTag2",edm::InputTag("hltFiltered2"));
118  desc.add<int>("triggerType1",0);
119  desc.add<int>("triggerType2",0);
120  desc.add<double>("MinDR",-1.0);
121  desc.add<double>("MaxDZ",0.2);
122  desc.add<bool>("checkSC",false);
123  desc.add<int>("MinN",1);
124  descriptions.add(std::string("hlt")+std::string(typeid(HLTDoubletDZ<T1,T2>).name()),desc);
125 }
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 129 of file HLTDoubletDZ.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

129  {
132  std::vector<edm::InputTag> originTag1(1,edm::InputTag("hltOriginal1"));
133  std::vector<edm::InputTag> originTag2(1,edm::InputTag("hltOriginal2"));
134  desc.add<std::vector<edm::InputTag> >("originTag1",originTag1);
135  desc.add<std::vector<edm::InputTag> >("originTag2",originTag2);
136  desc.add<edm::InputTag>("inputTag1",edm::InputTag("hltFiltered1"));
137  desc.add<edm::InputTag>("inputTag2",edm::InputTag("hltFiltered2"));
138  desc.add<edm::InputTag>("electronTag",edm::InputTag("electronTag"));
139  desc.add<int>("triggerType1",0);
140  desc.add<int>("triggerType2",0);
141  desc.add<double>("MinDR",-1.0);
142  desc.add<double>("MaxDZ",0.2);
143  desc.add<bool>("checkSC",false);
144  desc.add<int>("MinN",1);
146 }
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 150 of file HLTDoubletDZ.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

150  {
153  std::vector<edm::InputTag> originTag1(1,edm::InputTag("hltOriginal1"));
154  std::vector<edm::InputTag> originTag2(1,edm::InputTag("hltOriginal2"));
155  desc.add<std::vector<edm::InputTag> >("originTag1",originTag1);
156  desc.add<std::vector<edm::InputTag> >("originTag2",originTag2);
157  desc.add<edm::InputTag>("inputTag1",edm::InputTag("hltFiltered1"));
158  desc.add<edm::InputTag>("inputTag2",edm::InputTag("hltFiltered2"));
159  desc.add<edm::InputTag>("electronTag",edm::InputTag("electronTag"));
160  desc.add<int>("triggerType1",0);
161  desc.add<int>("triggerType2",0);
162  desc.add<double>("MinDR",-1.0);
163  desc.add<double>("MaxDZ",0.2);
164  desc.add<bool>("checkSC",false);
165  desc.add<int>("MinN",1);
167 }
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 171 of file HLTDoubletDZ.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

171  {
174  std::vector<edm::InputTag> originTag1(1,edm::InputTag("hltOriginal1"));
175  std::vector<edm::InputTag> originTag2(1,edm::InputTag("hltOriginal2"));
176  desc.add<std::vector<edm::InputTag> >("originTag1",originTag1);
177  desc.add<std::vector<edm::InputTag> >("originTag2",originTag2);
178  desc.add<edm::InputTag>("inputTag1",edm::InputTag("hltFiltered1"));
179  desc.add<edm::InputTag>("inputTag2",edm::InputTag("hltFiltered2"));
180  desc.add<edm::InputTag>("electronTag",edm::InputTag("electronTag"));
181  desc.add<int>("triggerType1",0);
182  desc.add<int>("triggerType2",0);
183  desc.add<double>("MinDR",-1.0);
184  desc.add<double>("MaxDZ",0.2);
185  desc.add<bool>("checkSC",false);
186  desc.add<int>("MinN",1);
188 }
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 193 of file HLTDoubletDZ.cc.

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

193  {
194 
196  if (iEvent.getByToken(inputToken1_, handle1) and iEvent.getByToken(inputToken2_, handle2)) {
197 
198  // get hold of pre-filtered object collections
199  handle1->getObjects(triggerType1_, coll1);
200  handle2->getObjects(triggerType2_, coll2);
201  const trigger::size_type n1(coll1.size());
202  const trigger::size_type n2(coll2.size());
203 
204  if (saveTags()) {
205  edm::InputTag tagOld;
206  for (unsigned int i=0; i<originTag1_.size(); ++i) {
207  filterproduct.addCollectionTag(originTag1_[i]);
208  }
209  tagOld=edm::InputTag();
210  for (trigger::size_type i1=0; i1!=n1; ++i1) {
211  const edm::ProductID pid(coll1[i1].id());
212  const std::string& label(iEvent.getProvenance(pid).moduleLabel());
214  const std::string& process(iEvent.getProvenance(pid).processName());
216  if (tagOld.encode()!=tagNew.encode()) {
217  filterproduct.addCollectionTag(tagNew);
218  tagOld=tagNew;
219  }
220  }
221  for (unsigned int i=0; i<originTag2_.size(); ++i) {
222  filterproduct.addCollectionTag(originTag2_[i]);
223  }
224  tagOld=edm::InputTag();
225  for (trigger::size_type i2=0; i2!=n2; ++i2) {
226  const edm::ProductID pid(coll2[i2].id());
227  const std::string& label(iEvent.getProvenance(pid).moduleLabel());
229  const std::string& process(iEvent.getProvenance(pid).processName());
231  if (tagOld.encode()!=tagNew.encode()) {
232  filterproduct.addCollectionTag(tagNew);
233  tagOld=tagNew;
234  }
235  }
236  }
237 
238  return true;
239  } else
240  return false;
241 }
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:446
std::string const & processName() const
Definition: Provenance.h:62
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:61
bool saveTags() const
Definition: HLTFilter.h:45
std::string const & productInstanceName() const
Definition: Provenance.h:63
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 334 of file HLTDoubletDZ.cc.

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

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