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 // $Id: V0Producer.cc,v 1.12 2010/02/20 21:02:02 wmtan Exp $
17 //
18 //
19 
20 
21 // system include files
22 #include <memory>
23 
25 
26 // Constructor
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 }
41 
42 // (Empty) Destructor
44 
45 }
46 
47 
48 //
49 // Methods
50 //
51 
52 // Producer Method
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 }
81 
82 
83 //void V0Producer::beginJob() {
85 }
86 
87 
89 }
90 
91 //define this as a plug-in
93 
95 //DEFINE_FWK_MODULE(V0finder);
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
V0Producer(const edm::ParameterSet &)
Definition: V0Producer.cc:27
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int iEvent
Definition: GenABIO.cc:243
const reco::VertexCompositeCandidateCollection & getLambdas() const
Definition: V0Fitter.cc:502
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
edm::ParameterSet theParams
Definition: V0Producer.h:54
const reco::VertexCompositeCandidateCollection & getKshorts() const
Definition: V0Fitter.cc:498
virtual void beginJob()
Definition: V0Producer.cc:84
virtual void produce(edm::Event &, const edm::EventSetup &)
Definition: V0Producer.cc:53
virtual void endJob()
Definition: V0Producer.cc:88