Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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
#include <boost/shared_ptr.hpp>
21
22
class
CSCFakeDBGains
:
public
edm::ESProducer
,
public
edm::EventSetupRecordIntervalFinder
{
23
public
:
24
CSCFakeDBGains
(
const
edm::ParameterSet
&);
25
~CSCFakeDBGains
();
26
27
inline
static
CSCDBGains
*
prefillDBGains
();
28
29
typedef
boost::shared_ptr<CSCDBGains>
Pointer
;
30
Pointer
produceDBGains
(
const
CSCDBGainsRcd
&);
31
32
private
:
33
void
setIntervalFor
(
const
edm::eventsetup::EventSetupRecordKey
&,
const
edm::IOVSyncValue
&,
edm::ValidityInterval
& );
34
35
// member data
36
Pointer
cndbGains
;
37
38
};
39
40
#include<fstream>
41
#include<vector>
42
#include<iostream>
43
44
// to workaround plugin library
45
inline
CSCDBGains
*
CSCFakeDBGains::prefillDBGains
()
46
{
47
int
seed;
48
long
int
M;
49
float
mean
,
min
, minchi;
50
const
int
MAX_SIZE = 217728;
//or 252288 for ME4/2 chambers
51
const
int
FACTOR=1000;
52
53
CSCDBGains
* cndbgains =
new
CSCDBGains
();
54
cndbgains->
gains
.resize(MAX_SIZE);
55
56
seed = 10000;
57
srand(seed);
58
mean=6.8, min=-10.0, minchi=1.0, M=1000;
59
cndbgains->
factor_gain
= int (FACTOR);
60
61
for
(
int
i
=0;
i
<MAX_SIZE;
i
++){
62
cndbgains->
gains
[
i
].gain_slope= (
short
int) (((
double
)
rand
()/((
double
)(RAND_MAX)+(
double
)(1)))+mean*FACTOR+0.5);
63
}
64
return
cndbgains;
65
}
66
67
#endif
CSCFakeDBGains::Pointer
boost::shared_ptr< CSCDBGains > Pointer
Definition:
CSCFakeDBGains.h:29
i
int i
Definition:
DBlmapReader.cc:9
edm::ValidityInterval
Definition:
ValidityInterval.h:28
CSCDBGainsRcd.h
CSCDetId.h
CSCDBGains
Definition:
CSCDBGains.h:8
CSCFakeDBGains::produceDBGains
Pointer produceDBGains(const CSCDBGainsRcd &)
Definition:
CSCFakeDBGains.cc:23
Event.h
MakerMacros.h
EventSetup.h
min
#define min(a, b)
Definition:
mlp_lapack.h:161
CSCDBGains::gains
GainContainer gains
Definition:
CSCDBGains.h:27
CSCDBGains::factor_gain
int factor_gain
Definition:
CSCDBGains.h:18
Frameworkfwd.h
edm::ESProducer
Definition:
ESProducer.h:97
ParameterSet.h
CSCFakeDBGains::prefillDBGains
static CSCDBGains * prefillDBGains()
Definition:
CSCFakeDBGains.h:45
CSCDBGains.h
CSCFakeDBGains::~CSCFakeDBGains
~CSCFakeDBGains()
Definition:
CSCFakeDBGains.cc:17
ESHandle.h
CSCFakeDBGains::cndbGains
Pointer cndbGains
Definition:
CSCFakeDBGains.h:36
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:34
rand
Signal rand(Signal arg)
Definition:
vlib.cc:442
SourceFactory.h
edm::ParameterSet
Definition:
ParameterSet.h:31
plotscripts.mean
def mean
Definition:
plotscripts.py:50
CSCFakeDBGains
Definition:
CSCFakeDBGains.h:22
CSCDBGainsRcd
Definition:
CSCDBGainsRcd.h:5
edm::IOVSyncValue
Definition:
IOVSyncValue.h:31
CSCFakeDBGains::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
Definition:
CSCFakeDBGains.cc:28
Generated for CMSSW Reference Manual by
1.8.5