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
pat::PATVertexSlimmer Class Reference
Inheritance diagram for pat::PATVertexSlimmer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PATVertexSlimmer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~PATVertexSlimmer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::EDGetTokenT< std::vector
< reco::Vertex > > 
src_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
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 14 of file PATVertexSlimmer.cc.

Constructor & Destructor Documentation

pat::PATVertexSlimmer::PATVertexSlimmer ( const edm::ParameterSet iConfig)
explicit

Definition at line 25 of file PATVertexSlimmer.cc.

25  :
26  src_(consumes<std::vector<reco::Vertex> >(iConfig.getParameter<edm::InputTag>("src")))
27 {
28  produces<std::vector<reco::Vertex> >();
29 }
T getParameter(std::string const &) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< std::vector< reco::Vertex > > src_
pat::PATVertexSlimmer::~PATVertexSlimmer ( )

Definition at line 31 of file PATVertexSlimmer.cc.

31 {}

Member Function Documentation

void pat::PATVertexSlimmer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 33 of file PATVertexSlimmer.cc.

References reco::Vertex::chi2(), reco::Vertex::error(), edm::Event::getByToken(), i, n, reco::Vertex::ndof(), reco::Vertex::position(), edm::Event::put(), and findQualityFiles::v.

33  {
35  iEvent.getByToken(src_, vertices);
36  std::auto_ptr<std::vector<reco::Vertex> > outPtr(new std::vector<reco::Vertex>());
37 
38  outPtr->reserve(vertices->size());
39  for (unsigned int i = 0, n = vertices->size(); i < n; ++i) {
40  const reco::Vertex &v = (*vertices)[i];
41  outPtr->push_back(reco::Vertex(v.position(), v.error(), v.chi2(), v.ndof(), 0));
42  }
43 
44  iEvent.put(outPtr);
45 }
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
const Point & position() const
position
Definition: Vertex.h:106
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
double chi2() const
chi-squares
Definition: Vertex.h:95
double ndof() const
Definition: Vertex.h:102
Error error() const
return SMatrix
Definition: Vertex.h:129
edm::EDGetTokenT< std::vector< reco::Vertex > > src_

Member Data Documentation

edm::EDGetTokenT<std::vector<reco::Vertex> > pat::PATVertexSlimmer::src_
private

Definition at line 21 of file PATVertexSlimmer.cc.