ATLAS Offline Software
Functions | Variables
SCTCalibWriteTool.cxx File Reference

Implementation file for uploading to DB on CAF. More...

#include "SCT_CalibAlgs/SCTCalibWriteTool.h"
#include "AthenaKernel/IAthenaOutputStreamTool.h"
#include "CoralBase/Attribute.h"
#include "Identifier/IdentifierHash.h"
#include "Identifier/Identifier.h"
#include "InDetIdentifier/SCT_ID.h"
#include "PathResolver/PathResolver.h"
#include "GaudiKernel/StatusCode.h"
#include "GaudiKernel/IToolSvc.h"
#include <fstream>
#include <iostream>
#include <istream>
#include <iterator>
#include <sstream>

Go to the source code of this file.

Functions

StatusCode SCTCalibWriteTool::createCondObjects ATLAS_NOT_THREAD_SAFE (const Identifier &wafer_id, const SCT_ID *sctId, const int samplesize, const std::string &defectType, const float threshold, const std::string &defectList) const
 
StatusCode SCTCalibWriteTool::createListEff ATLAS_NOT_THREAD_SAFE (const Identifier &wafer_id, const SCT_ID *sctId, const int samplesize, const float eff) const
 
StatusCode SCTCalibWriteTool::createListBSErr ATLAS_NOT_THREAD_SAFE (const Identifier &wafer_id, const SCT_ID *sctId, const int samplesize, const std::string &errorList, const std::string &probList) const
 
StatusCode SCTCalibWriteTool::createListLA ATLAS_NOT_THREAD_SAFE (const Identifier &wafer_id, const SCT_ID *sctId, const int samplesize, int module, const float lorentz, const float err_lorentz, const float chisq, const float fitParam_a, const float err_a, const float fitParam_b, const float err_b, const float fitParam_sigma, const float err_sigma, const float MCW, const float err_MCW) const
 

Variables

const bool becCapsFormat {true}
 
const bool becUnderscoreFormat {false}
 

Detailed Description

Implementation file for uploading to DB on CAF.

Author
Jose E. Garcia

Definition in file SCTCalibWriteTool.cxx.

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE() [1/4]

StatusCode SCTCalibWriteTool::createListRawOccu ATLAS_NOT_THREAD_SAFE ( const Identifier wafer_id,
const SCT_ID sctId,
const int  samplesize,
const float  eff 
) const

Definition at line 284 of file SCTCalibWriteTool.cxx.

285  {
286  if (!m_writeCondObjs) {
287  return StatusCode::SUCCESS;
288  }
289 
290  coral::AttributeListSpecification* attrSpec{createBasicDbSpec(becUnderscoreFormat)};
291  attrSpec->extend("Efficiency", "float");
292  if (!attrSpec->size()) {
293  ATH_MSG_ERROR(" Attribute list specification is empty");
294  return StatusCode::FAILURE;
295  }
296 
297  coral::AttributeList attrList0{*attrSpec};
298  setBasicValues(attrList0, wafer_id, samplesize,sctId,becUnderscoreFormat);
299  attrList0["Efficiency"].setValue(static_cast<float>(eff));
300 
301  std::ostringstream attrStr2;
302  attrList0.toOutputStream(attrStr2);
303  m_attrListColl_eff->add(wafer_id.get_identifier32().get_compact(), attrList0);
304 
305  return StatusCode::SUCCESS;
306 }

◆ ATLAS_NOT_THREAD_SAFE() [2/4]

StatusCode SCTCalibWriteTool::createListChip ATLAS_NOT_THREAD_SAFE ( const Identifier wafer_id,
const SCT_ID sctId,
const int  samplesize,
const std::string &  defectType,
const float  threshold,
const std::string &  defectList 
) const

Definition at line 189 of file SCTCalibWriteTool.cxx.

190  {
191  if (!m_writeCondObjs) {
192  return StatusCode::SUCCESS;
193  }
194  coral::AttributeListSpecification* attrSpec{createBasicDbSpec(becCapsFormat)};
195  attrSpec->extend("DefectType", "string");
196  attrSpec->extend("Threshold", "float");
197  attrSpec->extend("DefectList", "string");
198 
199  if (!attrSpec->size()) {
200  ATH_MSG_ERROR(" Attribute list specification is empty");
201  return StatusCode::FAILURE;
202  }
203 
204  coral::AttributeList attrList0{*attrSpec};
205  setBasicValues(attrList0, wafer_id, samplesize,sctId,becCapsFormat);
206  attrList0["DefectType"].setValue(static_cast<std::string>(defectType));
207  attrList0["Threshold"].setValue(static_cast<float>(threshold));
208  attrList0["DefectList"].setValue(static_cast<std::string>(defectList));
209  std::ostringstream attrStr2;
210  attrList0.toOutputStream(attrStr2);
211  m_attrListColl->add(wafer_id.get_identifier32().get_compact(), attrList0);
212  return StatusCode::SUCCESS;
213 }

◆ ATLAS_NOT_THREAD_SAFE() [3/4]

StatusCode SCTCalibWriteTool::createListBSErr ATLAS_NOT_THREAD_SAFE ( const Identifier wafer_id,
const SCT_ID sctId,
const int  samplesize,
const std::string &  errorList,
const std::string &  probList 
) const

Definition at line 364 of file SCTCalibWriteTool.cxx.

