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::stream::EDFilter<> edm::stream::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

bool filter (edm::Event &evt, const edm::EventSetup &es) override
 
 RecoTauPileUpVertexSelector (const edm::ParameterSet &pset)
 
 ~RecoTauPileUpVertexSelector ()
 
- Public Member Functions inherited from edm::stream::EDFilter<>
 EDFilter ()=default
 
- Public Member Functions inherited from edm::stream::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilterBase ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool filter_
 
edm::InputTag src_
 
edm::EDGetTokenT
< reco::VertexCollection
token
 
VertexTrackPtSumFilter vtxFilter_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDFilter<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDFilterBase
typedef EDFilterAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::stream::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 41 of file RecoTauPileUpVertexSelector.cc.

Constructor & Destructor Documentation

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

Definition at line 53 of file RecoTauPileUpVertexSelector.cc.

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

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

Definition at line 44 of file RecoTauPileUpVertexSelector.cc.

44 {}

Member Function Documentation

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

Implements edm::stream::EDFilterBase.

Definition at line 63 of file RecoTauPileUpVertexSelector.cc.

References filter_, edm::Event::getByToken(), convertSQLitetoXML_cfg::output, edm::Event::put(), token, and vtxFilter_.

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

Member Data Documentation

bool RecoTauPileUpVertexSelector::filter_
private

Definition at line 49 of file RecoTauPileUpVertexSelector.cc.

Referenced by filter(), and RecoTauPileUpVertexSelector().

edm::InputTag RecoTauPileUpVertexSelector::src_
private

Definition at line 47 of file RecoTauPileUpVertexSelector.cc.

Referenced by RecoTauPileUpVertexSelector().

edm::EDGetTokenT<reco::VertexCollection> RecoTauPileUpVertexSelector::token
private

Definition at line 50 of file RecoTauPileUpVertexSelector.cc.

Referenced by filter(), and RecoTauPileUpVertexSelector().

VertexTrackPtSumFilter RecoTauPileUpVertexSelector::vtxFilter_
private

Definition at line 48 of file RecoTauPileUpVertexSelector.cc.

Referenced by filter().