CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
HcalDbXml Namespace Reference

IO for XML instances of Hcal Calibrations. More...

Functions

bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalPedestals &fObject, const HcalPedestalWidths &fError)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const HcalPedestals &fObject, const HcalPedestalWidths &fError)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalPedestals &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const HcalPedestals &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const HcalPedestalWidths &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalPedestalWidths &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const HcalGains &fObject, const HcalGainWidths &fError)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalGains &fObject, const HcalGainWidths &fError)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const HcalGains &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalGains &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const HcalRawGains &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalGainWidths &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const HcalGainWidths &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalElectronicsMap &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const HcalElectronicsMap &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalQIEData &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const HcalQIEData &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const HcalCalibrationQIEData &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalCalibrationQIEData &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalQIETypes &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalFrontEndMap &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalSiPMParameters &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalSiPMCharacteristics &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalTPParameters &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalTPChannelParameters &fObject)
 

Detailed Description

IO for XML instances of Hcal Calibrations.

Author
Fedor Ratnikov Oct. 28, 2005
Fedor Ratnikov Oct. 28, 2005
Id:
HcalDbXml.h,v 1.4 2007/10/22 19:09:59 fedor Exp

Function Documentation

bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalPedestals fObject,
const HcalPedestalWidths fError 
)

Definition at line 171 of file HcalDbXml.cc.

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, HcalCondObjectContainer< Item >::getAllChannels(), HcalPedestal::getValues(), HcalCondObjectContainer< Item >::getValues(), AlCaHLTBitMon_QueryRunRegistry::string, HcalText2DetIdConverter::toString(), and makeHLTPrescaleTable::values.

178  {
179  const std::string KIND = "HCAL_PEDESTALS_V2";
180 
181  dumpProlog(fOutput);
182  dumpHeader(fOutput, fRun, KIND, KIND);
183 
184  std::vector<DetId> channels = fObject.getAllChannels();
185  for (std::vector<DetId>::iterator channel = channels.begin(); channel != channels.end(); ++channel) {
186  DetId chId = *channel;
187  const float* values = fObject.getValues(chId)->getValues();
188  const HcalPedestalWidth* errors = fError.getValues(chId);
189  if (!values) {
190  std::cerr << "HcalDbXml::dumpObject-> Can not get data for channel " << HcalText2DetIdConverter(chId).toString()
191  << std::endl;
192  continue;
193  }
194  if (!errors) {
195  std::cerr << "HcalDbXml::dumpObject-> Can not get errors for channel " << HcalText2DetIdConverter(chId).toString()
196  << ". Use defaults" << std::endl;
197  continue;
198  }
199  dumpDataset(fOutput, fVersion, "", "");
200  dumpChannelId(fOutput, chId);
201  dumpData(fOutput, values, *errors);
202  endDataset(fOutput);
203  }
204  dumpMapping(fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
205 
206  dumpFooter(fOutput);
207  return true;
208 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::vector< DetId > getAllChannels() const
Definition: DetId.h:17
const float * getValues() const
get value for all capId = 0..3
Definition: HcalPedestal.h:18
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
const HcalPedestals fObject,
const HcalPedestalWidths fError 
)

Definition at line 377 of file HcalDbXml.cc.

References dumpObject_().

383  {
384  return dumpObject_(fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, &fObject, &fError);
385 }
bool dumpObject_(std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const T1 *fObject1, const T2 *fObject2=0)
Definition: HcalDbXml.cc:334
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalPedestals fObject 
)

Definition at line 150 of file HcalDbXml.cc.

References gather_cfg::cout, CastorDbASCIIIO::dumpObject(), HcalCondObjectContainer< Item >::getAllChannels(), HcalPedestals::isADC(), B2GTnPMonitor_cfi::item, HcalPedestalWidth::setSigma(), and HcalCondObjectContainerBase::topo().

