CMS 3D CMS Logo

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...
 
 ~ObjectSelector () 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 ::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

◆ ObjectSelector()

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.

44  : Base(cfg),
45  srcToken_(
46  this->template consumes<typename Selector::collection>(cfg.template getParameter<edm::InputTag>("src"))),
47  filter_(false),
48  selector_(cfg, this->consumesCollector()),
49  sizeSelector_(reco::modules::make<SizeSelector>(cfg)),
50  postProcessor_(cfg, this->consumesCollector()) {
51  const std::string filter("filter");
52  std::vector<std::string> bools = cfg.template getParameterNamesForType<bool>();
53  bool found = std::find(bools.begin(), bools.end(), filter) != bools.end();
54  if (found)
55  filter_ = cfg.template getParameter<bool>(filter);
56  postProcessor_.init(*this);
57  }

◆ ~ObjectSelector()

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 ( )
inlineoverride

destructor

Definition at line 59 of file ObjectSelector.h.

59 {}

Member Function Documentation

◆ filter()

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 
)
inlineoverrideprivate

process one event

Definition at line 63 of file ObjectSelector.h.

63  {
64  Init::init(selector_, evt, es);
65  using namespace std;
68  StoreManager manager(source);
69  selector_.select(source, evt, es);
70  manager.cloneAndStore(selector_.begin(), selector_.end(), evt);
71  bool result = (!filter_ || sizeSelector_(manager.size()));
73  postProcessor_.process(filtered, evt);
74  return result;
75  }

Referenced by ObjectSelector< SingleElementCollectionSelector< InputCollection, Selector, reco::CandidateCollection, StoreContainer, RefAdder >, reco::CandidateCollection, NonNullNumberSelector >::ObjectSelector().

Member Data Documentation

◆ filter_

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

◆ postProcessor_

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

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

◆ sizeSelector_

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

◆ srcToken_

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
init
int init
Definition: HydjetWrapper.h:64
ObjectSelector::sizeSelector_
SizeSelector sizeSelector_
selected object collection size selector
Definition: ObjectSelector.h:83
ObjectSelector::selector_
Selector selector_
Object collection selector.
Definition: ObjectSelector.h:81
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::Handle
Definition: AssociativeIterator.h:50
ObjectSelector::postProcessor_
PostProcessor postProcessor_
post processor
Definition: ObjectSelector.h:85
CustomConfigs.Base
def Base(process)
Definition: CustomConfigs.py:17
source
static const std::string source
Definition: EdmProvDump.cc:47
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:531
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
filtered
static const TGPicture * filtered(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:100
looper.cfg
cfg
Definition: looper.py:297
ObjectSelector::filter_
bool filter_
filter event
Definition: ObjectSelector.h:79
std
Definition: JetResolutionObject.h:76
edm::OrphanHandle
Definition: EDProductfwd.h:39
ObjectSelector::srcToken_
edm::EDGetTokenT< typename Selector::collection > srcToken_
source collection label
Definition: ObjectSelector.h:77
mps_fire.result
result
Definition: mps_fire.py:311
ObjectSelector::filter
bool filter(edm::Event &evt, const edm::EventSetup &es) override
process one event
Definition: ObjectSelector.h:63