CMS 3D CMS Logo

CSCFakeDBGains.h
Go to the documentation of this file.
1 #ifndef _CSCFAKEDBGAINS_H
2 #define _CSCFAKEDBGAINS_H
3 
12 #include <memory>
13 
15 
19 
21 public:
23  ~CSCFakeDBGains() override;
24 
25  inline static CSCDBGains *prefillDBGains();
26 
27  typedef std::unique_ptr<CSCDBGains> Pointer;
29 
30 private:
32  const edm::IOVSyncValue &,
33  edm::ValidityInterval &) override;
34 
35  // member data
37 };
38 
39 #include <fstream>
40 #include <iostream>
41 #include <vector>
42 
43 // to workaround plugin library
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 =
60  (short int)(((double)rand() / ((double)(RAND_MAX) + (double)(1))) + mean * FACTOR + 0.5);
61  }
62  return cndbgains;
63 }
64 
65 #endif
CSCFakeDBGains::CSCFakeDBGains
CSCFakeDBGains(const edm::ParameterSet &)
Definition: CSCFakeDBGains.cc:6
CSCFakeDBGains::produceDBGains
Pointer produceDBGains(const CSCDBGainsRcd &)
Definition: CSCFakeDBGains.cc:16
mps_fire.i
i
Definition: mps_fire.py:428
CSCFakeDBGains::prefillDBGains
static CSCDBGains * prefillDBGains()
Definition: CSCFakeDBGains.h:44
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
ESHandle.h
edm::ValidityInterval
Definition: ValidityInterval.h:28
ESProducer.h
CSCFakeDBGains::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
Definition: CSCFakeDBGains.cc:20
edm::EventSetupRecordIntervalFinder
Definition: EventSetupRecordIntervalFinder.h:33
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
CSCDetId.h
CSCDBGains
Definition: CSCDBGains.h:9
fileCollector.seed
seed
Definition: fileCollector.py:127
MakerMacros.h
CSCFakeDBGains
Definition: CSCFakeDBGains.h:20
pixelgpudetails::MAX_SIZE
constexpr unsigned int MAX_SIZE
Definition: SiPixelROCsStatusAndMapping.h:10
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
EventSetupRecordIntervalFinder.h
SourceFactory.h
CSCDBGains::gains
GainContainer gains
Definition: CSCDBGains.h:24
edm::ParameterSet
Definition: ParameterSet.h:47
CSCFakeDBGains::Pointer
std::unique_ptr< CSCDBGains > Pointer
Definition: CSCFakeDBGains.h:27
Event.h
createfilelist.int
int
Definition: createfilelist.py:10
CSCFakeDBGains::cndbGains
Pointer cndbGains
Definition: CSCFakeDBGains.h:36
Frameworkfwd.h
CSCDBGainsRcd.h
CSCDBGains::factor_gain
int factor_gain
Definition: CSCDBGains.h:19
EventSetup.h
CSCDBGainsRcd
Definition: CSCDBGainsRcd.h:5
CSCDBGains.h
edm::ESProducer
Definition: ESProducer.h:104
CSCFakeDBGains::~CSCFakeDBGains
~CSCFakeDBGains() override
Definition: CSCFakeDBGains.cc:13
ParameterSet.h