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, edm::ConsumesCollector &&iC)
 
 StringCutEventSelector (const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
 
- 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

StringCutObjectSelector< Object > f_
 
unsigned int nFirst_
 
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>
class StringCutEventSelector< Object >

Definition at line 11 of file StringCutEventSelector.h.

Constructor & Destructor Documentation

template<typename Object >
StringCutEventSelector< Object >::StringCutEventSelector ( const edm::ParameterSet pset,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 13 of file StringCutEventSelector.h.

13  :
14  StringCutEventSelector(pset, iC) {}
StringCutEventSelector(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
template<typename Object >
StringCutEventSelector< Object >::StringCutEventSelector ( const edm::ParameterSet pset,
edm::ConsumesCollector iC 
)
inline

Definition at line 15 of file StringCutEventSelector.h.

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

15  :
16  EventSelector(pset, iC),
17  src_(edm::Service<InputTagDistributorService>()->retrieve("src",pset)),
19  f_(pset.getParameter<std::string>("cut")),
20  //put this guy to 0 to do the check on "all" object in the collection
21  nFirst_(pset.getParameter<unsigned int>("nFirst"))
22  {
23  std::stringstream ss;
24  ss<<"string cut based selection on collection: "<<src_;
25  description_.push_back(ss.str());
26  ss.str("");
27  description_.push_back(std::string("selection cut is: ")+pset.getParameter<std::string>("cut"));
28  }
edm::EDGetTokenT< edm::View< Object > > srcToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
StringCutObjectSelector< Object > f_
std::vector< std::string > description_
Definition: EventSelector.h:34

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

References StringCutEventSelector< Object >::f_, edm::Event::getByToken(), i, StringCutEventSelector< Object >::nFirst_, python.connectstrParser::o, and StringCutEventSelector< Object >::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().

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

Member Data Documentation

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

Definition at line 49 of file StringCutEventSelector.h.

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

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

Definition at line 50 of file StringCutEventSelector.h.

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

template<typename Object >
edm::InputTag StringCutEventSelector< Object >::src_
private
template<typename Object >
edm::EDGetTokenT<edm::View<Object> > StringCutEventSelector< Object >::srcToken_
private

Definition at line 48 of file StringCutEventSelector.h.

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