CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
Filter Class Reference

#include <Selections.h>

Inheritance diagram for Filter:
FilterOR FilterSelection

Public Member Functions

virtual bool accept (edm::Event &iEvent)
 
const std::vector< std::string > description ()
 
const std::string descriptionText ()
 
const std::string & dump ()
 
 Filter ()=default
 
 Filter (const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
 Filter (std::string name, edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
 Filter (const Filter &)=delete
 
 Filter (Filter &&)=default
 
const std::string & name ()
 
Filteroperator= (const Filter &)=delete
 
Filteroperator= (Filter &&)=default
 
virtual ~Filter ()
 

Protected Attributes

bool cached_decision_
 
std::vector< std::string > description_
 
std::string dump_
 
edm::Event::CacheIdentifier_t eventCacheID_ = 0
 
std::string name_
 
std::unique_ptr< EventSelectorselector_
 

Detailed Description

Description: Filter list

Implementation: Filter criteria is defined in XML

Definition at line 12 of file Selections.h.

Constructor & Destructor Documentation

Filter::Filter ( )
default
Filter::Filter ( const edm::ParameterSet iConfig,
edm::ConsumesCollector iC 
)
Filter::Filter ( std::string  name,
edm::ParameterSet iConfig,
edm::ConsumesCollector iC 
)
inline

Definition at line 16 of file Selections.h.

References edm::ParameterSet::addUntrackedParameter(), edmIntegrityCheck::d, description_, edm::ParameterSet::dump(), dump_, edm::ParameterSet::empty(), edm::ParameterSet::exists(), reco::get(), edm::ParameterSet::getParameter(), name(), selector_, and AlCaHLTBitMon_QueryRunRegistry::string.

16  :
18  {
19  dump_=iConfig.dump();
20  if (!iConfig.empty()){
21  const std::string d("name");
23  std::string componentName = iConfig.getParameter<std::string>("selector");
24  selector_ = std::unique_ptr<EventSelector>(EventSelectorFactoryFromHelper::get()->create(componentName, iConfig, iC));
25  if (iConfig.exists("description"))
26  description_=iConfig.getParameter<std::vector<std::string> >("description");
27  else
28  description_=selector_->description();
29  }
30  }
T getParameter(std::string const &) const
bool empty() const
Definition: ParameterSet.h:191
std::vector< std::string > description_
Definition: Selections.h:65
std::string dump_
Definition: Selections.h:69
std::string dump(unsigned int indent=0) const
edm::Event::CacheIdentifier_t eventCacheID_
Definition: Selections.h:68
bool exists(std::string const &parameterName) const
checks if a parameter exists
bool cached_decision_
Definition: Selections.h:67
const std::string & name()
Definition: Selections.h:38
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:182
std::unique_ptr< EventSelector > selector_
Definition: Selections.h:66
std::string name_
Definition: Selections.h:64
T get(const Candidate &c)
Definition: component.h:55
virtual Filter::~Filter ( )
inlinevirtual

Definition at line 31 of file Selections.h.

References Filter(), and operator=().

31 {}
Filter::Filter ( const Filter )
delete
Filter::Filter ( Filter &&  )
default

Member Function Documentation

virtual bool Filter::accept ( edm::Event iEvent)
inlinevirtual

Reimplemented in FilterSelection, and FilterOR.

Definition at line 47 of file Selections.h.

References cached_decision_, edm::Event::cacheIdentifier(), eventCacheID_, SiStripPI::max, and selector_.

Referenced by Vispa.Gui.BoxContentDialog.BoxContentDialog::apply(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog::apply(), and esMonitoring.FDJsonServer::handle_accept().

47  {
48  bool decision=false;
51 
52  if (selector_)
53  decision=selector_->select(iEvent);
54  else
55  decision=true;
56  cached_decision_ = decision;
57  }else{
58  decision = cached_decision_;
59  }
60  return decision;
61  }
edm::Event::CacheIdentifier_t eventCacheID_
Definition: Selections.h:68
bool cached_decision_
Definition: Selections.h:67
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:35
std::unique_ptr< EventSelector > selector_
Definition: Selections.h:66
const std::vector<std::string> Filter::description ( )
inline

Definition at line 40 of file Selections.h.

References description_.

Referenced by FilterSelection::print().

40 { return description_;}
std::vector< std::string > description_
Definition: Selections.h:65
const std::string Filter::descriptionText ( )
inline

Definition at line 41 of file Selections.h.

References description_, dump(), mps_fire::i, AlCaHLTBitMon_QueryRunRegistry::string, and RecoTauValidation_cfi::text.

41  {
43  for (unsigned int i=0;i!=description_.size();++i) text+=description_[i]+"\n";
44  text+=dump()+"\n";
45  return text;}
std::vector< std::string > description_
Definition: Selections.h:65
const std::string & dump()
Definition: Selections.h:39
const std::string& Filter::dump ( void  )
inline

Definition at line 39 of file Selections.h.

References dump_.

Referenced by descriptionText().

39 { return dump_;}
std::string dump_
Definition: Selections.h:69
const std::string& Filter::name ( void  )
inline
Filter& Filter::operator= ( const Filter )
delete
Filter& Filter::operator= ( Filter &&  )
default

Member Data Documentation

bool Filter::cached_decision_
mutableprotected

Definition at line 67 of file Selections.h.

Referenced by accept(), FilterSelection::accept(), and FilterSelection::acceptMap().

std::vector<std::string> Filter::description_
protected
std::string Filter::dump_
protected

Definition at line 69 of file Selections.h.

Referenced by dump(), and Filter().

edm::Event::CacheIdentifier_t Filter::eventCacheID_ = 0
mutableprotected

Definition at line 68 of file Selections.h.

Referenced by accept(), FilterSelection::accept(), and FilterSelection::acceptMap().

std::string Filter::name_
protected
std::unique_ptr<EventSelector> Filter::selector_
protected

Definition at line 66 of file Selections.h.

Referenced by accept(), and Filter().