CMS 3D CMS Logo

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::ProductRegistryHelper

List of all members.

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_

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_.

                                                                  : 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_ ;
}
template<typename T >
HLTSmartSinglet< T >::~HLTSmartSinglet ( )

Definition at line 43 of file HLTSmartSinglet.cc.

{
}

Member Function Documentation

template<typename T >
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);
}
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, 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;
}

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().