test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
V0Producer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: V0Producer
4 // Class: V0Producer
5 //
13 //
14 // Original Author: Brian Drell
15 // Created: Fri May 18 22:57:40 CEST 2007
16 //
17 //
18 
19 
20 // system include files
21 #include <memory>
22 
24 
25 // Constructor
27  theParams(iConfig)
28 {
30 
31  // Registering V0 Collections
32  //produces<reco::VertexCollection>("Kshort");
33  //produces<reco::VertexCollection>("Lambda");
34  //produces<reco::VertexCollection>("LambdaBar");
35 
36  // Trying this with Candidates instead of the simple reco::Vertex
37  produces< reco::VertexCompositeCandidateCollection >("Kshort");
38  produces< reco::VertexCompositeCandidateCollection >("Lambda");
39  //produces< reco::VertexCompositeCandidateCollection >("LambdaBar");
40 
41 }
42 
43 // (Empty) Destructor
45 
46 }
47 
48 
49 //
50 // Methods
51 //
52 
53 // Producer Method
55  using namespace edm;
56 
57  // Create V0Fitter object which reconstructs the vertices and creates
58  // (and contains) collections of Kshorts, Lambda0s
59  theVees->fitAll(iEvent, iSetup);
60 
61  // Create auto_ptr for each collection to be stored in the Event
62  std::auto_ptr< reco::VertexCompositeCandidateCollection >
63  kShortCandidates( new reco::VertexCompositeCandidateCollection );
64  kShortCandidates->reserve( theVees->getKshorts().size() );
65 
66  std::auto_ptr< reco::VertexCompositeCandidateCollection >
67  lambdaCandidates( new reco::VertexCompositeCandidateCollection );
68  lambdaCandidates->reserve( theVees->getLambdas().size() );
69 
70  std::copy( theVees->getKshorts().begin(),
71  theVees->getKshorts().end(),
72  std::back_inserter(*kShortCandidates) );
73  std::copy( theVees->getLambdas().begin(),
74  theVees->getLambdas().end(),
75  std::back_inserter(*lambdaCandidates) );
76 
77  // Write the collections to the Event
78  iEvent.put( kShortCandidates, std::string("Kshort") );
79  iEvent.put( lambdaCandidates, std::string("Lambda") );
80 
81 }
82 
83 
84 //define this as a plug-in
86 
88 //DEFINE_FWK_MODULE(V0finder);
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
V0Producer(const edm::ParameterSet &)
Definition: V0Producer.cc:26
void fitAll(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: V0Fitter.cc:103
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual void produce(edm::Event &, const edm::EventSetup &) override
Definition: V0Producer.cc:54
int iEvent
Definition: GenABIO.cc:230
const reco::VertexCompositeCandidateCollection & getLambdas() const
Definition: V0Fitter.cc:502
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::ParameterSet theParams
Definition: V0Producer.h:50
const reco::VertexCompositeCandidateCollection & getKshorts() const
Definition: V0Fitter.cc:498
V0Fitter * theVees
Definition: V0Producer.h:51