CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
StringCutEventSelector< Object > Class Template Reference

#include <StringCutEventSelector.h>

Inheritance diagram for StringCutEventSelector< Object >:
EventSelector

Public Member Functions

bool select (const edm::Event &e) const
 decision of the selector module More...
 
 StringCutEventSelector (const edm::ParameterSet &pset)
 
- Public Member Functions inherited from EventSelector
const std::vector< std::string > & description ()
 
const std::vector< std::string > & description ()
 
 EventSelector ()
 
 EventSelector ()
 
 EventSelector (const edm::ParameterSet &iConfig)
 
 EventSelector (const edm::ParameterSet &iConfig)
 
const std::string & name () const
 name of the module (from configuration) More...
 
const std::string & name () const
 name of the module (from configuration) More...
 
virtual ~EventSelector ()
 
virtual ~EventSelector ()
 

Private Attributes

StringCutObjectSelector< Object > f_
 
unsigned int nFirst_
 
edm::InputTag src_
 

Additional Inherited Members

- Protected Attributes inherited from EventSelector
std::vector< std::string > description_
 
std::string name_
 

Detailed Description

template<typename Object>
class StringCutEventSelector< Object >

Definition at line 10 of file StringCutEventSelector.h.

Constructor & Destructor Documentation

template<typename Object >
StringCutEventSelector< Object >::StringCutEventSelector ( const edm::ParameterSet pset)
inline

Definition at line 12 of file StringCutEventSelector.h.

References EventSelector::description_, edm::ParameterSet::getParameter(), StringCutEventSelector< Object >::src_, and AlCaHLTBitMon_QueryRunRegistry::string.

12  :
13  EventSelector(pset),
14  src_(edm::Service<InputTagDistributorService>()->retrieve("src",pset)),
15  f_(pset.getParameter<std::string>("cut")),
16  //put this guy to 0 to do the check on "all" object in the collection
17  nFirst_(pset.getParameter<unsigned int>("nFirst"))
18  {
19  std::stringstream ss;
20  ss<<"string cut based selection on collection: "<<src_;
21  description_.push_back(ss.str());
22  ss.str("");
23  description_.push_back(std::string("selection cut is: ")+pset.getParameter<std::string>("cut"));
24  }
T getParameter(std::string const &) const
std::vector< std::string > description_
Definition: EventSelector.h:31
StringCutObjectSelector< Object > f_

Member Function Documentation

template<typename Object >
bool StringCutEventSelector< Object >::select ( const edm::Event ) const
inlinevirtual

decision of the selector module

Implements EventSelector.

Definition at line 26 of file StringCutEventSelector.h.

References StringCutEventSelector< Object >::f_, edm::Event::getByLabel(), i, StringCutEventSelector< Object >::nFirst_, python.connectstrParser::o, and StringCutEventSelector< Object >::src_.

Referenced by Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), and Vispa.Views.AbstractView.AbstractView::restoreSelection().

26  {
28  e.getByLabel(src_, oH);
29  //reject events if not enough object in collection
30  // if ((nFirst_!=0) && (oH->size()<nFirst_)) return false;
31  unsigned int i=0;
32  for (;i!=oH->size();i++)
33  {
34  //stop doing the check if reaching too far in the collection
35  if ((nFirst_!=0) && (i>=nFirst_)) break;
36  const Object & o = (*oH)[i];
37  if (!f_(o)) return false;
38  }
39  return true;
40  }
int i
Definition: DBlmapReader.cc:9
StringCutObjectSelector< Object > f_

Member Data Documentation

template<typename Object >
StringCutObjectSelector<Object> StringCutEventSelector< Object >::f_
private

Definition at line 44 of file StringCutEventSelector.h.

Referenced by StringCutEventSelector< Object >::select().

template<typename Object >
unsigned int StringCutEventSelector< Object >::nFirst_
private

Definition at line 45 of file StringCutEventSelector.h.

Referenced by StringCutEventSelector< Object >::select().

template<typename Object >
edm::InputTag StringCutEventSelector< Object >::src_
private