365  {
366  if (!m_writeCondObjs) {
367  return StatusCode::SUCCESS;
368  }
369 
370  coral::AttributeListSpecification* attrSpec{createBasicDbSpec(becUnderscoreFormat)};
371  attrSpec->extend("BSErrors", "string");
372  attrSpec->extend("BadFraction", "string");
373 
374  if (!attrSpec->size()) {
375  ATH_MSG_ERROR(" Attribute list specification is empty");
376  return StatusCode::FAILURE;
377  }
378 
379  coral::AttributeList attrList0{*attrSpec};
380  setBasicValues(attrList0, wafer_id, samplesize, sctId, becUnderscoreFormat);
381  attrList0["BSErrors"].setValue(static_cast<std::string>(errorList));
382  attrList0["BadFraction"].setValue(static_cast<std::string>(probList));
383 
384  std::ostringstream attrStr2;
385  attrList0.toOutputStream(attrStr2);
386  m_attrListColl_BSErr->add(wafer_id.get_identifier32().get_compact(), attrList0);
387  return StatusCode::SUCCESS;
388 }

◆ ATLAS_NOT_THREAD_SAFE() [4/4]

StatusCode SCTCalibWriteTool::createListLA ATLAS_NOT_THREAD_SAFE ( const Identifier wafer_id,
const SCT_ID sctId,
const int  samplesize,
int  module,
const float  lorentz,
const float  err_lorentz,
const float  chisq,
const float  fitParam_a,
const float  err_a,
const float  fitParam_b,
const float  err_b,
const float  fitParam_sigma,
const float  err_sigma,
const float  MCW,
const float  err_MCW 
) const

Definition at line 393 of file SCTCalibWriteTool.cxx.

394  {
395  if (!m_writeCondObjs) return StatusCode::SUCCESS;
396  int barrel_ec{sctId->barrel_ec(wafer_id)};
397  int layer{sctId->layer_disk(wafer_id)};
398  int side{sctId->side(wafer_id)};
399 
400  coral::AttributeListSpecification* attrSpec{new coral::AttributeListSpecification{}};
401  attrSpec->extend("SampleSize", "int");
402  attrSpec->extend("barrel_endcap", "int");
403  attrSpec->extend("Layer", "int");
404  attrSpec->extend("Side", "int");
405  attrSpec->extend("moduleType", "int");
406  attrSpec->extend("lorentzAngle", "float");
407  attrSpec->extend("err_lorentzAngle", "float");
408  attrSpec->extend("chisq", "float");
409  attrSpec->extend("fitParam_a", "float");
410  attrSpec->extend("err_a", "float");
411  attrSpec->extend("fitParam_b", "float");
412  attrSpec->extend("err_b", "float");
413  attrSpec->extend("fitParam_sigma", "float");
414  attrSpec->extend("err_sigma", "float");
415  attrSpec->extend("minClusterWidth", "float");
416  attrSpec->extend("err_minClusterWidth", "float");
417 
418  if (!attrSpec->size()) {
419  ATH_MSG_ERROR(" Attribute list specification is empty");
420  return StatusCode::FAILURE;
421  }
422 
423  // Add three attr lists
424  coral::AttributeList attrList0{*attrSpec};
425  attrList0["SampleSize"].setValue(static_cast<int>(samplesize));
426  attrList0["barrel_endcap"].setValue(static_cast<int>(barrel_ec));
427  attrList0["Layer"].setValue(static_cast<int>(layer));
428  attrList0["Side"].setValue(static_cast<int>(side));
429  attrList0["moduleType"].setValue(static_cast<int>(module));
430  attrList0["lorentzAngle"].setValue(static_cast<float>(lorentz));
431  attrList0["err_lorentzAngle"].setValue(static_cast<float>(err_lorentz));
432  attrList0["chisq"].setValue(static_cast<float>(chisq));
433  attrList0["fitParam_a"].setValue(static_cast<float>(fitParam_a));
434  attrList0["err_a"].setValue(static_cast<float>(err_a));
435  attrList0["fitParam_b"].setValue(static_cast<float>(fitParam_b));
436  attrList0["err_b"].setValue(static_cast<float>(err_b));
437  attrList0["fitParam_sigma"].setValue(static_cast<float>(fitParam_sigma));
438  attrList0["err_sigma"].setValue(static_cast<float>(err_sigma));
439  attrList0["minClusterWidth"].setValue(static_cast<float>(MCW));
440  attrList0["err_minClusterWidth"].setValue(static_cast<float>(err_MCW));
441 
442  std::ostringstream attrStr2;
443  attrList0.toOutputStream(attrStr2);
444  m_attrListColl_LA->add(wafer_id.get_identifier32().get_compact(), attrList0);
445 
446  return StatusCode::SUCCESS;
447 }

Variable Documentation

◆ becCapsFormat

const bool becCapsFormat {true}

Definition at line 47 of file SCTCalibWriteTool.cxx.

◆ becUnderscoreFormat

const bool becUnderscoreFormat {false}

Definition at line 48 of file SCTCalibWriteTool.cxx.

Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
SCT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: SCT_ID.h:728
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
becUnderscoreFormat
const bool becUnderscoreFormat
Definition: SCTCalibWriteTool.cxx:48
TRT::Hit::side
@ side
Definition: HitInfo.h:83
python.PyAthena.module
module
Definition: PyAthena.py:131
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
becCapsFormat
const bool becCapsFormat
Definition: SCTCalibWriteTool.cxx:47
threshold
Definition: chainparser.cxx:74
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
SCT_ID::side
int side(const Identifier &id) const
Definition: SCT_ID.h:752
dqt_zlumi_alleff_HIST.eff
int eff
Definition: dqt_zlumi_alleff_HIST.py:113