156  {
157  float dummyError = 0.0001;
158  std::cout << "HcalDbXml::dumpObject-> set default errors: 0.0001, 0.0001, 0.0001, 0.0001" << std::endl;
159  HcalPedestalWidths widths(fObject.topo(), fObject.isADC());
160  std::vector<DetId> channels = fObject.getAllChannels();
161  for (std::vector<DetId>::iterator channel = channels.begin(); channel != channels.end(); ++channel) {
162  HcalPedestalWidth item(*channel);
163  for (int iCapId = 1; iCapId <= 4; iCapId++) {
164  item.setSigma(iCapId, iCapId, dummyError * dummyError);
165  }
166  widths.addValues(item);
167  }
168  return dumpObject(fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, fObject, widths);
169 }
bool isADC() const
Definition: HcalPedestals.h:30
std::vector< DetId > getAllChannels() const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
tuple cout
Definition: gather_cfg.py:144
const HcalTopology * topo() const
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
const HcalPedestals fObject 
)

Definition at line 387 of file HcalDbXml.cc.

References gather_cfg::cout, CastorDbASCIIIO::dumpObject(), HcalCondObjectContainer< Item >::getAllChannels(), HcalPedestals::isADC(), B2GTnPMonitor_cfi::item, HcalPedestalWidth::setSigma(), and HcalCondObjectContainerBase::topo().

392  {
393  float dummyError = 0.0001;
394  std::cout << "HcalDbXml::dumpObject-> set default errors: 0.0001, 0.0001, 0.0001, 0.0001" << std::endl;
395  HcalPedestalWidths widths(fObject.topo(), fObject.isADC());
396  std::vector<DetId> channels = fObject.getAllChannels();
397  for (std::vector<DetId>::iterator channel = channels.begin(); channel != channels.end(); channel++) {
398  HcalPedestalWidth item(*channel);
399  for (int iCapId = 0; iCapId < 4; iCapId++) {
400  item.setSigma(iCapId, iCapId, dummyError * dummyError);
401  }
402  widths.addValues(item);
403  }
404  return dumpObject(fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, fObject, widths);
405 }
bool isADC() const
Definition: HcalPedestals.h:30
std::vector< DetId > getAllChannels() const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
tuple cout
Definition: gather_cfg.py:144
const HcalTopology * topo() const
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
const HcalPedestalWidths fObject 
)
inline

Definition at line 32 of file HcalDbXml.h.

37  {
38  return false;
39  }
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalPedestalWidths fObject 
)
inline

Definition at line 33 of file HcalDbXml.h.

39  {
40  return false;
41  }
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
const HcalGains fObject,
const HcalGainWidths fError 
)

Definition at line 407 of file HcalDbXml.cc.

References dumpObject_().

413  {
414  return dumpObject_(fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, &fObject, &fError);
415 }
bool dumpObject_(std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const T1 *fObject1, const T2 *fObject2=0)
Definition: HcalDbXml.cc:334
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalGains fObject,
const HcalGainWidths fError 
)

Definition at line 230 of file HcalDbXml.cc.

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, HcalCondObjectContainer< Item >::getAllChannels(), HcalGainWidth::getValues(), HcalGain::getValues(), HcalCondObjectContainer< Item >::getValues(), AlCaHLTBitMon_QueryRunRegistry::string, HcalText2DetIdConverter::toString(), and makeHLTPrescaleTable::values.

