CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalDbASCIIIO.cc
Go to the documentation of this file.
1 
2 //
3 // F.Ratnikov (UMd), Oct 28, 2005
4 // $Id: HcalDbASCIIIO.cc,v 1.57 2010/09/20 11:56:02 rofierzy Exp $
5 //
6 #include <vector>
7 #include <string>
8 #include <cstdio>
9 #include <sstream>
10 
15 
19 
20 namespace {
21  class DetIdLess {
22  public:
23  bool operator () (DetId fFirst, DetId fSecond) const {
24  HcalGenericDetId first (fFirst);
25  HcalGenericDetId second (fSecond);
26  if (first.genericSubdet () != second.genericSubdet ()) return first.genericSubdet () < second.genericSubdet ();
27  if (first.isHcalDetId ()) {
28  HcalDetId f1 (first);
29  HcalDetId s1 (second);
30  return f1.zside () != s1.zside () ? f1.zside () < s1.zside () :
31  f1.iphi () != s1.iphi () ? f1.iphi () < s1.iphi () :
32  f1.ietaAbs () != s1.ietaAbs () ? f1.ietaAbs () < s1.ietaAbs () :
33  f1.depth () < s1.depth ();
34  }
35  else {
36  return first.rawId() < second.rawId();
37  }
38  }
39  };
40  class HcalElectronicsIdLess {
41  public:
42  bool operator () (HcalElectronicsId first, HcalElectronicsId second) const {
43  return
44  first.readoutVMECrateId () != second.readoutVMECrateId () ? first.readoutVMECrateId () < second.readoutVMECrateId () :
45  first.htrSlot () != second.htrSlot () ? first.htrSlot () < second.htrSlot () :
46  first.htrTopBottom () != second.htrTopBottom () ? first.htrTopBottom () < second.htrTopBottom () :
47  first.fiberIndex () != second.fiberIndex () ? first.fiberIndex () < second.fiberIndex () :
48  first.fiberChanId () < second.fiberChanId ();
49  }
50  };
51 }
52 
53 // ------------------------------ some little helpers ------------------------------
54 
55 std::vector <std::string> splitString (const std::string& fLine) {
56  std::vector <std::string> result;
57  int start = 0;
58  bool empty = true;
59  for (unsigned i = 0; i <= fLine.size (); i++) {
60  if (fLine [i] == ' ' || i == fLine.size ()) {
61  if (!empty) {
62  std::string item (fLine, start, i-start);
63  result.push_back (item);
64  empty = true;
65  }
66  start = i+1;
67  }
68  else {
69  if (empty) empty = false;
70  }
71  }
72  return result;
73 }
74 
75 std::vector <unsigned int> splitStringToIntByComma (const std::string& fLine) {
76  std::vector <unsigned int> result;
77  int start = 0;
78  bool empty = true;
79  for (unsigned i = 0; i <= fLine.size (); i++) {
80  if (fLine [i] == ',' || i == fLine.size ()) {
81  if (!empty) {
82  std::string itemString (fLine, start, i-start);
83  result.push_back (atoi (itemString.c_str()) );
84  empty = true;
85  }
86  start = i+1;
87  }
88  else {
89  if (empty) empty = false;
90  }
91  }
92  return result;
93 }
94 
95 DetId HcalDbASCIIIO::getId (const std::vector <std::string> & items) {
96  HcalText2DetIdConverter converter (items [3], items [0], items [1], items [2]);
97  return converter.getId ();
98 }
99 
100 void HcalDbASCIIIO::dumpId (std::ostream& fOutput, DetId id) {
101  HcalText2DetIdConverter converter (id);
102  char buffer [1024];
103  sprintf (buffer, " %15s %15s %15s %15s",
104  converter.getField1 ().c_str (), converter.getField2 ().c_str (), converter.getField3 ().c_str (),converter.getFlavor ().c_str ());
105  fOutput << buffer;
106 }
107 
108 // ------------------------------ start templates ------------------------------
109 
110 template<class T>
111 bool from_string(T& t, const std::string& s, std::ios_base& (*f)(std::ios_base&)) {
112  std::istringstream iss(s);
113  return !(iss >> f >> t).fail();
114 }
115 
116 template <class T,class S>
117 bool getHcalObject (std::istream& fInput, T* fObject, S* fCondObject) {
118  if (!fObject) fObject = new T;
119  char buffer [1024];
120  while (fInput.getline(buffer, 1024)) {
121  if (buffer [0] == '#') continue; //ignore comment
122  std::vector <std::string> items = splitString (std::string (buffer));
123  if (items.size()==0) continue; // blank line
124  if (items.size () < 8) {
125  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 8 items: eta, phi, depth, subdet, 4x values" << std::endl;
126  continue;
127  }
128  DetId id = HcalDbASCIIIO::getId (items);
129 
130 // if (fObject->exists(id) )
131 // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
132 // else
133 // {
134  fCondObject = new S(id, atof (items [4].c_str()), atof (items [5].c_str()),
135  atof (items [6].c_str()), atof (items [7].c_str()));
136  fObject->addValues(*fCondObject);
137  delete fCondObject;
138  // }
139  }
140 
141  return true;
142 }
143 
144 template <class T>
145 bool dumpHcalObject (std::ostream& fOutput, const T& fObject) {
146  char buffer [1024];
147  sprintf (buffer, "# %15s %15s %15s %15s %8s %8s %8s %8s %10s\n", "eta", "phi", "dep", "det", "cap0", "cap1", "cap2", "cap3", "DetId");
148  fOutput << buffer;
149  std::vector<DetId> channels = fObject.getAllChannels ();
150  std::sort (channels.begin(), channels.end(), DetIdLess ());
151  for (std::vector<DetId>::iterator channel = channels.begin ();
152  channel != channels.end ();
153  channel++) {
154  const float* values = fObject.getValues (*channel)->getValues ();
155  if (values) {
156  HcalDbASCIIIO::dumpId (fOutput, *channel);
157  sprintf (buffer, " %8.5f %8.5f %8.5f %8.5f %10X\n",
158  values[0], values[1], values[2], values[3], channel->rawId ());
159  fOutput << buffer;
160  }
161  }
162  return true;
163 }
164 
165 template <class T,class S>
166 bool getHcalSingleFloatObject (std::istream& fInput, T* fObject, S* fCondObject) {
167  if (!fObject) fObject = new T;
168  char buffer [1024];
169  while (fInput.getline(buffer, 1024)) {
170  if (buffer [0] == '#') continue; //ignore comment
171  std::vector <std::string> items = splitString (std::string (buffer));
172  if (items.size()==0) continue; // blank line
173  if (items.size () < 5) {
174  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 5 items: eta, phi, depth, subdet, value" << std::endl;
175  continue;
176  }
177  DetId id = HcalDbASCIIIO::getId (items);
178 
179 // if (fObject->exists(id) )
180 // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
181 // else
182 // {
183  fCondObject = new S(id, atof (items [4].c_str()) );
184  fObject->addValues(*fCondObject);
185  delete fCondObject;
186  // }
187  }
188  return true;
189 }
190 
191 template <class T>
192 bool dumpHcalSingleFloatObject (std::ostream& fOutput, const T& fObject) {
193  char buffer [1024];
194  sprintf (buffer, "# %15s %15s %15s %15s %8s %10s\n", "eta", "phi", "dep", "det", "value", "DetId");
195  fOutput << buffer;
196  std::vector<DetId> channels = fObject.getAllChannels ();
197  std::sort (channels.begin(), channels.end(), DetIdLess ());
198  for (std::vector<DetId>::iterator channel = channels.begin ();
199  channel != channels.end ();
200  channel++) {
201  const float value = fObject.getValues (*channel)->getValue ();
202  HcalDbASCIIIO::dumpId (fOutput, *channel);
203  sprintf (buffer, " %8.5f %10X\n",
204  value, channel->rawId ());
205  fOutput << buffer;
206  }
207  return true;
208 }
209 
210 template <class T,class S>
211 bool getHcalSingleIntObject (std::istream& fInput, T* fObject, S* fCondObject) {
212  if (!fObject) fObject = new T;
213  char buffer [1024];
214  while (fInput.getline(buffer, 1024)) {
215  if (buffer [0] == '#') continue; //ignore comment
216  std::vector <std::string> items = splitString (std::string (buffer));
217  if (items.size()==0) continue; // blank line
218  if (items.size () < 5) {
219  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 5 items: eta, phi, depth, subdet, value" << std::endl;
220  continue;
221  }
222  DetId id = HcalDbASCIIIO::getId (items);
223 
224 // if (fObject->exists(id) )
225 // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
226 // else
227 // {
228  fCondObject = new S(id, atoi (items [4].c_str()) );
229  fObject->addValues(*fCondObject);
230  delete fCondObject;
231  // }
232  }
233  return true;
234 }
235 
236 template <class T>
237 bool dumpHcalSingleIntObject (std::ostream& fOutput, const T& fObject) {
238  char buffer [1024];
239  sprintf (buffer, "# %15s %15s %15s %15s %8s %10s\n", "eta", "phi", "dep", "det", "value", "DetId");
240  fOutput << buffer;
241  std::vector<DetId> channels = fObject.getAllChannels ();
242  std::sort (channels.begin(), channels.end(), DetIdLess ());
243  for (std::vector<DetId>::iterator channel = channels.begin ();
244  channel != channels.end ();
245  channel++) {
246  const int value = fObject.getValues (*channel)->getValue ();
247  HcalDbASCIIIO::dumpId (fOutput, *channel);
248  sprintf (buffer, " %15d %10X\n",
249  value, channel->rawId ());
250  fOutput << buffer;
251  }
252  return true;
253 }
254 
255 template <class T,class S>
256 bool getHcalMatrixObject (std::istream& fInput, T* fObject, S* fCondObject) {
257  if (!fObject) fObject = new T;
258  char buffer [1024];
259  while (fInput.getline(buffer, 1024)) {
260  if (buffer [0] == '#') continue; //ignore comment
261  std::vector <std::string> items = splitString (std::string (buffer));
262  if (items.size()==0) continue; // blank line
263  DetId firstid = HcalDbASCIIIO::getId (items);
264  fCondObject = new S(firstid.rawId());
265  for(int j = 0; j != 10; j++) fCondObject->setValue(atoi(items[4].c_str()), 0, j, atof(items[j+5].c_str()));
266  for(int i = 1; i != 40; i++){
267  fInput.getline(buffer, 1024);
268  items = splitString (std::string (buffer));
269  DetId id = HcalDbASCIIIO::getId (items);
270  if(id.rawId() != firstid.rawId()) break;//throw cms::Exception("Wrong number of elements");
271  for(int j = 0; j != 10; j++) fCondObject->setValue(atoi(items[4].c_str()), i%10, j, atof(items[j+5].c_str()));
272  }
273  fObject->addValues(*fCondObject);
274  delete fCondObject;
275  }
276  return true;
277 }
278 
279 template <class T>
280 bool dumpHcalMatrixObject (std::ostream& fOutput, const T& fObject) {
281  char buffer [1024];
282  sprintf (buffer, "# %5s %5s %5s %5s %5s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %10s\n",
283  "eta", "phi", "dep", "det", "capid","c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "DetId");
284  fOutput << buffer;
285  std::vector<DetId> channels = fObject.getAllChannels ();
286  std::sort (channels.begin(), channels.end(), DetIdLess ());
287  for (std::vector<DetId>::iterator channel = channels.begin ();
288  channel != channels.end ();
289  channel++) {
290  float thisline[10];
291  for(int m = 0; m != 4; m++){
292  for(int i = 0; i != 10; i++){
293  for(int j = 0; j != 10; j++){
294 // std::cout <<"test "<<(fObject.getValues(*channel))->getValue(0,0,0);
295  thisline[j] = fObject.getValues(*channel)->getValue(m,i,j);
296 // thisline[j] = fObject.getValues(*channel)->getValue(1,1,1);
297  }
298  HcalDbASCIIIO::dumpId (fOutput, *channel);
299  sprintf(buffer, " %5i %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %10X\n",
300  m, thisline[0], thisline[1], thisline[2], thisline[3], thisline[4], thisline[5], thisline[6], thisline[7],
301  thisline[8], thisline[9], channel->rawId());
302  fOutput << buffer;
303  }
304  }
305  }
306 
307  return true;
308 }
309 
310 // ------------------------------ end templates ------------------------------
311 
312 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalGains* fObject) {return getHcalObject (fInput, fObject, new HcalGain);}
313 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalGains& fObject) {return dumpHcalObject (fOutput, fObject);}
314 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalGainWidths* fObject) {return getHcalObject (fInput, fObject, new HcalGainWidth);}
315 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalGainWidths& fObject) {return dumpHcalObject (fOutput, fObject);}
316 
317 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalRespCorrs* fObject) {return getHcalSingleFloatObject (fInput, fObject, new HcalRespCorr); }
318 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalRespCorrs& fObject) {return dumpHcalSingleFloatObject (fOutput, fObject); }
319 
320 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalLUTCorrs* fObject) {return getHcalSingleFloatObject (fInput, fObject, new HcalLUTCorr); }
321 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalLUTCorrs& fObject) {return dumpHcalSingleFloatObject (fOutput, fObject); }
322 
323 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalPFCorrs* fObject) {return getHcalSingleFloatObject (fInput, fObject, new HcalPFCorr); }
324 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalPFCorrs& fObject) {return dumpHcalSingleFloatObject (fOutput, fObject); }
325 
326 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalTimeCorrs* fObject) {return getHcalSingleFloatObject (fInput, fObject, new HcalTimeCorr); }
327 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalTimeCorrs& fObject) {return dumpHcalSingleFloatObject (fOutput, fObject); }
328 
329 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalZSThresholds* fObject) {return getHcalSingleIntObject (fInput, fObject, new HcalZSThreshold); }
330 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalZSThresholds& fObject) {return dumpHcalSingleIntObject (fOutput, fObject); }
331 
332 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalValidationCorrs* fObject) {return getHcalSingleFloatObject (fInput, fObject, new HcalValidationCorr); }
333 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalValidationCorrs& fObject) {return dumpHcalSingleFloatObject (fOutput, fObject); }
334 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalCholeskyMatrices* fObject) {return getHcalMatrixObject (fInput, fObject, new HcalCholeskyMatrix); }
335 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalCholeskyMatrices& fObject) {return dumpHcalMatrixObject (fOutput, fObject); }
336 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalCovarianceMatrices* fObject) {return getHcalMatrixObject (fInput, fObject, new HcalCovarianceMatrix); }
337 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalCovarianceMatrices& fObject) {return dumpHcalMatrixObject (fOutput, fObject); }
338 
339 
340 // ------------------------------ start specific implementations ------------------------------
341 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalRecoParams* fObject)
342 {
343  if (!fObject) fObject = new HcalRecoParams();
344  char buffer [1024];
345  while (fInput.getline(buffer, 1024)) {
346  if (buffer [0] == '#') continue; //ignore comment
347  std::vector <std::string> items = splitString (std::string (buffer));
348  if (items.size()==0) continue; // blank line
349  if (items.size () < 6) {
350  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 6 items: eta, phi, depth, subdet, firstSample, samplesToAdd" << std::endl;
351  continue;
352  }
353  DetId id = HcalDbASCIIIO::getId (items);
354 
355  HcalRecoParam* fCondObject = new HcalRecoParam(id, atoi (items [4].c_str()), atoi (items [5].c_str()) );
356  fObject->addValues(*fCondObject);
357  delete fCondObject;
358  }
359  return true;
360 }
361 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalRecoParams& fObject)
362 {
363  char buffer [1024];
364  sprintf (buffer, "# %15s %15s %15s %15s %18s %15s %10s\n", "eta", "phi", "dep", "det", "firstSample", "samplesToAdd", "DetId");
365  fOutput << buffer;
366  std::vector<DetId> channels = fObject.getAllChannels ();
367  std::sort (channels.begin(), channels.end(), DetIdLess ());
368  for (std::vector<DetId>::iterator channel = channels.begin ();
369  channel != channels.end ();
370  channel++) {
371  HcalDbASCIIIO::dumpId (fOutput, *channel);
372  sprintf (buffer, " %15d %15d %16X\n",
373  fObject.getValues (*channel)->firstSample(), fObject.getValues (*channel)->samplesToAdd(), channel->rawId ());
374  fOutput << buffer;
375  }
376  return true;
377 }
378 
379 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalLongRecoParams* fObject)
380 {
381  if (!fObject) fObject = new HcalLongRecoParams();
382  char buffer [1024];
383  while (fInput.getline(buffer, 1024)) {
384  if (buffer [0] == '#') continue; //ignore comment
385  std::vector <std::string> items = splitString (std::string (buffer));
386  if (items.size()==0) continue; // blank line
387  if (items.size() < 5) {
388  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 6 items: eta, phi, depth, subdet, signalTSs, noiseTSs" << std::endl;
389  continue;
390  }
391  if (items.size() > 7) {
392  edm::LogWarning("Format Problem ?") << "Check line: " << buffer << "\n line must contain 6 items: eta, phi, depth, subdet, signalTSs, noiseTSs. "
393  << "\n ! signalTS and noiseTS must be of format <ts1,ts2,ts3,...> withOUT spaces. Ignoring line for safety" << std::endl;
394  continue;
395  }
396  DetId id = HcalDbASCIIIO::getId (items);
397 
398  std::vector<unsigned int> mySignalTS = splitStringToIntByComma(items[4]);
399  std::vector<unsigned int> myNoiseTS = splitStringToIntByComma(items[5]);
400 
401  HcalLongRecoParam* fCondObject = new HcalLongRecoParam(id, mySignalTS, myNoiseTS );
402  fObject->addValues(*fCondObject);
403  delete fCondObject;
404  }
405  return true;
406 }
407 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalLongRecoParams& fObject)
408 {
409  char buffer [1024];
410  sprintf (buffer, "# %15s %15s %15s %15s %10s %10s %10s\n", "eta", "phi", "dep", "det", "signalTSs", "noiseTSs", "DetId");
411  fOutput << buffer;
412  std::vector<DetId> channels = fObject.getAllChannels ();
413  std::sort (channels.begin(), channels.end(), DetIdLess ());
414  for (std::vector<DetId>::iterator channel = channels.begin ();
415  channel != channels.end ();
416  channel++) {
417  HcalGenericDetId fId(*channel);
418  if (fId.isHcalZDCDetId())
419  {
420  std::vector<unsigned int> vSignalTS = fObject.getValues (*channel)->signalTS();
421  std::vector<unsigned int> vNoiseTS = fObject.getValues (*channel)->noiseTS();
422  HcalDbASCIIIO::dumpId (fOutput, *channel);
423  sprintf (buffer, " ");
424  fOutput << buffer;
425  for (unsigned int i=0; i<vSignalTS.size(); i++)
426  {
427  if (i>0) {sprintf (buffer, ","); fOutput << buffer;}
428  sprintf (buffer, "%u", vSignalTS.at(i));
429  fOutput << buffer;
430  }
431  sprintf (buffer, " ");
432  fOutput << buffer;
433  for (unsigned int i=0; i<vNoiseTS.size(); i++)
434  {
435  if (i>0) { sprintf (buffer, ","); fOutput << buffer;}
436  sprintf (buffer, "%u", vNoiseTS.at(i));
437  fOutput << buffer;
438  }
439  sprintf (buffer, " %10X\n", channel->rawId ());
440  fOutput << buffer;
441  }
442  }
443  return true;
444 }
445 
446 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalMCParams* fObject)
447 {
448  if (!fObject) fObject = new HcalMCParams();
449  char buffer [1024];
450  while (fInput.getline(buffer, 1024)) {
451  if (buffer [0] == '#') continue; //ignore comment
452  std::vector <std::string> items = splitString (std::string (buffer));
453  if (items.size()==0) continue; // blank line
454  if (items.size () < 5) {
455  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 5 items: eta, phi, depth, subdet, signalShape" << std::endl;
456  continue;
457  }
458  DetId id = HcalDbASCIIIO::getId (items);
459 
460  HcalMCParam* fCondObject = new HcalMCParam(id, atoi (items [4].c_str()) );
461  fObject->addValues(*fCondObject);
462  delete fCondObject;
463  }
464  return true;
465 }
466 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalMCParams& fObject)
467 {
468  char buffer [1024];
469  sprintf (buffer, "# %15s %15s %15s %15s %14s %10s\n", "eta", "phi", "dep", "det", "signalShape", "DetId");
470  fOutput << buffer;
471  std::vector<DetId> channels = fObject.getAllChannels ();
472  std::sort (channels.begin(), channels.end(), DetIdLess ());
473  for (std::vector<DetId>::iterator channel = channels.begin ();
474  channel != channels.end ();
475  channel++) {
476  const int value = fObject.getValues (*channel)->signalShape();
477  HcalDbASCIIIO::dumpId (fOutput, *channel);
478  sprintf (buffer, " %10d %17X\n",
479  value, channel->rawId ());
480  fOutput << buffer;
481  }
482  return true;
483 }
484 
485 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalPedestals* fObject) {
486  if (!fObject) fObject = new HcalPedestals(false);
487  char buffer [1024];
488 
489  while (fInput.getline(buffer, 1024)) {
490  std::vector <std::string> items = splitString (std::string (buffer));
491  if (items.size()==0) continue; // blank line
492  else {
493  if (items[0] == "#U")
494  {
495  if (items[1] == (std::string)"ADC") fObject->setUnitADC(true);
496  else if (items[1] == (std::string)"fC") fObject->setUnitADC(false);
497  else
498  {
499  edm::LogWarning("Pedestal Unit Error") << "Unrecognized unit for pedestals. Assuming fC." << std::endl;
500  fObject->setUnitADC(false);
501  }
502  break;
503  }
504  else
505  {
506  edm::LogWarning("Pedestal Unit Missing") << "The unit for the pedestals is missing in the txt file." << std::endl;
507  return false;
508  }
509  }
510  }
511  while (fInput.getline(buffer, 1024)) {
512  if (buffer [0] == '#') continue;
513  std::vector <std::string> items = splitString (std::string (buffer));
514  if (items.size()==0) continue; // blank line
515  if (items.size () < 8) {
516  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 8 items: eta, phi, depth, subdet, 4x values"
517  << " or 12 items: eta, phi, depth, subdet, 4x values for mean, 4x values for width"
518  << std::endl;
519  continue;
520  }
521  DetId id = getId (items);
522 
523 // if (fObject->exists(id) )
524 // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
525 // else
526 // {
527 
528  if (items.size() < 12) // old format without widths
529  {
530  HcalPedestal* fCondObject = new HcalPedestal(id, atof (items [4].c_str()), atof (items [5].c_str()),
531  atof (items [6].c_str()), atof (items [7].c_str()),
532  0., 0., 0., 0. );
533  fObject->addValues(*fCondObject);
534  delete fCondObject;
535  }
536  else // new format with widths
537  {
538  HcalPedestal* fCondObject = new HcalPedestal(id, atof (items [4].c_str()), atof (items [5].c_str()),
539  atof (items [6].c_str()), atof (items [7].c_str()),
540  atof (items [8].c_str()), atof (items [9].c_str()),
541  atof (items [10].c_str()), atof (items [11].c_str()) );
542  fObject->addValues(*fCondObject);
543  delete fCondObject;
544  }
545 
546  // }
547  }
548  return true;
549 }
550 
551 
552 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalPedestals& fObject) {
553  char buffer [1024];
554  if (fObject.isADC() ) sprintf (buffer, "#U ADC << this is the unit \n");
555  else sprintf (buffer, "#U fC << this is the unit \n");
556  fOutput << buffer;
557 
558  sprintf (buffer, "# %15s %15s %15s %15s %8s %8s %8s %8s %8s %8s %8s %8s %10s\n", "eta", "phi", "dep", "det", "cap0", "cap1", "cap2", "cap3", "widthcap0", "widthcap1", "widthcap2", "widthcap3", "DetId");
559  fOutput << buffer;
560 
561  std::vector<DetId> channels = fObject.getAllChannels ();
562  std::sort (channels.begin(), channels.end(), DetIdLess ());
563  for (std::vector<DetId>::iterator channel = channels.begin ();
564  channel != channels.end ();
565  channel++) {
566  const float* values = fObject.getValues (*channel)->getValues ();
567  if (values) {
568  dumpId (fOutput, *channel);
569  sprintf (buffer, " %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %10X\n",
570  values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], channel->rawId ());
571  fOutput << buffer;
572  }
573  }
574  return true;
575 }
576 
577 
578 // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
579 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalChannelQuality* fObject)
580 {
581  if (!fObject) fObject = new HcalChannelQuality;
582  char buffer [1024];
583  while (fInput.getline(buffer, 1024)) {
584  if (buffer [0] == '#') continue; //ignore comment
585  std::vector <std::string> items = splitString (std::string (buffer));
586  if (items.size()==0) continue; // blank line
587  if (items.size () < 6) {
588  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 6 items: eta, phi, depth, subdet, base - either (hex) or (dec), value" << std::endl;
589  continue;
590  }
591  DetId id = getId (items);
592 
593 // if (fObject->exists(id) )
594 // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
595 // else
596 // {
597  uint32_t mystatus;
598  if (items[4] == "(hex)")
599  sscanf(items[5].c_str(),"%X", &mystatus);
600  else if (items[4] == "(dec)")
601  sscanf(items[5].c_str(),"%u", &mystatus);
602  else
603  {
604  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n value field must contain the base: one of (hex), (dec)" << std::endl;
605  continue;
606  }
607 
608  HcalChannelStatus* fCondObject = new HcalChannelStatus(id, mystatus); //atoi (items [4].c_str()) );
609  fObject->addValues(*fCondObject);
610  delete fCondObject;
611  // }
612  }
613  return true;
614 }
615 
616 
617 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalChannelQuality& fObject) {
618  char buffer [1024];
619  sprintf (buffer, "# %15s %15s %15s %15s %15s %10s\n", "eta", "phi", "dep", "det", "(base) value", "DetId");
620  fOutput << buffer;
621  std::vector<DetId> channels = fObject.getAllChannels ();
622  std::sort (channels.begin(), channels.end(), DetIdLess ());
623  for (std::vector<DetId>::iterator channel = channels.begin ();
624  channel != channels.end ();
625  channel++) {
626  const int value = fObject.getValues (*channel)->getValue ();
627  dumpId (fOutput, *channel);
628  sprintf (buffer, "%6s %15X %10X\n", "(hex)",
629  value, channel->rawId ());
630  fOutput << buffer;
631  }
632  return true;
633 }
634 
635 
636 // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
637 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalL1TriggerObjects* fObject)
638 {
639  if (!fObject) fObject = new HcalL1TriggerObjects;
640  char buffer [1024];
641 
642  while (fInput.getline(buffer, 1024)) {
643  if (buffer [0] == '#')
644  {
645  if (buffer [1] == 'T') // contains tag name
646  {
647  std::vector <std::string> items = splitString (std::string (buffer) );
648  fObject->setTagString(items[1]);
649  continue;
650  }
651  if (buffer [1] == 'A') // contains algo name
652  {
653  std::vector <std::string> items = splitString (std::string (buffer) );
654  fObject->setAlgoString(items[1]);
655  continue;
656  }
657  else continue; //ignore comment
658  }
659  std::vector <std::string> items = splitString (std::string (buffer));
660  if (items.size()==0) continue; // blank line
661  if (items.size () < 7) {
662  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 7 items: eta, phi, depth, subdet, pedestal, resp.corr.gain, flag" << std::endl;
663  continue;
664  }
665  DetId id = getId (items);
666 
667  HcalL1TriggerObject* fCondObject = new HcalL1TriggerObject(id, atof(items[4].c_str()), atof(items[5].c_str()), atoi(items[6].c_str()) );
668 
669  fObject->addValues(*fCondObject);
670  delete fCondObject;
671  }
672  return true;
673 }
674 
675 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalL1TriggerObjects& fObject)
676 {
677  char buffer [1024];
678  //first print tag and algo
679  sprintf (buffer, "#T %s << this is the tag name \n", fObject.getTagString().c_str() );
680  fOutput << buffer;
681  sprintf (buffer, "#A %s << this is the algorithm name \n", fObject.getAlgoString().c_str() );
682  fOutput << buffer;
683 
684  //then the values
685  sprintf (buffer, "# %15s %15s %15s %15s %8s %13s %8s %10s\n",
686  "eta", "phi", "dep", "det", "ped", "respcorrgain", "flag",
687  "DetId");
688  fOutput << buffer;
689  std::vector<DetId> channels = fObject.getAllChannels ();
690  // std::sort (channels.begin(), channels.end(), DetIdLess ());
691  for (std::vector<DetId>::iterator channel = channels.begin ();
692  channel != channels.end ();
693  channel++) {
694  const HcalL1TriggerObject* item = fObject.getValues (*channel);
695  if (item) {
696  dumpId (fOutput, *channel);
697  sprintf (buffer, " %10.7f %10.7f %12d %10X\n",
698  item->getPedestal(), item->getRespGain(), item->getFlag(), channel->rawId ());
699  fOutput << buffer;
700  }
701  }
702  return true;
703 
704 }
705 
706 
707 // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
708 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalPedestalWidths* fObject) {
709  if (!fObject) fObject = new HcalPedestalWidths(false);
710  char buffer [1024];
711  int linecounter = 0;
712 
713  while (fInput.getline(buffer, 1024)) {
714  linecounter++;
715  std::vector <std::string> items = splitString (std::string (buffer));
716  if (items.size()==0) continue; // blank line
717  else {
718  if (items[0] == (std::string)"#U")
719  {
720  if (items[1] == (std::string)"ADC") fObject->setUnitADC(true);
721  else if (items[1] == (std::string)"fC") fObject->setUnitADC(false);
722  else
723  {
724  edm::LogWarning("Pedestal Width Unit Error") << "Unrecognized unit for pedestal widths. Assuming fC." << std::endl;
725  fObject->setUnitADC(false);
726  }
727  break;
728  }
729  else
730  {
731  edm::LogWarning("Pedestal Width Unit Missing") << "The unit for the pedestal widths is missing in the txt file." << std::endl;
732  return false;
733  }
734  }
735  }
736 
737  while (fInput.getline(buffer, 1024)) {
738  linecounter++;
739  if (buffer [0] == '#') continue; //ignore comment
740  std::vector <std::string> items = splitString (std::string (buffer));
741  if (items.size()==0) continue; // blank line
742  if (items.size () < 14) {
743  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line number: " << linecounter << "\n line must contain 14 items: eta, phi, depth, subdet, 10x correlations"
744  << " or 20 items: eta, phi, depth, subdet, 16x correlations"
745  << std::endl;
746  continue;
747  }
748  DetId id = getId (items);
749 
750 // if (fObject->exists(id) )
751 // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
752 // else
753 // {
754 
755  if (items.size() < 20) //old format
756  {
758  values.setSigma (0, 0, atof (items [4].c_str()));
759  values.setSigma (1, 0, atof (items [5].c_str()));
760  values.setSigma (1, 1, atof (items [6].c_str()));
761  values.setSigma (2, 0, atof (items [7].c_str()));
762  values.setSigma (2, 1, atof (items [8].c_str()));
763  values.setSigma (2, 2, atof (items [9].c_str()));
764  values.setSigma (3, 0, atof (items [10].c_str()));
765  values.setSigma (3, 1, atof (items [11].c_str()));
766  values.setSigma (3, 2, atof (items [12].c_str()));
767  values.setSigma (3, 3, atof (items [13].c_str()));
768  values.setSigma (0, 1, 0.);
769  values.setSigma (0, 2, 0.);
770  values.setSigma (0, 3, 0.);
771  values.setSigma (1, 2, 0.);
772  values.setSigma (1, 3, 0.);
773  values.setSigma (2, 3, 0.);
774  fObject->addValues(values);
775  }
776  else // new format
777  {
779  values.setSigma (0, 0, atof (items [4].c_str()) );
780  values.setSigma (0, 1, atof (items [5].c_str()) );
781  values.setSigma (0, 2, atof (items [6].c_str()) );
782  values.setSigma (0, 3, atof (items [7].c_str()) );
783  values.setSigma (1, 0, atof (items [8].c_str()) );
784  values.setSigma (1, 1, atof (items [9].c_str()) );
785  values.setSigma (1, 2, atof (items [10].c_str()) );
786  values.setSigma (1, 3, atof (items [11].c_str()) );
787  values.setSigma (2, 0, atof (items [12].c_str()) );
788  values.setSigma (2, 1, atof (items [13].c_str()) );
789  values.setSigma (2, 2, atof (items [14].c_str()) );
790  values.setSigma (2, 3, atof (items [15].c_str()) );
791  values.setSigma (3, 0, atof (items [16].c_str()) );
792  values.setSigma (3, 1, atof (items [17].c_str()) );
793  values.setSigma (3, 2, atof (items [18].c_str()) );
794  values.setSigma (3, 3, atof (items [19].c_str()) );
795  fObject->addValues(values);
796  }
797 
798  // }
799  }
800  return true;
801 }
802 
803 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalPedestalWidths& fObject) {
804  char buffer [1024];
805  if (fObject.isADC() ) sprintf (buffer, "#U ADC << this is the unit \n");
806  else sprintf (buffer, "#U fC << this is the unit \n");
807  fOutput << buffer;
808 
809  sprintf (buffer, "# %15s %15s %15s %15s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %10s\n",
810  "eta", "phi", "dep", "det",
811  "cov_0_0", "cov_0_1", "cov_0_2", "cov_0_3", "cov_1_0", "cov_1_1", "cov_1_2", "cov_1_3", "cov_2_0", "cov_2_1", "cov_2_2", "cov_2_3", "cov_3_0", "cov_3_1", "cov_3_2", "cov_3_3",
812  "DetId");
813  fOutput << buffer;
814  std::vector<DetId> channels = fObject.getAllChannels ();
815  std::sort (channels.begin(), channels.end(), DetIdLess ());
816  for (std::vector<DetId>::iterator channel = channels.begin ();
817  channel != channels.end ();
818  channel++) {
819  const HcalPedestalWidth* item = fObject.getValues (*channel);
820  if (item) {
821  dumpId (fOutput, *channel);
822  sprintf (buffer, " %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %10X\n",
823  item->getSigma (0,0), item->getSigma (0,1), item->getSigma (0,2), item->getSigma (0,3),
824  item->getSigma (1,0), item->getSigma (1,1), item->getSigma (1,2), item->getSigma (1,3),
825  item->getSigma (2,0), item->getSigma (2,1), item->getSigma (2,2), item->getSigma (2,3),
826  item->getSigma (3,0), item->getSigma (3,1), item->getSigma (3,2), item->getSigma (3,3), channel->rawId ());
827  fOutput << buffer;
828  }
829  }
830  return true;
831 }
832 
833 
834 // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
835 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalQIEData* fObject) {
836  char buffer [1024];
837  while (fInput.getline(buffer, 1024)) {
838  if (buffer [0] == '#') continue; //ignore comment
839  std::vector <std::string> items = splitString (std::string (buffer));
840  if (items.size()<1) continue;
841  if (items [0] == "SHAPE") { // basic shape
842  if (items.size () < 33) {
843  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 33 items: SHAPE 32 x low QIE edges for first 32 bins" << std::endl;
844  continue;
845  }
846  float lowEdges [32];
847  int i = 32;
848  while (--i >= 0) lowEdges [i] = atof (items [i+1].c_str ());
849  // fObject->setShape (lowEdges);
850  }
851  else { // QIE parameters
852  if (items.size () < 36) {
853  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 36 items: eta, phi, depth, subdet, 4 capId x 4 Ranges x offsets, 4 capId x 4 Ranges x slopes" << std::endl;
854  continue;
855  }
856  DetId id = getId (items);
857  fObject->sort ();
858  // try {
859  // fObject->getCoder (id);
860  // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
861  // }
862 // catch (cms::Exception& e) {
863  HcalQIECoder coder (id.rawId ());
864  int index = 4;
865  for (unsigned capid = 0; capid < 4; capid++) {
866  for (unsigned range = 0; range < 4; range++) {
867  coder.setOffset (capid, range, atof (items [index++].c_str ()));
868  }
869  }
870  for (unsigned capid = 0; capid < 4; capid++) {
871  for (unsigned range = 0; range < 4; range++) {
872  coder.setSlope (capid, range, atof (items [index++].c_str ()));
873  }
874  }
875  fObject->addCoder (coder);
876 // }
877  }
878  }
879  fObject->sort ();
880  return true;
881 }
882 
883 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalQIEData& fObject) {
884  char buffer [1024];
885  fOutput << "# QIE basic shape: SHAPE 32 x low edge values for first 32 channels" << std::endl;
886  sprintf (buffer, "SHAPE ");
887  fOutput << buffer;
888  for (unsigned bin = 0; bin < 32; bin++) {
889  sprintf (buffer, " %8.5f", fObject.getShape ().lowEdge (bin));
890  fOutput << buffer;
891  }
892  fOutput << std::endl;
893 
894  fOutput << "# QIE data" << std::endl;
895  sprintf (buffer, "# %15s %15s %15s %15s %36s %36s %36s %36s %36s %36s %36s %36s\n",
896  "eta", "phi", "dep", "det",
897  "4 x offsets cap0", "4 x offsets cap1", "4 x offsets cap2", "4 x offsets cap3",
898  "4 x slopes cap0", "4 x slopes cap1", "4 x slopes cap2", "4 x slopes cap3");
899  fOutput << buffer;
900  std::vector<DetId> channels = fObject.getAllChannels ();
901  std::sort (channels.begin(), channels.end(), DetIdLess ());
902  for (std::vector<DetId>::iterator channel = channels.begin ();
903  channel != channels.end ();
904  channel++) {
905  const HcalQIECoder* coder = fObject.getCoder (*channel);
906  dumpId (fOutput, *channel);
907  for (unsigned capid = 0; capid < 4; capid++) {
908  for (unsigned range = 0; range < 4; range++) {
909  sprintf (buffer, " %8.5f", coder->offset (capid, range));
910  fOutput << buffer;
911  }
912  }
913  for (unsigned capid = 0; capid < 4; capid++) {
914  for (unsigned range = 0; range < 4; range++) {
915  sprintf (buffer, " %8.5f", coder->slope (capid, range));
916  fOutput << buffer;
917  }
918  }
919  fOutput << std::endl;
920  }
921  return true;
922 }
923 
924 // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
925 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalCalibrationQIEData* fObject) {
926  char buffer [1024];
927  while (fInput.getline(buffer, 1024)) {
928  if (buffer [0] == '#') continue; //ignore comment
929  std::vector <std::string> items = splitString (std::string (buffer));
930  if (items.size () < 36) {
931  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 36 items: eta, phi, depth, subdet, 32 bin values" << std::endl;
932  continue;
933  }
934  DetId id = getId (items);
935  fObject->sort ();
936  // try {
937  // fObject->getCoder (id);
938  // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
939  // }
940 // catch (cms::Exception& e) {
941  HcalCalibrationQIECoder coder (id.rawId ());
942  int index = 4;
943  float values [32];
944  for (unsigned bin = 0; bin < 32; bin++) {
945  values[bin] = atof (items [index++].c_str ());
946  }
947  coder.setMinCharges (values);
948  fObject->addCoder (coder);
949 // }
950  }
951  fObject->sort ();
952  return true;
953 }
954 
955 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalCalibrationQIEData& fObject) {
956  char buffer [1024];
957  fOutput << "# QIE data in calibration mode" << std::endl;
958  sprintf (buffer, "# %15s %15s %15s %15s %288s\n",
959  "eta", "phi", "dep", "det", "32 x charges");
960  fOutput << buffer;
961  std::vector<DetId> channels = fObject.getAllChannels ();
962  std::sort (channels.begin(), channels.end(), DetIdLess ());
963  for (std::vector<DetId>::iterator channel = channels.begin ();
964  channel != channels.end ();
965  channel++) {
966  const HcalCalibrationQIECoder* coder = fObject.getCoder (*channel);
967  if (coder) {
968  dumpId (fOutput, *channel);
969  const float* lowEdge = coder->minCharges ();
970  for (unsigned bin = 0; bin < 32; bin++) {
971  sprintf (buffer, " %8.5f", lowEdge [bin]);
972  fOutput << buffer;
973  }
974  fOutput << std::endl;
975  }
976  }
977  return true;
978 }
979 
980 
981 // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
982 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalElectronicsMap* fObject) {
983  char buffer [1024];
984  while (fInput.getline(buffer, 1024)) {
985  if (buffer [0] == '#') continue; //ignore comment
986  std::vector <std::string> items = splitString (std::string (buffer));
987  if (items.size () < 12) {
988  if (items.size()==0) continue; // no warning here
989  if (items.size()<9) {
990  edm::LogError("MapFormat") << "HcalElectronicsMap-> line too short: " << buffer;
991  continue;
992  }
993  if (items[8]=="NA" || items[8]=="NT") {
994  while (items.size()<12) items.push_back(""); // don't worry here
995  } else if (items[8]=="HT") {
996  if (items.size()==11) items.push_back("");
997  else {
998  edm::LogError("MapFormat") << "HcalElectronicsMap-> Bad line: " << buffer
999  << "\n HT line must contain at least 11 items: i cr sl tb dcc spigot fiber fiberchan subdet=HT ieta iphi";
1000  continue;
1001  }
1002  } else {
1003  edm::LogError("MapFormat") << "HcalElectronicsMap-> Bad line: " << buffer
1004  << "\n line must contain 12 items: i cr sl tb dcc spigot fiber fiberchan subdet ieta iphi depth";
1005  continue;
1006  }
1007  }
1008  // std::cout << "HcalElectronicsMap-> processing line: " << buffer << std::endl;
1009  int crate = atoi (items [1].c_str());
1010  int slot = atoi (items [2].c_str());
1011  int top = 1;
1012  if (items [3] == "b") top = 0;
1013  int dcc = atoi (items [4].c_str());
1014  int spigot = atoi (items [5].c_str());
1015  HcalElectronicsId elId;
1016  if (items[8] == "HT" || items[8] == "NT") {
1017  int slb = atoi (items [6].c_str());
1018  int slbCh = atoi (items [7].c_str());
1019  elId=HcalElectronicsId(slbCh, slb, spigot, dcc,crate,slot,top);
1020  } else {
1021  int fiber = atoi (items [6].c_str());
1022  int fiberCh = atoi (items [7].c_str());
1023 
1024  elId=HcalElectronicsId(fiberCh, fiber, spigot, dcc);
1025  elId.setHTR (crate, slot, top);
1026  }
1027 
1028  // first, handle undefined cases
1029  if (items [8] == "NA") { // undefined channel
1030  fObject->mapEId2chId (elId, DetId (HcalDetId::Undefined));
1031  } else if (items [8] == "NT") { // undefined trigger channel
1032  fObject->mapEId2tId (elId, DetId (HcalTrigTowerDetId::Undefined));
1033  } else {
1034  HcalText2DetIdConverter converter (items [8], items [9], items [10], items [11]);
1035  if (converter.isHcalDetId ()) {
1036  fObject->mapEId2chId (elId, converter.getId ());
1037  }
1038  else if (converter.isHcalTrigTowerDetId ()) {
1039  fObject->mapEId2tId (elId, converter.getId ());
1040  }
1041  else if (converter.isHcalCalibDetId ()) {
1042  fObject->mapEId2chId (elId, converter.getId ());
1043  }
1044  else if (converter.isHcalZDCDetId ()) {
1045  fObject->mapEId2chId (elId, converter.getId ());
1046  }
1047  else {
1048  edm::LogWarning("Format Error") << "HcalElectronicsMap-> Unknown subdetector: "
1049  << items [8] << '/' << items [9] << '/' << items [10] << '/' << items [11] << std::endl;
1050  }
1051  }
1052  }
1053  fObject->sort ();
1054  return true;
1055 }
1056 
1057 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalElectronicsMap& fObject) {
1058  std::vector<HcalElectronicsId> eids = fObject.allElectronicsId ();
1059  char buf [1024];
1060  // changes by Jared, 6.03.09/(included 25.03.09)
1061  // sprintf (buf, "#%10s %6s %6s %6s %6s %6s %6s %6s %15s %15s %15s %15s",
1062  sprintf (buf, "# %7s %3s %3s %3s %4s %7s %10s %14s %7s %5s %5s %6s",
1063  "i", "cr", "sl", "tb", "dcc", "spigot", "fiber/slb", "fibcha/slbcha", "subdet", "ieta", "iphi", "depth");
1064  fOutput << buf << std::endl;
1065 
1066  for (unsigned i = 0; i < eids.size (); i++) {
1067  HcalElectronicsId eid = eids[i];
1068  if (eid.isTriggerChainId()) {
1069  DetId trigger = fObject.lookupTrigger (eid);
1070  if (trigger.rawId ()) {
1071  HcalText2DetIdConverter converter (trigger);
1072  // changes by Jared, 6.03.09/(included 25.03.09)
1073  // sprintf (buf, " %10X %6d %6d %6c %6d %6d %6d %6d %15s %15s %15s %15s",
1074  sprintf (buf, " %7X %3d %3d %3c %4d %7d %10d %14d %7s %5s %5s %6s",
1075  // i,
1076  converter.getId().rawId(),
1077  // changes by Jared, 6.03.09/(included 25.03.09)
1078  // eid.readoutVMECrateId(), eid.htrSlot(), eid.htrTopBottom()>0?'t':'b', eid.dccid(), eid.spigot(), eid.fiberIndex(), eid.fiberChanId(),
1079  eid.readoutVMECrateId(), eid.htrSlot(), eid.htrTopBottom()>0?'t':'b', eid.dccid(), eid.spigot(), eid.slbSiteNumber(), eid.slbChannelIndex(),
1080  converter.getFlavor ().c_str (), converter.getField1 ().c_str (), converter.getField2 ().c_str (), converter.getField3 ().c_str ()
1081  );
1082  fOutput << buf << std::endl;
1083  }
1084  } else {
1085  DetId channel = fObject.lookup (eid);
1086  if (channel.rawId()) {
1087  HcalText2DetIdConverter converter (channel);
1088  // changes by Jared, 6.03.09/(included 25.03.09)
1089  // sprintf (buf, " %10X %6d %6d %6c %6d %6d %6d %6d %15s %15s %15s %15s",
1090  sprintf (buf, " %7X %3d %3d %3c %4d %7d %10d %14d %7s %5s %5s %6s",
1091  // i,
1092  converter.getId().rawId(),
1093  eid.readoutVMECrateId(), eid.htrSlot(), eid.htrTopBottom()>0?'t':'b', eid.dccid(), eid.spigot(), eid.fiberIndex(), eid.fiberChanId(),
1094  converter.getFlavor ().c_str (), converter.getField1 ().c_str (), converter.getField2 ().c_str (), converter.getField3 ().c_str ()
1095  );
1096  fOutput << buf << std::endl;
1097  }
1098  }
1099  }
1100  return true;
1101 }
1102 
1103 
1104 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalLutMetadata* fObject){
1105  if (!fObject) fObject = new HcalLutMetadata;
1106  char buffer [1024];
1107  while (fInput.getline(buffer, 1024)) {
1108  if (buffer [0] == '#') continue; //ignore comment
1109  std::vector <std::string> items = splitString (std::string (buffer));
1110  if (items.size()==0) continue; // blank line
1111  // now get non-channel data
1112  if (items.size() > 1 &&
1113  items[0].find("RctLsb")!=std::string::npos){
1114  fObject->setRctLsb( atof( items[1].c_str() ) );
1115  continue;
1116  }
1117  if (items.size() > 1 &&
1118  items[0].find("Gain")!=std::string::npos){
1119  fObject->setNominalGain( atof( items[1].c_str() ) );
1120  continue;
1121  }
1122  // now proceeed to per-channel data
1123  if (items.size () < 7) {
1124  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 7 items: eta, phi, depth, subdet, Rcalib, LutGranularity, OutputLutThreshold" << std::endl;
1125  continue;
1126  }
1127  DetId id = getId (items);
1128 
1129  HcalLutMetadatum * fCondObject = new HcalLutMetadatum(id,
1130  atof (items [4].c_str()),
1131  atoi (items [5].c_str()),
1132  atoi (items [6].c_str()));
1133  fObject->addValues(*fCondObject);
1134  delete fCondObject;
1135  }
1136  return true;
1137 }
1138 
1139 
1140 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalLutMetadata& fObject){
1141  char buffer [1024];
1142  const float _rctLsb = fObject.getRctLsb();
1143  const float _gain = fObject.getNominalGain();
1144  sprintf (buffer, "# %20s\n", "Non-channel data");
1145  fOutput << buffer;
1146  sprintf (buffer, "%8s %8.5f\n", "RctLsb", _rctLsb);
1147  fOutput << buffer;
1148  sprintf (buffer, "%8s %8.5f\n", "Gain", _gain);
1149  fOutput << buffer;
1150  sprintf (buffer, "# %15s %15s %15s %15s %8s %15s %19s %10s\n", "eta", "phi", "dep", "det", "Rcalib", "LutGranularity", "OutputLutThreshold", "DetId");
1151  fOutput << buffer;
1152  std::vector<DetId> channels = fObject.getAllChannels ();
1153  std::sort (channels.begin(), channels.end(), DetIdLess ());
1154  for (std::vector<DetId>::iterator channel = channels.begin ();
1155  channel != channels.end ();
1156  channel++) {
1157  const float _rCalib = fObject.getValues (*channel)->getRCalib();
1158  const uint8_t _lutGranularity = fObject.getValues (*channel)->getLutGranularity();
1159  const uint8_t _outputLutThreshold = fObject.getValues (*channel)->getOutputLutThreshold();
1160  dumpId (fOutput, *channel);
1161  sprintf (buffer, " %8.5f %15d %19d %10X\n",
1162  _rCalib,
1163  _lutGranularity,
1164  _outputLutThreshold,
1165  channel->rawId ());
1166  fOutput << buffer;
1167  }
1168  return true;
1169 }
1170 
1171 //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1172 bool HcalDbASCIIIO::getObject(std::istream& fInput, HcalDcsValues * fObject) {
1173  if (!fObject) fObject = new HcalDcsValues;
1174  std::string buffer;
1175  while (getline(fInput, buffer)) {
1176  if (buffer.at(0) == '#') continue; //ignore comment
1177  std::vector <std::string> items = splitString (buffer);
1178  if (items.size()==0) continue; // blank line
1179 
1180  if (items.size() < 9) {
1181  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 9 items: subDet, side_ring, slice, type, subChannel, LS, Value, UpperLimit, LowerLimit" << std::endl;
1182  continue;
1183  }
1184 
1185  HcalOtherSubdetector subd;
1186  int sidering;
1187  unsigned int slice, subchan;
1188  switch (items[0].at(1)) {
1189  case 'B':
1190  subd = HcalDcsBarrel;
1191  break;
1192  case 'E':
1193  subd = HcalDcsEndcap;
1194  break;
1195  case 'F':
1196  subd = HcalDcsForward;
1197  break;
1198  case 'O':
1199  subd = HcalDcsOuter;
1200  break;
1201  default:
1202  continue;
1203  }
1204  //from_string<int>(subd, items[0], std::dec);
1205  from_string<int>(sidering, items[1], std::dec);
1206  from_string<unsigned int>(slice, items[2], std::dec);
1207  //from_string<int>(ty, items[3], std::dec);
1208  from_string<unsigned int>(subchan, items[4], std::dec);
1209 
1210  HcalDcsDetId newId(subd, sidering, slice,
1211  HcalDcsDetId::DcsTypeFromString(items[3]), subchan);
1212 
1213  int LS;
1214  float val,upper,lower;
1215  from_string<int>(LS, items[5], std::dec);
1216  from_string<float>(val, items[6], std::dec);
1217  from_string<float>(upper, items[7], std::dec);
1218  from_string<float>(lower, items[8], std::dec);
1219 
1220  HcalDcsValue newVal(newId.rawId(),LS,val,upper,lower);
1221 // std::cout << buffer << '\n';
1222 // std::cout << subd << ' ' << sidering << ' ' << slice << ' '
1223 // << ty << ' ' << subchan << ' ' << LS << ' '
1224 // << val << ' ' << upper << ' ' << lower << '\n';
1225 // std::cout << newId ;
1226  if (!(fObject->addValue(newVal))) {
1227  edm::LogWarning("Data Error") << "Data from line " << buffer
1228  << "\nwas not added to the HcalDcsValues object." << std::endl;
1229  }
1230 // std::cout << std::endl;
1231  }
1232  fObject->sortAll();
1233  return true;
1234 }
1235 
1236 bool HcalDbASCIIIO::dumpObject(std::ostream& fOutput,
1237  HcalDcsValues const& fObject) {
1238  fOutput << "# subDet side_ring slice type subChan LS Value UpperLimit LowerLimit DcsId\n";
1239  for(int subd = HcalDcsValues::HcalHB;
1240  subd <= HcalDcsValues::HcalHF; ++subd) {
1241 // std::cout << "subd: " << subd << '\n';
1242  HcalDcsValues::DcsSet const & vals=
1244  for (HcalDcsValues::DcsSet::const_iterator val = vals.begin();
1245  val != vals.end(); ++val) {
1246  HcalDcsDetId valId(val->DcsId());
1247 
1248  switch (valId.subdet()) {
1249  case HcalDcsBarrel:
1250  fOutput << "HB ";
1251  break;
1252  case HcalDcsEndcap:
1253  fOutput << "HE ";
1254  break;
1255  case HcalDcsOuter:
1256  fOutput << "HO ";
1257  break;
1258  case HcalDcsForward:
1259  fOutput << "HF ";
1260  break;
1261  default :
1262  fOutput << valId.subdet() << ' ';
1263  }
1264 
1265  if (valId.subdet() == HcalDcsOuter)
1266  fOutput << valId.ring() << ' ';
1267  else
1268  fOutput << valId.zside() << ' ';
1269 
1270  fOutput << valId.slice() << ' '
1271  << valId.typeString(valId.type()) << ' '
1272  << valId.subchannel() << ' ';
1273  fOutput << val->LS() << ' '
1274  << val->getValue() << ' '
1275  << val->getUpperLimit() << ' '
1276  << val->getLowerLimit() << ' ';
1277  fOutput << std::hex << val->DcsId() << std::dec << '\n';
1278 
1279 // std::cout << valId << ' '
1280 // << valId.subdet() << ' '
1281 // << val->LS() << ' ' << val->getValue() << ' '
1282 // << val->getUpperLimit() << ' ' << val->getLowerLimit()
1283 // << std::endl;
1284  }
1285  }
1286 
1287  return true;
1288 }
1289 
1290 
1291 // Format of the ASCII file:
1292 // line# Ring Slice Subchannel Subdetector Eta Phi Depth
1293 // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1294 bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalDcsMap* fObject) {
1295  char buffer [1024];
1296  while (fInput.getline(buffer, 1024)) {
1297  if (buffer [0] == '#') continue; //ignore comment
1298  std::vector <std::string> items = splitString (std::string (buffer));
1299  if (items.size () < 8) {
1300  if (items.size()==0) continue; // no warning here
1301  else {
1302  edm::LogError("MapFormat") << "HcalDcsMap-> Bad line: " << buffer
1303  << "\n line must contain 8 items: line side_ring slice subchannel subdet ieta iphi depth";
1304  continue;
1305  }
1306  }
1307  // std::cout << "HcalDcsMap-> processing line: " << buffer << std::endl;
1308  //int ring = atoi (items [1].c_str());
1309  int ring = atoi(items[1].c_str());
1310  unsigned int slice = atoi (items [2].c_str());
1311  unsigned int subchannel = atoi (items [3].c_str());
1313 // if(items[4].find("HV")!=std::string::npos){
1314 // type = HcalDcsDetId::HV;
1315 // }
1316 // else if (items[4].find("BV")!=std::string::npos){
1317 // type = HcalDcsDetId::BV;
1318 // }
1319 // else if (items[4].find("CATH")!=std::string::npos){
1320 // type = HcalDcsDetId::CATH;
1321 // }
1322 // else if (items[4].find("DYN7")!=std::string::npos){
1323 // type = HcalDcsDetId::DYN7;
1324 // }
1325 // else if (items[4].find("DYN8")!=std::string::npos){
1326 // type = HcalDcsDetId::DYN8;
1327 // }
1328 // else if (items[4].find("RM_TEMP")!=std::string::npos){
1329 // type = HcalDcsDetId::RM_TEMP;
1330 // }
1331 // else if (items[4].find("CCM_TEMP")!=std::string::npos){
1332 // type = HcalDcsDetId::CCM_TEMP;
1333 // }
1334 // else if (items[4].find("CALIB_TEMP")!=std::string::npos){
1335 // type = HcalDcsDetId::CALIB_TEMP;
1336 // }
1337 // else if (items[4].find("LVTTM_TEMP")!=std::string::npos){
1338 // type = HcalDcsDetId::LVTTM_TEMP;
1339 // }
1340 // else if (items[4].find("TEMP")!=std::string::npos){
1341 // type = HcalDcsDetId::TEMP;
1342 // }
1343 // else if (items[4].find("QPLL_LOCK")!=std::string::npos){
1344 // type = HcalDcsDetId::QPLL_LOCK;
1345 // }
1346 // else if (items[4].find("STATUS")!=std::string::npos){
1347 // type = HcalDcsDetId::STATUS;
1348 // }
1349 // else if (items[4].find("DCS_MAX")!=std::string::npos){
1350 // type = HcalDcsDetId::DCS_MAX;
1351 // }
1352 // else{
1353 // edm::LogError("MapFormat") << "HcalDcsMap-> Unknown DCS Type, line is not accepted: " << items[4];
1354 // continue;
1355 // }
1357  if (items[4].find("CALIB")!=std::string::npos){
1358  subdet = HcalCalibration;
1359  }
1360  else if (items[4].find("HB")!=std::string::npos){
1361  subdet = HcalDcsBarrel;
1362  }
1363  else if (items[4].find("HE")!=std::string::npos){
1364  subdet = HcalDcsEndcap;
1365  }
1366  else if (items[4].find("HO")!=std::string::npos){
1367  subdet = HcalDcsOuter;
1368  }
1369  else if (items[4].find("HF")!=std::string::npos){
1370  subdet = HcalDcsForward;
1371  }
1372  else{
1373  edm::LogError("MapFormat") << "HcalDcsMap-> Unknown subdetector, line is not accepted: " << items[5];
1374  continue;
1375  }
1376  HcalDcsDetId dcsId(subdet, ring, slice, type, subchannel);
1377  HcalText2DetIdConverter converter (items [4], items [5], items [6], items [7]);
1378  HcalDetId id(0);
1379  if (converter.isHcalDetId()){
1380  id = converter.getId();
1381  }
1382  else{
1383  edm::LogWarning("Invalid HCAL channel") << "HcalDcsMap-> invalid channel: "
1384  << items [4] << '/'
1385  << items [5] << '/'
1386  << items [6] << '/'
1387  << items [7] << std::endl;
1388  continue;
1389  }
1390  fObject->mapGeomId2DcsId(id, dcsId);
1391  }
1392  fObject->sort ();
1393  return true;
1394 }
1395 
1396 // Format of the ASCII file:
1397 // line# Ring Slice Subchannel Subdetector Eta Phi Depth
1398 // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1399 bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalDcsMap& fObject) {
1400  char buf [1024];
1401  sprintf (buf, "# %7s %10s %6s %8s %7s %5s %5s %6s",
1402  "i", "side_ring", "slice", "subchan", "subdet", "ieta", "iphi", "depth");
1403  fOutput << buf << std::endl;
1405  unsigned int line_counter = 0;
1406  for (_line = fObject.beginById();
1407  _line != fObject.endById();
1408  ++_line) {
1409  HcalDcsDetId dcsId = _line.getHcalDcsDetId();
1410  //std::string _dcs_type = "DCSUNKNOWN";
1411  HcalText2DetIdConverter _converter(_line.getHcalDetId());
1412  sprintf (buf, " %8X %10d %6d %8d %7s %5s %5s %6s",
1413  line_counter,
1414  dcsId.ring(), // contains zside() already
1415  dcsId.slice(),
1416  dcsId.subchannel(),
1417  _converter.getFlavor().c_str(),
1418  _converter.getField1().c_str(),
1419  _converter.getField2().c_str(),
1420  _converter.getField3().c_str()
1421  );
1422  fOutput << buf << std::endl;
1423  ++line_counter;
1424  }
1425  return true;
1426 }
1427 
1428 
uint32_t getFlag() const
type
Definition: HCALResponse.h:22
float getPedestal() const
unsigned int firstSample() const
Definition: HcalRecoParam.h:21
static const HcalDetId Undefined
Definition: HcalDetId.h:66
void setAlgoString(std::string fAlgo)
int i
Definition: DBlmapReader.cc:9
bool addValues(const Item &myItem, bool h2mode_=false)
int fiberIndex() const
get the fiber index [1-8] (which of eight fibers carried by a spigot) (valid only for non-trigger-cha...
void setUnitADC(bool isADC)
Definition: HcalPedestals.h:25
float slope(unsigned fCapId, unsigned fRange) const
Definition: HcalQIECoder.cc:52
bool getHcalSingleIntObject(std::istream &fInput, T *fObject, S *fCondObject)
std::vector< unsigned int > signalTS() const
bool isADC() const
Definition: HcalPedestals.h:23
int subchannel() const
Definition: HcalDcsDetId.h:49
bool getHcalSingleFloatObject(std::istream &fInput, T *fObject, S *fCondObject)
const HcalQIECoder * getCoder(DetId fId) const
get QIE parameters
Definition: HcalQIEData.h:38
uint8_t getOutputLutThreshold() const
float getSigma(int fCapId1, int fCapId2) const
get correlation element for capId1/2 = 0..3
bool mapGeomId2DcsId(HcalDetId fId, HcalDcsDetId fDcsId)
Definition: HcalDcsMap.cc:205
bool getHcalMatrixObject(std::istream &fInput, T *fObject, S *fCondObject)
DcsSet const & getAllSubdetValues(DcsSubDet subd) const
int htrSlot() const
get the htr slot
std::vector< unsigned int > splitStringToIntByComma(const std::string &fLine)
bool dumpHcalSingleFloatObject(std::ostream &fOutput, const T &fObject)
bool mapEId2tId(HcalElectronicsId fElectronicsId, HcalTrigTowerDetId fTriggerId)
const HcalQIEShape & getShape() const
get basic shape
Definition: HcalQIEData.h:36
uint8_t getLutGranularity() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
const HcalCalibrationQIECoder * getCoder(DetId fId) const
get QIE parameters
std::vector< std::string > splitString(const std::string &fLine)
float lowEdge(unsigned fAdc) const
Definition: HcalQIEShape.cc:39
bool setRctLsb(float rctlsb)
int readoutVMECrateId() const
get the readout VME crate number
void dumpId(std::ostream &fOutput, DetId id)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
U second(std::pair< T, U > const &p)
const_iterator endById(void) const
Definition: HcalDcsMap.cc:59
bool addCoder(const HcalQIECoder &fCoder, bool h2mode_=false)
Definition: HcalQIEData.h:42
std::vector< HcalDcsValue > DcsSet
Definition: HcalDcsValues.h:25
void setUnitADC(bool isADC)
float getRespGain() const
int htrTopBottom() const
get the htr top/bottom (1=top/0=bottom)
float offset(unsigned fCapId, unsigned fRange) const
Definition: HcalQIECoder.cc:48
const_iterator beginById(void) const
Definition: HcalDcsMap.cc:45
std::vector< DetId > getAllChannels() const
float getNominalGain() const
HcalDetId getHcalDetId(void)
Definition: HcalDcsMap.cc:98
tuple result
Definition: query.py:137
HcalOtherSubdetector
Definition: HcalAssistant.h:33
float getRCalib() const
int dccid() const
get the (Hcal local) DCC id
HcalDcsDetId getHcalDcsDetId(void)
Definition: HcalDcsMap.cc:94
int j
Definition: DBlmapReader.cc:9
bool dumpHcalMatrixObject(std::ostream &fOutput, const T &fObject)
double f[11][100]
int fiberChanId() const
get the fiber channel id (which of three channels on a readout fiber) (valid only for non-trigger-cha...
std::string getTagString() const
unsigned int samplesToAdd() const
Definition: HcalRecoParam.h:22
bool first
Definition: L1TdeRCT.cc:79
bool mapEId2chId(HcalElectronicsId fElectronicsId, DetId fId)
int spigot() const
get the spigot (input number on DCC)
static DcsType DcsTypeFromString(const std::string &str)
Definition: HcalDcsDetId.cc:31
int slbChannelIndex() const
get the SLB channel index (valid only for trigger-chain ids)
Definition: DetId.h:20
void setHTR(int crate, int slot, int tb)
std::string getAlgoString() const
std::vector< HcalElectronicsId > allElectronicsId() const
void sort()
Definition: HcalQIEData.h:44
void sort()
Definition: HcalDcsMap.h:62
int slice() const
Definition: HcalDcsDetId.h:47
float getRctLsb() const
bool isTriggerChainId() const
unsigned int signalShape() const
Definition: HcalMCParam.h:30
static const HcalTrigTowerDetId Undefined
bool addValue(HcalDcsValue const &newVal)
bool getHcalObject(std::istream &fInput, T *fObject, S *fCondObject)
bool getObject(std::istream &fInput, HcalPedestals *fObject)
DetId getId(const std::vector< std::string > &items)
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
int slbSiteNumber() const
get the SLB site number (valid only for trigger-chain ids)
const float * getValues() const
get value for all capId = 0..3
Definition: HcalPedestal.h:17
bool dumpHcalObject(std::ostream &fOutput, const T &fObject)
std::vector< unsigned int > noiseTS() const
const DetId lookupTrigger(HcalElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
const float * minCharges() const
void setTagString(std::string fTag)
string s
Definition: asciidump.py:422
uint32_t getValue() const
bool addCoder(const HcalCalibrationQIECoder &fCoder)
const Item * getValues(DetId fId) const
long double T
int ring() const
Definition: HcalDcsDetId.h:46
Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Read...
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
bool setNominalGain(float gain)
bool dumpHcalSingleIntObject(std::ostream &fOutput, const T &fObject)
bool from_string(T &t, const std::string &s, std::ios_base &(*f)(std::ios_base &))
list at
Definition: asciidump.py:428