CMS 3D CMS Logo

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

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  selector_(cfg, this->consumesCollector()),
42  sizeSelector_(reco::modules::make<SizeSelector>(cfg)),
43  postProcessor_(cfg, this->consumesCollector()) {
44  const std::string filter("filter");
45  std::vector<std::string> bools = cfg.template getParameterNamesForType<bool>();
46  bool found = std::find(bools.begin(), bools.end(), filter) != bools.end();
47  if (found)
48  filter_ = cfg.template getParameter<bool>(filter);
49  postProcessor_.init(*this);
50  }
bool filter(edm::Event &evt, const edm::EventSetup &es) override
process one event
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
Selector selector_
Object collection selector.
edm::EDGetTokenT< typename Selector::collection > srcToken_
source collection label
PostProcessor postProcessor_
post processor
SizeSelector sizeSelector_
selected object collection size selector
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 52 of file ObjectSelectorBase.h.

52 {}

Member Function Documentation

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 56 of file ObjectSelectorBase.h.

Referenced by ObjectSelectorBase< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, NonNullNumberSelector,::helper::NullPostProcessor< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::type, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::base,::reco::modules::EventSetupInit< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type > >::type >::ObjectSelectorBase().

56  {
57  Init::init(selector_, evt, es);
58  using namespace std;
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  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
int init
Definition: HydjetWrapper.h:64
bool filter_
filter event
tuple result
Definition: mps_fire.py:311
Selector selector_
Object collection selector.
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

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

filter event

Definition at line 72 of file ObjectSelectorBase.h.

Referenced by ObjectSelectorBase< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, NonNullNumberSelector,::helper::NullPostProcessor< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::type, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::base,::reco::modules::EventSetupInit< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type > >::type >::filter(), and ObjectSelectorBase< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, NonNullNumberSelector,::helper::NullPostProcessor< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::type, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::base,::reco::modules::EventSetupInit< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type > >::type >::ObjectSelectorBase().

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

post processor

Definition at line 78 of file ObjectSelectorBase.h.

Referenced by ObjectSelectorBase< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, NonNullNumberSelector,::helper::NullPostProcessor< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::type, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::base,::reco::modules::EventSetupInit< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type > >::type >::filter(), and ObjectSelectorBase< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, NonNullNumberSelector,::helper::NullPostProcessor< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::type, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::base,::reco::modules::EventSetupInit< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type > >::type >::ObjectSelectorBase().

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

Object collection selector.

Definition at line 74 of file ObjectSelectorBase.h.

Referenced by ObjectSelectorBase< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, NonNullNumberSelector,::helper::NullPostProcessor< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::type, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::base,::reco::modules::EventSetupInit< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type > >::type >::filter().

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

selected object collection size selector

Definition at line 76 of file ObjectSelectorBase.h.

Referenced by ObjectSelectorBase< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, NonNullNumberSelector,::helper::NullPostProcessor< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::type, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::base,::reco::modules::EventSetupInit< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type > >::type >::filter().

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

source collection label

Definition at line 70 of file ObjectSelectorBase.h.

Referenced by ObjectSelectorBase< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, NonNullNumberSelector,::helper::NullPostProcessor< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::type, typename::helper::StoreManagerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, EdmFilter >::base,::reco::modules::EventSetupInit< SingleElementCollectionSelector< reco::TrackCollection, StringCutObjectSelector< reco::Track >, typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type, typename::helper::SelectionAdderTrait< reco::TrackCollection, typename::helper::StoreContainerTrait< typename::helper::SelectedOutputCollectionTrait< reco::TrackCollection >::type >::type >::type > >::type >::filter().