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

#include <HLTSinglet.h>

Inheritance diagram for HLTSinglet< T >:
HLTFilter edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct)
 
 HLTSinglet (const edm::ParameterSet &)
 
 ~HLTSinglet ()
 
- 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_Eta_
 
double min_E_
 
double min_Mass_
 
int min_N_
 
double min_Pt_
 
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 HLTSinglet< T >

This class is an HLTFilter (-> EDFilter) implementing a basic HLT trigger for single objects of the same physics type, cutting on variables relating to their 4-momentum representation

Date:
2012/02/24 13:13:47
Revision:
1.9
Author
Martin Grunewald

See header file for documentation

Date:
2012/02/24 13:13:47
Revision:
1.15
Author
Martin Grunewald

Definition at line 28 of file HLTSinglet.h.

Constructor & Destructor Documentation

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

Definition at line 78 of file HLTSinglet.cc.

References edm::InputTag::encode(), HLTSinglet< T >::inputTag_, LogDebug, HLTSinglet< T >::max_Eta_, HLTSinglet< T >::min_E_, HLTSinglet< T >::min_Mass_, HLTSinglet< T >::min_N_, and HLTSinglet< T >::min_Pt_.

78  : HLTFilter(iConfig),
79  inputTag_ (iConfig.template getParameter<edm::InputTag>("inputTag")),
80  triggerType_ (iConfig.template getParameter<int>("triggerType")),
81  min_E_ (iConfig.template getParameter<double> ("MinE" )),
82  min_Pt_ (iConfig.template getParameter<double> ("MinPt" )),
83  min_Mass_ (iConfig.template getParameter<double> ("MinMass" )),
84  max_Eta_ (iConfig.template getParameter<double> ("MaxEta" )),
85  min_N_ (iConfig.template getParameter<int> ("MinN" )),
87 {
88  LogDebug("") << "Input/ptcut/etacut/ncut : "
89  << inputTag_.encode() << " "
90  << min_E_ << " " << min_Pt_ << " " << min_Mass_ << " "
91  << max_Eta_ << " " << min_N_ ;
92 }
#define LogDebug(id)
int triggerType_
Definition: HLTSinglet.h:38
double min_E_
Definition: HLTSinglet.h:39
double min_Pt_
Definition: HLTSinglet.h:40
std::string encode() const
Definition: InputTag.cc:72
double min_Mass_
Definition: HLTSinglet.h:41
edm::InputTag inputTag_
Definition: HLTSinglet.h:37
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:18
int min_N_
Definition: HLTSinglet.h:43
double max_Eta_
Definition: HLTSinglet.h:42
template<typename T >
HLTSinglet< T >::~HLTSinglet ( )

Definition at line 95 of file HLTSinglet.cc.

96 {
97 }

Member Function Documentation

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

Definition at line 101 of file HLTSinglet.cc.

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

101  {
104  desc.add<edm::InputTag>("inputTag",edm::InputTag("hltCollection"));
105  desc.add<int>("triggerType",0);
106  desc.add<double>("MinE",-1.0);
107  desc.add<double>("MinPt",-1.0);
108  desc.add<double>("MinMass",-1.0);
109  desc.add<double>("MaxEta",-1.0);
110  desc.add<int>("MinN",1);
111  descriptions.add(std::string("hlt")+std::string(typeid(HLTSinglet<T>).name()),desc);
112 }
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 HLTSinglet< T >::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
)
virtual

Implements HLTFilter.

Definition at line 121 of file HLTSinglet.cc.

References abs, accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), edm::Event::getByLabel(), i, n, dt_dqm_sourceclient_common_cff::reco, and CommPDSkim_cfg::saveTags.

122 {
123  using namespace std;
124  using namespace edm;
125  using namespace reco;
126  using namespace trigger;
127 
128  typedef vector<T> TCollection;
129  typedef Ref<TCollection> TRef;
130 
131  // All HLT filters must create and fill an HLT filter object,
132  // recording any reconstructed physics objects satisfying (or not)
133  // this HLT filter, and place it in the Event.
134 
135  // The filter object
136  if (saveTags()) filterproduct.addCollectionTag(inputTag_);
137 
138  // Ref to Candidate object to be recorded in filter object
139  TRef ref;
140 
141 
142  // get hold of collection of objects
143  Handle<TCollection> objects;
144  iEvent.getByLabel (inputTag_,objects);
145 
146  // look at all objects, check cuts and add to filter object
147  int n(0);
148  typename TCollection::const_iterator i ( objects->begin() );
149  for (; i!=objects->end(); i++) {
150  if ( (i->energy() >= min_E_) &&
151  (i->pt() >= min_Pt_) &&
152  (i->mass() >= min_Mass_) &&
153  ( (max_Eta_ < 0.0) || (std::abs(i->eta()) <= max_Eta_) ) ) {
154  n++;
155  ref=TRef(objects,distance(objects->begin(),i));
156  tid_=getObjectType<T>(*i);
157  if (tid_==0) tid_=triggerType_;
158  filterproduct.addObject(tid_,ref);
159  }
160  }
161 
162  // filter decision
163  bool accept(n>=min_N_);
164 
165  return accept;
166 }
int i
Definition: DBlmapReader.cc:9
int triggerType_
Definition: HLTSinglet.h:38
double min_E_
Definition: HLTSinglet.h:39
double min_Pt_
Definition: HLTSinglet.h:40
#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;)
double min_Mass_
Definition: HLTSinglet.h:41
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::InputTag inputTag_
Definition: HLTSinglet.h:37
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
bool saveTags() const
Definition: HLTFilter.h:45
int min_N_
Definition: HLTSinglet.h:43
double max_Eta_
Definition: HLTSinglet.h:42

Member Data Documentation

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

Definition at line 37 of file HLTSinglet.h.

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

template<typename T >
double HLTSinglet< T >::max_Eta_
private

Definition at line 42 of file HLTSinglet.h.

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

template<typename T >
double HLTSinglet< T >::min_E_
private

Definition at line 39 of file HLTSinglet.h.

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

template<typename T >
double HLTSinglet< T >::min_Mass_
private

Definition at line 41 of file HLTSinglet.h.

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

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

Definition at line 43 of file HLTSinglet.h.

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

template<typename T >
double HLTSinglet< T >::min_Pt_
private

Definition at line 40 of file HLTSinglet.h.

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

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

Definition at line 44 of file HLTSinglet.h.

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

Definition at line 38 of file HLTSinglet.h.