CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes
TriggerObjectFilterByCollection Class Reference
Inheritance diagram for TriggerObjectFilterByCollection:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

class  h
 Creates a filtered list of TriggerObjectStandAlone objects selecting by collection label Inputs are: More...
 

Public Member Functions

void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 TriggerObjectFilterByCollection (const edm::ParameterSet &iConfig)
 
 ~TriggerObjectFilterByCollection () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () 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)
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

std::vector< std::string > collections_
 
edm::EDGetTokenT< std::vector< pat::TriggerObjectStandAlone > > src_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

Definition at line 31 of file TriggerObjectFilterByCollection.cc.

Constructor & Destructor Documentation

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

Definition at line 43 of file TriggerObjectFilterByCollection.cc.

References EnergyCorrector::c, collections_, KineDebug3::count(), mps_fire::i, gen::n, and AlCaHLTBitMon_QueryRunRegistry::string.

43  :
44  src_(consumes<std::vector<pat::TriggerObjectStandAlone>>(iConfig.getParameter<edm::InputTag>("src"))),
45  collections_(iConfig.getParameter<std::vector<std::string> >("collections"))
46 {
47  produces<std::vector<pat::TriggerObjectStandAlone> >();
48  for (unsigned int i = 0, n = collections_.size(); i < n; ++i) {
50  int numsc = std::count(c.begin(), c.end(), ':');
51  if (numsc == 1) c.push_back(':');
52  else if (numsc == 2) c.append("::");
53  }
54 }
T getParameter(std::string const &) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< std::vector< pat::TriggerObjectStandAlone > > src_
TriggerObjectFilterByCollection::~TriggerObjectFilterByCollection ( )
inlineoverride

Definition at line 34 of file TriggerObjectFilterByCollection.cc.

References iEvent, and produce().

34 { }

Member Function Documentation

void TriggerObjectFilterByCollection::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 57 of file TriggerObjectFilterByCollection.cc.

References coll, collections_, DEFINE_FWK_MODULE, RecoEcal_EventContent_cff::ec, runEdmFileComparison::found, edm::Event::getByToken(), eostools::move(), MillePedeFileConverter_cfg::out, edm::Event::put(), TrackRefitter_38T_cff::src, src_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~TriggerObjectFilterByCollection().

57  {
58  using namespace edm;
59 
61  iEvent.getByToken(src_, src);
62 
63  std::unique_ptr<std::vector<pat::TriggerObjectStandAlone> > out(new std::vector<pat::TriggerObjectStandAlone>());
64  out->reserve(src->size());
65  for (std::vector<pat::TriggerObjectStandAlone>::const_iterator it = src->begin(), ed = src->end(); it != ed; ++it) {
66  const std::string &coll = it->collection();
67  bool found = false;
68  for (std::vector<std::string>::const_iterator ic = collections_.begin(), ec = collections_.end(); ic != ec; ++ic) {
69  if (strncmp(coll.c_str(), ic->c_str(), ic->size()) == 0) { found = true; break; }
70  }
71  if (found) out->push_back(*it);
72  }
73 
74  iEvent.put(std::move(out));
75 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< std::vector< pat::TriggerObjectStandAlone > > src_
JetCorrectorParametersCollection coll
Definition: classes.h:10
HLT enums.
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

std::vector<std::string> TriggerObjectFilterByCollection::collections_
private

Definition at line 40 of file TriggerObjectFilterByCollection.cc.

Referenced by produce(), and TriggerObjectFilterByCollection().

edm::EDGetTokenT<std::vector<pat::TriggerObjectStandAlone> > TriggerObjectFilterByCollection::src_
private

Definition at line 39 of file TriggerObjectFilterByCollection.cc.

Referenced by produce().