CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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, unsigned fVersion, const HcalPedestalWidths &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 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, 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)
 
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 HcalGainWidths &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, 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, unsigned fVersion, const HcalCalibrationQIEData &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)
 

Detailed Description

IO for XML instances of Hcal Calibrations.

Author
Fedor Ratnikov Oct. 28, 2005
Id:
HcalDbXml.h,v 1.8 2008/03/03 16:44:41 rofierzy Exp
Author
Fedor Ratnikov Oct. 28, 2005
Id:
HcalDbXml.h,v 1.5 2008/03/03 20:33:18 rofierzy 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 169 of file HcalDbXml.cc.

References dtNoiseDBValidation_cfg::cerr, lumiQueryAPI::dumpData(), benchmark_cfg::errors, HcalCondObjectContainer< Item >::getAllChannels(), HcalPedestal::getValues(), HcalCondObjectContainer< Item >::getValues(), AlCaHLTBitMon_QueryRunRegistry::string, HcalText2DetIdConverter::toString(), and makeHLTPrescaleTable::values.

Referenced by copyObject().

171  {
172  const std::string KIND = "HCAL_PEDESTALS_V2";
173 
174  dumpProlog (fOutput);
175  dumpHeader (fOutput, fRun, KIND, KIND);
176 
177  std::vector<DetId> channels = fObject.getAllChannels ();
178  for (std::vector<DetId>::iterator channel = channels.begin ();
179  channel != channels.end ();
180  channel++) {
181  DetId chId = *channel;
182  const float* values = fObject.getValues (chId)->getValues ();
183  const HcalPedestalWidth* errors = fError.getValues (chId);
184  if (!values) {
185  std::cerr << "HcalDbXml::dumpObject-> Can not get data for channel " << HcalText2DetIdConverter(chId).toString () << std::endl;
186  continue;
187  }
188  if (!errors) {
189  std::cerr << "HcalDbXml::dumpObject-> Can not get errors for channel " << HcalText2DetIdConverter(chId).toString () << ". Use defaults" << std::endl;
190  continue;
191  }
192  dumpDataset (fOutput, fVersion, "", "");
193  dumpChannelId (fOutput,chId);
194  dumpData (fOutput, values, *errors);
195  endDataset (fOutput);
196  }
197  dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
198 
199  dumpFooter (fOutput);
200  return true;
201 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::vector< DetId > getAllChannels() const
Definition: DetId.h:20
const float * getValues() const
get value for all capId = 0..3
Definition: HcalPedestal.h:17
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 346 of file HcalDbXml.cc.

References dumpObject_().

348  {
349  return dumpObject_ (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, &fObject, &fError);
350 }
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:307
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 148 of file HcalDbXml.cc.

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

150  {
151  float dummyError = 0.0001;
152  std::cout << "HcalDbXml::dumpObject-> set default errors: 0.0001, 0.0001, 0.0001, 0.0001" << std::endl;
153  HcalPedestalWidths widths(fObject.topo(),fObject.isADC() );
154  std::vector<DetId> channels = fObject.getAllChannels ();
155  for (std::vector<DetId>::iterator channel = channels.begin ();
156  channel != channels.end ();
157  channel++) {
158 
159  HcalPedestalWidth item(*channel);
160  for (int iCapId = 1; iCapId <= 4; iCapId++) {
161  item.setSigma (iCapId, iCapId, dummyError*dummyError);
162  }
163  widths.addValues(item);
164 
165  }
166  return dumpObject (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, fObject, widths);
167 }
bool isADC() const
Definition: HcalPedestals.h:26
std::vector< DetId > getAllChannels() const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
tuple cout
Definition: gather_cfg.py:121
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 352 of file HcalDbXml.cc.

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

354  {
355  float dummyError = 0.0001;
356  std::cout << "HcalDbXml::dumpObject-> set default errors: 0.0001, 0.0001, 0.0001, 0.0001" << std::endl;
357  HcalPedestalWidths widths(fObject.topo(), fObject.isADC() );
358  std::vector<DetId> channels = fObject.getAllChannels ();
359  for (std::vector<DetId>::iterator channel = channels.begin ();
360  channel != channels.end ();
361  channel++) {
362 
363  HcalPedestalWidth item(*channel);
364  for (int iCapId = 0; iCapId < 4; iCapId++) {
365  item.setSigma (iCapId, iCapId, dummyError*dummyError);
366  }
367  widths.addValues(item);
368  }
369  return dumpObject (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, fObject, widths);
370 }
bool isADC() const
Definition: HcalPedestals.h:26
std::vector< DetId > getAllChannels() const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
tuple cout
Definition: gather_cfg.py:121
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 HcalPedestalWidths fObject 
)

