CMS 3D CMS Logo

Functions
CastorDbXml Namespace Reference

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

Functions

bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const CastorPedestals &fObject, const CastorPedestalWidths &fError)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const CastorPedestals &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const CastorPedestalWidths &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const CastorGains &fObject, const CastorGainWidths &fError)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const CastorGains &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const CastorGainWidths &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const CastorElectronicsMap &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const CastorQIEData &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const CastorCalibrationQIEData &fObject)
 

Detailed Description

IO for XML instances of Hcal/Castor Calibrations.

Function Documentation

bool CastorDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const CastorPedestals fObject,
const CastorPedestalWidths fError 
)

Definition at line 170 of file CastorDbXml.cc.

References beam_dqm_sourceclient-live_cfg::cerr, ewkTauDQM_cfi::channels, CastorCondObjectContainer< Item >::getAllChannels(), CastorPedestal::getValues(), CastorCondObjectContainer< Item >::getValues(), AlCaHLTBitMon_QueryRunRegistry::string, CastorText2DetIdConverter::toString(), and contentValuesCheck::values.

Referenced by dumpObject().

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

Definition at line 149 of file CastorDbXml.cc.

References ewkTauDQM_cfi::channels, gather_cfg::cout, CastorDbASCIIIO::dumpObject(), CastorCondObjectContainer< Item >::getAllChannels(), CastorPedestals::isADC(), B2GTnPMonitor_cfi::item, and CastorPedestalWidth::setSigma().

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

Definition at line 29 of file CastorDbXml.h.

References dumpObject(), and AlCaHLTBitMon_QueryRunRegistry::string.

35  {
36  return false;
37  }
bool CastorDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const CastorGains fObject,
const CastorGainWidths fError 
)

Definition at line 229 of file CastorDbXml.cc.

References beam_dqm_sourceclient-live_cfg::cerr, ewkTauDQM_cfi::channels, CastorCondObjectContainer< Item >::getAllChannels(), CastorGainWidth::getValues(), CastorGain::getValues(), CastorCondObjectContainer< Item >::getValues(), AlCaHLTBitMon_QueryRunRegistry::string, CastorText2DetIdConverter::toString(), and contentValuesCheck::values.

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

Definition at line 209 of file CastorDbXml.cc.

References CastorCondObjectContainer< Item >::addValues(), ewkTauDQM_cfi::channels, gather_cfg::cout, CastorDbASCIIIO::dumpObject(), CastorCondObjectContainer< Item >::getAllChannels(), and B2GTnPMonitor_cfi::item.

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

Definition at line 53 of file CastorDbXml.h.

59  {
60  return false;
61  }
bool CastorDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const CastorElectronicsMap fObject 
)

Definition at line 62 of file CastorDbXml.h.

68  {
69  return false;
70  }
bool CastorDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const CastorQIEData fObject 
)

Definition at line 71 of file CastorDbXml.h.

77  {
78  return false;
79  }
bool CastorDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const CastorCalibrationQIEData fObject 
)

Definition at line 80 of file CastorDbXml.h.

86  {
87  return false;
88  }