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)
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)
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)
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"); }
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:542
LMFPnPrimDat::getPNAoverBRMS
float getPNAoverBRMS(EcalLogicID &id)
Definition: LMFPnPrimDat.cc:223
LMFColoredTable
Definition: LMFColoredTable.h:20
LMFPnPrimDat::setPNAoverBRMS
LMFPnPrimDat & setPNAoverBRMS(EcalLogicID &id, float v)
Definition: LMFPnPrimDat.cc:167
LMFDat::getData
std::map< int, std::vector< float > > getData()
Definition: LMFDat.cc:559
mps_fire.i
i
Definition: mps_fire.py:428
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
LMFColoredTable::setSystem
virtual LMFColoredTable & setSystem(int system)
Definition: LMFColoredTable.h:40
LMFPnPrimDat::setPNAoverBMean
LMFPnPrimDat & setPNAoverBMean(EcalLogicID &id, float v)
Definition: LMFPnPrimDat.cc:162
LMFPnPrimDat::setSystem
LMFPnPrimDat & setSystem(std::string s) override
Definition: LMFPnPrimDat.cc:62
LMFPnPrimDat::init
void init()
Definition: LMFPnPrimDat.cc:89
LMFPnPrimDat::getRMS
float getRMS(EcalLogicID &id)
Definition: LMFPnPrimDat.cc:215
LMFPnPrimDat.h
gather_cfg.cout
cout
Definition: gather_cfg.py:144
SiStripCommissioningClient_cfg.conn
conn
Definition: SiStripCommissioningClient_cfg.py:5
LMFUnique::m_className
std::string m_className
Definition: LMFUnique.h:99
DDAxes::x
findQualityFiles.v
v
Definition: findQualityFiles.py:179
LMFColoredTable::setColor
LMFColoredTable & setColor(int color)
Definition: LMFColoredTable.h:32
SiStripPI::rms
Definition: SiStripPayloadInspectorHelper.h:169
LMFPnPrimDat::setRMS
LMFPnPrimDat & setRMS(EcalLogicID &id, float v)
Definition: LMFPnPrimDat.cc:134
LMFColoredTable::getSystem
virtual std::string getSystem() const
Definition: LMFColoredTable.cc:48
LMFUnique::m_debug
char m_debug
Definition: LMFUnique.h:100
LMFPnPrimDat::setMean
LMFPnPrimDat & setMean(EcalLogicID &id, float v)
Definition: LMFPnPrimDat.cc:129
alignCSCRings.s
s
Definition: alignCSCRings.py:92
LMFPnPrimDat::setShapeCorr
LMFPnPrimDat & setShapeCorr(EcalLogicID &id, float mean)
Definition: LMFPnPrimDat.cc:150
LMFDat::m_data
std::map< int, std::vector< float > > m_data
Definition: LMFDat.h:143
LMFColoredTable::m_system
int m_system
Definition: LMFColoredTable.h:71
LMFPnPrimDat::LMFPnPrimDat
LMFPnPrimDat()
Definition: LMFPnPrimDat.cc:3
EcalLogicID
Definition: EcalLogicID.h:7
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
LMFDat::setData
LMFDat & setData(int logic_id, const std::vector< float > &data)
Definition: LMFDat.h:49
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
web.browse_db.env
env
Definition: browse_db.py:18
LMFDat::m_keys
std::map< std::string, unsigned int > m_keys
Definition: LMFDat.h:145
LMFPnPrimDat::setM3
LMFPnPrimDat & setM3(EcalLogicID &id, float v)
Definition: LMFPnPrimDat.cc:139
LMFPnPrimDat::getM3
float getM3(EcalLogicID &id)
Definition: LMFPnPrimDat.cc:217
LMFPnPrimDat::setPNAoverBM3
LMFPnPrimDat & setPNAoverBM3(EcalLogicID &id, float v)
Definition: LMFPnPrimDat.cc:157
LMFPnPrimDat
Definition: LMFPnPrimDat.h:19
LMFPnPrimDat::setPN
LMFPnPrimDat & setPN(EcalLogicID &id, float mean, float rms, float m3)
Definition: LMFPnPrimDat.cc:144
LMFPnPrimDat::setPNAoverB
LMFPnPrimDat & setPNAoverB(EcalLogicID &id, float mean, float rms, float m3)
Definition: LMFPnPrimDat.cc:172
LMFColoredTable::m_color
int m_color
Definition: LMFColoredTable.h:70
LMFPnPrimDat::setFlag
LMFPnPrimDat & setFlag(EcalLogicID &id, int v)
Definition: LMFPnPrimDat.cc:178
LMFPnPrimDat::isValid
bool isValid() override
Definition: LMFPnPrimDat.cc:112
LMFColoredTable::getColor
std::string getColor() const
Definition: LMFColoredTable.cc:39
LMFPnPrimDat::getPNAoverBMean
float getPNAoverBMean(EcalLogicID &id)
Definition: LMFPnPrimDat.cc:221
LMFPnPrimDat::getShapeCor
float getShapeCor(EcalLogicID &id)
Definition: LMFPnPrimDat.cc:207
ztail.d
d
Definition: ztail.py:151
LMFPnPrimDat::getMean
float getMean(EcalLogicID &id)
Definition: LMFPnPrimDat.cc:205
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
LMFUnique::debug
void debug()
Definition: LMFUnique.h:74
LMFPnPrimDat::getPNAoverBM3
float getPNAoverBM3(EcalLogicID &id)
Definition: LMFPnPrimDat.cc:219
LMFDat::m_type
std::vector< std::string > m_type
Definition: LMFDat.h:140
LMFPnPrimDat::getFlag
int getFlag(EcalLogicID &id)
Definition: LMFPnPrimDat.cc:225
LMFDat::m_Error
std::string m_Error
Definition: LMFDat.h:147
EcalDBConnection
Definition: EcalDBConnection.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37