test
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, unsigned fVersion, const HcalElectronicsMap &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 HcalQIEData &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 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, unsigned fVersion, const HcalQIETypes &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
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 168 of file HcalDbXml.cc.

References ecal_dqm_sourceclient-live_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().

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

References dumpObject_().

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

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

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

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

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

26  {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 219 of file HcalDbXml.cc.

References ecal_dqm_sourceclient-live_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.

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

References dumpObject_().

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

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

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

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

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

Definition at line 33 of file HcalDbXml.h.

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

Definition at line 392 of file HcalDbXml.cc.

References dumpObject_().

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

38  {return false;}
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 HcalQIEData fObject 
)

Definition at line 39 of file HcalDbXml.h.

41  {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 HcalCalibrationQIEData fObject 
)

Definition at line 42 of file HcalDbXml.h.

44  {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,
unsigned  fVersion,
const HcalQIETypes fObject 
)

Definition at line 45 of file HcalDbXml.h.

47  {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;}