CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
fwlite::ObjectCountSelector< Collection > Class Template Reference

#include <EventSelectors.h>

Inheritance diagram for fwlite::ObjectCountSelector< Collection >:
fwlite::EventSelector

Public Member Functions

bool accept (const fwlite::EventBase &ev) const override
 
 ObjectCountSelector (const char *label, const char *instance, const char *process, const char *cut, int minNumber=1, int maxNumber=-1)
 
void setCut (const char *cut)
 
void setIgnoreExceptions (bool ignoreThem=true)
 
void setMax (int maxNumber)
 
void setMin (int minNumber)
 
 ~ObjectCountSelector () override
 
- Public Member Functions inherited from fwlite::EventSelector
 EventSelector (const char *name="", const char *title="")
 
 ~EventSelector () override
 

Protected Types

typedef fwlite::Handle< Collection > HandleT
 

Protected Member Functions

 ObjectCountSelector (const fwlite::ObjectCountSelector< Collection > &other)
 
ObjectCountSelectoroperator= (const fwlite::ObjectCountSelector< Collection > &other)
 

Protected Attributes

std::string instance_
 
std::string label_
 
int max_
 
int min_
 
std::string process_
 
helper::ScannerBasescanner
 

Detailed Description

template<typename Collection>
class fwlite::ObjectCountSelector< Collection >

Definition at line 60 of file EventSelectors.h.

Member Typedef Documentation

◆ HandleT

template<typename Collection>
typedef fwlite::Handle<Collection> fwlite::ObjectCountSelector< Collection >::HandleT
protected

Definition at line 95 of file EventSelectors.h.

Constructor & Destructor Documentation

◆ ObjectCountSelector() [1/2]

template<typename Collection>
fwlite::ObjectCountSelector< Collection >::ObjectCountSelector ( const char *  label,
const char *  instance,
const char *  process,
const char *  cut,
int  minNumber = 1,
int  maxNumber = -1 
)
inline

◆ ~ObjectCountSelector()

template<typename Collection>
fwlite::ObjectCountSelector< Collection >::~ObjectCountSelector ( )
inlineoverride

Definition at line 77 of file EventSelectors.h.

77 { delete scanner; }

References fwlite::ObjectCountSelector< Collection >::scanner.

◆ ObjectCountSelector() [2/2]

template<typename Collection>
fwlite::ObjectCountSelector< Collection >::ObjectCountSelector ( const fwlite::ObjectCountSelector< Collection > &  other)
protected

Member Function Documentation

◆ accept()

template<typename Collection>
bool fwlite::ObjectCountSelector< Collection >::accept ( const fwlite::EventBase ev) const
inlineoverridevirtual

Implements fwlite::EventSelector.

Definition at line 78 of file EventSelectors.h.

78  {
79  int nfound = 0;
80  HandleT handle; // here, not as a datamember, otherwise CINT segfaults (!?)
81  handle.getByLabel(ev, label_.c_str(), instance_.c_str(), process_.c_str());
82  const Collection &vals = *handle;
83  for (size_t j = 0, n = vals.size(); j < n; ++j) {
84  if (scanner->test(&vals[j]))
85  nfound++;
86  }
87  return (nfound >= min_ && (max_ == -1 || nfound <= max_));
88  }

References ev, patZpeak::handle, fwlite::ObjectCountSelector< Collection >::instance_, dqmiolumiharvest::j, fwlite::ObjectCountSelector< Collection >::label_, fwlite::ObjectCountSelector< Collection >::max_, fwlite::ObjectCountSelector< Collection >::min_, dqmiodumpmetadata::n, contentValuesCheck::nfound, fwlite::ObjectCountSelector< Collection >::process_, fwlite::ObjectCountSelector< Collection >::scanner, and helper::ScannerBase::test().

Referenced by esMonitoring.FDJsonServer::handle_accept().

◆ operator=()

