CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalCondXML.cc
Go to the documentation of this file.
1 // S. Won, Northwestern University, 5 June 2009
2 
3 #include <vector>
4 #include <string>
5 
7 
10 namespace {
11  void dumpHeader (std::ostream& fOutput, unsigned fRun, const std::string& fTableName, const std::string& fTypeName) {
12  fOutput << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << std::endl;
13 // fOutput << "<!DOCTYPE root []>" << std::endl;
14  fOutput << "<ROOT>" << std::endl;
15  fOutput << " <HEADER>" << std::endl;
16  fOutput << " <TYPE>" << std::endl;
17  fOutput << " <EXTENSION_TABLE_NAME>" << fTableName << "</EXTENSION_TABLE_NAME>" << std::endl;
18  fOutput << " <NAME>" << fTypeName << "</NAME>" << std::endl;
19  fOutput << " </TYPE>" << std::endl;
20  fOutput << " <RUN>"<< std::endl;
21  fOutput << " <RUN_TYPE>" << "HcalCalibrations" << "</RUN_TYPE>"<< std::endl;
22  fOutput << " <RUN_NUMBER>" << fRun << "</RUN_NUMBER>"<< std::endl;
23  fOutput << " </RUN>" << std::endl;
24  fOutput << " <HINTS channelmap='HCAL_CHANNELS'/>" << std::endl;
25  fOutput << " </HEADER>" << std::endl;
26  }
27 
28  void dumpMapping (std::ostream& fOutput, unsigned fRun, const std::string& fKind,
29  unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd,
30  const std::string& fTag, unsigned fVersion, const std::vector<DetId>& fChannels) {
31  const std::string IOV_ID = "IOV_ID";
32  const std::string TAG_ID = "TAG_ID";
33  fOutput << "<ELEMENTS>" << std::endl;
34  // set IOV
35  fOutput << "<DATA_SET id=\"-1\"/>" << std::endl;
36  fOutput << " <IOV id=\"1\">" << std::endl;
37  fOutput << " <INTERVAL_OF_VALIDITY_BEGIN>" << fGMTIOVBegin << "</INTERVAL_OF_VALIDITY_BEGIN>"<< std::endl;
38  fOutput << " <INTERVAL_OF_VALIDITY_END>" << fGMTIOVEnd << "</INTERVAL_OF_VALIDITY_END>"<< std::endl;
39  fOutput << " </IOV>" << std::endl;
40  // set TAG
41  fOutput << " <TAG id=\"2\" mode=\"auto\">"<< std::endl;
42  fOutput << " <TAG_NAME>" << fTag << "</TAG_NAME>"<< std::endl;
43  fOutput << " <DETECTOR_NAME>HCAL</DETECTOR_NAME>"<< std::endl;
44  fOutput << " <COMMENT_DESCRIPTION>Automatically created by HcalCondXML</COMMENT_DESCRIPTION>" << std::endl;
45  fOutput << " </TAG>" << std::endl;
46 
47  fOutput << "</ELEMENTS>" << std::endl;
48 
49  fOutput << "<MAPS>" << std::endl;
50  fOutput << " <TAG idref=\"2\">" << std::endl;
51  fOutput << " <IOV idref=\"1\">" << std::endl;
52  fOutput << " <DATA_SET idref=\"-1\"/>" << std::endl;
53  fOutput << " </IOV>" << std::endl;
54  fOutput << " </TAG>" << std::endl;
55  fOutput << "</MAPS>" << std::endl;
56  }
57 
58  void dumpFooter (std::ostream& fOutput) {
59  fOutput << "</ROOT>" << std::endl;
60  }
61 
62  void dumpDataset (std::ostream& fOutput, unsigned fVersion = 0) {
63  fOutput << "<DATA_SET>" << std::endl;
64  fOutput << " <VERSION>" << fVersion << "</VERSION>" << std::endl;
65  }
66 
67  void endDataset (std::ostream& fOutput) {
68  fOutput << "</DATA_SET>" << std::endl;
69  }
70 
71  void dumpChannelIdOld (std::ostream& fOutput, DetId fChannel) {
72  HcalText2DetIdConverter converter (fChannel);
73  fOutput << "<CHANNEL> "<< std::endl;
74  fOutput << " <EXTENSION_TABLE_NAME>HCAL_CHANNELS</EXTENSION_TABLE_NAME> "<< std::endl;
75  fOutput << " <ETA>" << abs (converter.getField (1)) << "</ETA>"<< std::endl;
76  fOutput << " <PHI>" << converter.getField (2) << "</PHI> "<< std::endl;
77  fOutput << " <DEPTH>" << converter.getField (3) << "</DEPTH> "<< std::endl;
78  fOutput << " <Z>" << (converter.getField (1) > 0 ? "1" : "-1") << "</Z> "<< std::endl;
79  fOutput << " <DETECTOR_NAME>" << converter.getFlavor () << "</DETECTOR_NAME> "<< std::endl;
80  fOutput << " <HCAL_CHANNEL_ID>" << converter.getId().rawId () << "</HCAL_CHANNEL_ID> "<< std::endl;
81  fOutput << "</CHANNEL>"<< std::endl;
82  fOutput << std::endl;
83  }
84 
85  void dumpChannelId (std::ostream& fOutput, DetId fChannel) {
86  HcalText2DetIdConverter converter (fChannel);
87  fOutput << "<CHANNEL> "<< std::endl;
88  fOutput << " <EXTENSION_TABLE_NAME>HCAL_CHANNELS</EXTENSION_TABLE_NAME> "<< std::endl;
89  fOutput << " <SUBDET>" << converter.getFlavor () << "</SUBDET> "<< std::endl;
90  fOutput << " <IETA>" << converter.getField (1) << "</IETA>"<< std::endl;
91  fOutput << " <IPHI>" << converter.getField (2) << "</IPHI> "<< std::endl;
92  fOutput << " <DEPTH>" << converter.getField (3) << "</DEPTH> "<< std::endl;
93 // fOutput << " <HCAL_CHANNEL_ID>" << converter.getId().rawId () << "</HCAL_CHANNEL_ID> "<< std::endl;
94  fOutput << "</CHANNEL>"<< std::endl;
95  fOutput << std::endl;
96  }
97 
98  void dumpZSData (std::ostream& fOutput, HcalZSThreshold fValue) {
99  fOutput << "<DATA> "<< std::endl;
100  fOutput << " <ZERO_SUPPRESSION>" << fValue.getValue() << "</ZERO_SUPPRESSION> "<< std::endl;
101  fOutput << "</DATA> " << std::endl;
102  }
103 
104  void dumpPedData (std::ostream& fOutput, HcalPedestal fValue, HcalPedestalWidth fValue2, int isADC) {
105  fOutput << "<DATA> "<< std::endl;
106  fOutput << " <CAP0>" << fValue.getValue(0) << "</CAP0> "<< std::endl;
107  fOutput << " <CAP1>" << fValue.getValue(1) << "</CAP1> "<< std::endl;
108  fOutput << " <CAP2>" << fValue.getValue(2) << "</CAP2> "<< std::endl;
109  fOutput << " <CAP3>" << fValue.getValue(3) << "</CAP3> "<< std::endl;
110  fOutput << " <SIGMA_00>" << fValue2.getWidth(0) << "</SIGMA_00> "<< std::endl;
111  fOutput << " <SIGMA_11>" << fValue2.getWidth(1) << "</SIGMA_11> "<< std::endl;
112  fOutput << " <SIGMA_22>" << fValue2.getWidth(2) << "</SIGMA_22> "<< std::endl;
113  fOutput << " <SIGMA_33>" << fValue2.getWidth(3) << "</SIGMA_33> "<< std::endl;
114  fOutput << " <SIGMA_01>" << fValue2.getSigma(0,1) << "</SIGMA_01> "<< std::endl;
115  fOutput << " <SIGMA_02>" << fValue2.getSigma(0,2) << "</SIGMA_02> "<< std::endl;
116  fOutput << " <SIGMA_03>" << fValue2.getSigma(0,3) << "</SIGMA_03> "<< std::endl;
117  fOutput << " <SIGMA_12>" << fValue2.getSigma(1,2) << "</SIGMA_12> "<< std::endl;
118  fOutput << " <SIGMA_13>" << fValue2.getSigma(1,3) << "</SIGMA_13> "<< std::endl;
119  fOutput << " <SIGMA_23>" << fValue2.getSigma(2,3) << "</SIGMA_23> "<< std::endl;
120  fOutput << " <IS_ADC_COUNTS>" << isADC << "</IS_ADC_COUNTS>" << std::endl;
121  fOutput << "</DATA> " << std::endl;
122  }
123 
124  void dumpGainData (std::ostream& fOutput, HcalGain fValue) {
125  fOutput << "<DATA> "<< std::endl;
126  fOutput << " <CAP0>" << fValue.getValue(0) << "</CAP0> "<< std::endl;
127  fOutput << " <CAP1>" << fValue.getValue(1) << "</CAP1> "<< std::endl;
128  fOutput << " <CAP2>" << fValue.getValue(2) << "</CAP2> "<< std::endl;
129  fOutput << " <CAP3>" << fValue.getValue(3) << "</CAP3> "<< std::endl;
130  fOutput << "</DATA> " << std::endl;
131  }
132 
133  void dumpGainWidthData (std::ostream& fOutput, HcalGainWidth fValue) {
134  fOutput << "<DATA> "<< std::endl;
135  fOutput << " <CAP0>" << fValue.getValue(0) << "</CAP0> "<< std::endl;
136  fOutput << " <CAP1>" << fValue.getValue(1) << "</CAP1> "<< std::endl;
137  fOutput << " <CAP2>" << fValue.getValue(2) << "</CAP2> "<< std::endl;
138  fOutput << " <CAP3>" << fValue.getValue(3) << "</CAP3> "<< std::endl;
139  fOutput << "</DATA> " << std::endl;
140  }
141 
142  void dumpRespCorrData (std::ostream& fOutput, HcalRespCorr fValue) {
143  fOutput << "<DATA> "<< std::endl;
144  fOutput << " <VALUE>" << fValue.getValue() << "</VALUE> "<< std::endl;
145  fOutput << "</DATA> " << std::endl;
146  }
147 
148  void dumpQIEData (std::ostream& fOutput, HcalQIECoder fValue) {
149  fOutput << "<DATA> "<< std::endl;
150  fOutput << " <CAP0_RANGE0_SLOPE>" << fValue.slope(0,0) << "</CAP0_RANGE0_SLOPE>" << std::endl;
151  fOutput << " <CAP0_RANGE1_SLOPE>" << fValue.slope(0,1) << "</CAP0_RANGE1_SLOPE>" << std::endl;
152  fOutput << " <CAP0_RANGE2_SLOPE>" << fValue.slope(0,2) << "</CAP0_RANGE2_SLOPE>" << std::endl;
153  fOutput << " <CAP0_RANGE3_SLOPE>" << fValue.slope(0,3) << "</CAP0_RANGE3_SLOPE>" << std::endl;
154  fOutput << " <CAP1_RANGE0_SLOPE>" << fValue.slope(1,0) << "</CAP1_RANGE0_SLOPE>" << std::endl;
155  fOutput << " <CAP1_RANGE1_SLOPE>" << fValue.slope(1,1) << "</CAP1_RANGE1_SLOPE>" << std::endl;
156  fOutput << " <CAP1_RANGE2_SLOPE>" << fValue.slope(1,2) << "</CAP1_RANGE2_SLOPE>" << std::endl;
157  fOutput << " <CAP1_RANGE3_SLOPE>" << fValue.slope(1,3) << "</CAP1_RANGE3_SLOPE>" << std::endl;
158  fOutput << " <CAP2_RANGE0_SLOPE>" << fValue.slope(2,0) << "</CAP2_RANGE0_SLOPE>" << std::endl;
159  fOutput << " <CAP2_RANGE1_SLOPE>" << fValue.slope(2,1) << "</CAP2_RANGE1_SLOPE>" << std::endl;
160  fOutput << " <CAP2_RANGE2_SLOPE>" << fValue.slope(2,2) << "</CAP2_RANGE2_SLOPE>" << std::endl;
161  fOutput << " <CAP2_RANGE3_SLOPE>" << fValue.slope(2,3) << "</CAP2_RANGE3_SLOPE>" << std::endl;
162  fOutput << " <CAP3_RANGE0_SLOPE>" << fValue.slope(3,0) << "</CAP3_RANGE0_SLOPE>" << std::endl;
163  fOutput << " <CAP3_RANGE1_SLOPE>" << fValue.slope(3,1) << "</CAP3_RANGE1_SLOPE>" << std::endl;
164  fOutput << " <CAP3_RANGE2_SLOPE>" << fValue.slope(3,2) << "</CAP3_RANGE2_SLOPE>" << std::endl;
165  fOutput << " <CAP3_RANGE3_SLOPE>" << fValue.slope(3,3) << "</CAP3_RANGE3_SLOPE>" << std::endl;
166  fOutput << " <CAP0_RANGE0_OFFSET>" << fValue.offset(0,0) << "</CAP0_RANGE0_OFFSET>" << std::endl;
167  fOutput << " <CAP0_RANGE1_OFFSET>" << fValue.offset(0,1) << "</CAP0_RANGE1_OFFSET>" << std::endl;
168  fOutput << " <CAP0_RANGE2_OFFSET>" << fValue.offset(0,2) << "</CAP0_RANGE2_OFFSET>" << std::endl;
169  fOutput << " <CAP0_RANGE3_OFFSET>" << fValue.offset(0,3) << "</CAP0_RANGE3_OFFSET>" << std::endl;
170  fOutput << " <CAP1_RANGE0_OFFSET>" << fValue.offset(1,0) << "</CAP1_RANGE0_OFFSET>" << std::endl;
171  fOutput << " <CAP1_RANGE1_OFFSET>" << fValue.offset(1,1) << "</CAP1_RANGE1_OFFSET>" << std::endl;
172  fOutput << " <CAP1_RANGE2_OFFSET>" << fValue.offset(1,2) << "</CAP1_RANGE2_OFFSET>" << std::endl;
173  fOutput << " <CAP1_RANGE3_OFFSET>" << fValue.offset(1,3) << "</CAP1_RANGE3_OFFSET>" << std::endl;
174  fOutput << " <CAP2_RANGE0_OFFSET>" << fValue.offset(2,0) << "</CAP2_RANGE0_OFFSET>" << std::endl;
175  fOutput << " <CAP2_RANGE1_OFFSET>" << fValue.offset(2,1) << "</CAP2_RANGE1_OFFSET>" << std::endl;
176  fOutput << " <CAP2_RANGE2_OFFSET>" << fValue.offset(2,2) << "</CAP2_RANGE2_OFFSET>" << std::endl;
177  fOutput << " <CAP2_RANGE3_OFFSET>" << fValue.offset(2,3) << "</CAP2_RANGE3_OFFSET>" << std::endl;
178  fOutput << " <CAP3_RANGE0_OFFSET>" << fValue.offset(3,0) << "</CAP3_RANGE0_OFFSET>" << std::endl;
179  fOutput << " <CAP3_RANGE1_OFFSET>" << fValue.offset(3,1) << "</CAP3_RANGE1_OFFSET>" << std::endl;
180  fOutput << " <CAP3_RANGE2_OFFSET>" << fValue.offset(3,2) << "</CAP3_RANGE2_OFFSET>" << std::endl;
181  fOutput << " <CAP3_RANGE3_OFFSET>" << fValue.offset(3,3) << "</CAP3_RANGE3_OFFSET>" << std::endl;
182  fOutput << "</DATA> " << std::endl;
183  }
184 
185  void dumpChannelQualityData (std::ostream& fOutput, HcalChannelStatus fValue) {
186  fOutput << "<DATA> "<< std::endl;
187  if(fValue.isBitSet(0))
188  {
189  fOutput << " <CHANNEL_ON_OFF_STATE>0</CHANNEL_ON_OFF_STATE> "<< std::endl;
190  }else{
191  fOutput << " <CHANNEL_ON_OFF_STATE>1</CHANNEL_ON_OFF_STATE> "<< std::endl;
192  }
193  fOutput << " <CHANNEL_STATUS_WORD>" << fValue.getValue() << "</CHANNEL_STATUS_WORD> "<< std::endl;
194  fOutput << "</DATA> " << std::endl;
195  }
196 
197  void dumpL1TriggerData (std::ostream& fOutput, HcalL1TriggerObject fValue) {
198  fOutput << "<DATA> "<< std::endl;
199  fOutput << " <AVERAGE_PEDESTAL>" << fValue.getPedestal() << "</AVERAGE_PEDESTAL> "<< std::endl;
200  fOutput << " <RESPONSE_CORRECTED_GAIN>" << fValue.getRespGain() << "</RESPONSE_CORRECTED_GAIN> "<< std::endl;
201  fOutput << " <FLAG>" << fValue.getFlag() << "</FLAG> "<< std::endl;
202  fOutput << "</DATA> " << std::endl;
203  }
204 
205 
206 }
207 bool HcalCondXML::dumpObject (std::ostream& fOutput,
208  unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
209  const HcalZSThresholds& fObject) {
210  const std::string KIND = "HCAL zero suppression [type 1]";
211  const std::string TABLE = "HCAL_ZERO_SUPPRESSION_TYPE01";
212 
213  dumpHeader (fOutput, fRun, TABLE, KIND);
214 
215  std::vector<DetId> channels = fObject.getAllChannels ();
216  dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
217  for (std::vector<DetId>::iterator channel = channels.begin ();
218  channel != channels.end ();
219  channel++) {
220  DetId chId = *channel;
221  if(fObject.exists(chId))
222  {
223  const HcalZSThreshold * item = fObject.getValues(chId);
224  dumpDataset (fOutput, fVersion);
225  dumpChannelId (fOutput,chId);
226  dumpZSData (fOutput, *item);
227  endDataset (fOutput);
228  }
229  }
230 
231  dumpFooter (fOutput);
232  return true;
233 }
234 bool HcalCondXML::dumpObject (std::ostream& fOutput,
235  unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
236  const HcalPedestals& fObject, const HcalPedestalWidths& fObject2) {
237  const std::string KIND = "HCAL Pedestals [V3]";
238  const std::string TABLE = "HCAL_PEDESTALS_V3";
239 
240  dumpHeader (fOutput, fRun, TABLE, KIND);
241  int isADC = 0;
242  if(fObject.isADC()) isADC = 1;
243 
244  std::vector<DetId> channels = fObject.getAllChannels ();
245  dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
246  for (std::vector<DetId>::iterator channel = channels.begin ();
247  channel != channels.end ();
248  channel++) {
249  DetId chId = *channel;
250  if(fObject.exists(chId))
251  {
252  const HcalPedestal * item = fObject.getValues (chId);
253  const HcalPedestalWidth * item2 = fObject2.getValues (chId);
254 
255  dumpDataset (fOutput, fVersion);
256  dumpChannelId (fOutput,chId);
257  dumpPedData (fOutput, *item, *item2, isADC);
258  endDataset (fOutput);
259  }
260  }
261 
262  dumpFooter (fOutput);
263  return true;
264 }
265 
266 bool HcalCondXML::dumpObject (std::ostream& fOutput,
267  unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
268  const HcalRespCorrs& fObject) {
269  const std::string KIND = "HCAL Response corrections [V1]";
270  const std::string TABLE = "HCAL_RESPONSE_CORRECTIONS_V1";
271 
272  dumpHeader (fOutput, fRun, TABLE, KIND);
273 
274  std::vector<DetId> channels = fObject.getAllChannels ();
275  dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
276  for (std::vector<DetId>::iterator channel = channels.begin ();
277  channel != channels.end ();
278  channel++) {
279  DetId chId = *channel;
280  if(fObject.exists(chId))
281  {
282  const HcalRespCorr * item = fObject.getValues(chId);
283  dumpDataset (fOutput, fVersion);
284  dumpChannelId (fOutput,chId);
285  dumpRespCorrData (fOutput, *item);
286  endDataset (fOutput);
287  }
288  }
289 
290  dumpFooter (fOutput);
291  return true;
292 }
293 
294 bool HcalCondXML::dumpObject (std::ostream& fOutput,
295  unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
296  const HcalGains& fObject) {
297  const std::string KIND = "HCAL Inverse Gains [V1]";
298  const std::string TABLE = "HCAL_INVERSE_GAINS_V1";
299 
300  dumpHeader (fOutput, fRun, TABLE, KIND);
301 
302  std::vector<DetId> channels = fObject.getAllChannels ();
303  dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
304  for (std::vector<DetId>::iterator channel = channels.begin ();
305  channel != channels.end ();
306  channel++) {
307  DetId chId = *channel;
308  if(fObject.exists(chId))
309  {
310  const HcalGain * item = fObject.getValues(chId);
311  dumpDataset (fOutput, fVersion);
312  dumpChannelId (fOutput,chId);
313  dumpGainData (fOutput, *item);
314  endDataset (fOutput);
315  }
316  }
317 
318  dumpFooter (fOutput);
319  return true;
320 }
321 
322 bool HcalCondXML::dumpObject (std::ostream& fOutput,
323  unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
324  const HcalGainWidths& fObject) {
325  const std::string KIND = "HCAL Inverse Gain Widths [V1]";
326  const std::string TABLE = "HCAL_INVERSE_GAIN_WIDTHS_V1";
327 
328  dumpHeader (fOutput, fRun, TABLE, KIND);
329 
330  std::vector<DetId> channels = fObject.getAllChannels ();
331  dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
332  for (std::vector<DetId>::iterator channel = channels.begin ();
333  channel != channels.end ();
334  channel++) {
335  DetId chId = *channel;
336  if(fObject.exists(chId))
337  {
338  const HcalGainWidth * item = fObject.getValues(chId);
339  dumpDataset (fOutput, fVersion);
340  dumpChannelId (fOutput,chId);
341  dumpGainWidthData (fOutput, *item);
342  endDataset (fOutput);
343  }
344  }
345 
346  dumpFooter (fOutput);
347  return true;
348 }
349 
350 bool HcalCondXML::dumpObject (std::ostream& fOutput,
351  unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
352  const HcalQIEData& fObject) {
353  const std::string KIND = "QIECARD_ADC_NORMMODE";
354  const std::string TABLE = "XXX need to check XXX";
355 
356  dumpHeader (fOutput, fRun, TABLE, KIND);
357 
358  std::vector<DetId> channels = fObject.getAllChannels ();
359  dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
360  for (std::vector<DetId>::iterator channel = channels.begin ();
361  channel != channels.end ();
362  channel++) {
363  DetId chId = *channel;
364  if(fObject.exists(chId))
365  {
366  const HcalQIECoder * item = fObject.getCoder(chId);
367  dumpDataset (fOutput, fVersion);
368  dumpChannelId (fOutput,chId);
369  dumpQIEData (fOutput, *item);
370  endDataset (fOutput);
371  }
372  }
373 
374  dumpFooter (fOutput);
375  return true;
376 }
377 
378 bool HcalCondXML::dumpObject (std::ostream& fOutput,
379  unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
380  const HcalChannelQuality& fObject) {
381  const std::string KIND = "HCAL_CHANNEL_QUALITY_V1";
382  const std::string TABLE = "HCAL Channel Quality [V1]";
383 
384  dumpHeader (fOutput, fRun, TABLE, KIND);
385 
386  std::vector<DetId> channels = fObject.getAllChannels ();
387  dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
388  for (std::vector<DetId>::iterator channel = channels.begin ();
389  channel != channels.end ();
390  channel++) {
391  DetId chId = *channel;
392  if(fObject.exists(chId))
393  {
394  const HcalChannelStatus * item = fObject.getValues(chId);
395  dumpDataset (fOutput, fVersion);
396  dumpChannelId (fOutput,chId);
397  dumpChannelQualityData (fOutput, *item);
398  endDataset (fOutput);
399  }
400  }
401 
402  dumpFooter (fOutput);
403  return true;
404 }
405 
406 bool HcalCondXML::dumpObject (std::ostream& fOutput,
407  unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
408  const HcalL1TriggerObjects& fObject) {
409  const std::string KIND = "HCAL_L1_TRIGGER_OBJECTS_V1";
410  const std::string TABLE = "HCAL L1 Trigger Objects [V1]";
411 
412  dumpHeader (fOutput, fRun, TABLE, KIND);
413 
414  std::vector<DetId> channels = fObject.getAllChannels ();
415  dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
416  for (std::vector<DetId>::iterator channel = channels.begin ();
417  channel != channels.end ();
418  channel++) {
419  DetId chId = *channel;
420  if(fObject.exists(chId))
421  {
422  const HcalL1TriggerObject * item = fObject.getValues(chId);
423  dumpDataset (fOutput, fVersion);
424  dumpChannelId (fOutput,chId);
425  dumpL1TriggerData (fOutput, *item);
426  endDataset (fOutput);
427  }
428  }
429 
430  dumpFooter (fOutput);
431  return true;
432 }
433 
uint32_t getFlag() const
float getPedestal() const
float slope(unsigned fCapId, unsigned fRange) const
Definition: HcalQIECoder.cc:52
bool isADC() const
Definition: HcalPedestals.h:23
const HcalQIECoder * getCoder(DetId fId) const
get QIE parameters
Definition: HcalQIEData.h:38
float getSigma(int fCapId1, int fCapId2) const
get correlation element for capId1/2 = 0..3
#define abs(x)
Definition: mlp_lapack.h:159
float getValue(int fCapId) const
get value for capId = 0..3
Definition: HcalGain.h:20
float getValue(int fCapId) const
get value for capId = 0..3
Definition: HcalGainWidth.h:19
float getRespGain() const
float offset(unsigned fCapId, unsigned fRange) const
Definition: HcalQIECoder.cc:48
const bool exists(DetId fId) const
std::vector< DetId > getAllChannels() const
float getValue(int fCapId) const
get value for capId = 0..3
Definition: HcalPedestal.h:19
bool dumpObject(std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalPedestals &fObject, const HcalPedestalWidths &fObject2)
Definition: HcalCondXML.cc:234
Definition: DetId.h:20
int getValue() const
float getWidth(int fCapId) const
get width (sqrt(sigma_i_i)) for capId = 0..3
bool isBitSet(unsigned int bitnumber) const
float getValue() const
Definition: HcalRespCorr.h:18
uint32_t getValue() const
const Item * getValues(DetId fId) const