CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCFakeDBPedestals.h
Go to the documentation of this file.
1 #ifndef _CSCFAKEDBPEDESTALS_H
2 #define _CSCFAKEDBPEDESTALS_H
3 
4 #include <memory>
13 
15 
19 #include <boost/shared_ptr.hpp>
20 
22  public:
25 
26  inline static CSCDBPedestals * prefillDBPedestals();
27 
28  typedef boost::shared_ptr<CSCDBPedestals> Pointer;
29 
31 
32  private:
33  // ----------member data ---------------------------
35 
37 };
38 
39 #include<fstream>
40 #include<vector>
41 #include<iostream>
42 
43 // to workaround plugin library
45 {
46  int seed;
47  long int M;
48  float meanped,meanrms;
49  const int MAX_SIZE = 217728; //or 252288 for ME4/2 chambers
50  const int PED_FACTOR=10;
51  const int RMS_FACTOR=1000;
52 
53  CSCDBPedestals * cndbpedestals = new CSCDBPedestals();
54  cndbpedestals->pedestals.resize(MAX_SIZE);
55 
56  seed = 10000;
57  srand(seed);
58  meanped=600.0, meanrms=1.5, M=1000;
59  cndbpedestals->factor_ped = int (PED_FACTOR);
60  cndbpedestals->factor_rms = int (RMS_FACTOR);
61 
62  for(int i=0; i<MAX_SIZE;i++){
63  cndbpedestals->pedestals[i].ped=(short int) (((double)rand()/((double)(RAND_MAX)+(double)(1)))*100+meanped*PED_FACTOR+0.5);
64  cndbpedestals->pedestals[i].rms= (short int) (((double)rand()/((double)(RAND_MAX)+(double)(1)))+meanrms*RMS_FACTOR+0.5);
65  }
66  return cndbpedestals;
67 }
68 
69 #endif
int i
Definition: DBlmapReader.cc:9
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
static CSCDBPedestals * prefillDBPedestals()
CSCFakeDBPedestals(const edm::ParameterSet &)
boost::shared_ptr< CSCDBPedestals > Pointer
Pointer produceDBPedestals(const CSCDBPedestalsRcd &)
PedestalContainer pedestals
Signal rand(Signal arg)
Definition: vlib.cc:442