test
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  float meanped,meanrms;
48  const int MAX_SIZE = 217728; //or 252288 for ME4/2 chambers
49  const int PED_FACTOR=10;
50  const int RMS_FACTOR=1000;
51 
52  CSCDBPedestals * cndbpedestals = new CSCDBPedestals();
53  cndbpedestals->pedestals.resize(MAX_SIZE);
54 
55  seed = 10000;
56  srand(seed);
57  meanped=600.0, meanrms=1.5;
58  cndbpedestals->factor_ped = int (PED_FACTOR);
59  cndbpedestals->factor_rms = int (RMS_FACTOR);
60 
61  for(int i=0; i<MAX_SIZE;i++){
62  cndbpedestals->pedestals[i].ped=(short int) (((double)rand()/((double)(RAND_MAX)+(double)(1)))*100+meanped*PED_FACTOR+0.5);
63  cndbpedestals->pedestals[i].rms= (short int) (((double)rand()/((double)(RAND_MAX)+(double)(1)))+meanrms*RMS_FACTOR+0.5);
64  }
65  return cndbpedestals;
66 }
67 
68 #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