CMS 3D CMS Logo

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

List of all members.

Public Member Functions

 HLTCollectionProducer (const edm::ParameterSet &)
virtual void produce (edm::Event &, const edm::EventSetup &)
virtual ~HLTCollectionProducer ()

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)

Private Attributes

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

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.

                                                                              :
  hltObject_    ( iConfig.getParameter<edm::InputTag>("HLTObject") ),
  triggerTypes_ ( iConfig.getParameter<std::vector<int> >("TriggerTypes") )
{
  produces< std::vector<T> >();
}
template<typename T >
HLTCollectionProducer< T >::~HLTCollectionProducer ( ) [virtual]

Definition at line 62 of file HLTCollectionProducer.h.

{}

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 66 of file HLTCollectionProducer.h.

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

                                                                                     {
  edm::ParameterSetDescription desc;
  desc.add<edm::InputTag> ("HLTObject", edm::InputTag("TriggerFilterObjectWithRefs"));
  std::vector<int> triggerTypes;
  desc.add<std::vector<int> > ("TriggerTypes",triggerTypes);
  descriptions.add(std::string("hlt")+std::string(typeid(HLTCollectionProducer<T>).name()), desc);
}
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.

{

  std::auto_ptr<std::vector<T> > collection ( new std::vector<T>() );

  // get hold of collection of TriggerFilterObjectsWithRefs
  edm::Handle<trigger::TriggerFilterObjectWithRefs> hltObject;
  iEvent.getByLabel(hltObject_, hltObject);
  std::vector<edm::Ref<std::vector<T> > > objectRefs;

  for (size_t t=0; t<triggerTypes_.size(); ++t) {
    objectRefs.clear();
    hltObject->getObjects( triggerTypes_[t], objectRefs );
    for (size_t i = 0; i < objectRefs.size(); ++i) {
      collection->push_back(*objectRefs[i]);
    }
  }
  
  iEvent.put(collection);

}

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.