CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
 TriggerObjectFilterByCollection (const edm::ParameterSet &iConfig)
 
virtual ~TriggerObjectFilterByCollection ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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

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_, prof2calltree::count, 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
int i
Definition: DBlmapReader.cc:9
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< std::vector< pat::TriggerObjectStandAlone > > src_
virtual TriggerObjectFilterByCollection::~TriggerObjectFilterByCollection ( )
inlinevirtual

Definition at line 34 of file TriggerObjectFilterByCollection.cc.

34 { }

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 57 of file TriggerObjectFilterByCollection.cc.

References coll, collections_, newFWLiteAna::found, edm::Event::getByToken(), dbtoconf::out, edm::Event::put(), alcazmumu_cfi::src, src_, and AlCaHLTBitMon_QueryRunRegistry::string.

57  {
58  using namespace edm;
59 
61  iEvent.getByToken(src_, src);
62 
63  std::auto_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(out);
75 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
edm::EDGetTokenT< std::vector< pat::TriggerObjectStandAlone > > src_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
tuple out
Definition: dbtoconf.py:99
JetCorrectorParametersCollection coll
Definition: classes.h:10

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