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::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTDoubletDZ (const edm::ParameterSet &)
 
virtual bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct)
 
 ~HLTDoubletDZ ()
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module () const
 
const std::string * moduleLabel () const
 
int path () const
 
const std::string * pathName () const
 
std::pair< int, int > pmid () const
 
bool saveTags () const
 
virtual ~HLTFilter ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- 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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) 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::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Types

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

Private Attributes

bool checkSC_
 
std::vector< T1Refcoll1_
 
std::vector< T2Refcoll2_
 
edm::InputTag inputTag1_
 
edm::InputTag inputTag2_
 
std::string label_
 
double maxDZ_
 
int min_N_
 
double minDR_
 
edm::InputTag originTag1_
 
edm::InputTag originTag2_
 
bool same_
 
int triggerType1_
 
int triggerType2_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- 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 20 of file HLTDoubletDZ.h.

Member Typedef Documentation

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

Definition at line 45 of file HLTDoubletDZ.h.

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

Definition at line 46 of file HLTDoubletDZ.h.

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

Definition at line 48 of file HLTDoubletDZ.h.

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

Definition at line 49 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.

References edm::InputTag::encode(), HLTDoubletDZ< T1, T2 >::inputTag1_, HLTDoubletDZ< T1, T2 >::inputTag2_, and HLTDoubletDZ< T1, T2 >::same_.

21  : HLTFilter(iConfig),
22  originTag1_(iConfig.template getParameter<edm::InputTag>("originTag1")),
23  originTag2_(iConfig.template getParameter<edm::InputTag>("originTag2")),
24  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
25  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
26  triggerType1_(iConfig.template getParameter<int>("triggerType1")),
27  triggerType2_(iConfig.template getParameter<int>("triggerType2")),
28  minDR_ (iConfig.template getParameter<double>("MinDR")),
29  maxDZ_ (iConfig.template getParameter<double>("MaxDZ")),
30  min_N_ (iConfig.template getParameter<int>("MinN")),
31  checkSC_ (iConfig.template getParameter<bool>("checkSC")),
32  label_ (iConfig.getParameter<std::string>("@module_label")),
33  coll1_(),
34  coll2_()
35 {
36  // same collections to be compared?
38 }
T getParameter(std::string const &) const
double maxDZ_
Definition: HLTDoubletDZ.h:38
std::string encode() const
Definition: InputTag.cc:164
std::vector< T1Ref > coll1_
Definition: HLTDoubletDZ.h:47
edm::InputTag inputTag2_
Definition: HLTDoubletDZ.h:34
std::vector< T2Ref > coll2_
Definition: HLTDoubletDZ.h:50
edm::InputTag inputTag1_
Definition: HLTDoubletDZ.h:33
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:18
double minDR_
Definition: HLTDoubletDZ.h:37
edm::InputTag originTag2_
Definition: HLTDoubletDZ.h:32
std::string label_
Definition: HLTDoubletDZ.h:43
edm::InputTag originTag1_
Definition: HLTDoubletDZ.h:31
template<typename T1 , typename T2 >
HLTDoubletDZ< T1, T2 >::~HLTDoubletDZ ( )

Definition at line 41 of file HLTDoubletDZ.cc.

42 {
43 }

Member Function Documentation

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

Definition at line 47 of file HLTDoubletDZ.cc.

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

47  {
50  desc.add<edm::InputTag>("originTag1",edm::InputTag("hltOriginal1"));
51  desc.add<edm::InputTag>("originTag2",edm::InputTag("hltOriginal2"));
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:27
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 
)
virtual

Implements HLTFilter.

Definition at line 66 of file HLTDoubletDZ.cc.

