CMS 3D CMS Logo

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  auto kShortCandidates = std::make_unique<reco::VertexCompositeCandidateCollection>();
73 
74  auto lambdaCandidates = std::make_unique<reco::VertexCompositeCandidateCollection>();
75 
76  // invoke the fitter which reconstructs the vertices and fills,
77  // collections of Kshorts, Lambda0s
78  theVees.fitAll(iEvent, iSetup, *kShortCandidates, *lambdaCandidates);
79 
80 
81  // Write the collections to the Event
82  kShortCandidates->shrink_to_fit(); iEvent.put(std::move(kShortCandidates), std::string("Kshort") );
83  lambdaCandidates->shrink_to_fit(); iEvent.put(std::move(lambdaCandidates), std::string("Lambda") );
84 
85 }
86 
87 
88 //define this as a plug-in
90 
92 //DEFINE_FWK_MODULE(V0finder);
#define dso_hidden
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
V0Producer(const edm::ParameterSet &)
Definition: V0Producer.cc:52
#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
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
HLT enums.
def move(src, dest)
Definition: eostools.py:510