Definition at line 25 of file HcalDbXml.h.

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

Definition at line 25 of file HcalDbXml.h.

27  {return false;}
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 220 of file HcalDbXml.cc.

References dtNoiseDBValidation_cfg::cerr, lumiQueryAPI::dumpData(), benchmark_cfg::errors, HcalCondObjectContainer< Item >::getAllChannels(), HcalGainWidth::getValues(), HcalGain::getValues(), HcalCondObjectContainer< Item >::getValues(), AlCaHLTBitMon_QueryRunRegistry::string, HcalText2DetIdConverter::toString(), and makeHLTPrescaleTable::values.

222  {
223  const std::string KIND = "HCAL Gains";
224  const std::string TABLE = "HCAL_GAIN_PEDSTL_CALIBRATIONS";
225 
226  dumpProlog (fOutput);
227  dumpHeader (fOutput, fRun, TABLE, KIND);
228 
229  std::vector<DetId> channels = fObject.getAllChannels ();
230  for (std::vector<DetId>::iterator channel = channels.begin ();
231  channel != channels.end ();
232  channel++) {
233  DetId chId = *channel;
234  const float* values = fObject.getValues (chId)->getValues ();
235  const float* errors = fError.getValues (chId)->getValues ();
236  if (!values) {
237  std::cerr << "HcalDbXml::dumpObject-> Can not get data for channel " << HcalText2DetIdConverter(chId).toString () << std::endl;
238  continue;
239  }
240  if (!errors) {
241  std::cerr << "HcalDbXml::dumpObject-> Can not get errors for channel " << HcalText2DetIdConverter(chId).toString () << ". Use defaults" << std::endl;
242  continue;
243  }
244  dumpDataset (fOutput, fVersion, "", "");
245  dumpChannelId (fOutput,chId);
246  dumpData (fOutput, values, errors);
247  endDataset (fOutput);
248  }
249  dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);
250 
251  dumpFooter (fOutput);
252  return true;
253 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const float * getValues() const
get value for all capId = 0..3
Definition: HcalGainWidth.h:17
std::vector< DetId > getAllChannels() const
const float * getValues() const
get value for all capId = 0..3
Definition: HcalGain.h:18
Definition: DetId.h:20
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 372 of file HcalDbXml.cc.

References dumpObject_().

374  {
375  return dumpObject_ (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, &fObject, &fError);
376 }
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:307
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 203 of file HcalDbXml.cc.

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

205  {
206  float dummyErrors [4] = {0., 0., 0., 0.};
207  std::cout << "HcalDbXml::dumpObject-> set default errors: 4 x 0.0" << std::endl;
208 
209  HcalGainWidths widths(fObject.topo());
210  std::vector<DetId> channels = fObject.getAllChannels ();
211  for (std::vector<DetId>::iterator channel = channels.begin (); channel != channels.end (); channel++)
212  {
213  HcalGainWidth item(*channel,dummyErrors[0],dummyErrors[1],dummyErrors[2],dummyErrors[3]);
214  widths.addValues(item);
215  }
216 
217  return dumpObject (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, fObject, widths);
218 }
std::vector< DetId > getAllChannels() const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
tuple cout
Definition: gather_cfg.py:121
const HcalTopology * topo() const
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
const HcalGains fObject 
)

Definition at line 378 of file HcalDbXml.cc.

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

380  {
381  HcalGainWidths widths(fObject.topo());
382  std::vector<DetId> channels = fObject.getAllChannels ();
383  for (std::vector<DetId>::iterator channel = channels.begin (); channel != channels.end (); channel++)
384  {
385  HcalGainWidth item(*channel,0,0,0,0);
386  widths.addValues(item); // no error
387  }
388  return dumpObject (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, fObject, widths);
389 }
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 HcalGainWidths fObject 
)
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
const HcalRawGains fObject 
)

Definition at line 391 of file HcalDbXml.cc.

References dumpObject_().

393  {
394  return dumpObject_ (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, &fObject, (const HcalGainWidths*)0);
395 }
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:307
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 37 of file HcalDbXml.h.

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

Definition at line 37 of file HcalDbXml.h.

39  {return false;}
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 40 of file HcalDbXml.h.

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

Definition at line 43 of file HcalDbXml.h.

45  {return false;}
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 43 of file HcalDbXml.h.

45  {return false;}
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 46 of file HcalDbXml.h.

48  {return false;}