00001
00002
00003 #include <vector>
00004 #include <string>
00005
00006 #include "CalibFormats/HcalObjects/interface/HcalText2DetIdConverter.h"
00007
00008 #include "CondFormats/HcalObjects/interface/AllObjects.h"
00009 #include "CalibCalorimetry/HcalStandardModules/interface/HcalCondXML.h"
00010 namespace {
00011 void dumpHeader (std::ostream& fOutput, unsigned fRun, const std::string& fTableName, const std::string& fTypeName) {
00012 fOutput << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << std::endl;
00013
00014 fOutput << "<ROOT>" << std::endl;
00015 fOutput << " <HEADER>" << std::endl;
00016 fOutput << " <TYPE>" << std::endl;
00017 fOutput << " <EXTENSION_TABLE_NAME>" << fTableName << "</EXTENSION_TABLE_NAME>" << std::endl;
00018 fOutput << " <NAME>" << fTypeName << "</NAME>" << std::endl;
00019 fOutput << " </TYPE>" << std::endl;
00020 fOutput << " <RUN>"<< std::endl;
00021 fOutput << " <RUN_TYPE>" << "HcalCalibrations" << "</RUN_TYPE>"<< std::endl;
00022 fOutput << " <RUN_NUMBER>" << fRun << "</RUN_NUMBER>"<< std::endl;
00023 fOutput << " </RUN>" << std::endl;
00024 fOutput << " <HINTS channelmap='HCAL_CHANNELS'/>" << std::endl;
00025 fOutput << " </HEADER>" << std::endl;
00026 }
00027
00028 void dumpMapping (std::ostream& fOutput, unsigned fRun, const std::string& fKind,
00029 unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd,
00030 const std::string& fTag, unsigned fVersion, const std::vector<DetId>& fChannels) {
00031 const std::string IOV_ID = "IOV_ID";
00032 const std::string TAG_ID = "TAG_ID";
00033 fOutput << "<ELEMENTS>" << std::endl;
00034
00035 fOutput << "<DATA_SET id=\"-1\"/>" << std::endl;
00036 fOutput << " <IOV id=\"1\">" << std::endl;
00037 fOutput << " <INTERVAL_OF_VALIDITY_BEGIN>" << fGMTIOVBegin << "</INTERVAL_OF_VALIDITY_BEGIN>"<< std::endl;
00038 fOutput << " <INTERVAL_OF_VALIDITY_END>" << fGMTIOVEnd << "</INTERVAL_OF_VALIDITY_END>"<< std::endl;
00039 fOutput << " </IOV>" << std::endl;
00040
00041 fOutput << " <TAG id=\"2\" mode=\"auto\">"<< std::endl;
00042 fOutput << " <TAG_NAME>" << fTag << "</TAG_NAME>"<< std::endl;
00043 fOutput << " <DETECTOR_NAME>HCAL</DETECTOR_NAME>"<< std::endl;
00044 fOutput << " <COMMENT_DESCRIPTION>Automatically created by HcalCondXML</COMMENT_DESCRIPTION>" << std::endl;
00045 fOutput << " </TAG>" << std::endl;
00046
00047 fOutput << "</ELEMENTS>" << std::endl;
00048
00049 fOutput << "<MAPS>" << std::endl;
00050 fOutput << " <TAG idref=\"2\">" << std::endl;
00051 fOutput << " <IOV idref=\"1\">" << std::endl;
00052 fOutput << " <DATA_SET idref=\"-1\"/>" << std::endl;
00053 fOutput << " </IOV>" << std::endl;
00054 fOutput << " </TAG>" << std::endl;
00055 fOutput << "</MAPS>" << std::endl;
00056 }
00057
00058 void dumpFooter (std::ostream& fOutput) {
00059 fOutput << "</ROOT>" << std::endl;
00060 }
00061
00062 void dumpDataset (std::ostream& fOutput, unsigned fVersion = 0) {
00063 fOutput << "<DATA_SET>" << std::endl;
00064 fOutput << " <VERSION>" << fVersion << "</VERSION>" << std::endl;
00065 }
00066
00067 void endDataset (std::ostream& fOutput) {
00068 fOutput << "</DATA_SET>" << std::endl;
00069 }
00070
00071 void dumpChannelIdOld (std::ostream& fOutput, DetId fChannel) {
00072 HcalText2DetIdConverter converter (fChannel);
00073 fOutput << "<CHANNEL> "<< std::endl;
00074 fOutput << " <EXTENSION_TABLE_NAME>HCAL_CHANNELS</EXTENSION_TABLE_NAME> "<< std::endl;
00075 fOutput << " <ETA>" << abs (converter.getField (1)) << "</ETA>"<< std::endl;
00076 fOutput << " <PHI>" << converter.getField (2) << "</PHI> "<< std::endl;
00077 fOutput << " <DEPTH>" << converter.getField (3) << "</DEPTH> "<< std::endl;
00078 fOutput << " <Z>" << (converter.getField (1) > 0 ? "1" : "-1") << "</Z> "<< std::endl;
00079 fOutput << " <DETECTOR_NAME>" << converter.getFlavor () << "</DETECTOR_NAME> "<< std::endl;
00080 fOutput << " <HCAL_CHANNEL_ID>" << converter.getId().rawId () << "</HCAL_CHANNEL_ID> "<< std::endl;
00081 fOutput << "</CHANNEL>"<< std::endl;
00082 fOutput << std::endl;
00083 }
00084
00085 void dumpChannelId (std::ostream& fOutput, DetId fChannel) {
00086 HcalText2DetIdConverter converter (fChannel);
00087 fOutput << "<CHANNEL> "<< std::endl;
00088 fOutput << " <EXTENSION_TABLE_NAME>HCAL_CHANNELS</EXTENSION_TABLE_NAME> "<< std::endl;
00089 fOutput << " <SUBDET>" << converter.getFlavor () << "</SUBDET> "<< std::endl;
00090 fOutput << " <IETA>" << converter.getField (1) << "</IETA>"<< std::endl;
00091 fOutput << " <IPHI>" << converter.getField (2) << "</IPHI> "<< std::endl;
00092 fOutput << " <DEPTH>" << converter.getField (3) << "</DEPTH> "<< std::endl;
00093
00094 fOutput << "</CHANNEL>"<< std::endl;
00095 fOutput << std::endl;
00096 }
00097
00098 void dumpZSData (std::ostream& fOutput, HcalZSThreshold fValue) {
00099 fOutput << "<DATA> "<< std::endl;
00100 fOutput << " <ZERO_SUPPRESSION>" << fValue.getValue() << "</ZERO_SUPPRESSION> "<< std::endl;
00101 fOutput << "</DATA> " << std::endl;
00102 }
00103
00104 void dumpPedData (std::ostream& fOutput, HcalPedestal fValue, HcalPedestalWidth fValue2, int isADC) {
00105 fOutput << "<DATA> "<< std::endl;
00106 fOutput << " <CAP0>" << fValue.getValue(0) << "</CAP0> "<< std::endl;
00107 fOutput << " <CAP1>" << fValue.getValue(1) << "</CAP1> "<< std::endl;
00108 fOutput << " <CAP2>" << fValue.getValue(2) << "</CAP2> "<< std::endl;
00109 fOutput << " <CAP3>" << fValue.getValue(3) << "</CAP3> "<< std::endl;
00110 fOutput << " <SIGMA_00>" << fValue2.getWidth(0) << "</SIGMA_00> "<< std::endl;
00111 fOutput << " <SIGMA_11>" << fValue2.getWidth(1) << "</SIGMA_11> "<< std::endl;
00112 fOutput << " <SIGMA_22>" << fValue2.getWidth(2) << "</SIGMA_22> "<< std::endl;
00113 fOutput << " <SIGMA_33>" << fValue2.getWidth(3) << "</SIGMA_33> "<< std::endl;
00114 fOutput << " <SIGMA_01>" << fValue2.getSigma(0,1) << "</SIGMA_01> "<< std::endl;
00115 fOutput << " <SIGMA_02>" << fValue2.getSigma(0,2) << "</SIGMA_02> "<< std::endl;
00116 fOutput << " <SIGMA_03>" << fValue2.getSigma(0,3) << "</SIGMA_03> "<< std::endl;
00117 fOutput << " <SIGMA_12>" << fValue2.getSigma(1,2) << "</SIGMA_12> "<< std::endl;
00118 fOutput << " <SIGMA_13>" << fValue2.getSigma(1,3) << "</SIGMA_13> "<< std::endl;
00119 fOutput << " <SIGMA_23>" << fValue2.getSigma(2,3) << "</SIGMA_23> "<< std::endl;
00120 fOutput << " <IS_ADC_COUNTS>" << isADC << "</IS_ADC_COUNTS>" << std::endl;
00121 fOutput << "</DATA> " << std::endl;
00122 }
00123
00124 void dumpGainData (std::ostream& fOutput, HcalGain fValue) {
00125 fOutput << "<DATA> "<< std::endl;
00126 fOutput << " <CAP0>" << fValue.getValue(0) << "</CAP0> "<< std::endl;
00127 fOutput << " <CAP1>" << fValue.getValue(1) << "</CAP1> "<< std::endl;
00128 fOutput << " <CAP2>" << fValue.getValue(2) << "</CAP2> "<< std::endl;
00129 fOutput << " <CAP3>" << fValue.getValue(3) << "</CAP3> "<< std::endl;
00130 fOutput << "</DATA> " << std::endl;
00131 }
00132
00133 void dumpGainWidthData (std::ostream& fOutput, HcalGainWidth fValue) {
00134 fOutput << "<DATA> "<< std::endl;
00135 fOutput << " <CAP0>" << fValue.getValue(0) << "</CAP0> "<< std::endl;
00136 fOutput << " <CAP1>" << fValue.getValue(1) << "</CAP1> "<< std::endl;
00137 fOutput << " <CAP2>" << fValue.getValue(2) << "</CAP2> "<< std::endl;
00138 fOutput << " <CAP3>" << fValue.getValue(3) << "</CAP3> "<< std::endl;
00139 fOutput << "</DATA> " << std::endl;
00140 }
00141
00142 void dumpRespCorrData (std::ostream& fOutput, HcalRespCorr fValue) {
00143 fOutput << "<DATA> "<< std::endl;
00144 fOutput << " <VALUE>" << fValue.getValue() << "</VALUE> "<< std::endl;
00145 fOutput << "</DATA> " << std::endl;
00146 }
00147
00148 void dumpQIEData (std::ostream& fOutput, HcalQIECoder fValue) {
00149 fOutput << "<DATA> "<< std::endl;
00150 fOutput << " <CAP0_RANGE0_SLOPE>" << fValue.slope(0,0) << "</CAP0_RANGE0_SLOPE>" << std::endl;
00151 fOutput << " <CAP0_RANGE1_SLOPE>" << fValue.slope(0,1) << "</CAP0_RANGE1_SLOPE>" << std::endl;
00152 fOutput << " <CAP0_RANGE2_SLOPE>" << fValue.slope(0,2) << "</CAP0_RANGE2_SLOPE>" << std::endl;
00153 fOutput << " <CAP0_RANGE3_SLOPE>" << fValue.slope(0,3) << "</CAP0_RANGE3_SLOPE>" << std::endl;
00154 fOutput << " <CAP1_RANGE0_SLOPE>" << fValue.slope(1,0) << "</CAP1_RANGE0_SLOPE>" << std::endl;
00155 fOutput << " <CAP1_RANGE1_SLOPE>" << fValue.slope(1,1) << "</CAP1_RANGE1_SLOPE>" << std::endl;
00156 fOutput << " <CAP1_RANGE2_SLOPE>" << fValue.slope(1,2) << "</CAP1_RANGE2_SLOPE>" << std::endl;
00157 fOutput << " <CAP1_RANGE3_SLOPE>" << fValue.slope(1,3) << "</CAP1_RANGE3_SLOPE>" << std::endl;
00158 fOutput << " <CAP2_RANGE0_SLOPE>" << fValue.slope(2,0) << "</CAP2_RANGE0_SLOPE>" << std::endl;
00159 fOutput << " <CAP2_RANGE1_SLOPE>" << fValue.slope(2,1) << "</CAP2_RANGE1_SLOPE>" << std::endl;
00160 fOutput << " <CAP2_RANGE2_SLOPE>" << fValue.slope(2,2) << "</CAP2_RANGE2_SLOPE>" << std::endl;
00161 fOutput << " <CAP2_RANGE3_SLOPE>" << fValue.slope(2,3) << "</CAP2_RANGE3_SLOPE>" << std::endl;
00162 fOutput << " <CAP3_RANGE0_SLOPE>" << fValue.slope(3,0) << "</CAP3_RANGE0_SLOPE>" << std::endl;
00163 fOutput << " <CAP3_RANGE1_SLOPE>" << fValue.slope(3,1) << "</CAP3_RANGE1_SLOPE>" << std::endl;
00164 fOutput << " <CAP3_RANGE2_SLOPE>" << fValue.slope(3,2) << "</CAP3_RANGE2_SLOPE>" << std::endl;
00165 fOutput << " <CAP3_RANGE3_SLOPE>" << fValue.slope(3,3) << "</CAP3_RANGE3_SLOPE>" << std::endl;
00166 fOutput << " <CAP0_RANGE0_OFFSET>" << fValue.offset(0,0) << "</CAP0_RANGE0_OFFSET>" << std::endl;
00167 fOutput << " <CAP0_RANGE1_OFFSET>" << fValue.offset(0,1) << "</CAP0_RANGE1_OFFSET>" << std::endl;
00168 fOutput << " <CAP0_RANGE2_OFFSET>" << fValue.offset(0,2) << "</CAP0_RANGE2_OFFSET>" << std::endl;
00169 fOutput << " <CAP0_RANGE3_OFFSET>" << fValue.offset(0,3) << "</CAP0_RANGE3_OFFSET>" << std::endl;
00170 fOutput << " <CAP1_RANGE0_OFFSET>" << fValue.offset(1,0) << "</CAP1_RANGE0_OFFSET>" << std::endl;
00171 fOutput << " <CAP1_RANGE1_OFFSET>" << fValue.offset(1,1) << "</CAP1_RANGE1_OFFSET>" << std::endl;
00172 fOutput << " <CAP1_RANGE2_OFFSET>" << fValue.offset(1,2) << "</CAP1_RANGE2_OFFSET>" << std::endl;
00173 fOutput << " <CAP1_RANGE3_OFFSET>" << fValue.offset(1,3) << "</CAP1_RANGE3_OFFSET>" << std::endl;
00174 fOutput << " <CAP2_RANGE0_OFFSET>" << fValue.offset(2,0) << "</CAP2_RANGE0_OFFSET>" << std::endl;
00175 fOutput << " <CAP2_RANGE1_OFFSET>" << fValue.offset(2,1) << "</CAP2_RANGE1_OFFSET>" << std::endl;
00176 fOutput << " <CAP2_RANGE2_OFFSET>" << fValue.offset(2,2) << "</CAP2_RANGE2_OFFSET>" << std::endl;
00177 fOutput << " <CAP2_RANGE3_OFFSET>" << fValue.offset(2,3) << "</CAP2_RANGE3_OFFSET>" << std::endl;
00178 fOutput << " <CAP3_RANGE0_OFFSET>" << fValue.offset(3,0) << "</CAP3_RANGE0_OFFSET>" << std::endl;
00179 fOutput << " <CAP3_RANGE1_OFFSET>" << fValue.offset(3,1) << "</CAP3_RANGE1_OFFSET>" << std::endl;
00180 fOutput << " <CAP3_RANGE2_OFFSET>" << fValue.offset(3,2) << "</CAP3_RANGE2_OFFSET>" << std::endl;
00181 fOutput << " <CAP3_RANGE3_OFFSET>" << fValue.offset(3,3) << "</CAP3_RANGE3_OFFSET>" << std::endl;
00182 fOutput << "</DATA> " << std::endl;
00183 }
00184
00185 void dumpChannelQualityData (std::ostream& fOutput, HcalChannelStatus fValue) {
00186 fOutput << "<DATA> "<< std::endl;
00187 if(fValue.isBitSet(0))
00188 {
00189 fOutput << " <CHANNEL_ON_OFF_STATE>0</CHANNEL_ON_OFF_STATE> "<< std::endl;
00190 }else{
00191 fOutput << " <CHANNEL_ON_OFF_STATE>1</CHANNEL_ON_OFF_STATE> "<< std::endl;
00192 }
00193 fOutput << " <CHANNEL_STATUS_WORD>" << fValue.getValue() << "</CHANNEL_STATUS_WORD> "<< std::endl;
00194 fOutput << "</DATA> " << std::endl;
00195 }
00196
00197 void dumpL1TriggerData (std::ostream& fOutput, HcalL1TriggerObject fValue) {
00198 fOutput << "<DATA> "<< std::endl;
00199 fOutput << " <AVERAGE_PEDESTAL>" << fValue.getPedestal() << "</AVERAGE_PEDESTAL> "<< std::endl;
00200 fOutput << " <RESPONSE_CORRECTED_GAIN>" << fValue.getRespGain() << "</RESPONSE_CORRECTED_GAIN> "<< std::endl;
00201 fOutput << " <FLAG>" << fValue.getFlag() << "</FLAG> "<< std::endl;
00202 fOutput << "</DATA> " << std::endl;
00203 }
00204
00205
00206 }
00207 bool HcalCondXML::dumpObject (std::ostream& fOutput,
00208 unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
00209 const HcalZSThresholds& fObject) {
00210 const std::string KIND = "HCAL zero suppression [type 1]";
00211 const std::string TABLE = "HCAL_ZERO_SUPPRESSION_TYPE01";
00212
00213 dumpHeader (fOutput, fRun, TABLE, KIND);
00214
00215 std::vector<DetId> channels = fObject.getAllChannels ();
00216 dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
00217 for (std::vector<DetId>::iterator channel = channels.begin ();
00218 channel != channels.end ();
00219 channel++) {
00220 DetId chId = *channel;
00221 if(fObject.exists(chId))
00222 {
00223 const HcalZSThreshold * item = fObject.getValues(chId);
00224 dumpDataset (fOutput, fVersion);
00225 dumpChannelId (fOutput,chId);
00226 dumpZSData (fOutput, *item);
00227 endDataset (fOutput);
00228 }
00229 }
00230
00231 dumpFooter (fOutput);
00232 return true;
00233 }
00234 bool HcalCondXML::dumpObject (std::ostream& fOutput,
00235 unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
00236 const HcalPedestals& fObject, const HcalPedestalWidths& fObject2) {
00237 const std::string KIND = "HCAL Pedestals [V3]";
00238 const std::string TABLE = "HCAL_PEDESTALS_V3";
00239
00240 dumpHeader (fOutput, fRun, TABLE, KIND);
00241 int isADC = 0;
00242 if(fObject.isADC()) isADC = 1;
00243
00244 std::vector<DetId> channels = fObject.getAllChannels ();
00245 dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
00246 for (std::vector<DetId>::iterator channel = channels.begin ();
00247 channel != channels.end ();
00248 channel++) {
00249 DetId chId = *channel;
00250 if(fObject.exists(chId))
00251 {
00252 const HcalPedestal * item = fObject.getValues (chId);
00253 const HcalPedestalWidth * item2 = fObject2.getValues (chId);
00254
00255 dumpDataset (fOutput, fVersion);
00256 dumpChannelId (fOutput,chId);
00257 dumpPedData (fOutput, *item, *item2, isADC);
00258 endDataset (fOutput);
00259 }
00260 }
00261
00262 dumpFooter (fOutput);
00263 return true;
00264 }
00265
00266 bool HcalCondXML::dumpObject (std::ostream& fOutput,
00267 unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
00268 const HcalRespCorrs& fObject) {
00269 const std::string KIND = "HCAL Response corrections [V1]";
00270 const std::string TABLE = "HCAL_RESPONSE_CORRECTIONS_V1";
00271
00272 dumpHeader (fOutput, fRun, TABLE, KIND);
00273
00274 std::vector<DetId> channels = fObject.getAllChannels ();
00275 dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
00276 for (std::vector<DetId>::iterator channel = channels.begin ();
00277 channel != channels.end ();
00278 channel++) {
00279 DetId chId = *channel;
00280 if(fObject.exists(chId))
00281 {
00282 const HcalRespCorr * item = fObject.getValues(chId);
00283 dumpDataset (fOutput, fVersion);
00284 dumpChannelId (fOutput,chId);
00285 dumpRespCorrData (fOutput, *item);
00286 endDataset (fOutput);
00287 }
00288 }
00289
00290 dumpFooter (fOutput);
00291 return true;
00292 }
00293
00294 bool HcalCondXML::dumpObject (std::ostream& fOutput,
00295 unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
00296 const HcalGains& fObject) {
00297 const std::string KIND = "HCAL Inverse Gains [V1]";
00298 const std::string TABLE = "HCAL_INVERSE_GAINS_V1";
00299
00300 dumpHeader (fOutput, fRun, TABLE, KIND);
00301
00302 std::vector<DetId> channels = fObject.getAllChannels ();
00303 dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
00304 for (std::vector<DetId>::iterator channel = channels.begin ();
00305 channel != channels.end ();
00306 channel++) {
00307 DetId chId = *channel;
00308 if(fObject.exists(chId))
00309 {
00310 const HcalGain * item = fObject.getValues(chId);
00311 dumpDataset (fOutput, fVersion);
00312 dumpChannelId (fOutput,chId);
00313 dumpGainData (fOutput, *item);
00314 endDataset (fOutput);
00315 }
00316 }
00317
00318 dumpFooter (fOutput);
00319 return true;
00320 }
00321
00322 bool HcalCondXML::dumpObject (std::ostream& fOutput,
00323 unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
00324 const HcalGainWidths& fObject) {
00325 const std::string KIND = "HCAL Inverse Gain Widths [V1]";
00326 const std::string TABLE = "HCAL_INVERSE_GAIN_WIDTHS_V1";
00327
00328 dumpHeader (fOutput, fRun, TABLE, KIND);
00329
00330 std::vector<DetId> channels = fObject.getAllChannels ();
00331 dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
00332 for (std::vector<DetId>::iterator channel = channels.begin ();
00333 channel != channels.end ();
00334 channel++) {
00335 DetId chId = *channel;
00336 if(fObject.exists(chId))
00337 {
00338 const HcalGainWidth * item = fObject.getValues(chId);
00339 dumpDataset (fOutput, fVersion);
00340 dumpChannelId (fOutput,chId);
00341 dumpGainWidthData (fOutput, *item);
00342 endDataset (fOutput);
00343 }
00344 }
00345
00346 dumpFooter (fOutput);
00347 return true;
00348 }
00349
00350 bool HcalCondXML::dumpObject (std::ostream& fOutput,
00351 unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
00352 const HcalQIEData& fObject) {
00353 const std::string KIND = "QIECARD_ADC_NORMMODE";
00354 const std::string TABLE = "XXX need to check XXX";
00355
00356 dumpHeader (fOutput, fRun, TABLE, KIND);
00357
00358 std::vector<DetId> channels = fObject.getAllChannels ();
00359 dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
00360 for (std::vector<DetId>::iterator channel = channels.begin ();
00361 channel != channels.end ();
00362 channel++) {
00363 DetId chId = *channel;
00364 if(fObject.exists(chId))
00365 {
00366 const HcalQIECoder * item = fObject.getCoder(chId);
00367 dumpDataset (fOutput, fVersion);
00368 dumpChannelId (fOutput,chId);
00369 dumpQIEData (fOutput, *item);
00370 endDataset (fOutput);
00371 }
00372 }
00373
00374 dumpFooter (fOutput);
00375 return true;
00376 }
00377
00378 bool HcalCondXML::dumpObject (std::ostream& fOutput,
00379 unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
00380 const HcalChannelQuality& fObject) {
00381 const std::string KIND = "HCAL_CHANNEL_QUALITY_V1";
00382 const std::string TABLE = "HCAL Channel Quality [V1]";
00383
00384 dumpHeader (fOutput, fRun, TABLE, KIND);
00385
00386 std::vector<DetId> channels = fObject.getAllChannels ();
00387 dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
00388 for (std::vector<DetId>::iterator channel = channels.begin ();
00389 channel != channels.end ();
00390 channel++) {
00391 DetId chId = *channel;
00392 if(fObject.exists(chId))
00393 {
00394 const HcalChannelStatus * item = fObject.getValues(chId);
00395 dumpDataset (fOutput, fVersion);
00396 dumpChannelId (fOutput,chId);
00397 dumpChannelQualityData (fOutput, *item);
00398 endDataset (fOutput);
00399 }
00400 }
00401
00402 dumpFooter (fOutput);
00403 return true;
00404 }
00405
00406 bool HcalCondXML::dumpObject (std::ostream& fOutput,
00407 unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string& fTag, unsigned fVersion,
00408 const HcalL1TriggerObjects& fObject) {
00409 const std::string KIND = "HCAL_L1_TRIGGER_OBJECTS_V1";
00410 const std::string TABLE = "HCAL L1 Trigger Objects [V1]";
00411
00412 dumpHeader (fOutput, fRun, TABLE, KIND);
00413
00414 std::vector<DetId> channels = fObject.getAllChannels ();
00415 dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
00416 for (std::vector<DetId>::iterator channel = channels.begin ();
00417 channel != channels.end ();
00418 channel++) {
00419 DetId chId = *channel;
00420 if(fObject.exists(chId))
00421 {
00422 const HcalL1TriggerObject * item = fObject.getValues(chId);
00423 dumpDataset (fOutput, fVersion);
00424 dumpChannelId (fOutput,chId);
00425 dumpL1TriggerData (fOutput, *item);
00426 endDataset (fOutput);
00427 }
00428 }
00429
00430 dumpFooter (fOutput);
00431 return true;
00432 }
00433