CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ObjectSelector< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init > Class Template Reference

#include <ObjectSelector.h>

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

Public Member Functions

 ObjectSelector (const edm::ParameterSet &cfg)
 constructor More...
 
virtual ~ObjectSelector ()
 destructor More...
 

Private Member Functions

bool filter (edm::Event &evt, const edm::EventSetup &es)
 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 ::helper::SelectedOutputCollectionTrait<typename Selector::collection>::type, typename SizeSelector = NonNullNumberSelector, typename PostProcessor = ::helper::NullPostProcessor<OutputCollection, edm::EDFilter>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::base, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
class ObjectSelector< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >

selects a subset of a collection.

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

Definition at line 39 of file ObjectSelector.h.

Constructor & Destructor Documentation

template<typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<typename Selector::collection>::type, typename SizeSelector = NonNullNumberSelector, typename PostProcessor = ::helper::NullPostProcessor<OutputCollection, edm::EDFilter>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::base, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
ObjectSelector< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::ObjectSelector ( const edm::ParameterSet cfg)
inlineexplicit

constructor

Definition at line 43 of file ObjectSelector.h.

43  :
44  Base(cfg),
45  srcToken_( this-> template consumes<typename Selector::collection>(cfg.template getParameter<edm::InputTag>("src"))),
46  filter_(false),
47  selector_(cfg, this->consumesCollector()),
48  sizeSelector_(reco::modules::make<SizeSelector>(cfg)),
49  postProcessor_(cfg, this->consumesCollector()) {
50  const std::string filter("filter");
51  std::vector<std::string> bools = cfg.template getParameterNamesForType<bool>();
52  bool found = std::find(bools.begin(), bools.end(), filter) != bools.end();
53  if (found) filter_ = cfg.template getParameter<bool>(filter);
54  postProcessor_.init(* this);
55  }
bool filter(edm::Event &evt, const edm::EventSetup &es)
process one event
edm::EDGetTokenT< typename Selector::collection > srcToken_
source collection label
SizeSelector sizeSelector_
selected object collection size selector
bool filter_
filter event
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
PostProcessor postProcessor_
post processor
Selector selector_
Object collection selector.
template<typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<typename Selector::collection>::type, typename SizeSelector = NonNullNumberSelector, typename PostProcessor = ::helper::NullPostProcessor<OutputCollection, edm::EDFilter>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::base, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
virtual ObjectSelector< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::~ObjectSelector ( )
inlinevirtual

destructor

Definition at line 57 of file ObjectSelector.h.

57 { }

Member Function Documentation

template<typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<typename Selector::collection>::type, typename SizeSelector = NonNullNumberSelector, typename PostProcessor = ::helper::NullPostProcessor<OutputCollection, edm::EDFilter>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::base, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
bool ObjectSelector< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::filter ( edm::Event evt,
const edm::EventSetup es 
)
inlineprivate

process one event

Definition at line 61 of file ObjectSelector.h.

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), ObjectSelector< SingleElementCollectionSelector< InputCollection, Selector, reco::CandidateCollection, StoreContainer, RefAdder >, reco::CandidateCollection, NonNullNumberSelector >::ObjectSelector(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

61  {
62  Init::init(selector_, evt, es);
63  using namespace std;
66  StoreManager manager(source);
67  selector_.select(source, evt, es);
68  manager.cloneAndStore(selector_.begin(), selector_.end(), evt);
69  bool result = (! filter_ || sizeSelector_(manager.size()));
71  postProcessor_.process(filtered, evt);
72  return result;
73  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
int init
Definition: HydjetWrapper.h:67
edm::EDGetTokenT< typename Selector::collection > srcToken_
source collection label
SizeSelector sizeSelector_
selected object collection size selector
bool filter_
filter event
static const TGPicture * filtered(bool iBackgroundIsBlack)
tuple result
Definition: query.py:137
PostProcessor postProcessor_
post processor
Selector selector_
Object collection selector.
static std::string const source
Definition: EdmProvDump.cc:43

Member Data Documentation

template<typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<typename Selector::collection>::type, typename SizeSelector = NonNullNumberSelector, typename PostProcessor = ::helper::NullPostProcessor<OutputCollection, edm::EDFilter>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::base, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
bool ObjectSelector< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::filter_
private
template<typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<typename Selector::collection>::type, typename SizeSelector = NonNullNumberSelector, typename PostProcessor = ::helper::NullPostProcessor<OutputCollection, edm::EDFilter>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::base, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
PostProcessor ObjectSelector< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::postProcessor_
private
template<typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<typename Selector::collection>::type, typename SizeSelector = NonNullNumberSelector, typename PostProcessor = ::helper::NullPostProcessor<OutputCollection, edm::EDFilter>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::base, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
Selector ObjectSelector< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::selector_
private
template<typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<typename Selector::collection>::type, typename SizeSelector = NonNullNumberSelector, typename PostProcessor = ::helper::NullPostProcessor<OutputCollection, edm::EDFilter>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::base, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
SizeSelector ObjectSelector< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::sizeSelector_
private
template<typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<typename Selector::collection>::type, typename SizeSelector = NonNullNumberSelector, typename PostProcessor = ::helper::NullPostProcessor<OutputCollection, edm::EDFilter>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection, edm::EDFilter>::base, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
edm::EDGetTokenT<typename Selector::collection> ObjectSelector< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::srcToken_
private