CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
pat::PATTriggerObjectStandAloneUnpacker Class Reference

Unpacks a pat::TriggerObjectStandAloneCollection with packed path names. More...

Inheritance diagram for pat::PATTriggerObjectStandAloneUnpacker:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PATTriggerObjectStandAloneUnpacker (const edm::ParameterSet &iConfig)
 
 ~PATTriggerObjectStandAloneUnpacker ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 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)
 

Private Member Functions

virtual void produce (edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
 

Private Attributes

const edm::EDGetTokenT< std::vector< std::string > > filterLabelsToken_
 
const edm::EDGetTokenT< TriggerObjectStandAloneCollectionpatTriggerObjectsStandAloneToken_
 
const edm::EDGetTokenT< edm::TriggerResultstriggerResultsToken_
 
bool unpackFilterLabels_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Unpacks a pat::TriggerObjectStandAloneCollection with packed path names.

The producer will throw, if a pat::TriggerObjectStandAloneCollection with unpacked path names is used as input.

Author
Volker Adler

Definition at line 28 of file PATTriggerObjectStandAloneUnpacker.cc.

Constructor & Destructor Documentation

PATTriggerObjectStandAloneUnpacker::PATTriggerObjectStandAloneUnpacker ( const edm::ParameterSet iConfig)
explicit

Definition at line 52 of file PATTriggerObjectStandAloneUnpacker.cc.

53 : patTriggerObjectsStandAloneToken_( consumes< TriggerObjectStandAloneCollection >( iConfig.getParameter< edm::InputTag >( "patTriggerObjectsStandAlone" ) ) )
54 , triggerResultsToken_( consumes< edm::TriggerResults >( iConfig.getParameter< edm::InputTag >( "triggerResults" ) ) )
55 , unpackFilterLabels_( iConfig.getParameter< bool >("unpackFilterLabels") )
56 {
57  produces< TriggerObjectStandAloneCollection >();
58 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< TriggerObjectStandAloneCollection > patTriggerObjectsStandAloneToken_
const edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
pat::PATTriggerObjectStandAloneUnpacker::~PATTriggerObjectStandAloneUnpacker ( )
inline

Definition at line 33 of file PATTriggerObjectStandAloneUnpacker.cc.

References iEvent, and produce().

33 {};

Member Function Documentation

void PATTriggerObjectStandAloneUnpacker::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Definition at line 60 of file PATTriggerObjectStandAloneUnpacker.cc.

References DEFINE_FWK_MODULE, edm::Event::getByToken(), eostools::move(), cscdqm::h::names, triggerObjects_cff::patTriggerObjectsStandAlone, patTriggerObjectsStandAloneToken_, edm::Event::put(), edm::Event::triggerNames(), triggerResults, triggerResultsToken_, and unpackFilterLabels_.

Referenced by ~PATTriggerObjectStandAloneUnpacker().

61 {
63  iEvent.getByToken( patTriggerObjectsStandAloneToken_, patTriggerObjectsStandAlone );
65  iEvent.getByToken( triggerResultsToken_, triggerResults );
66 
67  auto patTriggerObjectsStandAloneUnpacked = std::make_unique<TriggerObjectStandAloneCollection>();
68 
69  for ( size_t iTrigObj = 0; iTrigObj < patTriggerObjectsStandAlone->size(); ++iTrigObj ) {
70  TriggerObjectStandAlone patTriggerObjectStandAloneUnpacked( patTriggerObjectsStandAlone->at( iTrigObj ) );
71  const edm::TriggerNames & names = iEvent.triggerNames( *triggerResults );
72  patTriggerObjectStandAloneUnpacked.unpackPathNames( names );
73  if (unpackFilterLabels_) patTriggerObjectStandAloneUnpacked.unpackFilterLabels(iEvent,*triggerResults );
74  patTriggerObjectsStandAloneUnpacked->push_back( patTriggerObjectStandAloneUnpacked );
75  }
76 
77  iEvent.put(std::move(patTriggerObjectsStandAloneUnpacked) );
78 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
static const HistoName names[]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
static std::string const triggerResults
Definition: EdmProvDump.cc:41
const edm::EDGetTokenT< TriggerObjectStandAloneCollection > patTriggerObjectsStandAloneToken_
const edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:272
def move(src, dest)
Definition: eostools.py:510
Analysis-level trigger object class (stand-alone)

Member Data Documentation

const edm::EDGetTokenT< std::vector<std::string> > pat::PATTriggerObjectStandAloneUnpacker::filterLabelsToken_
private

Definition at line 42 of file PATTriggerObjectStandAloneUnpacker.cc.

const edm::EDGetTokenT< TriggerObjectStandAloneCollection > pat::PATTriggerObjectStandAloneUnpacker::patTriggerObjectsStandAloneToken_
private

Definition at line 39 of file PATTriggerObjectStandAloneUnpacker.cc.

Referenced by produce().

const edm::EDGetTokenT< edm::TriggerResults > pat::PATTriggerObjectStandAloneUnpacker::triggerResultsToken_
private

Definition at line 40 of file PATTriggerObjectStandAloneUnpacker.cc.

Referenced by produce().

bool pat::PATTriggerObjectStandAloneUnpacker::unpackFilterLabels_
private

Definition at line 41 of file PATTriggerObjectStandAloneUnpacker.cc.

Referenced by produce().