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

Detailed Description

IO for XML instances of Hcal/Castor Calibrations.

Function Documentation

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 167 of file CastorDbXml.cc.

References MessageLogger_cfi::cerr, lumiQueryAPI::dumpData(), CastorCondObjectContainer< Item >::getAllChannels(), CastorPedestal::getValues(), CastorCondObjectContainer< Item >::getValues(), AlCaHLTBitMon_QueryRunRegistry::string, CastorText2DetIdConverter::toString(), and MuonErrorMatrixValues_cff::values.

Referenced by dumpObject().

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

References gather_cfg::cout, CastorDbASCIIIO::dumpObject(), CastorCondObjectContainer< Item >::getAllChannels(), CastorPedestals::isADC(), and CastorPedestalWidth::setSigma().

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

References dumpObject(), and AlCaHLTBitMon_QueryRunRegistry::string.

22  {return false;}
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 218 of file CastorDbXml.cc.

References MessageLogger_cfi::cerr, lumiQueryAPI::dumpData(), CastorCondObjectContainer< Item >::getAllChannels(), CastorGainWidth::getValues(), CastorGain::getValues(), CastorCondObjectContainer< Item >::getValues(), AlCaHLTBitMon_QueryRunRegistry::string, CastorText2DetIdConverter::toString(), and MuonErrorMatrixValues_cff::values.

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

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

203  {
204  float dummyErrors [4] = {0., 0., 0., 0.};
205  std::cout << "CastorDbXml::dumpObject-> set default errors: 4 x 0.0" << std::endl;
206 
207  CastorGainWidths widths;
208  std::vector<DetId> channels = fObject.getAllChannels ();
209  for (std::vector<DetId>::iterator channel = channels.begin (); channel != channels.end (); ++channel)
210  {
211  CastorGainWidth item(*channel,dummyErrors[0],dummyErrors[1],dummyErrors[2],dummyErrors[3]);
212  widths.addValues(item);
213  }
214 
215  return dumpObject (fOutput, fRun, fGMTIOVBegin, fGMTIOVEnd, fTag, fVersion, fObject, widths);
216 }
std::vector< DetId > getAllChannels() const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
bool addValues(const Item &myItem)
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 29 of file CastorDbXml.h.

31  {return false;}
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 32 of file CastorDbXml.h.

34  {return false;}
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 35 of file CastorDbXml.h.

37  {return false;}
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 38 of file CastorDbXml.h.

40  {return false;}