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::InputTag src_
 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 38 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 41 of file ObjectSelector.h.

41  :
42  Base(cfg),
43  src_(cfg.template getParameter<edm::InputTag>("src")),
44  filter_(false),
45  selector_(cfg),
46  sizeSelector_(reco::modules::make<SizeSelector>(cfg)),
47  postProcessor_(cfg) {
48  const std::string filter("filter");
49  std::vector<std::string> bools = cfg.template getParameterNamesForType<bool>();
50  bool found = std::find(bools.begin(), bools.end(), filter) != bools.end();
51  if (found) filter_ = cfg.template getParameter<bool>(filter);
52  postProcessor_.init(* this);
53  }
bool filter(edm::Event &evt, const edm::EventSetup &es)
process one event
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
edm::InputTag src_
source collection label
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 55 of file ObjectSelector.h.

55 { }

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

59  {
60  Init::init(selector_, evt, es);
61  using namespace std;
63  evt.getByLabel(src_, source);
64  StoreManager manager(source);
65  selector_.select(source, evt, es);
66  manager.cloneAndStore(selector_.begin(), selector_.end(), evt);
67  bool result = (! filter_ || sizeSelector_(manager.size()));
69  postProcessor_.process(filtered, evt);
70  return result;
71  }
int init
Definition: HydjetWrapper.h:63
SizeSelector sizeSelector_
selected object collection size selector
bool filter_
filter event
static const TGPicture * filtered(bool iBackgroundIsBlack)
tuple result
Definition: query.py:137
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
PostProcessor postProcessor_
post processor
edm::InputTag src_
source collection label
Selector selector_
Object collection selector.

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::InputTag ObjectSelector< Selector, OutputCollection, SizeSelector, PostProcessor, StoreManager, Base, Init >::src_
private