CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LMFPnPrimDat.cc
Go to the documentation of this file.
2 
4  init();
5 }
6 
7 LMFPnPrimDat::LMFPnPrimDat(oracle::occi::Environment* env,
8  oracle::occi::Connection* conn) :
9  LMFColoredTable(env, conn) {
10  init();
11 }
12 
14  init();
15 }
16 
18  LMFColoredTable() {
19  init();
20  setColor(color);
21  setSystem(system);
22 }
23 
24 LMFPnPrimDat::LMFPnPrimDat(oracle::occi::Environment* env,
25  oracle::occi::Connection* conn,
26  std::string color, std::string system) :
27  LMFColoredTable(env, conn) {
28  init();
29  setColor(color);
30  setSystem(system);
31 }
32 
34  std::string system, bool d) : LMFColoredTable(c) {
35  if (d) {
36  debug();
37  }
38  init();
39  setColor(color);
40  setSystem(system);
41 }
42 
44  std::string system) : LMFColoredTable(c) {
45  init();
46  setColor(color);
47  setSystem(system);
48 }
49 
51  LMFColoredTable() {
52  init();
53  setColor(color);
54  setSystem(system);
55 }
56 
57 LMFPnPrimDat::LMFPnPrimDat(oracle::occi::Environment* env,
58  oracle::occi::Connection* conn,
59  int color, std::string system) :
60  LMFColoredTable(env, conn) {
61  init();
62  setColor(color);
63  setSystem(system);
64 }
65 
67  std::string system) : LMFColoredTable(c) {
68  init();
69  setColor(color);
70  setSystem(system);
71 }
72 
74  // LED tables do not hold the shapecorr column. Drop it.
75  std::transform(s.begin(), s.end(), s.begin(), toupper);
76  if (s == "LED") {
77  if (m_debug) {
78  std::cout << "Erasing unwanted data" << std::endl;
79  }
80  m_type.erase(m_type.begin());
81  m_keys.erase("SHAPECORRPN");
82  if (m_debug) {
83  std::cout << "Data: " << m_data.size() << " Keys: " << m_keys.size()
84  << " Type: " << m_type.size() << std::endl;
85  }
86  std::map<std::string, unsigned int>::iterator i = m_keys.begin();
87  std::map<std::string, unsigned int>::iterator e = m_keys.end();
88  while (i != e) {
89  // modify indexes
90  (i->second)--;
91  if (m_debug) {
92  std::cout << "Key " << i->first << " = " << i->second << std::endl;
93  }
94  i++;
95  }
96  }
98  return *this;
99 }
100 
102  m_className = "LMFPnPrimDat";
103 
104  m_keys["SHAPECORRPN"] = 0;
105  m_keys["MEAN"] = 1;
106  m_keys["RMS"] = 2;
107  m_keys["M3"] = 3;
108  m_keys["PNABMEAN"] = 4;
109  m_keys["PNABRMS"] = 5;
110  m_keys["PNABM3"] = 6;
111  m_keys["FLAG"] = 7;
112  m_keys["VMIN"] = 8;
113  m_keys["VMAX"] = 9;
114 
115  m_type.resize(10);
116  for (int i = 0; i < 10; i++) {
117  m_type[i] = "NUMBER";
118  }
119 
120  m_system = 0;
121  m_color = 0;
122 }
123 
125  bool ret = true;
126  if ((getSystem() != "LASER") && (getSystem() != "LED")) {
127  m_Error += " System name not properly set [" + getSystem() + "]";
128  ret = false;
129  }
130  if ((getSystem() == "LASER") &&
131  (getColor() != "BLUE") && (getColor() != "IR")) {
132  m_Error += " Color not properly set [" + getColor() + "]";
133  ret = false;
134  }
135  if ((getSystem() == "LED") &&
136  (getColor() != "BLUE") && (getColor() != "ORANGE")) {
137  m_Error += " Color not properly set [" + getColor() + "]";
138  ret = false;
139  }
140  return ret;
141 }
142 
144  LMFDat::setData(id, "MEAN", v);
145  return *this;
146 }
147 
149  LMFDat::setData(id, "RMS", v);
150  return *this;
151 }
152 
154  LMFDat::setData(id, "M3", v);
155  return *this;
156 }
157 
159  float m3) {
160  setMean(id, mean);
161  setRMS(id, rms);
162  setM3(id, m3);
163  return *this;
164 }
166  if (getSystem() != "LED") {
167  LMFDat::setData(id, "SHAPECORRPN", v);
168  }
169  return *this;
170 }
171 
173  LMFDat::setData(id, "PNABM3", v);
174  return *this;
175 }
176 
178  LMFDat::setData(id, "PNABMEAN", v);
179  return *this;
180 }
181 
183  LMFDat::setData(id, "PNABRMS", v);
184  return *this;
185 }
186 
188  float mean, float rms, float m3) {
189  setPNAoverBMean(id, mean);
190  setPNAoverBRMS(id, rms);
191  setPNAoverBM3(id, m3);
192  return *this;
193 }
195  LMFDat::setData(id, "FLAG", v);
196  return *this;
197 }
198 
199 float LMFPnPrimDat::getMean(int id) {
200  return getData(id, "MEAN");
201 }
202 
204  float x = 0;
205  if (getSystem() != "LED") {
206  x = getData(id, "SHAPECORRPN");
207  }
208  return x;
209 }
210 
211 float LMFPnPrimDat::getRMS(int id) {
212  return getData(id, "RMS");
213 }
214 
215 float LMFPnPrimDat::getM3(int id) {
216  return getData(id, "M3");
217 }
218 
220  return getData(id, "PNABM3");
221 }
222 
224  return getData(id, "PNABMEAN");
225 }
226 
228  return getData(id, "PNABRMS");
229 }
230 
232  return getData(id, "FLAG");
233 }
234 
236  return getData(id, "MEAN");
237 }
238 
240  float x = 0.;
241  if (getSystem() != "LED") {
242  x = getData(id, "SHAPECORRPN");
243  }
244  return x;
245 }
246 
248  return getData(id, "RMS");
249 }
250 
252  return getData(id, "M3");
253 }
254 
256  return getData(id, "PNABM3");
257 }
258 
260  return getData(id, "PNABMEAN");
261 }
262 
264  return getData(id, "PNABRMS");
265 }
266 
268  return getData(id, "FLAG");
269 }
270 
271 
std::string m_className
Definition: LMFUnique.h:99
int i
Definition: DBlmapReader.cc:9
int getFlag(EcalLogicID &id)
float getM3(EcalLogicID &id)
LMFPnPrimDat & setPN(EcalLogicID &id, float mean, float rms, float m3)
float getMean(EcalLogicID &id)
float getShapeCor(EcalLogicID &id)
std::map< int, std::vector< float > > m_data
Definition: LMFDat.h:153
LMFDat & setData(int logic_id, const std::vector< float > &data)
Definition: LMFDat.h:55
std::vector< std::string > m_type
Definition: LMFDat.h:150
std::string getColor() const
tuple d
Definition: ztail.py:151
LMFPnPrimDat & setRMS(EcalLogicID &id, float v)
LMFPnPrimDat & setShapeCorr(EcalLogicID &id, float mean)
std::string m_Error
Definition: LMFDat.h:157
LMFColoredTable & setColor(int color)
LMFPnPrimDat & setSystem(std::string s)
Definition: LMFPnPrimDat.cc:73
LMFPnPrimDat & setM3(EcalLogicID &id, float v)
LMFPnPrimDat & setFlag(EcalLogicID &id, int v)
std::map< int, std::vector< float > > getData()
Definition: LMFDat.cc:636
float getPNAoverBM3(EcalLogicID &id)
float getPNAoverBMean(EcalLogicID &id)
float getPNAoverBRMS(EcalLogicID &id)
virtual LMFColoredTable & setSystem(int system)
LMFPnPrimDat & setPNAoverB(EcalLogicID &id, float mean, float rms, float m3)
std::map< std::string, unsigned int > m_keys
Definition: LMFDat.h:155
LMFPnPrimDat & setPNAoverBMean(EcalLogicID &id, float v)
LMFPnPrimDat & setPNAoverBRMS(EcalLogicID &id, float v)
tuple cout
Definition: gather_cfg.py:121
char m_debug
Definition: LMFUnique.h:100
void debug()
Definition: LMFUnique.h:68
float getRMS(EcalLogicID &id)
tuple conn
Definition: results_mgr.py:53
LMFPnPrimDat & setPNAoverBM3(EcalLogicID &id, float v)
LMFPnPrimDat & setMean(EcalLogicID &id, float v)
virtual std::string getSystem() const