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
V0Producer Class Reference

#include <MyProducers/V0Producer/src/V0Producer.cc>

Inheritance diagram for V0Producer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 V0Producer (const edm::ParameterSet &)
 
 ~V0Producer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::ParameterSet theParams
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- 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

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

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

Definition at line 43 of file V0Producer.h.

Constructor & Destructor Documentation

V0Producer::V0Producer ( const edm::ParameterSet iConfig)
explicit

Definition at line 27 of file V0Producer.cc.

27  :
28  theParams(iConfig) {
29 
30  // Registering V0 Collections
31  //produces<reco::VertexCollection>("Kshort");
32  //produces<reco::VertexCollection>("Lambda");
33  //produces<reco::VertexCollection>("LambdaBar");
34 
35  // Trying this with Candidates instead of the simple reco::Vertex
36  produces< reco::VertexCompositeCandidateCollection >("Kshort");
37  produces< reco::VertexCompositeCandidateCollection >("Lambda");
38  //produces< reco::VertexCompositeCandidateCollection >("LambdaBar");
39 
40 }
edm::ParameterSet theParams
Definition: V0Producer.h:54
V0Producer::~V0Producer ( )

Definition at line 43 of file V0Producer.cc.

43  {
44 
45 }

Member Function Documentation

void V0Producer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 84 of file V0Producer.cc.

84  {
85 }
void V0Producer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 88 of file V0Producer.cc.

88  {
89 }
void V0Producer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 53 of file V0Producer.cc.

References filterCSVwithJSON::copy, V0Fitter::getKshorts(), V0Fitter::getLambdas(), edm::Event::put(), AlCaHLTBitMon_QueryRunRegistry::string, and theParams.

53  {
54  using namespace edm;
55 
56  // Create V0Fitter object which reconstructs the vertices and creates
57  // (and contains) collections of Kshorts, Lambda0s
58  V0Fitter theVees(theParams, iEvent, iSetup);
59 
60  // Create auto_ptr for each collection to be stored in the Event
61  std::auto_ptr< reco::VertexCompositeCandidateCollection >
62  kShortCandidates( new reco::VertexCompositeCandidateCollection );
63  kShortCandidates->reserve( theVees.getKshorts().size() );
64 
65  std::auto_ptr< reco::VertexCompositeCandidateCollection >
66  lambdaCandidates( new reco::VertexCompositeCandidateCollection );
67  lambdaCandidates->reserve( theVees.getLambdas().size() );
68 
69  std::copy( theVees.getKshorts().begin(),
70  theVees.getKshorts().end(),
71  std::back_inserter(*kShortCandidates) );
72  std::copy( theVees.getLambdas().begin(),
73  theVees.getLambdas().end(),
74  std::back_inserter(*lambdaCandidates) );
75 
76  // Write the collections to the Event
77  iEvent.put( kShortCandidates, std::string("Kshort") );
78  iEvent.put( lambdaCandidates, std::string("Lambda") );
79 
80 }
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
edm::ParameterSet theParams
Definition: V0Producer.h:54

Member Data Documentation

edm::ParameterSet V0Producer::theParams
private

Definition at line 54 of file V0Producer.h.

Referenced by produce().