template<typename Collection>
ObjectCountSelector& fwlite::ObjectCountSelector< Collection >::operator= ( const fwlite::ObjectCountSelector< Collection > &  other)
protected

◆ setCut()

template<typename Collection>
void fwlite::ObjectCountSelector< Collection >::setCut ( const char *  cut)
inline

◆ setIgnoreExceptions()

template<typename Collection>
void fwlite::ObjectCountSelector< Collection >::setIgnoreExceptions ( bool  ignoreThem = true)
inline

◆ setMax()

template<typename Collection>
void fwlite::ObjectCountSelector< Collection >::setMax ( int  maxNumber)
inline

◆ setMin()

template<typename Collection>
void fwlite::ObjectCountSelector< Collection >::setMin ( int  minNumber)
inline

Member Data Documentation

◆ instance_

template<typename Collection>
std::string fwlite::ObjectCountSelector< Collection >::instance_
protected

Definition at line 96 of file EventSelectors.h.

Referenced by fwlite::ObjectCountSelector< Collection >::accept().

◆ label_

template<typename Collection>
std::string fwlite::ObjectCountSelector< Collection >::label_
protected

◆ max_

template<typename Collection>
int fwlite::ObjectCountSelector< Collection >::max_
protected

◆ min_

template<typename Collection>
int fwlite::ObjectCountSelector< Collection >::min_
protected

◆ process_

template<typename Collection>
std::string fwlite::ObjectCountSelector< Collection >::process_
protected

Definition at line 96 of file EventSelectors.h.

Referenced by fwlite::ObjectCountSelector< Collection >::accept().

◆ scanner

template<typename Collection>
helper::ScannerBase* fwlite::ObjectCountSelector< Collection >::scanner
protected
fwlite::ObjectCountSelector::process_
std::string process_
Definition: EventSelectors.h:96
contentValuesCheck.nfound
nfound
Definition: contentValuesCheck.py:80
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
helper::ScannerBase
Definition: ScannerHelpers.h:44
patZpeak.handle
handle
Definition: patZpeak.py:23
analysisFilters_cff.maxNumber
maxNumber
Definition: analysisFilters_cff.py:61
helper::Parser::elementType
static edm::TypeWithDict elementType(const edm::TypeWithDict &wrapperType)
Perform the type deduction form edm::Wrapper<C> to C::value_type and resolves typedefs.
Definition: ScannerHelpers.cc:42
fwlite::ObjectCountSelector::scanner
helper::ScannerBase * scanner
Definition: EventSelectors.h:98
fwlite::ObjectCountSelector::HandleT
fwlite::Handle< Collection > HandleT
Definition: EventSelectors.h:95
fwlite::ObjectCountSelector::min_
int min_
Definition: EventSelectors.h:97
edm::TypeWithDict
Definition: TypeWithDict.h:38
fwlite::ObjectCountSelector::instance_
std::string instance_
Definition: EventSelectors.h:96
helper::ScannerBase::setCut
bool setCut(const char *cut)
Set the default cut that is applied to the events.
Definition: ScannerHelpers.cc:78
edm::Wrapper::typeInfo
static std::type_info const & typeInfo()
Definition: Wrapper.h:43
instance
static PFTauRenderPlugin instance
Definition: PFTauRenderPlugin.cc:70
PA_ZEESkim_cff.minNumber
minNumber
Definition: PA_ZEESkim_cff.py:34
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
helper::ScannerBase::test
bool test(const void *obj, size_t icut=0) const
Definition: ScannerHelpers.cc:103
helper::ScannerBase::setIgnoreExceptions
void setIgnoreExceptions(bool ignoreThem)
Definition: ScannerHelpers.h:100
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
fwlite::ObjectCountSelector::label_
std::string label_
Definition: EventSelectors.h:96
fwlite::ObjectCountSelector::max_
int max_
Definition: EventSelectors.h:97
label
const char * label
Definition: PFTauDecayModeTools.cc:11