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

Member Function Documentation

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

Definition at line 98 of file HLTSinglet.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), defaultModuleLabel(), and HLTFilter::makeHLTFilterDescription().

98  {
101  desc.add<edm::InputTag>("inputTag",edm::InputTag("hltCollection"));
102  desc.add<int>("triggerType",0);
103  desc.add<double>("MinE",-1.0);
104  desc.add<double>("MinPt",-1.0);
105  desc.add<double>("MinMass",-1.0);
106  desc.add<double>("MinEta",-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(), SoftLeptonByDistance_cfi::distance, edm::Event::getByToken(), mps_fire::i, HLTSinglet< T >::inputTag_, HLTSinglet< T >::inputToken_, HLTSinglet< T >::max_Eta_, 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_.

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
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  ( (min_Eta_ < 0.0) || (std::abs(i->eta()) >= min_Eta_) ) &&
152  ( (max_Eta_ < 0.0) || (std::abs(i->eta()) <= max_Eta_) ) ) {
153  n++;
154  ref=TRef(objects,distance(objects->begin(),i));
155  int tid = getObjectType<T>(*i);
156  if (tid == 0)
157  tid = triggerType_;
158  filterproduct.addObject(tid, ref);
159  }
160  }
161 
162  // filter decision
163  bool accept(n>=min_N_);
164 
165  return accept;
166 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
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:43
const double min_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
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 43 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 42 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().