src
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->writeOneIOV(*ptr1, 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::EDAnalyzer::EDAnalyzer
EDAnalyzer()
Definition:
EDAnalyzer.cc:28
edm::Service< cond::service::PoolDBOutputService >
l1t::CaloParamsHelper::setIsoTauEtaMax
void setIsoTauEtaMax(int value)
Definition:
CaloParamsHelper.h:339
L1TCaloStage2ParamsRcd
Definition:
L1TCaloStage2ParamsRcd.h:10
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
Event.h
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition:
PoolDBOutputService.cc:258
CaloParamsHelper.h
MakerMacros.h
EventSetup.h
L1TCaloParamsUpdater
Definition:
L1TCaloParamsUpdater.cc:19
L1TCaloStage2ParamsRcd.h
ParameterSet.h
l1t::CaloParamsHelper
Definition:
CaloParamsHelper.h:21
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
cond::Time_t
unsigned long long Time_t
Definition:
Time.h:14
PoolDBOutputService.h
edm::ESHandle
Definition:
DTSurvey.h:22
ESHandle.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:82
Service.h
edm::EventSetup
Definition:
EventSetup.h:59
edm::EDAnalyzer
Definition:
EDAnalyzer.h:35
EDAnalyzer.h
L1TCaloParamsUpdater::~L1TCaloParamsUpdater
~L1TCaloParamsUpdater(void) override
Definition:
L1TCaloParamsUpdater.cc:24
edm
HLT enums.
Definition:
AlignableModifier.h:19
L1TCaloParamsUpdater::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
L1TCaloParamsUpdater.cc:27
L1TCaloParamsUpdater::L1TCaloParamsUpdater
L1TCaloParamsUpdater(const edm::ParameterSet &)
Definition:
L1TCaloParamsUpdater.cc:23
edm::ParameterSet
Definition:
ParameterSet.h:48
ModuleFactory.h
CaloParams.h
edm::Event
Definition:
Event.h:73
ModuleDef.h
Generated for CMSSW Reference Manual by
1.8.14