CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
Filter Class Reference

#include <Selections.h>

Inheritance diagram for Filter:
FilterOR

Public Member Functions

virtual bool accept (edm::Event &iEvent) const
 
const std::vector< std::string > description ()
 
const std::string descriptionText ()
 
const std::string & dump ()
 
 Filter ()
 
 Filter (const edm::ParameterSet &iConfig)
 
 Filter (std::string name, edm::ParameterSet &iConfig)
 
const std::string & name ()
 
void setInverted ()
 
virtual ~Filter ()
 

Protected Attributes

std::vector< std::string > description_
 
std::string dump_
 
bool inverted_
 
std::string name_
 
EventSelectorselector_
 

Detailed Description

Definition at line 9 of file Selections.h.

Constructor & Destructor Documentation

Filter::Filter ( )
inline

Definition at line 11 of file Selections.h.

11 : inverted_(false), selector_(0){}
EventSelector * selector_
Definition: Selections.h:54
bool inverted_
Definition: Selections.h:53
Filter::Filter ( const edm::ParameterSet iConfig)
Filter::Filter ( std::string  name,
edm::ParameterSet iConfig 
)
inline

Definition at line 13 of file Selections.h.

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

13  :
14  name_(name),inverted_(false), selector_(0)
15  {
16  dump_=iConfig.dump();
17  if (!iConfig.empty()){
18  const std::string d("name");
19  iConfig.addUntrackedParameter<std::string>(d,name);
20  std::string componentName = iConfig.getParameter<std::string>("selector");
21  selector_ = EventSelectorFactory::get()->create(componentName, iConfig);
22  if (iConfig.exists("description"))
23  description_=iConfig.getParameter<std::vector<std::string> >("description");
24  else
25  description_=selector_->description();
26  }
27  }
T getParameter(std::string const &) const
bool empty() const
Definition: ParameterSet.h:219
std::vector< std::string > description_
Definition: Selections.h:52
std::string dump_
Definition: Selections.h:55
bool exists(std::string const &parameterName) const
checks if a parameter exists
const std::string & name()
Definition: Selections.h:30
EventSelector * selector_
Definition: Selections.h:54
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:209
std::string name_
Definition: Selections.h:51
bool inverted_
Definition: Selections.h:53
std::string dump() const
T get(const Candidate &c)
Definition: component.h:56
virtual Filter::~Filter ( )
inlinevirtual

Definition at line 28 of file Selections.h.

28 {}

Member Function Documentation

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

Reimplemented in FilterOR.

Definition at line 39 of file Selections.h.

References inverted_, EventSelector::select(), and selector_.

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

39  {
40  bool decision=false;
41  if (selector_)
42  decision=selector_->select(iEvent);
43  else
44  decision=true;
45  if (inverted_) return !decision;
46  else return decision;
47  }
virtual bool select(const edm::Event &) const =0
decision of the selector module
EventSelector * selector_
Definition: Selections.h:54
bool inverted_
Definition: Selections.h:53
const std::vector<std::string> Filter::description ( )
inline

Definition at line 32 of file Selections.h.

References description_.

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

Definition at line 33 of file Selections.h.

References description_, dump(), i, and runonSM::text.

33  {
34  std::string text;
35  for (unsigned int i=0;i!=description_.size();++i) text+=description_[i]+"\n";
36  text+=dump()+"\n";
37  return text;}
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > description_
Definition: Selections.h:52
const std::string & dump()
Definition: Selections.h:31
tuple text
Definition: runonSM.py:42
const std::string& Filter::dump ( void  )
inline

Definition at line 31 of file Selections.h.

References dump_.

Referenced by descriptionText().

31 { return dump_;}
std::string dump_
Definition: Selections.h:55
const std::string& Filter::name ( void  )
inline

Definition at line 30 of file Selections.h.

References name_.

Referenced by Filter(), and ConfigurableAnalysis::filter().

30 {return name_;}
std::string name_
Definition: Selections.h:51
void Filter::setInverted ( )
inline

Definition at line 48 of file Selections.h.

References inverted_.

48 { inverted_=true; }
bool inverted_
Definition: Selections.h:53

Member Data Documentation

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

Definition at line 52 of file Selections.h.

Referenced by description(), descriptionText(), Filter(), and FilterOR::FilterOR().

std::string Filter::dump_
protected

Definition at line 55 of file Selections.h.

Referenced by dump(), and Filter().

bool Filter::inverted_
protected

Definition at line 53 of file Selections.h.

Referenced by accept(), and setInverted().

std::string Filter::name_
protected

Definition at line 51 of file Selections.h.

Referenced by FilterOR::FilterOR(), and name().

EventSelector* Filter::selector_
protected

Definition at line 54 of file Selections.h.

Referenced by accept(), and Filter().