Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
d
e
f
l
m
o
p
s
t
u
v
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
CalibCalorimetry
CaloMiscalibTools
plugins
WriteEcalMiscalibConstants.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: WriteEcalMiscalibConstants
4
// Class: WriteEcalMiscalibConstants
5
//
13
//
14
// Original Author: Stephanie BEAUCERON
15
// Created: Tue May 15 16:23:21 CEST 2007
16
//
17
//
18
19
// system include files
20
#include <iostream>
21
22
// user include files
23
24
#include "
FWCore/Framework/interface/ESHandle.h
"
25
#include "
FWCore/Framework/interface/EventSetup.h
"
26
27
// DB includes
28
#include "
FWCore/ServiceRegistry/interface/Service.h
"
29
#include "
CondCore/DBOutputService/interface/PoolDBOutputService.h
"
30
31
// user include files
32
#include "
CondFormats/EcalObjects/interface/EcalIntercalibConstants.h
"
33
#include "
CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h
"
34
//For Checks
35
36
//this one
37
#include "
CalibCalorimetry/CaloMiscalibTools/interface/WriteEcalMiscalibConstants.h
"
38
39
//
40
// static data member definitions
41
//
42
43
//
44
// constructors and destructor
45
//
46
WriteEcalMiscalibConstants::WriteEcalMiscalibConstants
(
const
edm::ParameterSet
& iConfig) {
47
//now do what ever initialization is needed
48
newTagRequest_
= iConfig.
getParameter
<
std::string
>(
"NewTagRequest"
);
49
}
50
51
WriteEcalMiscalibConstants::~WriteEcalMiscalibConstants
() {
52
// do anything here that needs to be done at desctruction time
53
// (e.g. close files, deallocate resources etc.)
54
}
55
56
//
57
// member functions
58
//
59
60
// ------------ method called to for each event ------------
61
void
WriteEcalMiscalibConstants::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
62
using namespace
edm
;
63
// Intercalib constants
64
edm::ESHandle<EcalIntercalibConstants>
pIcal;
65
iSetup.
get
<
EcalIntercalibConstantsRcd
>().
get
(pIcal);
66
const
EcalIntercalibConstants
* Mcal = pIcal.
product
();
67
68
edm::Service<cond::service::PoolDBOutputService>
poolDbService;
69
if
(poolDbService.
isAvailable
()) {
70
if
(poolDbService->
isNewTagRequest
(
newTagRequest_
)) {
71
std::cout
<<
" Creating a new one "
<< std::endl;
72
poolDbService->
createNewIOV
<
const
EcalIntercalibConstants
>(
73
Mcal, poolDbService->
beginOfTime
(), poolDbService->
endOfTime
(),
newTagRequest_
);
74
std::cout
<<
"Done"
<< std::endl;
75
}
else
{
76
std::cout
<<
"Old One "
<< std::endl;
77
poolDbService->
appendSinceTime
<
const
EcalIntercalibConstants
>(Mcal, poolDbService->
currentTime
(),
newTagRequest_
);
78
}
79
}
80
}
81
82
// ------------ method called once each job just before starting event loop ------------
83
void
WriteEcalMiscalibConstants::beginJob
() {}
84
85
// ------------ method called once each job just after ending the event loop ------------
86
void
87
88
WriteEcalMiscalibConstants::endJob
() {
89
std::cout
<<
"Here is the end"
<< std::endl;
90
}
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition:
PoolDBOutputService.cc:215
ESHandle.h
EcalIntercalibConstants.h
WriteEcalMiscalibConstants::newTagRequest_
std::string newTagRequest_
Definition:
WriteEcalMiscalibConstants.h:35
edm
HLT enums.
Definition:
AlignableModifier.h:19
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
cond::service::PoolDBOutputService::appendSinceTime
void appendSinceTime(const T *payloadObj, cond::Time_t sinceTime, const std::string &recordName)
Definition:
PoolDBOutputService.h:141
WriteEcalMiscalibConstants::beginJob
void beginJob() override
Definition:
WriteEcalMiscalibConstants.cc:83
EcalCondObjectContainer
Definition:
EcalCondObjectContainer.h:13
edm::Service::isAvailable
bool isAvailable() const
Definition:
Service.h:40
WriteEcalMiscalibConstants.h
WriteEcalMiscalibConstants::WriteEcalMiscalibConstants
WriteEcalMiscalibConstants(const edm::ParameterSet &)
Definition:
WriteEcalMiscalibConstants.cc:46
PoolDBOutputService.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:87
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition:
PoolDBOutputService.h:116
Service.h
edm::ESHandle
Definition:
DTSurvey.h:22
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
WriteEcalMiscalibConstants::~WriteEcalMiscalibConstants
~WriteEcalMiscalibConstants() override
Definition:
WriteEcalMiscalibConstants.cc:51
edm::ParameterSet
Definition:
ParameterSet.h:47
WriteEcalMiscalibConstants::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
WriteEcalMiscalibConstants.cc:61
edm::Service< cond::service::PoolDBOutputService >
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EventSetup
Definition:
EventSetup.h:58
get
#define get
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition:
PoolDBOutputService.cc:213
WriteEcalMiscalibConstants::endJob
void endJob() override
Definition:
WriteEcalMiscalibConstants.cc:88
EventSetup.h
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition:
PoolDBOutputService.cc:128
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
edm::Event
Definition:
Event.h:73
EcalIntercalibConstantsRcd
Definition:
EcalIntercalibConstantsRcd.h:5
EcalIntercalibConstantsRcd.h
cond::service::PoolDBOutputService::currentTime
cond::Time_t currentTime() const
Definition:
PoolDBOutputService.cc:217
Generated for CMSSW Reference Manual by
1.8.16