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

#include <HLTSmartSinglet.h>

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

Public Member Functions

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

std::string cut_
 
edm::InputTag inputTag_
 
int min_N_
 
StringCutObjectSelector< T, true > select_
 
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
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 HLTSmartSinglet< T >

This class is an HLTFilter (-> EDFilter) implementing a smart HLT trigger cut, specified as a string such as "pt>15 && -3<eta<3", for single objects of the same physics type, allowing to cut on variables relating to both the base class T and the derived actual class

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

See header file for documentation

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

Definition at line 32 of file HLTSmartSinglet.h.

Constructor & Destructor Documentation

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

Definition at line 28 of file HLTSmartSinglet.cc.

References HLTSmartSinglet< T >::cut_, edm::InputTag::encode(), HLTSmartSinglet< T >::inputTag_, LogDebug, HLTSmartSinglet< T >::min_N_, and HLTSmartSinglet< T >::triggerType_.

28  : HLTFilter(iConfig),
29  inputTag_ (iConfig.template getParameter<edm::InputTag>("inputTag")),
30  triggerType_ (iConfig.template getParameter<int>("triggerType")),
31  cut_ (iConfig.template getParameter<std::string> ("cut" )),
32  min_N_ (iConfig.template getParameter<int> ("MinN" )),
33  select_ (cut_ )
34 {
35  LogDebug("") << "Input/tyre/cut/ncut : "
36  << inputTag_.encode() << " "
37  << triggerType_ << " "
38  << cut_<< " "
39  << min_N_ ;
40 }
#define LogDebug(id)
edm::InputTag inputTag_
std::string encode() const
Definition: InputTag.cc:164
std::string cut_
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:18
StringCutObjectSelector< T, true > select_
template<typename T >
HLTSmartSinglet< T >::~HLTSmartSinglet ( )

Definition at line 43 of file HLTSmartSinglet.cc.

44 {
45 }

Member Function Documentation

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

Definition at line 49 of file HLTSmartSinglet.cc.

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

49  {
52  desc.add<edm::InputTag>("inputTag",edm::InputTag("hltCollection"));
53  desc.add<int>("triggerType",0);
54  desc.add<std::string>("cut","1>0");
55  desc.add<int>("MinN",1);
56  descriptions.add(std::string("hlt")+std::string(typeid(HLTSmartSinglet<T>).name()),desc);
57 }
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 HLTSmartSinglet< T >::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
)
virtual

Implements HLTFilter.

Definition at line 66 of file HLTSmartSinglet.cc.

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

67 {
68  using namespace std;
69  using namespace edm;
70  using namespace reco;
71  using namespace trigger;
72 
73  typedef vector<T> TCollection;
74  typedef Ref<TCollection> TRef;
75 
76  // All HLT filters must create and fill an HLT filter object,
77  // recording any reconstructed physics objects satisfying (or not)
78  // this HLT filter, and place it in the Event.
79 
80  // The filter object
81  if (saveTags()) filterproduct.addCollectionTag(inputTag_);
82 
83  // Ref to Candidate object to be recorded in filter object
84  TRef ref;
85 
86  // get hold of collection of objects
87  Handle<TCollection> objects;
88  iEvent.getByLabel (inputTag_,objects);
89 
90  // look at all objects, check cuts and add to filter object
91  int n(0);
92  typename TCollection::const_iterator i ( objects->begin() );
93  for (; i!=objects->end(); i++) {
94  if (select_(*i)) {
95  n++;
96  ref=TRef(objects,distance(objects->begin(),i));
97  filterproduct.addObject(triggerType_,ref);
98  }
99  }
100 
101  // filter decision
102  bool accept(n>=min_N_);
103 
104  return accept;
105 }
int i
Definition: DBlmapReader.cc:9
edm::InputTag inputTag_
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:361
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
StringCutObjectSelector< T, true > select_
bool saveTags() const
Definition: HLTFilter.h:45

Member Data Documentation

template<typename T >
std::string HLTSmartSinglet< T >::cut_
private

Definition at line 44 of file HLTSmartSinglet.h.

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

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

Definition at line 42 of file HLTSmartSinglet.h.

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

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

Definition at line 45 of file HLTSmartSinglet.h.

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

template<typename T >
StringCutObjectSelector<T,true> HLTSmartSinglet< T >::select_
private

Definition at line 47 of file HLTSmartSinglet.h.

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

Definition at line 43 of file HLTSmartSinglet.h.

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