File indexing completed on 2024-04-06 12:29:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <memory>
0020
0021
0022 #include "FWCore/Framework/interface/Frameworkfwd.h"
0023 #include "FWCore/Framework/interface/stream/EDProducer.h"
0024
0025 #include "FWCore/Framework/interface/Event.h"
0026 #include "FWCore/Framework/interface/MakerMacros.h"
0027
0028 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0029
0030 #include "FWCore/Framework/interface/ESHandle.h"
0031
0032 #include "DataFormats/VertexReco/interface/Vertex.h"
0033
0034 #include "DataFormats/Candidate/interface/VertexCompositeCandidate.h"
0035
0036 #include "V0Fitter.h"
0037
0038 class dso_hidden V0Producer final : public edm::stream::EDProducer<> {
0039 public:
0040 explicit V0Producer(const edm::ParameterSet&);
0041
0042 private:
0043 void produce(edm::Event&, const edm::EventSetup&) override;
0044
0045 V0Fitter theVees;
0046 };
0047
0048
0049 V0Producer::V0Producer(const edm::ParameterSet& iConfig) : theVees(iConfig, consumesCollector()) {
0050 produces<reco::VertexCompositeCandidateCollection>("Kshort");
0051 produces<reco::VertexCompositeCandidateCollection>("Lambda");
0052
0053 }
0054
0055
0056
0057
0058
0059
0060 void V0Producer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
0061 using namespace edm;
0062
0063
0064 auto kShortCandidates = std::make_unique<reco::VertexCompositeCandidateCollection>();
0065
0066 auto lambdaCandidates = std::make_unique<reco::VertexCompositeCandidateCollection>();
0067
0068
0069
0070 theVees.fitAll(iEvent, iSetup, *kShortCandidates, *lambdaCandidates);
0071
0072
0073 kShortCandidates->shrink_to_fit();
0074 iEvent.put(std::move(kShortCandidates), std::string("Kshort"));
0075 lambdaCandidates->shrink_to_fit();
0076 iEvent.put(std::move(lambdaCandidates), std::string("Lambda"));
0077 }
0078
0079
0080 #include "FWCore/PluginManager/interface/ModuleDef.h"
0081
0082 DEFINE_FWK_MODULE(V0Producer);
0083