test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalErrorMask.cc
Go to the documentation of this file.
1 
10 
12 
14 
16 
17 #include <iostream>
18 
19 int EcalErrorMask::runNb_ = -1;
20 std::map<EcalLogicID, RunCrystalErrorsDat> EcalErrorMask::mapCrystalErrors_;
21 std::map<EcalLogicID, RunTTErrorsDat> EcalErrorMask::mapTTErrors_;
22 std::map<EcalLogicID, RunPNErrorsDat> EcalErrorMask::mapPNErrors_;
23 std::map<EcalLogicID, RunMemChErrorsDat> EcalErrorMask::mapMemChErrors_;
24 std::map<EcalLogicID, RunMemTTErrorsDat> EcalErrorMask::mapMemTTErrors_;
25 
26 void EcalErrorMask::readDB( EcalCondDBInterface* eConn, RunIOV* runIOV ) throw( std::runtime_error ) {
27 
28  if( eConn ) {
29 
30  RunIOV validIOV;
31  RunTag runTag = runIOV->getRunTag();
32 
33  std::string location = runTag.getLocationDef().getLocation();
34 
35  std::cout << std::endl;
36  std::cout << " RunCrystalErrorsDat: ";
37  try {
38  eConn->fetchValidDataSet( &EcalErrorMask::mapCrystalErrors_, &validIOV, location, runIOV->getRunNumber() );
39  std::cout << "found" << std::endl;
40  } catch ( std::runtime_error &e ) {
41  std::cout << "not found" << std::endl;
42  throw( std::runtime_error( e.what() ) );
43  }
44 
45  // use the IOV for CrystalErrors as reference
47 
48  std::cout << " RunTTErrorsDat: ";
49  try {
50  eConn->fetchValidDataSet( &EcalErrorMask::mapTTErrors_, &validIOV, location, runIOV->getRunNumber() );
51  std::cout << "found" << std::endl;
52  } catch ( std::runtime_error &e ) {
53  std::cout << "not found" << std::endl;
54  }
55  std::cout << " RunPNErrorsDat: ";
56  try {
57  eConn->fetchValidDataSet( &EcalErrorMask::mapPNErrors_, &validIOV, location, runIOV->getRunNumber() );
58  std::cout << "found" << std::endl;
59  } catch ( std::runtime_error &e ) {
60  std::cout << "not found" << std::endl;
61  }
62  std::cout << " RunMemChErrorsDat: ";
63  try {
64  eConn->fetchValidDataSet( &EcalErrorMask::mapMemChErrors_, &validIOV, location, runIOV->getRunNumber() );
65  std::cout << "found" << std::endl;
66  } catch ( std::runtime_error &e ) {
67  std::cout << "not found" << std::endl;
68  }
69  std::cout << " RunMemTTErrorsDat: ";
70  try {
71  eConn->fetchValidDataSet( &EcalErrorMask::mapMemTTErrors_, &validIOV, location, runIOV->getRunNumber() );
72  std::cout << "found" << std::endl;
73  } catch ( std::runtime_error &e ) {
74  std::cout << "not found" << std::endl;
75  }
76 
77  std::cout << std::endl;
78 
79  }
80 
81 }
82 
83 void EcalErrorMask::fetchDataSet( std::map< EcalLogicID, RunCrystalErrorsDat>* fillMap ) {
84 
85  fillMap->clear();
87  return;
88 
89 }
90 
91 void EcalErrorMask::fetchDataSet( std::map< EcalLogicID, RunTTErrorsDat>* fillMap ) {
92 
93  fillMap->clear();
94  *fillMap = EcalErrorMask::mapTTErrors_;
95  return;
96 
97 }
98 
99 void EcalErrorMask::fetchDataSet( std::map< EcalLogicID, RunPNErrorsDat>* fillMap ) {
100 
101  fillMap->clear();
102  *fillMap = EcalErrorMask::mapPNErrors_;
103  return;
104 
105 }
106 
107 void EcalErrorMask::fetchDataSet( std::map< EcalLogicID, RunMemChErrorsDat>* fillMap ) {
108 
109  fillMap->clear();
111  return;
112 
113 }
114 
115 void EcalErrorMask::fetchDataSet( std::map< EcalLogicID, RunMemTTErrorsDat>* fillMap ) {
116 
117  fillMap->clear();
119  return;
120 
121 }
122 
LocationDef getLocationDef() const
Definition: RunTag.cc:46
Definition: RunTag.h:13
static void fetchDataSet(std::map< EcalLogicID, RunCrystalErrorsDat > *fillMap)
static std::map< EcalLogicID, RunCrystalErrorsDat > mapCrystalErrors_
Definition: EcalErrorMask.h:34
std::string getLocation() const
Definition: LocationDef.cc:26
static std::map< EcalLogicID, RunPNErrorsDat > mapPNErrors_
Definition: EcalErrorMask.h:36
static int runNb_
Definition: EcalErrorMask.h:32
static std::map< EcalLogicID, RunTTErrorsDat > mapTTErrors_
Definition: EcalErrorMask.h:35
run_t getRunNumber() const
Definition: RunIOV.cc:45
static std::map< EcalLogicID, RunMemTTErrorsDat > mapMemTTErrors_
Definition: EcalErrorMask.h:38
tuple cout
Definition: gather_cfg.py:121
Definition: RunIOV.h:13
static void readDB(EcalCondDBInterface *eConn, RunIOV *runIOV)
static std::map< EcalLogicID, RunMemChErrorsDat > mapMemChErrors_
Definition: EcalErrorMask.h:37