CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ObjectSelectorBase< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init > Class Template Reference

#include <ObjectSelectorBase.h>

Inheritance diagram for ObjectSelectorBase< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >:

Public Member Functions

 ObjectSelectorBase (const edm::ParameterSet &cfg)
 constructor More...
 
 ~ObjectSelectorBase () override
 destructor More...
 

Private Member Functions

bool filter (edm::Event &evt, const edm::EventSetup &es) override
 process one event More...
 

Private Attributes

bool filter_
 filter event More...
 
PostProcessor postProcessor_
 post processor More...
 
Selector selector_
 
Init selectorInit_
 Object collection selector. More...
 
SizeSelector sizeSelector_
 selected object collection size selector More...
 
edm::EDGetTokenT< typename Selector::collection > srcToken_
 source collection label More...
 

Detailed Description

template<typename Selector, typename OutputCollection, typename SizeSelector, typename PostProcessor, typename StoreManager, typename Base, typename Init>
class ObjectSelectorBase< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >

selects a subset of a collection.

Author
Luca Lista, INFN
Version
Revision
1.3
Id
ObjectSelectorBase.h,v 1.3 2010/02/20 20:55:27 wmtan Exp

Definition at line 32 of file ObjectSelectorBase.h.

Constructor & Destructor Documentation

◆ ObjectSelectorBase()

template<typename Selector, typename OutputCollection, typename SizeSelector, typename PostProcessor, typename StoreManager, typename Base, typename Init>
ObjectSelectorBase< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::ObjectSelectorBase ( const edm::ParameterSet cfg)
inlineexplicit

constructor

Definition at line 36 of file ObjectSelectorBase.h.

37  : Base(cfg),
38  srcToken_(
39  this->template consumes<typename Selector::collection>(cfg.template getParameter<edm::InputTag>("src"))),
40  filter_(false),
41  selectorInit_(this->consumesCollector()),
42  selector_(cfg, this->consumesCollector()),
43  sizeSelector_(reco::modules::make<SizeSelector>(cfg)),
44  postProcessor_(cfg, this->consumesCollector()) {
45  const std::string filter("filter");
46  std::vector<std::string> bools = cfg.template getParameterNamesForType<bool>();
47  bool found = std::find(bools.begin(), bools.end(), filter) != bools.end();
48  if (found)
49  filter_ = cfg.template getParameter<bool>(filter);
50  postProcessor_.init(*this);
51  }
bool filter(edm::Event &evt, const edm::EventSetup &es) override
process one event
Init selectorInit_
Object collection selector.
def Base(process)
bool filter_
filter event
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::EDGetTokenT< typename Selector::collection > srcToken_
source collection label
PostProcessor postProcessor_
post processor
SizeSelector sizeSelector_
selected object collection size selector

◆ ~ObjectSelectorBase()

template<typename Selector, typename OutputCollection, typename SizeSelector, typename PostProcessor, typename StoreManager, typename Base, typename Init>
ObjectSelectorBase< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::~ObjectSelectorBase ( )
inlineoverride

destructor

Definition at line 53 of file ObjectSelectorBase.h.

53 {}

Member Function Documentation

◆ filter()

template<typename Selector, typename OutputCollection, typename SizeSelector, typename PostProcessor, typename StoreManager, typename Base, typename Init>
bool ObjectSelectorBase< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::filter ( edm::Event evt,
const edm::EventSetup es 
)
inlineoverrideprivate

process one event

Definition at line 57 of file ObjectSelectorBase.h.

Referenced by ObjectSelectorBase< SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >, OutputCollection, NonNullNumberSelector, PostProcessor, StoreManager, Base, ::reco::modules::EventSetupInit< SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder > >::type >::ObjectSelectorBase().

57  {
58  selectorInit_.init(selector_, evt, es);
61  StoreManager manager(source);
62  selector_.select(source, evt, es);
63  manager.cloneAndStore(selector_.begin(), selector_.end(), evt);
64  bool result = (!filter_ || sizeSelector_(manager.size()));
66  postProcessor_.process(filtered, evt);
67  return result;
68  }
Init selectorInit_
Object collection selector.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
bool filter_
filter event
static const TGPicture * filtered(bool iBackgroundIsBlack)
edm::EDGetTokenT< typename Selector::collection > srcToken_
source collection label
PostProcessor postProcessor_
post processor
SizeSelector sizeSelector_
selected object collection size selector
static std::string const source
Definition: EdmProvDump.cc:46

Member Data Documentation

◆ filter_

template<typename Selector, typename OutputCollection, typename SizeSelector, typename PostProcessor, typename StoreManager, typename Base, typename Init>
bool ObjectSelectorBase< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::filter_
private

◆ postProcessor_

template<typename Selector, typename OutputCollection, typename SizeSelector, typename PostProcessor, typename StoreManager, typename Base, typename Init>
PostProcessor ObjectSelectorBase< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::postProcessor_
private

◆ selector_

template<typename Selector, typename OutputCollection, typename SizeSelector, typename PostProcessor, typename StoreManager, typename Base, typename Init>
Selector ObjectSelectorBase< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::selector_
private

◆ selectorInit_

template<typename Selector, typename OutputCollection, typename SizeSelector, typename PostProcessor, typename StoreManager, typename Base, typename Init>
Init ObjectSelectorBase< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::selectorInit_
private

◆ sizeSelector_

template<typename Selector, typename OutputCollection, typename SizeSelector, typename PostProcessor, typename StoreManager, typename Base, typename Init>
SizeSelector ObjectSelectorBase< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::sizeSelector_
private

◆ srcToken_

template<typename Selector, typename OutputCollection, typename SizeSelector, typename PostProcessor, typename StoreManager, typename Base, typename Init>
edm::EDGetTokenT<typename Selector::collection> ObjectSelectorBase< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::srcToken_
private