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 
21 #include <memory>
22 
23 // user include files
26 
29 
31 
33 
35 //#include "DataFormats/V0Candidate/interface/V0Candidate.h"
37 
38 #include "V0Fitter.h"
39 
41 public:
42  explicit V0Producer(const edm::ParameterSet&);
43 
44 private:
45  void produce(edm::Event&, const edm::EventSetup&) override;
46 
48 };
49 
50 
51 // Constructor
53  theVees(iConfig, consumesCollector())
54 {
55  produces< reco::VertexCompositeCandidateCollection >("Kshort");
56  produces< reco::VertexCompositeCandidateCollection >("Lambda");
57  //produces< reco::VertexCompositeCandidateCollection >("LambdaBar");
58 
59 }
60 
61 
62 //
63 // Methods
64 //
65 
66 // Producer Method
68  using namespace edm;
69 
70 
71  // Create auto_ptr for each collection to be stored in the Event
72  std::auto_ptr< reco::VertexCompositeCandidateCollection >
73  kShortCandidates( new reco::VertexCompositeCandidateCollection );
74 
75  std::auto_ptr< reco::VertexCompositeCandidateCollection >
76  lambdaCandidates( new reco::VertexCompositeCandidateCollection );
77 
78  // invoke the fitter which reconstructs the vertices and fills,
79  // collections of Kshorts, Lambda0s
80  theVees.fitAll(iEvent, iSetup, *kShortCandidates, *lambdaCandidates);
81 
82 
83  // Write the collections to the Event
84  kShortCandidates->shrink_to_fit(); iEvent.put( kShortCandidates, std::string("Kshort") );
85  lambdaCandidates->shrink_to_fit(); iEvent.put( lambdaCandidates, std::string("Lambda") );
86 
87 }
88 
89 
90 //define this as a plug-in
92 
94 //DEFINE_FWK_MODULE(V0finder);
#define dso_hidden
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
V0Producer(const edm::ParameterSet &)
Definition: V0Producer.cc:52
virtual void produce(Event &, EventSetup const &)=0
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void produce(edm::Event &, const edm::EventSetup &) override
Definition: V0Producer.cc:67
int iEvent
Definition: GenABIO.cc:230
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
void fitAll(const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::VertexCompositeCandidateCollection &k, reco::VertexCompositeCandidateCollection &l)
Definition: V0Fitter.cc:87
V0Fitter theVees
Definition: V0Producer.cc:47