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
HLTCollectionProducer< T > Class Template Reference

#include <HLTCollectionProducer.h>

Inheritance diagram for HLTCollectionProducer< T >:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 HLTCollectionProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
virtual ~HLTCollectionProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::InputTag hltObject_
 
std::vector< int > triggerTypes_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

template<typename T>
class HLTCollectionProducer< T >

Extract objects from trigger::TriggerFilterObjectWithRefs and fill them into a new collection (Based on GetJetsFromHLTobject.h)

Definition at line 36 of file HLTCollectionProducer.h.

Constructor & Destructor Documentation

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

Definition at line 54 of file HLTCollectionProducer.h.

54  :
55  hltObject_ ( iConfig.getParameter<edm::InputTag>("HLTObject") ),
56  triggerTypes_ ( iConfig.getParameter<std::vector<int> >("TriggerTypes") )
57 {
58  produces< std::vector<T> >();
59 }
T getParameter(std::string const &) const
std::vector< int > triggerTypes_
template<typename T >
HLTCollectionProducer< T >::~HLTCollectionProducer ( )
virtual

Definition at line 62 of file HLTCollectionProducer.h.

62 {}

Member Function Documentation

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

Definition at line 66 of file HLTCollectionProducer.h.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and mergeVDriftHistosByStation::name.

66  {
68  desc.add<edm::InputTag> ("HLTObject", edm::InputTag("TriggerFilterObjectWithRefs"));
69  std::vector<int> triggerTypes;
70  desc.add<std::vector<int> > ("TriggerTypes",triggerTypes);
71  descriptions.add(std::string("hlt")+std::string(typeid(HLTCollectionProducer<T>).name()), desc);
72 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename T >
void HLTCollectionProducer< T >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 81 of file HLTCollectionProducer.h.

References runEdmFileComparison::collection, edm::Event::getByLabel(), i, edm::Event::put(), and lumiQTWidget::t.

82 {
83 
84  std::auto_ptr<std::vector<T> > collection ( new std::vector<T>() );
85 
86  // get hold of collection of TriggerFilterObjectsWithRefs
88  iEvent.getByLabel(hltObject_, hltObject);
89  std::vector<edm::Ref<std::vector<T> > > objectRefs;
90 
91  for (size_t t=0; t<triggerTypes_.size(); ++t) {
92  objectRefs.clear();
93  hltObject->getObjects( triggerTypes_[t], objectRefs );
94  for (size_t i = 0; i < objectRefs.size(); ++i) {
95  collection->push_back(*objectRefs[i]);
96  }
97  }
98 
99  iEvent.put(collection);
100 
101 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > triggerTypes_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356

Member Data Documentation

template<typename T >
edm::InputTag HLTCollectionProducer< T >::hltObject_
private

Definition at line 45 of file HLTCollectionProducer.h.

template<typename T >
std::vector<int> HLTCollectionProducer< T >::triggerTypes_
private

Definition at line 46 of file HLTCollectionProducer.h.