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, edm::ConsumesCollector &&iC)
 
 StringCutsEventSelector (const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
 
 ~StringCutsEventSelector ()
 
- Public Member Functions inherited from EventSelector
const std::vector< std::string > & description ()
 
 EventSelector ()
 
 EventSelector (const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC)
 
 EventSelector (const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
const std::string & name () const
 name of the module (from configuration) More...
 
virtual ~EventSelector ()
 

Private Attributes

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

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 55 of file StringCutEventSelector.h.

Constructor & Destructor Documentation

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

Definition at line 57 of file StringCutEventSelector.h.

57  :
58  StringCutsEventSelector(pset, iC) {}
StringCutsEventSelector(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
template<typename Object , bool existenceMatter = true>
StringCutsEventSelector< Object, existenceMatter >::StringCutsEventSelector ( const edm::ParameterSet pset,
edm::ConsumesCollector iC 
)
inline

Definition at line 59 of file StringCutEventSelector.h.

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

59  :
60  EventSelector(pset, iC),
61  src_(edm::Service<InputTagDistributorService>()->retrieve("src",pset)),
63  {
64  std::vector<std::string> selection=pset.getParameter<std::vector<std::string > >("cut");
65  std::stringstream ss;
66  ss<<"string cut based selection on collection: "<<src_;
67  description_.push_back(ss.str()); ss.str("");
68  description_.push_back("selection cuts are:");
69  for (unsigned int i=0;i!=selection.size();i++)
70  if (selection[i]!="-"){
71  f_.push_back( new StringCutObjectSelector<Object>(selection[i]));
72  ss<<"["<<i<<"]: "<<selection[i];
73  description_.push_back(ss.str()); ss.str("");
74  }
75  else
76  {
77  f_.push_back(0);
78  ss<<"["<<i<<"]: no selection";
79  description_.push_back(ss.str()); ss.str("");
80  }
81  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
selection
main part
Definition: corrVsCorr.py:98
std::vector< StringCutObjectSelector< Object > * > f_
edm::EDGetTokenT< edm::View< Object > > srcToken_
std::vector< std::string > description_
Definition: EventSelector.h:34
template<typename Object , bool existenceMatter = true>
StringCutsEventSelector< Object, existenceMatter >::~StringCutsEventSelector ( )
inline

Definition at line 82 of file StringCutEventSelector.h.

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

82 {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 84 of file StringCutEventSelector.h.

References StringCutsEventSelector< Object, existenceMatter >::f_, edm::Event::getByToken(), i, python.connectstrParser::o, and StringCutsEventSelector< Object, existenceMatter >::srcToken_.

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

84  {
86  e.getByToken(srcToken_, oH);
87  unsigned int i=0;
88  if (existenceMatter && oH->size()<f_.size()) return false;
89  for (;i!=f_.size();i++)
90  {
91  if (!existenceMatter && i==oH->size()) break;
92  if (!f_[i]) continue;
93  const Object & o = (*oH)[i];
94  if (!(*f_[i])(o)) return false;
95  }
96  return true;
97  }
int i
Definition: DBlmapReader.cc:9
std::vector< StringCutObjectSelector< Object > * > f_
edm::EDGetTokenT< edm::View< Object > > srcToken_

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
template<typename Object , bool existenceMatter = true>
edm::EDGetTokenT<edm::View<Object> > StringCutsEventSelector< Object, existenceMatter >::srcToken_
private