CalibMuon
CSCCalibration
interface
CSCFakeDBPedestals.h
Go to the documentation of this file.
1
#ifndef _CSCFAKEDBPEDESTALS_H
2
#define _CSCFAKEDBPEDESTALS_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/CSCDBPedestals.h
"
17
#include "
CondFormats/DataRecord/interface/CSCDBPedestalsRcd.h
"
18
#include <
DataFormats/MuonDetId/interface/CSCDetId.h
>
19
20
class
CSCFakeDBPedestals
:
public
edm::ESProducer
,
public
edm::EventSetupRecordIntervalFinder
{
21
public
:
22
CSCFakeDBPedestals
(
const
edm::ParameterSet
&);
23
~CSCFakeDBPedestals
()
override
;
24
25
inline
static
CSCDBPedestals
*
prefillDBPedestals
();
26
27
typedef
std::unique_ptr<CSCDBPedestals>
Pointer
;
28
29
Pointer
produceDBPedestals
(
const
CSCDBPedestalsRcd
&);
30
31
private
:
32
// ----------member data ---------------------------
33
void
setIntervalFor
(
const
edm::eventsetup::EventSetupRecordKey
&,
34
const
edm::IOVSyncValue
&,
35
edm::ValidityInterval
&)
override
;
36
};
37
38
#include <fstream>
39
#include <iostream>
40
#include <vector>
41
42
// to workaround plugin library
43
inline
CSCDBPedestals
*
CSCFakeDBPedestals::prefillDBPedestals
() {
44
int
seed
;
45
float
meanped, meanrms;
46
const
int
MAX_SIZE = 217728;
// or 252288 for ME4/2 chambers
47
const
int
PED_FACTOR = 10;
48
const
int
RMS_FACTOR = 1000;
49
50
CSCDBPedestals
*cndbpedestals =
new
CSCDBPedestals
();
51
cndbpedestals->
pedestals
.resize(MAX_SIZE);
52
53
seed
= 10000;
54
srand(
seed
);
55
meanped = 600.0, meanrms = 1.5;
56
cndbpedestals->
factor_ped
=
int
(PED_FACTOR);
57
cndbpedestals->
factor_rms
=
int
(RMS_FACTOR);
58
59
for
(
int
i
= 0;
i
< MAX_SIZE;
i
++) {
60
cndbpedestals->
pedestals
[
i
].ped =
61
(
short
int
)(((
double
)rand() / ((
double
)(RAND_MAX) + (
double
)(1))) * 100 + meanped * PED_FACTOR + 0.5);
62
cndbpedestals->
pedestals
[
i
].rms =
63
(
short
int
)(((
double
)rand() / ((double)(RAND_MAX) + (double)(1))) + meanrms * RMS_FACTOR + 0.5);
64
}
65
return
cndbpedestals;
66
}
67
68
#endif
CSCDBPedestalsRcd
Definition:
CSCDBPedestalsRcd.h:5
CSCDBPedestals::pedestals
PedestalContainer pedestals
Definition:
CSCDBPedestals.h:26
mps_fire.i
i
Definition:
mps_fire.py:428
CSCFakeDBPedestals::CSCFakeDBPedestals
CSCFakeDBPedestals(const edm::ParameterSet &)
Definition:
CSCFakeDBPedestals.cc:6
ESHandle.h
CSCDBPedestals::factor_ped
int factor_ped
Definition:
CSCDBPedestals.h:20
CSCFakeDBPedestals::produceDBPedestals
Pointer produceDBPedestals(const CSCDBPedestalsRcd &)
Definition:
CSCFakeDBPedestals.cc:16
edm::ValidityInterval
Definition:
ValidityInterval.h:28
ESProducer.h
edm::EventSetupRecordIntervalFinder
Definition:
EventSetupRecordIntervalFinder.h:33
edm::eventsetup::EventSetupRecordKey
Definition:
EventSetupRecordKey.h:30
CSCDetId.h
fileCollector.seed
seed
Definition:
fileCollector.py:127
MakerMacros.h
CSCDBPedestals
Definition:
CSCDBPedestals.h:9
edm::IOVSyncValue
Definition:
IOVSyncValue.h:31
EventSetupRecordIntervalFinder.h
SourceFactory.h
CSCFakeDBPedestals::Pointer
std::unique_ptr< CSCDBPedestals > Pointer
Definition:
CSCFakeDBPedestals.h:27
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
CSCDBPedestals.h
CSCFakeDBPedestals::prefillDBPedestals
static CSCDBPedestals * prefillDBPedestals()
Definition:
CSCFakeDBPedestals.h:43
createfilelist.int
int
Definition:
createfilelist.py:10
Frameworkfwd.h
CSCFakeDBPedestals::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
Definition:
CSCFakeDBPedestals.cc:21
EventSetup.h
edm::ESProducer
Definition:
ESProducer.h:104
ParameterSet.h
CSCDBPedestalsRcd.h
CSCFakeDBPedestals::~CSCFakeDBPedestals
~CSCFakeDBPedestals() override
Definition:
CSCFakeDBPedestals.cc:13
CSCDBPedestals::factor_rms
int factor_rms
Definition:
CSCDBPedestals.h:21
CSCFakeDBPedestals
Definition:
CSCFakeDBPedestals.h:20
Generated for CMSSW Reference Manual by
1.8.16