CMS 3D CMS Logo

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)
 
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 168 of file HcalDbXml.cc.

References MessageLogger_cfi::cerr, lumiQueryAPI::dumpData(), HcalCondObjectContainer< Item >::getAllChannels(), HcalPedestal::getValues(), HcalCondObjectContainer< Item >::getValues(), AlCaHLTBitMon_QueryRunRegistry::string, HcalText2DetIdConverter::toString(), and MuonErrorMatrixValues_cff::values.

Referenced by dumpObject().

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
def dumpData(lumidata, filename)
Definition: DetId.h:18
const float * getValues() const
get value for all capId = 0..3
Definition: HcalPedestal.h:19
Definition: errors.py:1
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 354 of file HcalDbXml.cc.

References dumpObject_().

356  {
357  return dumpObject_ (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, &fObject, &fError);
358 }
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:315
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)
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 360 of file HcalDbXml.cc.

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

362  {
363  float dummyError = 0.0001;
364  std::cout << "HcalDbXml::dumpObject-> set default errors: 0.0001, 0.0001, 0.0001, 0.0001" << std::endl;
365  HcalPedestalWidths widths(fObject.topo(), fObject.isADC() );
366  std::vector<DetId> channels = fObject.getAllChannels ();
367  for (std::vector<DetId>::iterator channel = channels.begin ();
368  channel != channels.end ();
369  channel++) {
370 
371  HcalPedestalWidth item(*channel);
372  for (int iCapId = 0; iCapId < 4; iCapId++) {
373  item.setSigma (iCapId, iCapId, dummyError*dummyError);
374  }
375  widths.addValues(item);
376  }
377  return dumpObject (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, fObject, widths);
378 }
bool isADC() const
Definition: HcalPedestals.h:28
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 HcalPedestalWidths fObject 
)

Definition at line 24 of file HcalDbXml.h.

References dumpObject(), and AlCaHLTBitMon_QueryRunRegistry::string.

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.

References dumpObject(), and AlCaHLTBitMon_QueryRunRegistry::string.

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 MessageLogger_cfi::cerr, lumiQueryAPI::dumpData(), HcalCondObjectContainer< Item >::getAllChannels(), HcalGainWidth::getValues(), HcalGain::getValues(), HcalCondObjectContainer< Item >::getValues(), AlCaHLTBitMon_QueryRunRegistry::string, HcalText2DetIdConverter::toString(), and MuonErrorMatrixValues_cff::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
def dumpData(lumidata, filename)
Definition: DetId.h:18
Definition: errors.py:1
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 380 of file HcalDbXml.cc.

References dumpObject_().

382  {
383  return dumpObject_ (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, &fObject, &fError);
384 }
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:315
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)
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 386 of file HcalDbXml.cc.

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

388  {
389  HcalGainWidths widths(fObject.topo());
390  std::vector<DetId> channels = fObject.getAllChannels ();
391  for (std::vector<DetId>::iterator channel = channels.begin (); channel != channels.end (); channel++)
392  {
393  HcalGainWidth item(*channel,0,0,0,0);
394  widths.addValues(item); // no error
395  }
396  return dumpObject (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, fObject, widths);
397 }
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 399 of file HcalDbXml.cc.

References dumpObject_().

401  {
402  return dumpObject_ (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, &fObject, (const HcalGainWidths*)0);
403 }
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:315
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;}
bool HcalDbXml::dumpObject ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
unsigned  fVersion,
const HcalFrontEndMap fObject 
)

Definition at line 48 of file HcalDbXml.h.

References dumpObject(), and AlCaHLTBitMon_QueryRunRegistry::string.

50  {return false;}
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 
)