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 Member Functions | Private Attributes
BVertexFilterT< VTX > Class Template Reference

#include <RecoBTag/SecondaryVertex/plugins/BVertexFilter.cc>

Inheritance diagram for BVertexFilterT< VTX >:
edm::stream::EDFilter<> edm::stream::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 BVertexFilterT (const edm::ParameterSet &)
 
 ~BVertexFilterT ()
 
- 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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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 Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

int minVertices
 
reco::VertexFilter svFilter
 
edm::EDGetTokenT
< reco::VertexCollection
token_primaryVertex
 
edm::EDGetTokenT< edm::View
< VTX > > 
token_secondaryVertex
 
bool useVertexKinematicAsJetAxis
 

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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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

template<typename VTX>
class BVertexFilterT< VTX >

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 43 of file BVertexFilter.cc.

Constructor & Destructor Documentation

template<typename VTX >
BVertexFilterT< VTX >::BVertexFilterT ( const edm::ParameterSet params)
explicit

Definition at line 58 of file BVertexFilter.cc.

References edm::ParameterSet::getParameter(), BVertexFilterT< VTX >::token_primaryVertex, and BVertexFilterT< VTX >::token_secondaryVertex.

58  :
59  svFilter(params.getParameter<edm::ParameterSet>("vertexFilter")),
60  useVertexKinematicAsJetAxis(params.getParameter<bool>("useVertexKinematicAsJetAxis")),
61  minVertices(params.getParameter<int>("minVertices"))
62 
63 {
64  token_primaryVertex = consumes<reco::VertexCollection>(params.getParameter<edm::InputTag>("primaryVertices"));
65  token_secondaryVertex = consumes<edm::View<VTX> >(params.getParameter<edm::InputTag>("secondaryVertices"));
66  produces<std::vector<VTX> >();
67 
68 }
T getParameter(std::string const &) const
reco::VertexFilter svFilter
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
edm::EDGetTokenT< edm::View< VTX > > token_secondaryVertex
bool useVertexKinematicAsJetAxis
template<typename VTX >
BVertexFilterT< VTX >::~BVertexFilterT ( )

Definition at line 71 of file BVertexFilter.cc.

72 {
73 }

Member Function Documentation

template<typename VTX >
bool BVertexFilterT< VTX >::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::stream::EDFilterBase.

Definition at line 77 of file BVertexFilter.cc.

References edm::View< T >::begin(), prof2calltree::count, edm::View< T >::end(), edm::Event::getByToken(), reco::Vertex::isFake(), edm::Handle< T >::product(), edm::Event::put(), and HLT_25ns14e33_v1_cff::vertices.

78 {
79  int count = 0;
81  iEvent.getByToken(token_primaryVertex, pvHandle);
82  edm::Handle<edm::View<VTX> > svHandle;
83  iEvent.getByToken(token_secondaryVertex, svHandle);
84 
85  std::auto_ptr<std::vector<VTX> > recoVertices(new std::vector<VTX>);
86 
87  if(pvHandle->size()!=0) {
88  const reco::Vertex & primary = (*pvHandle.product())[0];
89  const edm::View<VTX> & vertices = *svHandle.product();
90 
91 
92  if(! primary.isFake())
93  {
94  for(typename edm::View<VTX>::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it)
95  {
96  GlobalVector axis(0,0,0);
97  if(useVertexKinematicAsJetAxis) axis = GlobalVector(it->p4().X(),it->p4().Y(),it->p4().Z());
98  if(svFilter(primary,reco::TemplatedSecondaryVertex<VTX>(primary,*it,axis,true),axis)) {
99  count++;
100  recoVertices->push_back(*it);
101  }
102  }
103  }
104  }
105  iEvent.put(recoVertices);
106 
107  return(count >= minVertices);
108 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
reco::VertexFilter svFilter
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
edm::EDGetTokenT< edm::View< VTX > > token_secondaryVertex
const_iterator begin() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
bool useVertexKinematicAsJetAxis
bool isFake() const
Definition: Vertex.h:64
T const * product() const
Definition: Handle.h:81
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:85
const_iterator end() const
Global3DVector GlobalVector
Definition: GlobalVector.h:10

Member Data Documentation

template<typename VTX >
int BVertexFilterT< VTX >::minVertices
private

Definition at line 54 of file BVertexFilter.cc.

template<typename VTX >
reco::VertexFilter BVertexFilterT< VTX >::svFilter
private

Definition at line 52 of file BVertexFilter.cc.

template<typename VTX >
edm::EDGetTokenT<reco::VertexCollection> BVertexFilterT< VTX >::token_primaryVertex
private

Definition at line 50 of file BVertexFilter.cc.

Referenced by BVertexFilterT< VTX >::BVertexFilterT().

template<typename VTX >
edm::EDGetTokenT<edm::View<VTX> > BVertexFilterT< VTX >::token_secondaryVertex
private

Definition at line 51 of file BVertexFilter.cc.

Referenced by BVertexFilterT< VTX >::BVertexFilterT().

template<typename VTX >
bool BVertexFilterT< VTX >::useVertexKinematicAsJetAxis
private

Definition at line 53 of file BVertexFilter.cc.