IOMC
EventVertexGenerators
src
BeamProfile2DB.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: BeamProfile2DB
4
// Class: BeamProfile2DB
5
//
13
//
14
// Original Author: Jean-Roch Vlimant,40 3-A28,+41227671209,
15
// Created: Fri Jan 6 14:49:42 CET 2012
16
//
17
//
18
19
// system include files
20
#include <memory>
21
22
// user include files
23
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
24
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
25
26
#include "
FWCore/Framework/interface/Event.h
"
27
#include "
FWCore/Framework/interface/MakerMacros.h
"
28
29
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
30
31
#include "
FWCore/ServiceRegistry/interface/Service.h
"
32
#include "
CondCore/DBOutputService/interface/PoolDBOutputService.h
"
33
#include "
CondFormats/BeamSpotObjects/interface/SimBeamSpotObjects.h
"
34
35
//
36
// class declaration
37
//
38
39
class
BeamProfile2DB
:
public
edm::EDAnalyzer
{
40
public
:
41
explicit
BeamProfile2DB
(
const
edm::ParameterSet
&);
42
~BeamProfile2DB
()
override
;
43
44
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
45
46
private
:
47
void
beginJob
()
override
;
48
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
49
void
endJob
()
override
;
50
51
// ----------member data ---------------------------
52
edm::ParameterSet
config_
;
53
};
54
55
//
56
// constants, enums and typedefs
57
//
58
59
//
60
// static data member definitions
61
//
62
63
//
64
// constructors and destructor
65
//
66
BeamProfile2DB::BeamProfile2DB
(
const
edm::ParameterSet
& iConfig)
67
68
{
69
config_
= iConfig;
70
}
71
72
BeamProfile2DB::~BeamProfile2DB
() {
73
// do anything here that needs to be done at desctruction time
74
// (e.g. close files, deallocate resources etc.)
75
}
76
77
//
78
// member functions
79
//
80
81
// ------------ method called for each event ------------
82
void
BeamProfile2DB::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {}
83
84
// ------------ method called once each job just before starting event loop ------------
85
void
BeamProfile2DB::beginJob
() {}
86
87
// ------------ method called once each job just after ending the event loop ------------
88
void
BeamProfile2DB::endJob
() {
89
edm::Service<cond::service::PoolDBOutputService>
poolDbService;
90
SimBeamSpotObjects
*
beam
=
new
SimBeamSpotObjects
();
91
92
beam
->read(
config_
);
93
94
poolDbService->
createNewIOV
<
SimBeamSpotObjects
>(
95
beam
, poolDbService->
beginOfTime
(), poolDbService->
endOfTime
(),
"SimBeamSpotObjectsRcd"
);
96
}
97
98
// ------------ method fills 'descriptions' with the allowed parameters for the module ------------
99
void
BeamProfile2DB::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
100
//The following says we do not know what parameters are allowed so do no validation
101
// Please change this to state exactly what you do use, even if it is no parameters
102
edm::ParameterSetDescription
desc
;
103
desc
.setUnknown();
104
descriptions.
addDefault
(
desc
);
105
}
106
107
//define this as a plug-in
108
DEFINE_FWK_MODULE
(
BeamProfile2DB
);
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition:
PoolDBOutputService.cc:215
BeamProfile2DB::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
BeamProfile2DB.cc:82
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
SimBeamSpotObjects.h
EDAnalyzer.h
BeamProfile2DB
Definition:
BeamProfile2DB.cc:39
SimBeamSpotObjects
Definition:
SimBeamSpotObjects.h:18
BeamProfile2DB::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
BeamProfile2DB.cc:99
edm::EDAnalyzer
Definition:
EDAnalyzer.h:28
MakerMacros.h
PoolDBOutputService.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition:
PoolDBOutputService.h:116
BeamProfile2DB::BeamProfile2DB
BeamProfile2DB(const edm::ParameterSet &)
Definition:
BeamProfile2DB.cc:66
Service.h
EcalCondDBWriter_cfi.beam
beam
Definition:
EcalCondDBWriter_cfi.py:45
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
BeamProfile2DB::beginJob
void beginJob() override
Definition:
BeamProfile2DB.cc:85
edm::Service< cond::service::PoolDBOutputService >
iEvent
int iEvent
Definition:
GenABIO.cc:224
BeamProfile2DB::~BeamProfile2DB
~BeamProfile2DB() override
Definition:
BeamProfile2DB.cc:72
BeamProfile2DB::config_
edm::ParameterSet config_
Definition:
BeamProfile2DB.cc:52
edm::EventSetup
Definition:
EventSetup.h:58
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition:
PoolDBOutputService.cc:213
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
Frameworkfwd.h
BeamProfile2DB::endJob
void endJob() override
Definition:
BeamProfile2DB.cc:88
ParameterSet.h
edm::Event
Definition:
Event.h:73
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:99
Generated for CMSSW Reference Manual by
1.8.16