CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCFakeDBGains.h
Go to the documentation of this file.
1 #ifndef _CSCFAKEDBGAINS_H
2 #define _CSCFAKEDBGAINS_H
3 
4 #include <memory>
13 
15 
19 
20 #include <boost/shared_ptr.hpp>
21 
23  public:
26 
27  inline static CSCDBGains* prefillDBGains();
28 
29  typedef boost::shared_ptr<CSCDBGains> Pointer;
31 
32  private:
34 
35  // member data
37 
38 };
39 
40 #include<fstream>
41 #include<vector>
42 #include<iostream>
43 
44 // to workaround plugin library
46 {
47  int seed;
48  float mean;
49  const int MAX_SIZE = 217728; //or 252288 for ME4/2 chambers
50  const int FACTOR=1000;
51 
52  CSCDBGains* cndbgains = new CSCDBGains();
53  cndbgains->gains.resize(MAX_SIZE);
54 
55  seed = 10000;
56  srand(seed);
57  mean=6.8;
58  cndbgains->factor_gain = int (FACTOR);
59 
60  for(int i=0; i<MAX_SIZE;i++){
61  cndbgains->gains[i].gain_slope= (short int) (((double)rand()/((double)(RAND_MAX)+(double)(1)))+mean*FACTOR+0.5);
62  }
63  return cndbgains;
64 }
65 
66 #endif
boost::shared_ptr< CSCDBGains > Pointer
int i
Definition: DBlmapReader.cc:9
Pointer produceDBGains(const CSCDBGainsRcd &)
GainContainer gains
Definition: CSCDBGains.h:20
int factor_gain
Definition: CSCDBGains.h:15
static CSCDBGains * prefillDBGains()
CSCFakeDBGains(const edm::ParameterSet &)
Signal rand(Signal arg)
Definition: vlib.cc:442
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)