CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 168 of file CastorDbXml.cc.

References dtNoiseDBValidation_cfg::cerr, lumiQueryAPI::dumpData(), benchmark_cfg::errors, CastorCondObjectContainer< Item >::getAllChannels(), CastorPedestal::getValues(), CastorCondObjectContainer< Item >::getValues(), CastorText2DetIdConverter::toString(), and makeHLTPrescaleTable::values.

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 CastorPedestalWidth* errors = fError.getValues (chId);
183  if (!values) {
184  std::cerr << "CastorDbXml::dumpObject-> Can not get data for channel " << CastorText2DetIdConverter(chId).toString () << std::endl;
185  continue;
186  }
187  if (!errors) {
188  std::cerr << "CastorDbXml::dumpObject-> Can not get errors for channel " << CastorText2DetIdConverter(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 }
std::vector< DetId > getAllChannels() const
const Item * getValues(DetId fId) const
Definition: DetId.h:20
const float * getValues() const
get value for all capId = 0..3
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 147 of file CastorDbXml.cc.

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

149  {
150  float dummyError = 0.0001;
151  std::cout << "CastorDbXml::dumpObject-> set default errors: 0.0001, 0.0001, 0.0001, 0.0001" << std::endl;
152  CastorPedestalWidths widths(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  CastorPedestalWidth 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 }
std::vector< DetId > getAllChannels() const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
bool isADC() const
tuple cout
Definition: gather_cfg.py:121
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.

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

References dtNoiseDBValidation_cfg::cerr, lumiQueryAPI::dumpData(), benchmark_cfg::errors, CastorCondObjectContainer< Item >::getAllChannels(), CastorGainWidth::getValues(), CastorGain::getValues(), CastorCondObjectContainer< Item >::getValues(), CastorText2DetIdConverter::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 << "CastorDbXml::dumpObject-> Can not get data for channel " << CastorText2DetIdConverter(chId).toString () << std::endl;
237  continue;
238  }
239  if (!errors) {
240  std::cerr << "CastorDbXml::dumpObject-> Can not get errors for channel " << CastorText2DetIdConverter(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 }
std::vector< DetId > getAllChannels() const
const float * getValues() const
get value for all capId = 0..3
const Item * getValues(DetId fId) const
Definition: DetId.h:20
const float * getValues() const
get value for all capId = 0..3
Definition: CastorGain.h:15
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 202 of file CastorDbXml.cc.

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

204  {
205  float dummyErrors [4] = {0., 0., 0., 0.};
206  std::cout << "CastorDbXml::dumpObject-> set default errors: 4 x 0.0" << std::endl;
207 
208  CastorGainWidths widths;
209  std::vector<DetId> channels = fObject.getAllChannels ();
210  for (std::vector<DetId>::iterator channel = channels.begin (); channel != channels.end (); channel++)
211  {
212  CastorGainWidth 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)
bool addValues(const Item &myItem)
tuple cout
Definition: gather_cfg.py:121
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;}