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
SecondaryVertexTagInfoProxy Class Reference
Inheritance diagram for SecondaryVertexTagInfoProxy:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SecondaryVertexTagInfoProxy (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

edm::EDGetTokenT
< reco::SecondaryVertexTagInfoCollection
svTagInfoCollection_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase 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::global::EDProducerBase
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

Definition at line 23 of file SecondaryVertexTagInfoProxy.cc.

Constructor & Destructor Documentation

SecondaryVertexTagInfoProxy::SecondaryVertexTagInfoProxy ( const edm::ParameterSet config)
explicit

Definition at line 37 of file SecondaryVertexTagInfoProxy.cc.

References edm::ParameterSet::getUntrackedParameter(), and svTagInfoCollection_.

38 {
39  // Get the cfg parameter
40  svTagInfoCollection_ = consumes<reco::SecondaryVertexTagInfoCollection>(config.getUntrackedParameter<edm::InputTag> ( "svTagInfoProducer" ));
41 
42  // Declare the type of objects to be produced.
43  produces<reco::VertexCollection>();
44  produces<edm::AssociationMap<edm::OneToMany<reco::SecondaryVertexTagInfoCollection, reco::VertexCollection> > >();
45 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::SecondaryVertexTagInfoCollection > svTagInfoCollection_

Member Function Documentation

void SecondaryVertexTagInfoProxy::produce ( edm::StreamID  ,
edm::Event event,
const edm::EventSetup setup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 48 of file SecondaryVertexTagInfoProxy.cc.

References cmsHarvester::index, and svTagInfoCollection_.

49 {
50  // Vertex collection
52  event.getByToken(svTagInfoCollection_, svTagInfoCollection);
53 
54  // Auto pointers to the collection to be added to the event
55  std::auto_ptr<reco::VertexCollection> proxy (new reco::VertexCollection);
56  std::auto_ptr<edm::AssociationMap<edm::OneToMany<reco::SecondaryVertexTagInfoCollection, reco::VertexCollection> > >
58 
59  // Get a reference before to put in the event
60  reco::VertexRefProd vertexRefProd = event.getRefBeforePut<reco::VertexCollection>();
61 
62  // General index
63  std::size_t index = 0;
64 
65  // Loop over SecondaryVertexTagInfo collection
66  for (std::size_t svIndex = 0; svIndex < svTagInfoCollection->size(); ++svIndex)
67  {
68  // Reference to svTagInfo
69  reco::SecondaryVertexTagInfoRef svTagInfo(svTagInfoCollection, svIndex);
70 
71  // Loop over the vertexes and add them to the new collection
72  for (unsigned int vIndex = 0; vIndex < svTagInfo->nVertices(); ++vIndex)
73  {
74  proxy->push_back(svTagInfo->secondaryVertex(vIndex));
75  assoc->insert(svTagInfo, reco::VertexRef(vertexRefProd, index));
76  ++index;
77  }
78  }
79 
80  // Adding the collection to the event
81  event.put(proxy);
82  event.put(assoc);
83 }
edm::EDGetTokenT< reco::SecondaryVertexTagInfoCollection > svTagInfoCollection_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9

Member Data Documentation

edm::EDGetTokenT<reco::SecondaryVertexTagInfoCollection> SecondaryVertexTagInfoProxy::svTagInfoCollection_
private

Definition at line 33 of file SecondaryVertexTagInfoProxy.cc.

Referenced by produce(), and SecondaryVertexTagInfoProxy().