237  {
238  const std::string KIND = "HCAL Gains";
239  const std::string TABLE = "HCAL_GAIN_PEDSTL_CALIBRATIONS";
240 
241  dumpProlog(fOutput);
242  dumpHeader(fOutput, fRun, TABLE, KIND);
243 
244  std::vector<DetId> channels = fObject.getAllChannels();
245  for (std::vector<DetId>::iterator channel = channels.begin(); channel != channels.end(); ++channel) {
246  DetId chId = *channel;
247  const float* values = fObject.getValues(chId)->getValues();
248  const float* errors = fError.getValues(chId)->getValues();
249  if (!values) {
250  std::cerr << "HcalDbXml::dumpObject-> Can not get data for channel " << HcalText2DetIdConverter(chId).toString()
251  << std::endl;
252  continue;
253  }
254  if (!errors) {
255  std::cerr << "HcalDbXml::dumpObject-> Can not get errors for channel " << HcalText2DetIdConverter(chId).toString()
256  << ". Use defaults" << std::endl;
257  continue;
258  }
259  dumpDataset(fOutput, fVersion, "", "");
260  dumpChannelId(fOutput, chId);
261  dumpData(fOutput, values, errors);
262  endDataset(fOutput);
263  }
264  dumpMapping(fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
265 
266  dumpFooter(fOutput);
267  return true;
268 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const float * getValues() const
get value for all capId = 0..3
Definition: HcalGainWidth.h:18
std::vector< DetId > getAllChannels() const
const float * getValues() const
get value for all capId = 0..3
Definition: HcalGain.h:19
Definition: DetId.h:17
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
const HcalGains fObject 
)

Definition at line 417 of file HcalDbXml.cc.

References CastorDbASCIIIO::dumpObject(), HcalCondObjectContainer< Item >::getAllChannels(), B2GTnPMonitor_cfi::item, and HcalCondObjectContainerBase::topo().

422  {
423  HcalGainWidths widths(fObject.topo());
424  std::vector<DetId> channels = fObject.getAllChannels();
425  for (std::vector<DetId>::iterator channel = channels.begin(); channel != channels.end(); channel++) {
426  HcalGainWidth item(*channel, 0, 0, 0, 0);
427  widths.addValues(item); // no error
428  }
429  return dumpObject(fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, fObject, widths);
430 }
std::vector< DetId > getAllChannels() const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
const HcalTopology * topo() const
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalGains fObject 
)

Definition at line 210 of file HcalDbXml.cc.

References gather_cfg::cout, CastorDbASCIIIO::dumpObject(), HcalCondObjectContainer< Item >::getAllChannels(), B2GTnPMonitor_cfi::item, and HcalCondObjectContainerBase::topo().

216  {
217  float dummyErrors[4] = {0., 0., 0., 0.};
218  std::cout << "HcalDbXml::dumpObject-> set default errors: 4 x 0.0" << std::endl;
219 
220  HcalGainWidths widths(fObject.topo());
221  std::vector<DetId> channels = fObject.getAllChannels();
222  for (std::vector<DetId>::iterator channel = channels.begin(); channel != channels.end(); ++channel) {
223  HcalGainWidth item(*channel, dummyErrors[0], dummyErrors[1], dummyErrors[2], dummyErrors[3]);
224  widths.addValues(item);
225  }
226 
227  return dumpObject(fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, fObject, widths);
228 }
std::vector< DetId > getAllChannels() const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
tuple cout
Definition: gather_cfg.py:144
const HcalTopology * topo() const
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
const HcalRawGains fObject 
)

Definition at line 432 of file HcalDbXml.cc.

References dumpObject_().

437  {
438  return dumpObject_(fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, &fObject, (const HcalGainWidths*)nullptr);
439 }
bool dumpObject_(std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const T1 *fObject1, const T2 *fObject2=0)
Definition: HcalDbXml.cc:334
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalGainWidths fObject 
)
inline

Definition at line 57 of file HcalDbXml.h.

63  {
64  return false;
65  }
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
const HcalGainWidths fObject 
)
inline

Definition at line 59 of file HcalDbXml.h.

64  {
65  return false;
66  }
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalElectronicsMap fObject 
)
inline

Definition at line 66 of file HcalDbXml.h.

72  {
73  return false;
74  }
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
const HcalElectronicsMap fObject 
)
inline

Definition at line 67 of file HcalDbXml.h.

72  {
73  return false;
74  }
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalQIEData fObject 
)
inline

Definition at line 75 of file HcalDbXml.h.

81  {
82  return false;
83  }
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
const HcalQIEData fObject 
)
inline

Definition at line 75 of file HcalDbXml.h.

80  {
81  return false;
82  }
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
const HcalCalibrationQIEData fObject 
)
inline

Definition at line 83 of file HcalDbXml.h.

88  {
89  return false;
90  }
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalCalibrationQIEData fObject 
)
inline

Definition at line 84 of file HcalDbXml.h.

90  {
91  return false;
92  }
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalQIETypes fObject 
)
inline

Definition at line 93 of file HcalDbXml.h.

99  {
100  return false;
101  }
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalFrontEndMap fObject 
)
inline

Definition at line 102 of file HcalDbXml.h.

108  {
109  return false;
110  }
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalSiPMParameters fObject 
)
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalSiPMCharacteristics fObject 
)
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalTPParameters fObject 
)
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalTPChannelParameters fObject 
)