CMS 3D CMS Logo

Public Member Functions | Protected Attributes

Filter Class Reference

#include <Selections.h>

Inheritance diagram for Filter:
FilterOR

List of all members.

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.

: inverted_(false), selector_(0){}
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_.

                                                   : 
    name_(name),inverted_(false), selector_(0)
  {
    dump_=iConfig.dump();
    if (!iConfig.empty()){
      const std::string d("name");
      iConfig.addUntrackedParameter<std::string>(d,name);
      std::string componentName = iConfig.getParameter<std::string>("selector");
      selector_ = EventSelectorFactory::get()->create(componentName, iConfig);
      if (iConfig.exists("description"))
        description_=iConfig.getParameter<std::vector<std::string> >("description");
      else
        description_=selector_->description();
    }
  }
virtual Filter::~Filter ( ) [inline, virtual]

Definition at line 28 of file Selections.h.

{}

Member Function Documentation

virtual bool Filter::accept ( edm::Event iEvent) const [inline, virtual]

Reimplemented in FilterOR.

Definition at line 39 of file Selections.h.

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

                                              {
    bool decision=false;
    if (selector_)
      decision=selector_->select(iEvent);
    else
      decision=true;
    if (inverted_) return !decision;
    else return decision;
  }
const std::vector<std::string> Filter::description ( ) [inline]

Definition at line 32 of file Selections.h.

References description_.

{ return description_;}
const std::string Filter::descriptionText ( ) [inline]

Definition at line 33 of file Selections.h.

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

                                    { 
    std::string text;
    for (unsigned int i=0;i!=description_.size();++i) text+=description_[i]+"\n";
    text+=dump()+"\n";
    return text;}
const std::string& Filter::dump ( void  ) [inline]

Definition at line 31 of file Selections.h.

References dump_.

Referenced by descriptionText().

{ return dump_;}
const std::string& Filter::name ( void  ) [inline]

Definition at line 30 of file Selections.h.

References name_.

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

{return name_;}
void Filter::setInverted ( ) [inline]

Definition at line 48 of file Selections.h.

References inverted_.

{    inverted_=true; }

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

Definition at line 54 of file Selections.h.

Referenced by accept(), and Filter().