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 #include <memory>
20 
21 // user include files
24 
27 
29 
31 
33 //#include "DataFormats/V0Candidate/interface/V0Candidate.h"
35 
36 #include "V0Fitter.h"
37 
39 public:
40  explicit V0Producer(const edm::ParameterSet&);
41 
42 private:
43  void produce(edm::Event&, const edm::EventSetup&) override;
44 
46 };
47 
48 // Constructor
49 V0Producer::V0Producer(const edm::ParameterSet& iConfig) : theVees(iConfig, consumesCollector()) {
50  produces<reco::VertexCompositeCandidateCollection>("Kshort");
51  produces<reco::VertexCompositeCandidateCollection>("Lambda");
52  //produces< reco::VertexCompositeCandidateCollection >("LambdaBar");
53 }
54 
55 //
56 // Methods
57 //
58 
59 // Producer Method
61  using namespace edm;
62 
63  // Create auto_ptr for each collection to be stored in the Event
64  auto kShortCandidates = std::make_unique<reco::VertexCompositeCandidateCollection>();
65 
66  auto lambdaCandidates = std::make_unique<reco::VertexCompositeCandidateCollection>();
67 
68  // invoke the fitter which reconstructs the vertices and fills,
69  // collections of Kshorts, Lambda0s
70  theVees.fitAll(iEvent, iSetup, *kShortCandidates, *lambdaCandidates);
71 
72  // Write the collections to the Event
73  kShortCandidates->shrink_to_fit();
74  iEvent.put(std::move(kShortCandidates), std::string("Kshort"));
75  lambdaCandidates->shrink_to_fit();
76  iEvent.put(std::move(lambdaCandidates), std::string("Lambda"));
77 }
78 
79 //define this as a plug-in
81 
83 //DEFINE_FWK_MODULE(V0finder);
V0Producer(const edm::ParameterSet &)
Definition: V0Producer.cc:49
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void produce(edm::Event &, const edm::EventSetup &) override
Definition: V0Producer.cc:60
int iEvent
Definition: GenABIO.cc:224
void fitAll(const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::VertexCompositeCandidateCollection &k, reco::VertexCompositeCandidateCollection &l)
Definition: V0Fitter.cc:86
#define dso_hidden
Definition: Visibility.h:12
V0Fitter theVees
Definition: V0Producer.cc:45
HLT enums.
def move(src, dest)
Definition: eostools.py:511