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 Attributes
HLTGlobalSums< T > Class Template Reference

#include <HLTGlobalSums.h>

Inheritance diagram for HLTGlobalSums< T >:
HLTFilter edm::global::EDFilter<> edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 
 HLTGlobalSums (const edm::ParameterSet &)
 
 ~HLTGlobalSums ()
 
- 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 Attributes

edm::InputTag inputTag_
 
edm::EDGetTokenT< std::vector
< T > > 
inputToken_
 
double max_
 
double min_
 
int min_N_
 
std::string observable_
 
int tid_
 
int triggerType_
 

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 T>
class HLTGlobalSums< T >

This class is an HLTFilter (-> EDFilter) implementing cuts on global sums such as the scalar sum of Et (a.k.a. H_T), available in the T=CaloMET or T=MET object.

Author
Martin Grunewald

Definition at line 26 of file HLTGlobalSums.h.

Constructor & Destructor Documentation

template<typename T >
HLTGlobalSums< T >::HLTGlobalSums ( const edm::ParameterSet iConfig)
explicit

Definition at line 26 of file HLTGlobalSums.cc.

References edm::InputTag::encode(), HLTGlobalSums< T >::inputTag_, LogDebug, HLTGlobalSums< T >::max_, HLTGlobalSums< T >::min_, HLTGlobalSums< T >::min_N_, HLTGlobalSums< T >::observable_, HLTGlobalSums< T >::tid_, trigger::TriggerELongit, trigger::TriggerHLongit, trigger::TriggerMETSig, trigger::TriggerMHTSig, trigger::TriggerTET, trigger::TriggerTHT, and HLTGlobalSums< T >::triggerType_.

26  : HLTFilter(iConfig),
27  inputTag_ (iConfig.template getParameter<edm::InputTag>("inputTag")),
28  inputToken_ (consumes<std::vector<T> >(inputTag_)),
29  triggerType_(iConfig.template getParameter<int>("triggerType")),
30  observable_ (iConfig.template getParameter<std::string>("observable")),
31  min_ (iConfig.template getParameter<double>("Min")),
32  max_ (iConfig.template getParameter<double>("Max")),
33  min_N_ (iConfig.template getParameter<int>("MinN")),
35 {
36  LogDebug("") << "InputTags and cuts : "
37  << inputTag_.encode() << " "
38  << triggerType_ << " "
39  << observable_
40  << " Range [" << min_ << " " << max_ << "]"
41  << " MinN =" << min_N_ ;
42 
43  if (observable_=="sumEt") {
45  } else if (observable_=="mEtSig") {
48  } else if (triggerType_==trigger::TriggerTHT) {
50  } else {
52  }
53  } else if (observable_=="e_longitudinal") {
56  } else if (triggerType_==trigger::TriggerTHT) {
58  } else {
60  }
61  } else {
63  }
64 }
#define LogDebug(id)
edm::EDGetTokenT< std::vector< T > > inputToken_
Definition: HLTGlobalSums.h:38
std::string encode() const
Definition: InputTag.cc:164
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
edm::InputTag inputTag_
Definition: HLTGlobalSums.h:37
std::string observable_
Definition: HLTGlobalSums.h:40
template<typename T >
HLTGlobalSums< T >::~HLTGlobalSums ( )

Definition at line 67 of file HLTGlobalSums.cc.

68 {
69 }

Member Function Documentation

template<typename T >
void HLTGlobalSums< T >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 73 of file HLTGlobalSums.cc.

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

73  {
76  desc.add<edm::InputTag>("inputTag",edm::InputTag("hltCollection"));
77  desc.add<int>("triggerType",0);
78  desc.add<std::string>("observable","");
79  desc.add<double>("Min",-1e125);
80  desc.add<double>("Max",+1e125);
81  desc.add<int>("MinN",1);
82  descriptions.add(std::string("hlt")+std::string(typeid(HLTGlobalSums<T>).name()),desc);
83 }
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 T >
bool HLTGlobalSums< T >::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 92 of file HLTGlobalSums.cc.

References funct::abs(), accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), edm::Event::getByToken(), getDQMSummary::iter, LogDebug, n, dt_dqm_sourceclient_common_cff::reco, CommPDSkim_cfg::saveTags, trigger::TriggerELongit, trigger::TriggerHLongit, trigger::TriggerMETSig, trigger::TriggerMHTSig, trigger::TriggerTET, trigger::TriggerTHT, and relativeConstraints::value.

