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>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection>::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>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection>::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 42 of file ObjectSelector.h.

42  :
43  Base(cfg),
44  srcToken_(edm::EDFilter::consumes<typename Selector::collection>(cfg.template getParameter<edm::InputTag>("src"))),
45  filter_(false),
47  sizeSelector_(reco::modules::make<SizeSelector>(cfg)),
49  const std::string filter("filter");
50  std::vector<std::string> bools = cfg.template getParameterNamesForType<bool>();
51  bool found = std::find(bools.begin(), bools.end(), filter) != bools.end();
52  if (found) filter_ = cfg.template getParameter<bool>(filter);
53  postProcessor_.init(* this);
54  }
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
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
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>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection>::base, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
virtual ObjectSelector< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::~ObjectSelector ( )
inlinevirtual

destructor

Definition at line 56 of file ObjectSelector.h.

56 { }

Member Function Documentation

template<typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<typename Selector::collection>::type, typename SizeSelector = NonNullNumberSelector, typename PostProcessor = ::helper::NullPostProcessor<OutputCollection>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection>::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 60 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().

60  {
61  Init::init(selector_, evt, es);
62  using namespace std;
65  StoreManager manager(source);
66  selector_.select(source, evt, es);
67  manager.cloneAndStore(selector_.begin(), selector_.end(), evt);
68  bool result = (! filter_ || sizeSelector_(manager.size()));
70  postProcessor_.process(filtered, evt);
71  return result;
72  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
int init
Definition: HydjetWrapper.h:62
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>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection>::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>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection>::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>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection>::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>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection>::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>, typename StoreManager = typename ::helper::StoreManagerTrait<OutputCollection>::type, typename Base = typename ::helper::StoreManagerTrait<OutputCollection>::base, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
edm::EDGetTokenT<typename Selector::collection> ObjectSelector< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::srcToken_
private