CalibMuon
CSCCalibration
interface
CSCFakeDBNoiseMatrix.h
Go to the documentation of this file.
1
#ifndef _CSCFAKEDBNOISEMATRIX_H
2
#define _CSCFAKEDBNOISEMATRIX_H
3
4
#include "
FWCore/Framework/interface/ESHandle.h
"
5
#include "
FWCore/Framework/interface/ESProducer.h
"
6
#include "
FWCore/Framework/interface/Event.h
"
7
#include "
FWCore/Framework/interface/EventSetup.h
"
8
#include "
FWCore/Framework/interface/EventSetupRecordIntervalFinder.h
"
9
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
10
#include "
FWCore/Framework/interface/MakerMacros.h
"
11
#include "
FWCore/Framework/interface/SourceFactory.h
"
12
#include <memory>
13
14
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
15
16
#include "
CondFormats/CSCObjects/interface/CSCDBNoiseMatrix.h
"
17
#include "
CondFormats/DataRecord/interface/CSCDBNoiseMatrixRcd.h
"
18
#include <
DataFormats/MuonDetId/interface/CSCDetId.h
>
19
20
class
CSCFakeDBNoiseMatrix
:
public
edm::ESProducer
,
public
edm::EventSetupRecordIntervalFinder
{
21
public
:
22
CSCFakeDBNoiseMatrix
(
const
edm::ParameterSet
&);
23
~CSCFakeDBNoiseMatrix
()
override
;
24
25
inline
static
CSCDBNoiseMatrix
*
prefillDBNoiseMatrix
();
26
27
typedef
std::unique_ptr<CSCDBNoiseMatrix>
Pointer
;
28
29
Pointer
produceDBNoiseMatrix
(
const
CSCDBNoiseMatrixRcd
&);
30
31
private
:
32
// ----------member data ---------------------------
33
void
setIntervalFor
(
const
edm::eventsetup::EventSetupRecordKey
&,
34
const
edm::IOVSyncValue
&,
35
edm::ValidityInterval
&)
override
;
36
Pointer
cndbNoiseMatrix
;
37
};
38
39
#include <fstream>
40
#include <iostream>
41
#include <vector>
42
43
// to workaround plugin library
44
inline
CSCDBNoiseMatrix
*
CSCFakeDBNoiseMatrix::prefillDBNoiseMatrix
() {
45
int
seed
;
46
const
int
MAX_SIZE
= 252288;
// or 252288 for ME4/2 chambers
47
const
int
FACTOR = 1000;
48
49
CSCDBNoiseMatrix
*cndbmatrix =
new
CSCDBNoiseMatrix
();
50
cndbmatrix->
matrix
.resize(
MAX_SIZE
);
51
52
seed
= 10000;
53
srand(
seed
);
54
cndbmatrix->
factor_noise
=
int
(FACTOR);
55
56
for
(
int
i
= 0;
i
<
MAX_SIZE
;
i
++) {
57
cndbmatrix->
matrix
[
i
].elem33 = (
short
int
)(10.0 * FACTOR + 0.5);
58
cndbmatrix->
matrix
[
i
].elem34 = (
short
int
)(4.0 * FACTOR + 0.5);
59
cndbmatrix->
matrix
[
i
].elem35 = (
short
int
)(3.0 * FACTOR + 0.5);
60
cndbmatrix->
matrix
[
i
].elem44 = (
short
int
)(10.0 * FACTOR + 0.5);
61
cndbmatrix->
matrix
[
i
].elem45 = (
short
int
)(8.0 * FACTOR + 0.5);
62
cndbmatrix->
matrix
[
i
].elem46 = (
short
int
)(2.0 * FACTOR + 0.5);
63
cndbmatrix->
matrix
[
i
].elem55 = (
short
int
)(10.0 * FACTOR + 0.5);
64
cndbmatrix->
matrix
[
i
].elem56 = (
short
int
)(5.0 * FACTOR + 0.5);
65
cndbmatrix->
matrix
[
i
].elem57 = (
short
int
)(3.0 * FACTOR + 0.5);
66
cndbmatrix->
matrix
[
i
].elem66 = (
short
int
)(10.0 * FACTOR + 0.5);
67
cndbmatrix->
matrix
[
i
].elem67 = (
short
int
)(4.0 * FACTOR + 0.5);
68
cndbmatrix->
matrix
[
i
].elem77 = (
short
int
)(10.0 * FACTOR + 0.5);
69
}
70
return
cndbmatrix;
71
}
72
73
#endif
CSCFakeDBNoiseMatrix::~CSCFakeDBNoiseMatrix
~CSCFakeDBNoiseMatrix() override
Definition:
CSCFakeDBNoiseMatrix.cc:12
mps_fire.i
i
Definition:
mps_fire.py:428
ESHandle.h
CSCDBNoiseMatrix::factor_noise
int factor_noise
Definition:
CSCDBNoiseMatrix.h:19
edm::ValidityInterval
Definition:
ValidityInterval.h:28
ESProducer.h
CSCFakeDBNoiseMatrix::CSCFakeDBNoiseMatrix
CSCFakeDBNoiseMatrix(const edm::ParameterSet &)
Definition:
CSCFakeDBNoiseMatrix.cc:6
CSCDBNoiseMatrix::matrix
NoiseMatrixContainer matrix
Definition:
CSCDBNoiseMatrix.h:24
CSCFakeDBNoiseMatrix::Pointer
std::unique_ptr< CSCDBNoiseMatrix > Pointer
Definition:
CSCFakeDBNoiseMatrix.h:27
edm::EventSetupRecordIntervalFinder
Definition:
EventSetupRecordIntervalFinder.h:33
CSCFakeDBNoiseMatrix::prefillDBNoiseMatrix
static CSCDBNoiseMatrix * prefillDBNoiseMatrix()
Definition:
CSCFakeDBNoiseMatrix.h:44
edm::eventsetup::EventSetupRecordKey
Definition:
EventSetupRecordKey.h:30
CSCFakeDBNoiseMatrix::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
Definition:
CSCFakeDBNoiseMatrix.cc:19
CSCDetId.h
fileCollector.seed
seed
Definition:
fileCollector.py:127
MakerMacros.h
CSCDBNoiseMatrixRcd.h
pixelgpudetails::MAX_SIZE
constexpr unsigned int MAX_SIZE
Definition:
SiPixelROCsStatusAndMapping.h:10
edm::IOVSyncValue
Definition:
IOVSyncValue.h:31
EventSetupRecordIntervalFinder.h
SourceFactory.h
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
CSCDBNoiseMatrix
Definition:
CSCDBNoiseMatrix.h:9
createfilelist.int
int
Definition:
createfilelist.py:10
CSCDBNoiseMatrix.h
CSCFakeDBNoiseMatrix::cndbNoiseMatrix
Pointer cndbNoiseMatrix
Definition:
CSCFakeDBNoiseMatrix.h:36
CSCFakeDBNoiseMatrix::produceDBNoiseMatrix
Pointer produceDBNoiseMatrix(const CSCDBNoiseMatrixRcd &)
Definition:
CSCFakeDBNoiseMatrix.cc:15
Frameworkfwd.h
EventSetup.h
edm::ESProducer
Definition:
ESProducer.h:104
ParameterSet.h
CSCDBNoiseMatrixRcd
Definition:
CSCDBNoiseMatrixRcd.h:5
CSCFakeDBNoiseMatrix
Definition:
CSCFakeDBNoiseMatrix.h:20
Generated for CMSSW Reference Manual by
1.8.16