93 {
94  using namespace std;
95  using namespace edm;
96  using namespace reco;
97  using namespace trigger;
98 
99  typedef vector<T> TCollection;
100  typedef Ref<TCollection> TRef;
101 
102  // All HLT filters must create and fill an HLT filter object,
103  // recording any reconstructed physics objects satisfying (or not)
104  // this HLT filter, and place it in the Event.
105 
106  // The filter object
107  if (saveTags()) filterproduct.addCollectionTag(inputTag_);
108  // Ref to Candidate object to be recorded in filter object
109  TRef ref;
110 
111 
112  // get hold of MET product from Event
113  Handle<TCollection> objects;
114  iEvent.getByToken(inputToken_,objects);
115  if (!objects.isValid()) {
116  LogDebug("") << inputTag_ << " collection not found!";
117  return false;
118  }
119 
120  LogDebug("") << "Size of MET collection: " << objects->size();
121  if (objects->size()==0) {
122  LogDebug("") << "MET collection does not contain a MET object!";
123  } else if (objects->size()>1) {
124  LogDebug("") << "MET collection contains more than one MET object!";
125  }
126 
127  int n(0);
128  double value(0.0);
129  typename TCollection::const_iterator ibegin(objects->begin());
130  typename TCollection::const_iterator iend(objects->end());
131  typename TCollection::const_iterator iter;
132  for (iter=ibegin; iter!=iend; iter++) {
133 
134  // get hold of value of observable to cut on
135  if ( (tid_==TriggerTET) || (tid_==TriggerTHT) ) {
136  value=iter->sumEt();
137  } else if ( (tid_==TriggerMETSig) || (tid_==TriggerMHTSig) ) {
138  value=iter->mEtSig();
139  } else if ( (tid_==TriggerELongit) || (tid_==TriggerHLongit) ) {
140  value=iter->e_longitudinal();
141  } else {
142  value=0.0;
143  }
144 
146 
147  if ( ( (min_<0.0) || (min_<=value) ) &&
148  ( (max_<0.0) || (value<=max_) ) ) {
149  n++;
150  ref=TRef(objects,distance(ibegin,iter));
151  filterproduct.addObject(tid_,ref);
152  }
153 
154  }
155 
156  // filter decision
157  const bool accept(n>=min_N_);
158 
159  return accept;
160 }
#define LogDebug(id)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
edm::EDGetTokenT< std::vector< T > > inputToken_
Definition: HLTGlobalSums.h:38
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:25
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
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
bool saveTags() const
Definition: HLTFilter.h:45
edm::InputTag inputTag_
Definition: HLTGlobalSums.h:37

Member Data Documentation

template<typename T >
edm::InputTag HLTGlobalSums< T >::inputTag_
private

Definition at line 37 of file HLTGlobalSums.h.

Referenced by HLTGlobalSums< T >::HLTGlobalSums().

template<typename T >
edm::EDGetTokenT<std::vector<T> > HLTGlobalSums< T >::inputToken_
private

Definition at line 38 of file HLTGlobalSums.h.

template<typename T >
double HLTGlobalSums< T >::max_
private

Definition at line 41 of file HLTGlobalSums.h.

Referenced by HLTGlobalSums< T >::HLTGlobalSums().

template<typename T >
double HLTGlobalSums< T >::min_
private

Definition at line 41 of file HLTGlobalSums.h.

Referenced by HLTGlobalSums< T >::HLTGlobalSums().

template<typename T >
int HLTGlobalSums< T >::min_N_
private

Definition at line 42 of file HLTGlobalSums.h.

Referenced by HLTGlobalSums< T >::HLTGlobalSums().

template<typename T >
std::string HLTGlobalSums< T >::observable_
private

Definition at line 40 of file HLTGlobalSums.h.

Referenced by HLTGlobalSums< T >::HLTGlobalSums().

template<typename T >
int HLTGlobalSums< T >::tid_
private

Definition at line 43 of file HLTGlobalSums.h.

Referenced by HLTGlobalSums< T >::HLTGlobalSums().

template<typename T >
int HLTGlobalSums< T >::triggerType_
private

Definition at line 39 of file HLTGlobalSums.h.

Referenced by HLTGlobalSums< T >::HLTGlobalSums().