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 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 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, const HcalRawGains &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, const HcalGains &fObject, const HcalGainWidths &fError)
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, const HcalPedestals &fObject)
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 HcalCalibrationQIEData &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 HcalElectronicsMap &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, unsigned fVersion, 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, const HcalGainWidths &fError)
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, unsigned fVersion, const HcalPedestals &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(), HcalCondObjectContainer< Item >::getValues(), HcalPedestal::getValues(), AlCaHLTBitMon_QueryRunRegistry::string, HcalText2DetIdConverter::toString(), and makeHLTPrescaleTable::values.

Referenced by copyObject().

                                                                                            {
  const std::string KIND = "HCAL_PEDESTALS_V2";

  dumpProlog (fOutput);
  dumpHeader (fOutput, fRun, KIND, KIND);

  std::vector<DetId> channels = fObject.getAllChannels ();
  for (std::vector<DetId>::iterator channel = channels.begin ();
       channel !=  channels.end ();
       channel++) {
    DetId chId = *channel;
    const float* values = fObject.getValues (chId)->getValues ();
    const HcalPedestalWidth* errors = fError.getValues (chId);
    if (!values) {
      std::cerr << "HcalDbXml::dumpObject-> Can not get data for channel " << HcalText2DetIdConverter(chId).toString () << std::endl;
      continue;
    }
    if (!errors) {
      std::cerr << "HcalDbXml::dumpObject-> Can not get errors for channel " << HcalText2DetIdConverter(chId).toString () <<  ". Use defaults" << std::endl;
      continue;
    }
    dumpDataset (fOutput, fVersion, "", "");
    dumpChannelId (fOutput,chId); 
    dumpData (fOutput, values, *errors);
    endDataset (fOutput);
  }
  dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);

  dumpFooter (fOutput);
  return true;
}
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.

                                                          {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.

                                               {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.

                                                      {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.

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

References dumpObject_().

                                                         {
  return dumpObject_ (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, &fObject, (const HcalGainWidths*)0);
}
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().

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

                                                                                    {
  return dumpObject_ (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, &fObject, &fError);
}
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.

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

                                                          {
  float dummyError = 0.0001;
  std::cout << "HcalDbXml::dumpObject-> set default errors: 0.0001, 0.0001, 0.0001, 0.0001" << std::endl;
  HcalPedestalWidths widths(fObject.topo(), fObject.isADC() );
  std::vector<DetId> channels = fObject.getAllChannels ();
  for (std::vector<DetId>::iterator channel = channels.begin ();
       channel !=  channels.end ();
       channel++) {

    HcalPedestalWidth item(*channel);
    for (int iCapId = 0; iCapId < 4; iCapId++) {
      item.setSigma (iCapId, iCapId, dummyError*dummyError);
    }
    widths.addValues(item);
  }
  return dumpObject (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, fObject, widths);
}
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_().

                                                                                            {
  return dumpObject_ (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, &fObject, &fError);
}
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.

                                                          {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 HcalElectronicsMap fObject 
)

Definition at line 37 of file HcalDbXml.h.

                                                      {return false;}
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,
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().

                                                      {
  float dummyErrors [4] = {0., 0., 0., 0.};
  std::cout << "HcalDbXml::dumpObject-> set default errors: 4 x 0.0" << std::endl;

  HcalGainWidths widths(fObject.topo());
  std::vector<DetId> channels = fObject.getAllChannels ();
  for (std::vector<DetId>::iterator channel = channels.begin (); channel !=  channels.end (); channel++) 
    {
      HcalGainWidth item(*channel,dummyErrors[0],dummyErrors[1],dummyErrors[2],dummyErrors[3]);
      widths.addValues(item);
    }

  return dumpObject (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, fObject, widths);
}
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(), HcalCondObjectContainer< Item >::getValues(), HcalGainWidth::getValues(), HcalGain::getValues(), AlCaHLTBitMon_QueryRunRegistry::string, HcalText2DetIdConverter::toString(), and makeHLTPrescaleTable::values.

                                                                                    {
  const std::string KIND = "HCAL Gains";
  const std::string TABLE = "HCAL_GAIN_PEDSTL_CALIBRATIONS";

  dumpProlog (fOutput);
  dumpHeader (fOutput, fRun, TABLE, KIND);

  std::vector<DetId> channels = fObject.getAllChannels ();
  for (std::vector<DetId>::iterator channel = channels.begin ();
       channel !=  channels.end ();
       channel++) {
    DetId chId = *channel;
    const float* values = fObject.getValues (chId)->getValues ();
    const float* errors = fError.getValues (chId)->getValues ();
    if (!values) {
      std::cerr << "HcalDbXml::dumpObject-> Can not get data for channel " << HcalText2DetIdConverter(chId).toString () << std::endl;
      continue;
    }
    if (!errors) {
      std::cerr << "HcalDbXml::dumpObject-> Can not get errors for channel " << HcalText2DetIdConverter(chId).toString () <<  ". Use defaults" << std::endl;
      continue;
    }
    dumpDataset (fOutput, fVersion, "", "");
    dumpChannelId (fOutput,chId); 
    dumpData (fOutput, values, errors);
    endDataset (fOutput);
  }
  dumpMapping (fOutput, fRun, KIND, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, channels);

  dumpFooter (fOutput);
  return true;
}
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.

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

                                                          {
  float dummyError = 0.0001;
  std::cout << "HcalDbXml::dumpObject-> set default errors: 0.0001, 0.0001, 0.0001, 0.0001" << std::endl;
  HcalPedestalWidths widths(fObject.topo(),fObject.isADC() );
  std::vector<DetId> channels = fObject.getAllChannels ();
  for (std::vector<DetId>::iterator channel = channels.begin ();
       channel !=  channels.end ();
       channel++) {

    HcalPedestalWidth item(*channel);
    for (int iCapId = 1; iCapId <= 4; iCapId++) {
      item.setSigma (iCapId, iCapId, dummyError*dummyError);
    }
    widths.addValues(item);

  }
  return dumpObject (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, fObject, widths);
}