CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCFakeDBNoiseMatrix.h
Go to the documentation of this file.
1 #ifndef _CSCFAKEDBNOISEMATRIX_H
2 #define _CSCFAKEDBNOISEMATRIX_H
3 
4 #include <memory>
13 
15 
19 #include <boost/shared_ptr.hpp>
20 
22  public:
25 
26  inline static CSCDBNoiseMatrix * prefillDBNoiseMatrix();
27 
28  typedef boost::shared_ptr<CSCDBNoiseMatrix> Pointer;
29 
31 
32  private:
33  // ----------member data ---------------------------
36 
37 };
38 
39 #include<fstream>
40 #include<vector>
41 #include<iostream>
42 
43 // to workaround plugin library
45 {
46  int seed;
47  const int MAX_SIZE = 252288; //or 252288 for ME4/2 chambers
48  const int FACTOR=1000;
49 
50  CSCDBNoiseMatrix * cndbmatrix = new CSCDBNoiseMatrix();
51  cndbmatrix->matrix.resize(MAX_SIZE);
52 
53  seed = 10000;
54  srand(seed);
55  cndbmatrix->factor_noise = int (FACTOR);
56 
57  for(int i=0; i<MAX_SIZE;i++){
58  cndbmatrix->matrix[i].elem33 = (short int) (10.0*FACTOR+0.5);
59  cndbmatrix->matrix[i].elem34 = (short int) (4.0*FACTOR+0.5);
60  cndbmatrix->matrix[i].elem35 = (short int) (3.0*FACTOR+0.5);
61  cndbmatrix->matrix[i].elem44 = (short int) (10.0*FACTOR+0.5);
62  cndbmatrix->matrix[i].elem45 = (short int) (8.0*FACTOR+0.5);
63  cndbmatrix->matrix[i].elem46 = (short int) (2.0*FACTOR+0.5);
64  cndbmatrix->matrix[i].elem55 = (short int) (10.0*FACTOR+0.5);
65  cndbmatrix->matrix[i].elem56 = (short int) (5.0*FACTOR+0.5);
66  cndbmatrix->matrix[i].elem57 = (short int) (3.0*FACTOR+0.5);
67  cndbmatrix->matrix[i].elem66 = (short int) (10.0*FACTOR+0.5);
68  cndbmatrix->matrix[i].elem67 = (short int) (4.0*FACTOR+0.5);
69  cndbmatrix->matrix[i].elem77 = (short int) (10.0*FACTOR+0.5);
70  }
71  return cndbmatrix;
72 }
73 
74 #endif
75 
int i
Definition: DBlmapReader.cc:9
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
static CSCDBNoiseMatrix * prefillDBNoiseMatrix()
CSCFakeDBNoiseMatrix(const edm::ParameterSet &)
boost::shared_ptr< CSCDBNoiseMatrix > Pointer
Pointer produceDBNoiseMatrix(const CSCDBNoiseMatrixRcd &)
NoiseMatrixContainer matrix