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

 HLTDoubletDZ (const edm::ParameterSet &)
 
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_
 
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 23 of file HLTDoubletDZ.h.

Member Typedef Documentation

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

Definition at line 48 of file HLTDoubletDZ.h.

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

Definition at line 49 of file HLTDoubletDZ.h.

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

Definition at line 50 of file HLTDoubletDZ.h.

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

Definition at line 51 of file HLTDoubletDZ.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file HLTDoubletDZ.cc.

21  : HLTFilter(iConfig),
22  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag1")),
23  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag> >("originTag2")),
24  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
25  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
26  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
27  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
28  triggerType1_(iConfig.template getParameter<int>("triggerType1")),
29  triggerType2_(iConfig.template getParameter<int>("triggerType2")),
30  minDR_ (iConfig.template getParameter<double>("MinDR")),
31  maxDZ_ (iConfig.template getParameter<double>("MaxDZ")),
32  min_N_ (iConfig.template getParameter<int>("MinN")),
33  checkSC_ (iConfig.template getParameter<bool>("checkSC")),
34  same_ (inputTag1_.encode()==inputTag2_.encode()) // same collections to be compared?
35 {
36 }
const int triggerType1_
Definition: HLTDoubletDZ.h:40
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken1_
Definition: HLTDoubletDZ.h:38
const int triggerType2_
Definition: HLTDoubletDZ.h:41
const std::vector< edm::InputTag > originTag1_
Definition: HLTDoubletDZ.h:34
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken2_
Definition: HLTDoubletDZ.h:39
const std::vector< edm::InputTag > originTag2_
Definition: HLTDoubletDZ.h:35
const bool same_
Definition: HLTDoubletDZ.h:46
std::string encode() const
Definition: InputTag.cc:164
const edm::InputTag inputTag1_
Definition: HLTDoubletDZ.h:36
const edm::InputTag inputTag2_
Definition: HLTDoubletDZ.h:37
const int min_N_
Definition: HLTDoubletDZ.h:44
const double maxDZ_
Definition: HLTDoubletDZ.h:43
const double minDR_
Definition: HLTDoubletDZ.h:42
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
const bool checkSC_
Definition: HLTDoubletDZ.h:45
template<typename T1 , typename T2 >
HLTDoubletDZ< T1, T2 >::~HLTDoubletDZ ( )

Definition at line 39 of file HLTDoubletDZ.cc.

40 {
41 }

Member Function Documentation

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

Definition at line 45 of file HLTDoubletDZ.cc.

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

45  {
48  std::vector<edm::InputTag> originTag1(1,edm::InputTag("hltOriginal1"));
49  std::vector<edm::InputTag> originTag2(1,edm::InputTag("hltOriginal2"));
50  desc.add<std::vector<edm::InputTag> >("originTag1",originTag1);
51  desc.add<std::vector<edm::InputTag> >("originTag2",originTag2);
52  desc.add<edm::InputTag>("inputTag1",edm::InputTag("hltFiltered1"));
53  desc.add<edm::InputTag>("inputTag2",edm::InputTag("hltFiltered2"));
54  desc.add<int>("triggerType1",0);
55  desc.add<int>("triggerType2",0);
56  desc.add<double>("MinDR",-1.0);
57  desc.add<double>("MaxDZ",0.2);
58  desc.add<bool>("checkSC",false);
59  desc.add<int>("MinN",1);
60  descriptions.add(std::string("hlt")+std::string(typeid(HLTDoubletDZ<T1,T2>).name()),desc);
61 }
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 >::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 66 of file HLTDoubletDZ.cc.

References funct::abs(), accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), reco::deltaR(), edm::Event::getByToken(), edm::Event::getProvenance(), Exhume::I, i, instance, edm::Ref< C, T, F >::isNonnull(), diffTwoXMLs::label, edm::Provenance::moduleLabel(), n, AlCaHLTBitMon_ParallelJobs::p, p1, p2, sysUtil::pid, LaserDQM_cfg::process, edm::Provenance::processName(), edm::Provenance::productInstanceName(), diffTwoXMLs::r1, diffTwoXMLs::r2, dt_dqm_sourceclient_common_cff::reco, CommPDSkim_cfg::saveTags, and reco::Candidate::vz().

