CMS 3D CMS Logo

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)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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 max_Mass_
 
const double min_E_
 
const double min_Eta_
 
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 >::max_Mass_, HLTSinglet< T >::min_E_, HLTSinglet< T >::min_Eta_, HLTSinglet< T >::min_Mass_, HLTSinglet< T >::min_N_, HLTSinglet< T >::min_Pt_, and HLTSinglet< T >::~HLTSinglet().

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_Mass_ (iConfig.template getParameter<double> ("MaxMass" )),
85  min_Eta_ (iConfig.template getParameter<double> ("MinEta" )),
86  max_Eta_ (iConfig.template getParameter<double> ("MaxEta" ))
87 {
88  LogDebug("") << "Input/ptcut/etacut/ncut : "
89  << inputTag_.encode() << " "
90  << min_E_ << " " << min_Pt_ << " " << min_Mass_ << " " << max_Mass_ << " "
91  << min_Eta_ << " " << max_Eta_ << " " << min_N_ ;
92 }
#define LogDebug(id)
const double max_Mass_
Definition: HLTSinglet.h:42
const double min_E_
Definition: HLTSinglet.h:39
std::string encode() const
Definition: InputTag.cc:166
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const double max_Eta_
Definition: HLTSinglet.h:44
const double min_Eta_
Definition: HLTSinglet.h:43
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 ( )
default

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 HLTFilter::makeHLTFilterDescription().

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>("MaxMass",-1.0);
108  desc.add<double>("MinEta",-1.0);
109  desc.add<double>("MaxEta",-1.0);
110  desc.add<int>("MinN",1);
111  descriptions.add(defaultModuleLabel<HLTSinglet<T>>(), desc);
112 }
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 121 of file HLTSinglet.cc.

References funct::abs(), accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), SoftLeptonByDistance_cfi::distance, edm::Event::getByToken(), mps_fire::i, HLTSinglet< T >::inputTag_, HLTSinglet< T >::inputToken_, HLTSinglet< T >::max_Eta_, HLTSinglet< T >::max_Mass_, HLTSinglet< T >::min_E_, HLTSinglet< T >::min_Eta_, HLTSinglet< T >::min_Mass_, HLTSinglet< T >::min_N_, HLTSinglet< T >::min_Pt_, gen::n, HLTFilter::saveTags(), and HLTSinglet< T >::triggerType_.

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
144  iEvent.getByToken(inputToken_,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_Mass_ < 0.0) || (i->mass() <= max_Mass_ ) ) &&
154  ( (min_Eta_ < 0.0) || (std::abs(i->eta()) >= min_Eta_) ) &&
155  ( (max_Eta_ < 0.0) || (std::abs(i->eta()) <= max_Eta_) ) ) {
156  n++;
157  ref=TRef(objects,distance(objects->begin(),i));
158  int tid = getObjectType<T>(*i);
159  if (tid == 0)
160  tid = triggerType_;
161  filterproduct.addObject(tid, ref);
162  }
163  }
164 
165  // filter decision
166  bool accept(n>=min_N_);
167 
168  return accept;
169 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
const double max_Mass_
Definition: HLTSinglet.h:42
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:30
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
const double max_Eta_
Definition: HLTSinglet.h:44
const double min_Eta_
Definition: HLTSinglet.h:43
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
fixed size matrix
bool saveTags() const
Definition: HLTFilter.h:45
HLT enums.
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 >::hltFilter(), and HLTSinglet< T >::HLTSinglet().

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

Definition at line 36 of file HLTSinglet.h.

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

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

Definition at line 44 of file HLTSinglet.h.

Referenced by HLTSinglet< T >::hltFilter(), and HLTSinglet< T >::HLTSinglet().

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

Definition at line 42 of file HLTSinglet.h.

Referenced by HLTSinglet< T >::hltFilter(), and 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 >::hltFilter(), and HLTSinglet< T >::HLTSinglet().

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

Definition at line 43 of file HLTSinglet.h.

Referenced by HLTSinglet< T >::hltFilter(), and 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 >::hltFilter(), and 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 >::hltFilter(), and 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 >::hltFilter(), and HLTSinglet< T >::HLTSinglet().

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

Definition at line 37 of file HLTSinglet.h.

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