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::theVees
V0Fitter theVees
Definition: V0Producer.cc:45
ESHandle.h
edm
HLT enums.
Definition: AlignableModifier.h:19
EDProducer.h
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
VertexCompositeCandidate.h
V0Producer
Definition: V0Producer.cc:38
dso_hidden
#define dso_hidden
Definition: Visibility.h:12
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
V0Producer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: V0Producer.cc:60
V0Producer::V0Producer
V0Producer(const edm::ParameterSet &)
Definition: V0Producer.cc:49
ModuleDef.h
V0Fitter
Definition: V0Fitter.h:40
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:57
eostools.move
def move(src, dest)
Definition: eostools.py:511
Frameworkfwd.h
V0Fitter::fitAll
void fitAll(const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::VertexCompositeCandidateCollection &k, reco::VertexCompositeCandidateCollection &l)
Definition: V0Fitter.cc:86
ParameterSet.h
V0Fitter.h
edm::Event
Definition: Event.h:73