CondTools
RPC
src
RPCDBPerformanceHandler.cc
Go to the documentation of this file.
1
#include <memory>
2
3
// user include files
4
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
5
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
6
7
#include "
FWCore/Framework/interface/Event.h
"
8
#include "
FWCore/Framework/interface/MakerMacros.h
"
9
10
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
11
//
12
// class decleration
13
//
14
#include "
CondTools/RPC/interface/RPCDBPerformanceHandler.h
"
15
#include <iostream>
16
#include <fstream>
17
18
#include "
DataFormats/Common/interface/Handle.h
"
19
#include "
FWCore/Framework/interface/ESHandle.h
"
20
#include "
Geometry/Records/interface/MuonGeometryRecord.h
"
21
#include "
DataFormats/Common/interface/Handle.h
"
22
#include "
FWCore/Framework/interface/ESHandle.h
"
23
#include "
Geometry/Records/interface/MuonGeometryRecord.h
"
24
#include "
MagneticField/Records/interface/IdealMagneticFieldRecord.h
"
25
#include "
FWCore/ServiceRegistry/interface/Service.h
"
26
#include "
FWCore/Utilities/interface/RandomNumberGenerator.h
"
27
#include "
FWCore/Framework/interface/Event.h
"
28
#include "
FWCore/Framework/interface/EventSetup.h
"
29
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
30
#include "
SimDataFormats/TrackingHit/interface/PSimHitContainer.h
"
31
32
#include "
CondTools/RPC/interface/RPCDBSimSetUp.h
"
33
34
#include "
DataFormats/MuonDetId/interface/RPCDetId.h
"
35
#include "
CondFormats/RPCObjects/interface/RPCStripNoises.h
"
36
#include "
CondFormats/DataRecord/interface/RPCStripNoisesRcd.h
"
37
38
#include <cmath>
39
#include <cmath>
40
#include <fstream>
41
#include <sstream>
42
#include <iostream>
43
#include <cstring>
44
#include <string>
45
#include <vector>
46
#include <cstdlib>
47
#include <utility>
48
#include <map>
49
50
using namespace
edm
;
51
52
RPCDBPerformanceHandler::RPCDBPerformanceHandler
(
const
edm::ParameterSet
&
pset
)
53
: m_since(
pset
.getUntrackedParameter<
int
>(
"firstSince"
)),
dataTag
(
pset
.getParameter<
std
::
string
>(
"tag"
)) {
54
theRPCSimSetUp
=
new
RPCDBSimSetUp
(
pset
);
55
}
56
57
RPCDBPerformanceHandler::~RPCDBPerformanceHandler
() {}
58
59
void
RPCDBPerformanceHandler::getNewObjects
() {
60
std::cout
<<
" - > getNewObjects\n"
61
<<
62
//check whats already inside of database
63
"got offlineInfo"
<<
tagInfo
().
name
<<
", size "
<<
tagInfo
().
size
<<
", last object valid since "
64
<<
tagInfo
().
lastInterval
.
since
<< std::endl;
65
66
RPCStripNoises
*
obj
=
new
RPCStripNoises
();
67
68
std::map<int, std::vector<double> >::iterator itc;
69
for
(itc = (
theRPCSimSetUp
->
_clsMap
).begin(); itc != (
theRPCSimSetUp
->
_clsMap
).
end
(); ++itc) {
70
for
(
unsigned
int
n
= 0;
n
< (itc->second).
size
(); ++
n
) {
71
(
obj
->v_cls).push_back((itc->second)[
n
]);
72
}
73
}
74
75
RPCStripNoises::NoiseItem
tipoprova;
76
77
int
i
= 0;
78
for
(
std::map
<uint32_t, std::vector<float> >::iterator it = (
theRPCSimSetUp
->
_mapDetIdNoise
).begin();
79
it != (
theRPCSimSetUp
->
_mapDetIdNoise
).
end
();
80
it++) {
81
tipoprova.
dpid
= it->first;
82
tipoprova.
time
=
theRPCSimSetUp
->
getTime
(it->first);
83
84
for
(
unsigned
int
k
= 0;
k
< 96; ++
k
) {
85
tipoprova.
noise
= ((it->second))[
k
];
86
tipoprova.
eff
= (
theRPCSimSetUp
->
getEff
(it->first))[
k
];
87
(
obj
->v_noises).push_back(tipoprova);
88
}
89
90
edm::LogError
(
"RPCStripNoisesBuilder"
) <<
"[RPCStripNoisesBuilder::analyze] detid already exists"
<< std::endl;
91
92
i
++;
93
}
94
95
// prepare for transfer:
96
m_to_transfer
.push_back(std::make_pair((
RPCStripNoises
*)
obj
,
m_since
));
97
}
98
99
std::string
RPCDBPerformanceHandler::id
()
const
{
return
dataTag
; }
RPCDBSimSetUp::_mapDetIdNoise
std::map< uint32_t, std::vector< float > > _mapDetIdNoise
Definition:
RPCDBSimSetUp.h:38
Handle.h
mps_fire.i
i
Definition:
mps_fire.py:428
popcon::PopConSourceHandler< RPCStripNoises >::m_to_transfer
OldContainer m_to_transfer
Definition:
PopConSourceHandler.h:162
dqmiodumpmetadata.n
n
Definition:
dqmiodumpmetadata.py:28
ESHandle.h
RPCDBSimSetUp.h
RPCStripNoises::NoiseItem
Definition:
RPCStripNoises.h:12
RPCDBSimSetUp::getEff
std::vector< float > getEff(uint32_t id)
Definition:
RPCDBSimSetUp.cc:142
edm
HLT enums.
Definition:
AlignableModifier.h:19
RandomNumberGenerator.h
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
PSimHitContainer.h
RPCStripNoisesRcd.h
EDAnalyzer.h
RPCDBPerformanceHandler::dataTag
std::string dataTag
Definition:
RPCDBPerformanceHandler.h:27
RPCDBSimSetUp
Definition:
RPCDBSimSetUp.h:22
RPCStripNoises::NoiseItem::eff
float eff
Definition:
RPCStripNoises.h:15
cond::TagInfo_t::name
std::string name
Definition:
Types.h:72
MakerMacros.h
RPCStripNoises
Definition:
RPCStripNoises.h:10
Service.h
RPCDBPerformanceHandler::m_since
unsigned long long m_since
Definition:
RPCDBPerformanceHandler.h:26
mps_fire.end
end
Definition:
mps_fire.py:242
IdealMagneticFieldRecord.h
RPCDBSimSetUp::getTime
float getTime(uint32_t id)
Definition:
RPCDBSimSetUp.cc:147
RPCDBPerformanceHandler::id
std::string id() const override
Definition:
RPCDBPerformanceHandler.cc:99
dqmdumpme.k
k
Definition:
dqmdumpme.py:60
getGTfromDQMFile.obj
obj
Definition:
getGTfromDQMFile.py:32
RPCDetId.h
RPCDBSimSetUp::_clsMap
std::map< int, std::vector< double > > _clsMap
Definition:
RPCDBSimSetUp.h:41
edm::ParameterSet
Definition:
ParameterSet.h:47
popcon::PopConSourceHandler< RPCStripNoises >::tagInfo
cond::TagInfo_t const & tagInfo() const
Definition:
PopConSourceHandler.h:78
Event.h
cond::Iov_t::since
Time_t since
Definition:
Types.h:53
createfilelist.int
int
Definition:
createfilelist.py:10
RPCDBPerformanceHandler::RPCDBPerformanceHandler
RPCDBPerformanceHandler(const edm::ParameterSet &pset)
Definition:
RPCDBPerformanceHandler.cc:52
RPCStripNoises::NoiseItem::dpid
int dpid
Definition:
RPCStripNoises.h:13
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
cond::TagInfo_t::lastInterval
Iov_t lastInterval
Definition:
Types.h:73
RPCDBPerformanceHandler.h
std
Definition:
JetResolutionObject.h:76
Frameworkfwd.h
RPCStripNoises.h
RPCStripNoises::NoiseItem::noise
float noise
Definition:
RPCStripNoises.h:14
EventSetup.h
gctErrorAnalyzer_cfi.dataTag
dataTag
Definition:
gctErrorAnalyzer_cfi.py:28
genParticles_cff.map
map
Definition:
genParticles_cff.py:11
ParameterSet.h
RPCDBPerformanceHandler::theRPCSimSetUp
RPCDBSimSetUp * theRPCSimSetUp
Definition:
RPCDBPerformanceHandler.h:28
MuonGeometryRecord.h
RPCDBPerformanceHandler::getNewObjects
void getNewObjects() override
Definition:
RPCDBPerformanceHandler.cc:59
RPCDBPerformanceHandler::~RPCDBPerformanceHandler
~RPCDBPerformanceHandler() override
Definition:
RPCDBPerformanceHandler.cc:57
RPCStripNoises::NoiseItem::time
float time
Definition:
RPCStripNoises.h:16
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
cond::TagInfo_t::size
size_t size
Definition:
Types.h:74
findQualityFiles.size
size
Write out results.
Definition:
findQualityFiles.py:443
Generated for CMSSW Reference Manual by
1.8.16