CMS 3D CMS Logo

LMFPnPrimDat.cc
Go to the documentation of this file.
2 
4 
5 LMFPnPrimDat::LMFPnPrimDat(oracle::occi::Environment *env, oracle::occi::Connection *conn)
6  : LMFColoredTable(env, conn) {
7  init();
8 }
9 
11 
13  init();
14  setColor(color);
15  setSystem(system);
16 }
17 
18 LMFPnPrimDat::LMFPnPrimDat(oracle::occi::Environment *env,
19  oracle::occi::Connection *conn,
20  std::string color,
21  std::string system)
22  : LMFColoredTable(env, conn) {
23  init();
24  setColor(color);
25  setSystem(system);
26 }
27 
29  if (d) {
30  debug();
31  }
32  init();
33  setColor(color);
34  setSystem(system);
35 }
36 
38  init();
39  setColor(color);
40  setSystem(system);
41 }
42 
44  init();
45  setColor(color);
46  setSystem(system);
47 }
48 
49 LMFPnPrimDat::LMFPnPrimDat(oracle::occi::Environment *env, oracle::occi::Connection *conn, int color, std::string system)
50  : LMFColoredTable(env, conn) {
51  init();
52  setColor(color);
53  setSystem(system);
54 }
55 
57  init();
58  setColor(color);
59  setSystem(system);
60 }
61 
63  // LED tables do not hold the shapecorr column. Drop it.
64  std::transform(s.begin(), s.end(), s.begin(), toupper);
65  if (s == "LED") {
66  if (m_debug) {
67  std::cout << "Erasing unwanted data" << std::endl;
68  }
69  m_type.erase(m_type.begin());
70  m_keys.erase("SHAPECORRPN");
71  if (m_debug) {
72  std::cout << "Data: " << m_data.size() << " Keys: " << m_keys.size() << " Type: " << m_type.size() << std::endl;
73  }
74  std::map<std::string, unsigned int>::iterator i = m_keys.begin();
75  std::map<std::string, unsigned int>::iterator e = m_keys.end();
76  while (i != e) {
77  // modify indexes
78  (i->second)--;
79  if (m_debug) {
80  std::cout << "Key " << i->first << " = " << i->second << std::endl;
81  }
82  i++;
83  }
84  }
86  return *this;
87 }
88 
90  m_className = "LMFPnPrimDat";
91 
92  m_keys["SHAPECORRPN"] = 0;
93  m_keys["MEAN"] = 1;
94  m_keys["RMS"] = 2;
95  m_keys["M3"] = 3;
96  m_keys["PNABMEAN"] = 4;
97  m_keys["PNABRMS"] = 5;
98  m_keys["PNABM3"] = 6;
99  m_keys["FLAG"] = 7;
100  m_keys["VMIN"] = 8;
101  m_keys["VMAX"] = 9;
102 
103  m_type.resize(10);
104  for (int i = 0; i < 10; i++) {
105  m_type[i] = "NUMBER";
106  }
107 
108  m_system = 0;
109  m_color = 0;
110 }
111 
113  bool ret = true;
114  if ((getSystem() != "LASER") && (getSystem() != "LED")) {
115  m_Error += " System name not properly set [" + getSystem() + "]";
116  ret = false;
117  }
118  if ((getSystem() == "LASER") && (getColor() != "BLUE") && (getColor() != "IR")) {
119  m_Error += " Color not properly set [" + getColor() + "]";
120  ret = false;
121  }
122  if ((getSystem() == "LED") && (getColor() != "BLUE") && (getColor() != "ORANGE")) {
123  m_Error += " Color not properly set [" + getColor() + "]";
124  ret = false;
125  }
126  return ret;
127 }
128 
130  LMFDat::setData(id, "MEAN", v);
131  return *this;
132 }
133 
135  LMFDat::setData(id, "RMS", v);
136  return *this;
137 }
138 
140  LMFDat::setData(id, "M3", v);
141  return *this;
142 }
143 
144 LMFPnPrimDat &LMFPnPrimDat::setPN(EcalLogicID &id, float mean, float rms, float m3) {
145  setMean(id, mean);
146  setRMS(id, rms);
147  setM3(id, m3);
148  return *this;
149 }
151  if (getSystem() != "LED") {
152  LMFDat::setData(id, "SHAPECORRPN", v);
153  }
154  return *this;
155 }
156 
158  LMFDat::setData(id, "PNABM3", v);
159  return *this;
160 }
161 
163  LMFDat::setData(id, "PNABMEAN", v);
164  return *this;
165 }
166 
168  LMFDat::setData(id, "PNABRMS", v);
169  return *this;
170 }
171 
173  setPNAoverBMean(id, mean);
174  setPNAoverBRMS(id, rms);
175  setPNAoverBM3(id, m3);
176  return *this;
177 }
179  LMFDat::setData(id, "FLAG", v);
180  return *this;
181 }
182 
183 float LMFPnPrimDat::getMean(int id) { return getData(id, "MEAN"); }
184 
186  float x = 0;
187  if (getSystem() != "LED") {
188  x = getData(id, "SHAPECORRPN");
189  }
190  return x;
191 }
192 
193 float LMFPnPrimDat::getRMS(int id) { return getData(id, "RMS"); }
194 
195 float LMFPnPrimDat::getM3(int id) { return getData(id, "M3"); }
196 
197 float LMFPnPrimDat::getPNAoverBM3(int id) { return getData(id, "PNABM3"); }
198 
199 float LMFPnPrimDat::getPNAoverBMean(int id) { return getData(id, "PNABMEAN"); }
200 
201 float LMFPnPrimDat::getPNAoverBRMS(int id) { return getData(id, "PNABRMS"); }
202 
203 int LMFPnPrimDat::getFlag(int id) { return getData(id, "FLAG"); }
204 
205 float LMFPnPrimDat::getMean(EcalLogicID &id) { return getData(id, "MEAN"); }
206 
208  float x = 0.;
209  if (getSystem() != "LED") {
210  x = getData(id, "SHAPECORRPN");
211  }
212  return x;
213 }
214 
215 float LMFPnPrimDat::getRMS(EcalLogicID &id) { return getData(id, "RMS"); }
216 
217 float LMFPnPrimDat::getM3(EcalLogicID &id) { return getData(id, "M3"); }
218 
219 float LMFPnPrimDat::getPNAoverBM3(EcalLogicID &id) { return getData(id, "PNABM3"); }
220 
221 float LMFPnPrimDat::getPNAoverBMean(EcalLogicID &id) { return getData(id, "PNABMEAN"); }
222 
223 float LMFPnPrimDat::getPNAoverBRMS(EcalLogicID &id) { return getData(id, "PNABRMS"); }
224 
225 int LMFPnPrimDat::getFlag(EcalLogicID &id) { return getData(id, "FLAG"); }
std::string m_className
Definition: LMFUnique.h:95
int getFlag(EcalLogicID &id)
float getM3(EcalLogicID &id)
LMFPnPrimDat & setPN(EcalLogicID &id, float mean, float rms, float m3)
ret
prodAgent to be discontinued
float getMean(EcalLogicID &id)
float getShapeCor(EcalLogicID &id)
std::map< int, std::vector< float > > m_data
Definition: LMFDat.h:143
LMFDat & setData(int logic_id, const std::vector< float > &data)
Definition: LMFDat.h:49
LMFPnPrimDat & setSystem(std::string s) override
Definition: LMFPnPrimDat.cc:62
std::vector< std::string > m_type
Definition: LMFDat.h:140
std::string getColor() const
bool isValid() override
LMFPnPrimDat & setRMS(EcalLogicID &id, float v)
LMFPnPrimDat & setShapeCorr(EcalLogicID &id, float mean)
std::string m_Error
Definition: LMFDat.h:147
LMFColoredTable & setColor(int color)
LMFPnPrimDat & setM3(EcalLogicID &id, float v)
LMFPnPrimDat & setFlag(EcalLogicID &id, int v)
d
Definition: ztail.py:151
std::map< int, std::vector< float > > getData()
Definition: LMFDat.cc:559
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:145
LMFPnPrimDat & setPNAoverBMean(EcalLogicID &id, float v)
LMFPnPrimDat & setPNAoverBRMS(EcalLogicID &id, float v)
char m_debug
Definition: LMFUnique.h:96
void debug()
Definition: LMFUnique.h:70
float getRMS(EcalLogicID &id)
LMFPnPrimDat & setPNAoverBM3(EcalLogicID &id, float v)
LMFPnPrimDat & setMean(EcalLogicID &id, float v)
virtual std::string getSystem() const
unsigned transform(const HcalDetId &id, unsigned transformCode)