L1TriggerConfig
Utilities
src
L1TCaloParamsUpdater.cc
Go to the documentation of this file.
1
#include <iomanip>
2
#include <fstream>
3
#include <iostream>
4
5
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
6
#include "
FWCore/Framework/interface/Event.h
"
7
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
8
9
#include "
FWCore/Framework/interface/EventSetup.h
"
10
#include "
FWCore/Framework/interface/ESHandle.h
"
11
12
#include "
CondFormats/DataRecord/interface/L1TCaloStage2ParamsRcd.h
"
13
#include "
CondFormats/L1TObjects/interface/CaloParams.h
"
14
#include "
L1Trigger/L1TCalorimeter/interface/CaloParamsHelper.h
"
15
16
#include "
FWCore/ServiceRegistry/interface/Service.h
"
17
#include "
CondCore/DBOutputService/interface/PoolDBOutputService.h
"
18
19
class
L1TCaloParamsUpdater
:
public
edm::EDAnalyzer
{
20
public
:
21
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
22
23
explicit
L1TCaloParamsUpdater
(
const
edm::ParameterSet
&) :
edm
::
EDAnalyzer
() {}
24
~L1TCaloParamsUpdater
(
void
)
override
{}
25
};
26
27
void
L1TCaloParamsUpdater::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& evSetup) {
28
edm::ESHandle<l1t::CaloParams>
handle1;
29
// evSetup.get<L1TCaloParamsRcd>().get( "l1conddb", handle1 ) ;
30
evSetup.
get
<
L1TCaloStage2ParamsRcd
>().
get
(handle1);
31
l1t::CaloParamsHelper
m_params_helper(*(handle1.
product
()));
32
33
// std::ifstream is("tauL1CalibLUT_V2.txt");
34
// l1t::LUT lut;
35
// std::cout<<"LUT read success: "<<lut.read(is)<<std::endl;
36
37
m_params_helper.
setIsoTauEtaMax
(28);
38
39
std::shared_ptr<l1t::CaloParams> ptr1 = std::make_shared<l1t::CaloParams>(m_params_helper);
40
41
edm::Service<cond::service::PoolDBOutputService>
poolDb;
42
if
(poolDb.
isAvailable
()) {
43
cond::Time_t
firstSinceTime = poolDb->
beginOfTime
();
44
poolDb->
writeOne
(ptr1.get(), firstSinceTime,
"L1TCaloStage2ParamsTweakedRcd"
);
45
}
46
}
47
48
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
49
#include "
FWCore/Framework/interface/MakerMacros.h
"
50
#include "
FWCore/Framework/interface/ModuleFactory.h
"
51
52
DEFINE_FWK_MODULE
(
L1TCaloParamsUpdater
);
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition:
PoolDBOutputService.cc:215
l1t::CaloParamsHelper::setIsoTauEtaMax
void setIsoTauEtaMax(int value)
Definition:
CaloParamsHelper.h:339
ESHandle.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::EDAnalyzer::EDAnalyzer
EDAnalyzer()
Definition:
EDAnalyzer.cc:27
EDAnalyzer.h
edm::Service::isAvailable
bool isAvailable() const
Definition:
Service.h:40
edm::EDAnalyzer
Definition:
EDAnalyzer.h:28
MakerMacros.h
PoolDBOutputService.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:80
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
Service.h
CaloParams.h
edm::ESHandle
Definition:
DTSurvey.h:22
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
cond::Time_t
unsigned long long Time_t
Definition:
Time.h:14
ModuleDef.h
edm::Service< cond::service::PoolDBOutputService >
iEvent
int iEvent
Definition:
GenABIO.cc:224
L1TCaloParamsUpdater::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
L1TCaloParamsUpdater.cc:27
L1TCaloParamsUpdater::~L1TCaloParamsUpdater
~L1TCaloParamsUpdater(void) override
Definition:
L1TCaloParamsUpdater.cc:24
edm::EventSetup
Definition:
EventSetup.h:57
L1TCaloParamsUpdater
Definition:
L1TCaloParamsUpdater.cc:19
get
#define get
l1t::CaloParamsHelper
Definition:
CaloParamsHelper.h:21
ModuleFactory.h
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition:
PoolDBOutputService.h:63
EventSetup.h
CaloParamsHelper.h
L1TCaloParamsUpdater::L1TCaloParamsUpdater
L1TCaloParamsUpdater(const edm::ParameterSet &)
Definition:
L1TCaloParamsUpdater.cc:23
ParameterSet.h
edm::Event
Definition:
Event.h:73
L1TCaloStage2ParamsRcd
Definition:
L1TCaloStage2ParamsRcd.h:10
L1TCaloStage2ParamsRcd.h
Generated for CMSSW Reference Manual by
1.8.16