CMS 3D CMS Logo

CSCFakeDBGains.h
Go to the documentation of this file.
1 #ifndef _CSCFAKEDBGAINS_H
2 #define _CSCFAKEDBGAINS_H
3 
4 #include <memory>
13 
15 
19 
21  public:
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:
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
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() override
Pointer produceDBGains(const CSCDBGainsRcd &)
GainContainer gains
Definition: CSCDBGains.h:24
int factor_gain
Definition: CSCDBGains.h:19
static CSCDBGains * prefillDBGains()
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
CSCFakeDBGains(const edm::ParameterSet &)
Signal rand(Signal arg)
Definition: vlib.cc:442
std::unique_ptr< CSCDBGains > Pointer