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/one/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::one::EDAnalyzer
<> {
20
public
:
21
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
22
23
explicit
L1TCaloParamsUpdater
(
const
edm::ParameterSet
&) :
token_
{
esConsumes
()} {}
24
25
private
:
26
edm::ESGetToken<l1t::CaloParams, L1TCaloStage2ParamsRcd>
token_
;
27
};
28
29
void
L1TCaloParamsUpdater::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& evSetup) {
30
l1t::CaloParamsHelper
m_params_helper(evSetup.
getData
(
token_
));
31
32
// std::ifstream is("tauL1CalibLUT_V2.txt");
33
// l1t::LUT lut;
34
// std::cout<<"LUT read success: "<<lut.read(is)<<std::endl;
35
36
m_params_helper.
setIsoTauEtaMax
(28);
37
38
std::shared_ptr<l1t::CaloParams> ptr1 = std::make_shared<l1t::CaloParams>(m_params_helper);
39
40
edm::Service<cond::service::PoolDBOutputService>
poolDb;
41
if
(poolDb.isAvailable()) {
42
cond::Time_t
firstSinceTime = poolDb->
beginOfTime
();
43
poolDb->writeOneIOV(*ptr1, firstSinceTime,
"L1TCaloStage2ParamsTweakedRcd"
);
44
}
45
}
46
47
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
48
#include "
FWCore/Framework/interface/MakerMacros.h
"
49
#include "
FWCore/Framework/interface/ModuleFactory.h
"
50
51
DEFINE_FWK_MODULE
(
L1TCaloParamsUpdater
);
ModuleFactory.h
edm::Service< cond::service::PoolDBOutputService >
l1t::CaloParamsHelper::setIsoTauEtaMax
void setIsoTauEtaMax(int value)
Definition:
CaloParamsHelper.h:339
edm::EventSetup::getData
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition:
EventSetup.h:119
Event.h
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition:
PoolDBOutputService.cc:260
CaloParamsHelper.h
EventSetup.h
L1TCaloParamsUpdater
Definition:
L1TCaloParamsUpdater.cc:19
L1TCaloStage2ParamsRcd.h
ParameterSet.h
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition:
EDConsumerBase.h:208
l1t::CaloParamsHelper
Definition:
CaloParamsHelper.h:21
edm::ESGetToken< l1t::CaloParams, L1TCaloStage2ParamsRcd >
iEvent
int iEvent
Definition:
GenABIO.cc:224
cond::Time_t
unsigned long long Time_t
Definition:
Time.h:14
PoolDBOutputService.h
ESHandle.h
Service.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::EventSetup
Definition:
EventSetup.h:56
L1TCaloParamsUpdater::token_
edm::ESGetToken< l1t::CaloParams, L1TCaloStage2ParamsRcd > token_
Definition:
L1TCaloParamsUpdater.cc:26
EDAnalyzer.h
L1TCaloParamsUpdater::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
L1TCaloParamsUpdater.cc:29
L1TCaloParamsUpdater::L1TCaloParamsUpdater
L1TCaloParamsUpdater(const edm::ParameterSet &)
Definition:
L1TCaloParamsUpdater.cc:23
edm::ParameterSet
Definition:
ParameterSet.h:47
CaloParams.h
edm::Event
Definition:
Event.h:73
ModuleDef.h
MakerMacros.h
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
Generated for CMSSW Reference Manual by
1.8.14