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
RecoTauPileUpVertexSelector Class Reference
Inheritance diagram for RecoTauPileUpVertexSelector:
edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

bool filter (edm::Event &evt, const edm::EventSetup &es)
 
 RecoTauPileUpVertexSelector (const edm::ParameterSet &pset)
 
 ~RecoTauPileUpVertexSelector ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

bool filter_
 
edm::InputTag src_
 
VertexTrackPtSumFilter vtxFilter_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 40 of file RecoTauPileUpVertexSelector.cc.

Constructor & Destructor Documentation

RecoTauPileUpVertexSelector::RecoTauPileUpVertexSelector ( const edm::ParameterSet pset)
explicit

Definition at line 51 of file RecoTauPileUpVertexSelector.cc.

References edm::ParameterSet::exists(), filter_, edm::ParameterSet::getParameter(), and src_.

52  :vtxFilter_(
53  pset.getParameter<double>("minTrackSumPt")) {
54  src_ = pset.getParameter<edm::InputTag>("src");
55  filter_ = pset.exists("filter") ? pset.getParameter<bool>("filter") : false;
56  produces<reco::VertexCollection>();
57 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
RecoTauPileUpVertexSelector::~RecoTauPileUpVertexSelector ( )
inline

Definition at line 43 of file RecoTauPileUpVertexSelector.cc.

43 {}

Member Function Documentation

bool RecoTauPileUpVertexSelector::filter ( edm::Event evt,
const edm::EventSetup es 
)
virtual

Implements edm::EDFilter.

Definition at line 60 of file RecoTauPileUpVertexSelector.cc.

References filter_, edm::Event::getByLabel(), convertSQLitetoXML_cfg::output, edm::Event::put(), src_, and vtxFilter_.

61  {
63  evt.getByLabel(src_, vertices_);
64  std::auto_ptr<reco::VertexCollection> output(new reco::VertexCollection);
65  // If there is only one vertex, there are no PU vertices!
66  if (vertices_->size() > 1) {
67  // Copy over all the vertices that have associatd tracks with pt greater
68  // than the threshold. The predicate function is the VertexTrackPtSumFilter
69  // better name: copy_if_not
70  std::remove_copy_if(vertices_->begin()+1, vertices_->end(),
71  std::back_inserter(*output), std::not1(vtxFilter_));
72  }
73  size_t nPUVtx = output->size();
74  evt.put(output);
75  // If 'filter' is enabled, return whether true if there are PU vertices
76  if (!filter_)
77  return true;
78  else
79  return nPUVtx;
80 }
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355

Member Data Documentation

bool RecoTauPileUpVertexSelector::filter_
private

Definition at line 48 of file RecoTauPileUpVertexSelector.cc.

Referenced by filter(), and RecoTauPileUpVertexSelector().

edm::InputTag RecoTauPileUpVertexSelector::src_
private

Definition at line 46 of file RecoTauPileUpVertexSelector.cc.

Referenced by filter(), and RecoTauPileUpVertexSelector().

VertexTrackPtSumFilter RecoTauPileUpVertexSelector::vtxFilter_
private

Definition at line 47 of file RecoTauPileUpVertexSelector.cc.

Referenced by filter().