Main Page
Namespaces
Classes
Package Documentation
CalibMuon
CSCCalibration
interface
CSCFakeDBGains.h
Go to the documentation of this file.
1
#ifndef _CSCFAKEDBGAINS_H
2
#define _CSCFAKEDBGAINS_H
3
4
#include <memory>
5
#include "
FWCore/Framework/interface/SourceFactory.h
"
6
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
7
#include "
FWCore/Framework/interface/ESProducer.h
"
8
#include "
FWCore/Framework/interface/Event.h
"
9
#include "
FWCore/Framework/interface/MakerMacros.h
"
10
#include "
FWCore/Framework/interface/EventSetupRecordIntervalFinder.h
"
11
#include "
FWCore/Framework/interface/ESHandle.h
"
12
#include "
FWCore/Framework/interface/EventSetup.h
"
13
14
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
15
16
#include "
CondFormats/CSCObjects/interface/CSCDBGains.h
"
17
#include "
CondFormats/DataRecord/interface/CSCDBGainsRcd.h
"
18
#include <
DataFormats/MuonDetId/interface/CSCDetId.h
>
19
20
class
CSCFakeDBGains
:
public
edm::ESProducer
,
public
edm::EventSetupRecordIntervalFinder
{
21
public
:
22
CSCFakeDBGains
(
const
edm::ParameterSet
&);
23
~CSCFakeDBGains
()
override
;
24
25
inline
static
CSCDBGains
*
prefillDBGains
();
26
27
typedef
std::unique_ptr<CSCDBGains>
Pointer
;
28
Pointer
produceDBGains
(
const
CSCDBGainsRcd
&);
29
30
private
:
31
void
setIntervalFor
(
const
edm::eventsetup::EventSetupRecordKey
&,
const
edm::IOVSyncValue
&,
edm::ValidityInterval
& )
override
;
32
33
// member data
34
Pointer
cndbGains
;
35
36
};
37
38
#include<fstream>
39
#include<vector>
40
#include<iostream>
41
42
// to workaround plugin library
43
inline
CSCDBGains
*
CSCFakeDBGains::prefillDBGains
()
44
{
45
int
seed
;
46
float
mean
;
47
const
int
MAX_SIZE = 217728;
//or 252288 for ME4/2 chambers
48
const
int
FACTOR=1000;
49
50
CSCDBGains
* cndbgains =
new
CSCDBGains
();
51
cndbgains->
gains
.resize(MAX_SIZE);
52
53
seed = 10000;
54
srand(seed);
55
mean=6.8;
56
cndbgains->
factor_gain
=
int
(FACTOR);
57
58
for
(
int
i
=0;
i
<MAX_SIZE;
i
++){
59
cndbgains->
gains
[
i
].gain_slope= (
short
int
) (((
double
)
rand
()/((
double
)(RAND_MAX)+(
double
)(1)))+mean*FACTOR+0.5);
60
}
61
return
cndbgains;
62
}
63
64
#endif
CSCFakeDBGains::~CSCFakeDBGains
~CSCFakeDBGains() override
Definition:
CSCFakeDBGains.cc:15
edm::ValidityInterval
Definition:
ValidityInterval.h:28
mps_fire.i
i
Definition:
mps_fire.py:269
CSCDBGainsRcd.h
CSCDetId.h
CSCDBGains
Definition:
CSCDBGains.h:9
CSCFakeDBGains::produceDBGains
Pointer produceDBGains(const CSCDBGainsRcd &)
Definition:
CSCFakeDBGains.cc:21
Event.h
SurveyInfoScenario_cff.seed
seed
Definition:
SurveyInfoScenario_cff.py:295
MakerMacros.h
EventSetup.h
SiStripPI::mean
Definition:
SiStripPayloadInspectorHelper.h:179
CSCDBGains::gains
GainContainer gains
Definition:
CSCDBGains.h:24
CSCDBGains::factor_gain
int factor_gain
Definition:
CSCDBGains.h:19
Frameworkfwd.h
edm::ESProducer
Definition:
ESProducer.h:97
ParameterSet.h
CSCFakeDBGains::prefillDBGains
static CSCDBGains * prefillDBGains()
Definition:
CSCFakeDBGains.h:43
CSCDBGains.h
createfilelist.int
int
Definition:
createfilelist.py:10
CSCFakeDBGains::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
Definition:
CSCFakeDBGains.cc:26
ESHandle.h
CSCFakeDBGains::cndbGains
Pointer cndbGains
Definition:
CSCFakeDBGains.h:34
edm::eventsetup::EventSetupRecordKey
Definition:
EventSetupRecordKey.h:30
CSCFakeDBGains::CSCFakeDBGains
CSCFakeDBGains(const edm::ParameterSet &)
Definition:
CSCFakeDBGains.cc:6
ESProducer.h
EventSetupRecordIntervalFinder.h
edm::EventSetupRecordIntervalFinder
Definition:
EventSetupRecordIntervalFinder.h:33
rand
Signal rand(Signal arg)
Definition:
vlib.cc:442
SourceFactory.h
edm::ParameterSet
Definition:
ParameterSet.h:36
CSCFakeDBGains::Pointer
std::unique_ptr< CSCDBGains > Pointer
Definition:
CSCFakeDBGains.h:27
CSCFakeDBGains
Definition:
CSCFakeDBGains.h:20
CSCDBGainsRcd
Definition:
CSCDBGainsRcd.h:5
edm::IOVSyncValue
Definition:
IOVSyncValue.h:31
Generated for CMSSW Reference Manual by
1.8.11