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::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
 
 HLTSinglet (const edm::ParameterSet &)
 
 ~HLTSinglet ()
 
- 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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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

const edm::InputTag inputTag_
 
const edm::EDGetTokenT
< std::vector< T > > 
inputToken_
 
const double max_Eta_
 
const double min_E_
 
const double min_Mass_
 
const int min_N_
 
const double min_Pt_
 
const 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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 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

Author
Martin Grunewald

See header file for documentation

Author
Martin Grunewald

Definition at line 26 of file HLTSinglet.h.

Constructor & Destructor Documentation

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

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

76  : HLTFilter(iConfig),
77  inputTag_ (iConfig.template getParameter<edm::InputTag>("inputTag")),
78  inputToken_ (consumes<std::vector<T> >(inputTag_)),
79  triggerType_ (iConfig.template getParameter<int>("triggerType")),
80  min_N_ (iConfig.template getParameter<int> ("MinN" )),
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 {
86  LogDebug("") << "Input/ptcut/etacut/ncut : "
87  << inputTag_.encode() << " "
88  << min_E_ << " " << min_Pt_ << " " << min_Mass_ << " "
89  << max_Eta_ << " " << min_N_ ;
90 }
#define LogDebug(id)
const double min_E_
Definition: HLTSinglet.h:39
std::string encode() const
Definition: InputTag.cc:164
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const double max_Eta_
Definition: HLTSinglet.h:42
const double min_Mass_
Definition: HLTSinglet.h:41
const double min_Pt_
Definition: HLTSinglet.h:40
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
const int min_N_
Definition: HLTSinglet.h:38
const int triggerType_
Definition: HLTSinglet.h:37
const edm::EDGetTokenT< std::vector< T > > inputToken_
Definition: HLTSinglet.h:36
const edm::InputTag inputTag_
Definition: HLTSinglet.h:35
template<typename T >
HLTSinglet< T >::~HLTSinglet ( )

Definition at line 93 of file HLTSinglet.cc.

94 {
95 }

Member Function Documentation

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

Definition at line 99 of file HLTSinglet.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), defaultModuleLabel(), and HLT_25ns14e33_v1_cff::InputTag.

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

Implements HLTFilter.

Definition at line 119 of file HLTSinglet.cc.

References funct::abs(), accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), HLT_25ns14e33_v1_cff::distance, edm::Event::getByToken(), i, gen::n, dt_dqm_sourceclient_common_cff::reco, and CommPDSkim_cfg::saveTags.

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

Member Data Documentation

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

Definition at line 35 of file HLTSinglet.h.

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

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

Definition at line 36 of file HLTSinglet.h.

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

Definition at line 42 of file HLTSinglet.h.

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

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

Definition at line 39 of file HLTSinglet.h.

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

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

Definition at line 41 of file HLTSinglet.h.

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

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

Definition at line 38 of file HLTSinglet.h.

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

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

Definition at line 40 of file HLTSinglet.h.

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

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

Definition at line 37 of file HLTSinglet.h.