#include <HLTSmartSinglet.h>
Public Member Functions | |
virtual bool | hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) |
HLTSmartSinglet (const edm::ParameterSet &) | |
~HLTSmartSinglet () | |
Static Public Member Functions | |
static void | fillDescriptions (edm::ConfigurationDescriptions &descriptions) |
Private Attributes | |
std::string | cut_ |
edm::InputTag | inputTag_ |
int | min_N_ |
StringCutObjectSelector< T, true > | select_ |
int | triggerType_ |
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
See header file for documentation
Definition at line 32 of file HLTSmartSinglet.h.
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_.
: HLTFilter(iConfig), inputTag_ (iConfig.template getParameter<edm::InputTag>("inputTag")), triggerType_ (iConfig.template getParameter<int>("triggerType")), cut_ (iConfig.template getParameter<std::string> ("cut" )), min_N_ (iConfig.template getParameter<int> ("MinN" )), select_ (cut_ ) { LogDebug("") << "Input/tyre/cut/ncut : " << inputTag_.encode() << " " << triggerType_ << " " << cut_<< " " << min_N_ ; }
HLTSmartSinglet< T >::~HLTSmartSinglet | ( | ) |
Definition at line 43 of file HLTSmartSinglet.cc.
{ }
void HLTSmartSinglet< T >::fillDescriptions | ( | edm::ConfigurationDescriptions & | descriptions | ) | [static] |
Reimplemented from edm::EDFilter.
Definition at line 49 of file HLTSmartSinglet.cc.
References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::add(), and mergeVDriftHistosByStation::name.
{ edm::ParameterSetDescription desc; makeHLTFilterDescription(desc); desc.add<edm::InputTag>("inputTag",edm::InputTag("hltCollection")); desc.add<int>("triggerType",0); desc.add<std::string>("cut","1>0"); desc.add<int>("MinN",1); descriptions.add(std::string("hlt")+std::string(typeid(HLTSmartSinglet<T>).name()),desc); }
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, dt_dqm_sourceclient_common_cff::reco, and CommPDSkim_cfg::saveTags.
{ using namespace std; using namespace edm; using namespace reco; using namespace trigger; typedef vector<T> TCollection; typedef Ref<TCollection> TRef; // All HLT filters must create and fill an HLT filter object, // recording any reconstructed physics objects satisfying (or not) // this HLT filter, and place it in the Event. // The filter object if (saveTags()) filterproduct.addCollectionTag(inputTag_); // Ref to Candidate object to be recorded in filter object TRef ref; // get hold of collection of objects Handle<TCollection> objects; iEvent.getByLabel (inputTag_,objects); // look at all objects, check cuts and add to filter object int n(0); typename TCollection::const_iterator i ( objects->begin() ); for (; i!=objects->end(); i++) { if (select_(*i)) { n++; ref=TRef(objects,distance(objects->begin(),i)); filterproduct.addObject(triggerType_,ref); } } // filter decision bool accept(n>=min_N_); return accept; }
std::string HLTSmartSinglet< T >::cut_ [private] |
Definition at line 44 of file HLTSmartSinglet.h.
Referenced by HLTSmartSinglet< T >::HLTSmartSinglet().
edm::InputTag HLTSmartSinglet< T >::inputTag_ [private] |
Definition at line 42 of file HLTSmartSinglet.h.
Referenced by HLTSmartSinglet< T >::HLTSmartSinglet().
int HLTSmartSinglet< T >::min_N_ [private] |
Definition at line 45 of file HLTSmartSinglet.h.
Referenced by HLTSmartSinglet< T >::HLTSmartSinglet().
StringCutObjectSelector<T,true> HLTSmartSinglet< T >::select_ [private] |
Definition at line 47 of file HLTSmartSinglet.h.
int HLTSmartSinglet< T >::triggerType_ [private] |
Definition at line 43 of file HLTSmartSinglet.h.
Referenced by HLTSmartSinglet< T >::HLTSmartSinglet().