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
StringCutsEventSelector< Object, existenceMatter > Class Template Reference

#include <StringCutEventSelector.h>

Inheritance diagram for StringCutsEventSelector< Object, existenceMatter >:
EventSelector

Public Member Functions

bool select (const edm::Event &e) const
 decision of the selector module More...
 
 StringCutsEventSelector (const edm::ParameterSet &pset)
 
 ~StringCutsEventSelector ()
 
- 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

std::vector
< StringCutObjectSelector
< Object > * > 
f_
 
edm::InputTag src_
 

Additional Inherited Members

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

Detailed Description

template<typename Object, bool existenceMatter = true>
class StringCutsEventSelector< Object, existenceMatter >

Definition at line 50 of file StringCutEventSelector.h.

Constructor & Destructor Documentation

template<typename Object , bool existenceMatter = true>
StringCutsEventSelector< Object, existenceMatter >::StringCutsEventSelector ( const edm::ParameterSet pset)
inline

Definition at line 52 of file StringCutEventSelector.h.

References EventSelector::description_, StringCutsEventSelector< Object, existenceMatter >::f_, edm::ParameterSet::getParameter(), i, corrVsCorr::selection, and StringCutsEventSelector< Object, existenceMatter >::src_.

52  :
53  EventSelector(pset),
54  src_(edm::Service<InputTagDistributorService>()->retrieve("src",pset))
55  {
56  std::vector<std::string> selection=pset.getParameter<std::vector<std::string > >("cut");
57  std::stringstream ss;
58  ss<<"string cut based selection on collection: "<<src_;
59  description_.push_back(ss.str()); ss.str("");
60  description_.push_back("selection cuts are:");
61  for (unsigned int i=0;i!=selection.size();i++)
62  if (selection[i]!="-"){
63  f_.push_back( new StringCutObjectSelector<Object>(selection[i]));
64  ss<<"["<<i<<"]: "<<selection[i];
65  description_.push_back(ss.str()); ss.str("");
66  }
67  else
68  {
69  f_.push_back(0);
70  ss<<"["<<i<<"]: no selection";
71  description_.push_back(ss.str()); ss.str("");
72  }
73  }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > description_
Definition: EventSelector.h:31
selection
main part
Definition: corrVsCorr.py:98
std::vector< StringCutObjectSelector< Object > * > f_
template<typename Object , bool existenceMatter = true>
StringCutsEventSelector< Object, existenceMatter >::~StringCutsEventSelector ( )
inline

Definition at line 74 of file StringCutEventSelector.h.

References StringCutsEventSelector< Object, existenceMatter >::f_, and i.

74 {unsigned int i=0; for (;i!=f_.size();i++) if (f_[i]){ delete f_[i];f_[i]=0;}}
int i
Definition: DBlmapReader.cc:9
std::vector< StringCutObjectSelector< Object > * > f_

Member Function Documentation

template<typename Object , bool existenceMatter = true>
bool StringCutsEventSelector< Object, existenceMatter >::select ( const edm::Event ) const
inlinevirtual

decision of the selector module

Implements EventSelector.

Definition at line 76 of file StringCutEventSelector.h.

References StringCutsEventSelector< Object, existenceMatter >::f_, edm::Event::getByLabel(), i, python.connectstrParser::o, and StringCutsEventSelector< Object, existenceMatter >::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().

76  {
78  e.getByLabel(src_, oH);
79  unsigned int i=0;
80  if (existenceMatter && oH->size()<f_.size()) return false;
81  for (;i!=f_.size();i++)
82  {
83  if (!existenceMatter && i==oH->size()) break;
84  if (!f_[i]) continue;
85  const Object & o = (*oH)[i];
86  if (!(*f_[i])(o)) return false;
87  }
88  return true;
89  }
int i
Definition: DBlmapReader.cc:9
std::vector< StringCutObjectSelector< Object > * > f_

Member Data Documentation

template<typename Object , bool existenceMatter = true>
std::vector<StringCutObjectSelector<Object> *> StringCutsEventSelector< Object, existenceMatter >::f_
private
template<typename Object , bool existenceMatter = true>
edm::InputTag StringCutsEventSelector< Object, existenceMatter >::src_
private