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

Public Member Functions

virtual bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct)
 
 HLTGlobalSums (const edm::ParameterSet &)
 
 ~HLTGlobalSums ()
 
- 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 &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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 Attributes

edm::InputTag inputTag_
 
double max_
 
double min_
 
int min_N_
 
std::string observable_
 
int tid_
 
int triggerType_
 

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
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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.

Date:
2012/02/24 13:13:46
Revision:
1.8
Author
Martin Grunewald

Definition at line 27 of file HLTGlobalSums.h.

Constructor & Destructor Documentation

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

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

28  : HLTFilter(iConfig),
29  inputTag_ (iConfig.template getParameter<edm::InputTag>("inputTag")),
30  triggerType_(iConfig.template getParameter<int>("triggerType")),
31  observable_ (iConfig.template getParameter<std::string>("observable")),
32  min_ (iConfig.template getParameter<double>("Min")),
33  max_ (iConfig.template getParameter<double>("Max")),
34  min_N_ (iConfig.template getParameter<int>("MinN")),
36 {
37  LogDebug("") << "InputTags and cuts : "
38  << inputTag_.encode() << " "
39  << triggerType_ << " "
40  << observable_
41  << " Range [" << min_ << " " << max_ << "]"
42  << " MinN =" << min_N_ ;
43 
44  if (observable_=="sumEt") {
46  } else if (observable_=="mEtSig") {
49  } else if (triggerType_==trigger::TriggerTHT) {
51  } else {
53  }
54  } else if (observable_=="e_longitudinal") {
57  } else if (triggerType_==trigger::TriggerTHT) {
59  } else {
61  }
62  } else {
64  }
65 }
#define LogDebug(id)
std::string encode() const
Definition: InputTag.cc:72
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:18
edm::InputTag inputTag_
Definition: HLTGlobalSums.h:38
std::string observable_
Definition: HLTGlobalSums.h:40
template<typename T >
HLTGlobalSums< T >::~HLTGlobalSums ( )

Definition at line 68 of file HLTGlobalSums.cc.

69 {
70 }

Member Function Documentation

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

Definition at line 74 of file HLTGlobalSums.cc.

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

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

Implements HLTFilter.

Definition at line 93 of file HLTGlobalSums.cc.

References abs, accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), edm::Event::getByLabel(), 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.

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

Member Data Documentation

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

Definition at line 38 of file HLTGlobalSums.h.

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

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().