67 {
68  using namespace std;
69  using namespace edm;
70  using namespace reco;
71  using namespace trigger;
72 
73  // All HLT filters must create and fill an HLT filter object,
74  // recording any reconstructed physics objects satisfying (or not)
75  // this HLT filter, and place it in the Event.
76 
77  bool accept(false);
78 
79  LogVerbatim("HLTDoubletDZ") << " XXX " << moduleLabel() << " 0 " << std::endl;
80 
81  std::vector<T1Ref> coll1;
82  std::vector<T2Ref> coll2;
83 
84  // get hold of pre-filtered object collections
86  if (iEvent.getByToken(inputToken1_, handle1) and iEvent.getByToken(inputToken2_, handle2)) {
87  handle1->getObjects(triggerType1_, coll1);
88  handle2->getObjects(triggerType2_, coll2);
89  const size_type n1(coll1.size());
90  const size_type n2(coll2.size());
91 
92  if (saveTags()) {
93  InputTag tagOld;
94  for (unsigned int i=0; i<originTag1_.size(); ++i) {
95  filterproduct.addCollectionTag(originTag1_[i]);
96  LogVerbatim("HLTDoubletDZ") << " XXX " << moduleLabel() << " 1a/" << i << " " << originTag1_[i].encode() << std::endl;
97  }
98  tagOld=InputTag();
99  for (size_type i1=0; i1!=n1; ++i1) {
100  const ProductID pid(coll1[i1].id());
101  const string& label(iEvent.getProvenance(pid).moduleLabel());
102  const string& instance(iEvent.getProvenance(pid).productInstanceName());
103  const string& process(iEvent.getProvenance(pid).processName());
105  if (tagOld.encode()!=tagNew.encode()) {
106  filterproduct.addCollectionTag(tagNew);
107  tagOld=tagNew;
108  LogVerbatim("HLTDoubletDZ") << " XXX " << moduleLabel() << " 1b " << tagNew.encode() << std::endl;
109  }
110  }
111  for (unsigned int i=0; i<originTag2_.size(); ++i) {
112  filterproduct.addCollectionTag(originTag2_[i]);
113  LogVerbatim("HLTDoubletDZ") << " XXX " << moduleLabel() << " 2a/" << originTag2_[i].encode() << std::endl;
114  }
115  tagOld=InputTag();
116  for (size_type i2=0; i2!=n2; ++i2) {
117  const ProductID pid(coll2[i2].id());
118  const string& label(iEvent.getProvenance(pid).moduleLabel());
119  const string& instance(iEvent.getProvenance(pid).productInstanceName());
120  const string& process(iEvent.getProvenance(pid).processName());
122  if (tagOld.encode()!=tagNew.encode()) {
123  filterproduct.addCollectionTag(tagNew);
124  tagOld=tagNew;
125  LogVerbatim("HLTDoubletDZ") << " XXX " << moduleLabel() << " 2b " << tagNew.encode() << std::endl;
126  }
127  }
128  }
129 
130  int n(0);
131  T1Ref r1;
132  T2Ref r2;
134  for (unsigned int i1=0; i1!=n1; i1++) {
135  r1=coll1[i1];
136  const reco::Candidate& candidate1(*r1);
137  unsigned int I(0);
138  if (same_) {I=i1+1;}
139  for (unsigned int i2=I; i2!=n2; i2++) {
140  r2=coll2[i2];
141  if (checkSC_) {
142  if (r1->superCluster().isNonnull() && r2->superCluster().isNonnull()) {
143  if (r1->superCluster() == r2->superCluster()) continue;
144  }
145  }
146  const reco::Candidate& candidate2(*r2);
147  if ( reco::deltaR(candidate1, candidate2) < minDR_ ) continue;
148  if ( std::abs(candidate1.vz()-candidate2.vz()) > maxDZ_ ) continue;
149  n++;
150  filterproduct.addObject(triggerType1_,r1);
151  filterproduct.addObject(triggerType2_,r2);
152  }
153  }
154  // filter decision
155  accept = accept || (n>=min_N_);
156  }
157 
158  return accept;
159 }
int i
Definition: DBlmapReader.cc:9
const int triggerType1_
Definition: HLTDoubletDZ.h:40
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken1_
Definition: HLTDoubletDZ.h:38
const int triggerType2_
Definition: HLTDoubletDZ.h:41
const std::vector< edm::InputTag > originTag1_
Definition: HLTDoubletDZ.h:34
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken2_
Definition: HLTDoubletDZ.h:39
const std::vector< edm::InputTag > originTag2_
Definition: HLTDoubletDZ.h:35
static PFTauRenderPlugin instance
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
const bool same_
Definition: HLTDoubletDZ.h:46
std::string const & processName() const
Definition: Provenance.h:61
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:26
uint16_t size_type
std::string encode() const
Definition: InputTag.cc:164
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref&lt;C&gt;)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
const std::complex< double > I
Definition: I.h:8
const int min_N_
Definition: HLTDoubletDZ.h:44
const std::string * moduleLabel() const
Definition: HLTFilter.cc:67
double p2[4]
Definition: TauolaWrapper.h:90
const double maxDZ_
Definition: HLTDoubletDZ.h:43
const double minDR_
Definition: HLTDoubletDZ.h:42
tuple pid
Definition: sysUtil.py:22
edm::Ref< T2Collection > T2Ref
Definition: HLTDoubletDZ.h:51
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
std::string const & moduleLabel() const
Definition: Provenance.h:60
edm::Ref< T1Collection > T1Ref
Definition: HLTDoubletDZ.h:49
bool saveTags() const
Definition: HLTFilter.h:45
double p1[4]
Definition: TauolaWrapper.h:89
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:76
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:27
const bool checkSC_
Definition: HLTDoubletDZ.h:45

Member Data Documentation

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

Definition at line 45 of file HLTDoubletDZ.h.

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

Definition at line 36 of file HLTDoubletDZ.h.

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

Definition at line 37 of file HLTDoubletDZ.h.

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

Definition at line 38 of file HLTDoubletDZ.h.

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

Definition at line 39 of file HLTDoubletDZ.h.

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

Definition at line 43 of file HLTDoubletDZ.h.

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

Definition at line 44 of file HLTDoubletDZ.h.

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

Definition at line 42 of file HLTDoubletDZ.h.

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

Definition at line 34 of file HLTDoubletDZ.h.

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

Definition at line 35 of file HLTDoubletDZ.h.

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

Definition at line 46 of file HLTDoubletDZ.h.

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

Definition at line 40 of file HLTDoubletDZ.h.

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

Definition at line 41 of file HLTDoubletDZ.h.