References abs, accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), edm::HandleBase::clear(), reco::deltaR(), edm::Event::getByLabel(), edm::Event::getProvenance(), Exhume::I, instance, edm::Ref< C, T, F >::isNonnull(), diffTwoXMLs::label, edm::Provenance::moduleLabel(), n, AlCaHLTBitMon_ParallelJobs::p, p1, p2, evf::utils::pid, LaserDQM_cfg::process, edm::Provenance::processName(), edm::Provenance::productInstanceName(), diffTwoXMLs::r1, diffTwoXMLs::r2, L1Trigger_dataformats::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 " << label_ << " 0 " << std::endl;
80 
81  // get hold of pre-filtered object collections
83  if (iEvent.getByLabel (inputTag1_,coll1) && iEvent.getByLabel (inputTag2_,coll2)) {
84  coll1_.clear();
85  coll1->getObjects(triggerType1_,coll1_);
86  const size_type n1(coll1_.size());
87  coll2_.clear();
88  coll2->getObjects(triggerType2_,coll2_);
89  const size_type n2(coll2_.size());
90 
91  if (saveTags()) {
92  InputTag tagOld;
93  filterproduct.addCollectionTag(originTag1_);
94  LogVerbatim("HLTDoubletDZ") << " XXX " << label_ << " 1a " << originTag1_.encode() << std::endl;
95  tagOld=InputTag();
96  for (size_type i1=0; i1!=n1; ++i1) {
97  const ProductID pid(coll1_[i1].id());
98  const string& label(iEvent.getProvenance(pid).moduleLabel());
99  const string& instance(iEvent.getProvenance(pid).productInstanceName());
100  const string& process(iEvent.getProvenance(pid).processName());
102  if (tagOld.encode()!=tagNew.encode()) {
103  filterproduct.addCollectionTag(tagNew);
104  tagOld=tagNew;
105  LogVerbatim("HLTDoubletDZ") << " XXX " << label_ << " 1b " << tagNew.encode() << std::endl;
106  }
107  }
108  filterproduct.addCollectionTag(originTag2_);
109  LogVerbatim("HLTDoubletDZ") << " XXX " << label_ << " 2a " << originTag2_.encode() << std::endl;
110  tagOld=InputTag();
111  for (size_type i2=0; i2!=n2; ++i2) {
112  const ProductID pid(coll2_[i2].id());
113  const string& label(iEvent.getProvenance(pid).moduleLabel());
114  const string& instance(iEvent.getProvenance(pid).productInstanceName());
115  const string& process(iEvent.getProvenance(pid).processName());
117  if (tagOld.encode()!=tagNew.encode()) {
118  filterproduct.addCollectionTag(tagNew);
119  tagOld=tagNew;
120  LogVerbatim("HLTDoubletDZ") << " XXX " << label_ << " 2b " << tagNew.encode() << std::endl;
121  }
122  }
123  }
124 
125  int n(0);
126  T1Ref r1;
127  T2Ref r2;
129  for (unsigned int i1=0; i1!=n1; i1++) {
130  r1=coll1_[i1];
131  const reco::Candidate& candidate1(*r1);
132  unsigned int I(0);
133  if (same_) {I=i1+1;}
134  for (unsigned int i2=I; i2!=n2; i2++) {
135  r2=coll2_[i2];
136  if (checkSC_) {
137  if (r1->superCluster().isNonnull() && r2->superCluster().isNonnull()) {
138  if (r1->superCluster() == r2->superCluster()) continue;
139  }
140  }
141  const reco::Candidate& candidate2(*r2);
142  if ( reco::deltaR(candidate1, candidate2) < minDR_ ) continue;
143  if ( std::abs(candidate1.vz()-candidate2.vz()) > maxDZ_ ) continue;
144  n++;
145  filterproduct.addObject(triggerType1_,r1);
146  filterproduct.addObject(triggerType2_,r2);
147  }
148  }
149  // filter decision
150  accept = accept || (n>=min_N_);
151  }
152 
153  return accept;
154 }
static PFTauRenderPlugin instance
#define abs(x)
Definition: mlp_lapack.h:159
double maxDZ_
Definition: HLTDoubletDZ.h:38
std::string const & processName() const
Definition: Provenance.h:63
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:22
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;)
std::vector< T1Ref > coll1_
Definition: HLTDoubletDZ.h:47
edm::InputTag inputTag2_
Definition: HLTDoubletDZ.h:34
std::vector< T2Ref > coll2_
Definition: HLTDoubletDZ.h:50
edm::InputTag inputTag1_
Definition: HLTDoubletDZ.h:33
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
const std::complex< double > I
Definition: I.h:8
double p2[4]
Definition: TauolaWrapper.h:90
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
edm::Ref< T2Collection > T2Ref
Definition: HLTDoubletDZ.h:49
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
std::string const & moduleLabel() const
Definition: Provenance.h:62
edm::Ref< T1Collection > T1Ref
Definition: HLTDoubletDZ.h:46
double minDR_
Definition: HLTDoubletDZ.h:37
bool saveTags() const
Definition: HLTFilter.h:45
double p1[4]
Definition: TauolaWrapper.h:89
edm::InputTag originTag2_
Definition: HLTDoubletDZ.h:32
std::string const & productInstanceName() const
Definition: Provenance.h:64
tuple process
Definition: LaserDQM_cfg.py:3
Provenance getProvenance(BranchID const &theID) const
Definition: Event.cc:68
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:25
std::string label_
Definition: HLTDoubletDZ.h:43
edm::InputTag originTag1_
Definition: HLTDoubletDZ.h:31

Member Data Documentation

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

Definition at line 41 of file HLTDoubletDZ.h.

template<typename T1 , typename T2 >
std::vector<T1Ref> HLTDoubletDZ< T1, T2 >::coll1_
private

Definition at line 47 of file HLTDoubletDZ.h.

template<typename T1 , typename T2 >
std::vector<T2Ref> HLTDoubletDZ< T1, T2 >::coll2_
private

Definition at line 50 of file HLTDoubletDZ.h.

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

Definition at line 33 of file HLTDoubletDZ.h.

Referenced by HLTDoubletDZ< T1, T2 >::HLTDoubletDZ().

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

Definition at line 34 of file HLTDoubletDZ.h.

Referenced by HLTDoubletDZ< T1, T2 >::HLTDoubletDZ().

template<typename T1 , typename T2 >
std:: string HLTDoubletDZ< T1, T2 >::label_
private
template<typename T1 , typename T2 >
double HLTDoubletDZ< T1, T2 >::maxDZ_
private

Definition at line 38 of file HLTDoubletDZ.h.

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

Definition at line 40 of file HLTDoubletDZ.h.

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

Definition at line 37 of file HLTDoubletDZ.h.

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

Definition at line 31 of file HLTDoubletDZ.h.

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

Definition at line 32 of file HLTDoubletDZ.h.

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

Definition at line 39 of file HLTDoubletDZ.h.

Referenced by HLTDoubletDZ< T1, T2 >::HLTDoubletDZ().

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

Definition at line 35 of file HLTDoubletDZ.h.

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

Definition at line 36 of file HLTDoubletDZ.h.