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 CastorCalibrationQIEData &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 CastorGains &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 CastorGainWidths &fObject)
 
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 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 CastorPedestalWidths &fObject)
 
bool dumpObject (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const CastorQIEData &fObject)
 

Detailed Description

IO for XML instances of Hcal/Castor Calibrations.

Function Documentation

◆ dumpObject() [1/9]

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  }

◆ dumpObject() [2/9]

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  }

◆ dumpObject() [3/9]

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.

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 }

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

◆ dumpObject() [4/9]

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.

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 }

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

◆ dumpObject() [5/9]

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  }

◆ dumpObject() [6/9]

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.

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 }

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

◆ dumpObject() [7/9]

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.

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 }

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

◆ dumpObject() [8/9]

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.

35  {
36  return false;
37  }

◆ dumpObject() [9/9]

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  }
CastorCondObjectContainer::getValues
const Item * getValues(DetId fId, bool throwOnFail=true) const
Definition: CastorCondObjectContainer.h:65
CastorGainWidths
Definition: CastorGainWidths.h:18
CastorText2DetIdConverter
Definition: CastorText2DetIdConverter.h:12
gather_cfg.cout
cout
Definition: gather_cfg.py:144
CastorPedestals::isADC
bool isADC() const
Definition: CastorPedestals.h:25
CastorPedestal::getValues
const float * getValues() const
get value for all capId = 0..3
Definition: CastorPedestal.h:19
CastorPedestalWidth
Definition: CastorPedestalWidth.h:16
CastorCondObjectContainer::getAllChannels
std::vector< DetId > getAllChannels() const
Definition: CastorCondObjectContainer.h:119
DetId
Definition: DetId.h:17
errors
Definition: errors.py:1
CastorGain::getValues
const float * getValues() const
get value for all capId = 0..3
Definition: CastorGain.h:16
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
CastorGainWidth
Definition: CastorGainWidth.h:12
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CastorGainWidth::getValues
const float * getValues() const
get value for all capId = 0..3
Definition: CastorGainWidth.h:15
CastorDbASCIIIO::dumpObject
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
Definition: CastorDbASCIIIO.cc:323
CastorCondObjectContainer::addValues
bool addValues(const Item &myItem)
Definition: CastorCondObjectContainer.h:98
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
CastorText2DetIdConverter::toString
std::string toString() const
Definition: CastorText2DetIdConverter.cc:126
ewkTauDQM_cfi.channels
channels
Definition: ewkTauDQM_cfi.py:14
CastorPedestalWidths
Definition: CastorPedestalWidths.h:18
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8