ATLAS Offline Software
Classes | Public Member Functions | Private Types | Private Attributes | List of all members
SCT_CalibDefectData Class Reference

Container with a list of defects derived from calibration data and used in SCT_ReadCalibDataCondAlg and SCT_ReadCalibDataTool. More...

#include <SCT_CalibDefectData.h>

Collaboration diagram for SCT_CalibDefectData:

Classes

struct  CalibModuleDefects
 

Public Member Functions

 SCT_CalibDefectData ()
 Constructor. More...
 
virtual ~SCT_CalibDefectData ()=default
 Destructor. More...
 
bool addModule (const Identifier &moduleId, const CalibModuleDefects &defects)
 Add defects for a module. More...
 
CalibModuleDefects findModule (const Identifier &moduleId) const
 Search the map for a module. More...
 
std::string str ()
 Print the map - might be useful. More...
 
std::string moduleText (const Identifier &moduleId) const
 Print data for one module. More...
 
bool empty () const
 Return whether the map is empty. More...
 
void clear ()
 Clear the map. More...
 
unsigned long int size () const
 Return the size of the map. More...
 

Private Types

typedef std::map< Identifier, CalibModuleDefectsCalibConditions
 

Private Attributes

CalibConditions m_defectMap
 

Detailed Description

Container with a list of defects derived from calibration data and used in SCT_ReadCalibDataCondAlg and SCT_ReadCalibDataTool.

Definition at line 29 of file SCT_CalibDefectData.h.

Member Typedef Documentation

◆ CalibConditions

Definition at line 69 of file SCT_CalibDefectData.h.

Constructor & Destructor Documentation

◆ SCT_CalibDefectData()

SCT_CalibDefectData::SCT_CalibDefectData ( )

Constructor.

Definition at line 19 of file SCT_CalibDefectData.cxx.

19  :
20  m_defectMap{}
21 {}

◆ ~SCT_CalibDefectData()

virtual SCT_CalibDefectData::~SCT_CalibDefectData ( )
virtualdefault

Destructor.

Member Function Documentation

◆ addModule()

bool SCT_CalibDefectData::addModule ( const Identifier moduleId,
const CalibModuleDefects defects 
)

Add defects for a module.

Definition at line 25 of file SCT_CalibDefectData.cxx.

26 {
27  return (m_defectMap.insert(std::make_pair(moduleId, moduleDefects))).second;
28 }

◆ clear()

void SCT_CalibDefectData::clear ( )

Clear the map.

Definition at line 95 of file SCT_CalibDefectData.cxx.

95  {
96  m_defectMap.clear();
97 }

◆ empty()

bool SCT_CalibDefectData::empty ( ) const

Return whether the map is empty.

Definition at line 89 of file SCT_CalibDefectData.cxx.

89  {
90  return m_defectMap.empty();
91 }

◆ findModule()

SCT_CalibDefectData::CalibModuleDefects SCT_CalibDefectData::findModule ( const Identifier moduleId) const

Search the map for a module.

Definition at line 32 of file SCT_CalibDefectData.cxx.

33 {
34  // Create container for the defect data
36  // Iterate over the map and look for the requested module
37  CalibConditions::const_iterator iter(m_defectMap.find(moduleId));
38  if (iter not_eq m_defectMap.end()){
39  ModuleDefects = iter->second;
40  }
41  return ModuleDefects;
42 }

◆ moduleText()

std::string SCT_CalibDefectData::moduleText ( const Identifier moduleId) const

Print data for one module.

Definition at line 62 of file SCT_CalibDefectData.cxx.

62  {
63  CalibModuleDefects thisModuleDefects = findModule( moduleId );
64  std::ostringstream txt;
65  std::ostringstream tmp;
66 
67  if ( thisModuleDefects.begDefects.empty() ){
68  txt << "The SCT module Calibration defect data map is empty for module " << moduleId <<".\n";
69  } else {
70  txt << "\n" << std::left << std::setw(15) << "Bad strips" << std::setw(15) << "Defect type" << std::setw(15) << "Value:" << "\n";
71  for ( unsigned int i = 0; i < thisModuleDefects.begDefects.size(); i++){
72  if ( thisModuleDefects.begDefects[i] == thisModuleDefects.endDefects[i] ){
73  txt << std::left << std::setw(15) << thisModuleDefects.begDefects[i];
74  }
75  else{
76  tmp << thisModuleDefects.begDefects[i] << " - " << thisModuleDefects.endDefects[i];
77  txt << std::left << std::setw(15) << tmp.str();
78  }
79  txt << std::left << std::setw(15) << thisModuleDefects.typeOfDefect[i];
80  txt << std::left << std::setw(15) << thisModuleDefects.parValue[i] << "\n";
81  tmp.str("");
82  }
83  }
84  return txt.str();
85 }

◆ size()

unsigned long int SCT_CalibDefectData::size ( ) const

Return the size of the map.

Definition at line 101 of file SCT_CalibDefectData.cxx.

101  {
102  return m_defectMap.size();
103 }

◆ str()

std::string SCT_CalibDefectData::str ( )

Print the map - might be useful.

Definition at line 46 of file SCT_CalibDefectData.cxx.

47 {
48  std::ostringstream txt;
49  if (m_defectMap.empty()){
50  txt << "No modules are in the SCT Calibration defect data map.\n";
51  } else {
52  CalibConditions::const_iterator itr(m_defectMap.begin());
53  for (; itr!=m_defectMap.end(); ++itr){
54  txt << itr->first << " " << moduleText(itr->first);
55  }
56  }
57  return txt.str();
58 }

Member Data Documentation

◆ m_defectMap

CalibConditions SCT_CalibDefectData::m_defectMap
private

Definition at line 70 of file SCT_CalibDefectData.h.


The documentation for this class was generated from the following files:
SCT_CalibDefectData::findModule
CalibModuleDefects findModule(const Identifier &moduleId) const
Search the map for a module.
Definition: SCT_CalibDefectData.cxx:32
lumiFormat.i
int i
Definition: lumiFormat.py:85
SCT_CalibDefectData::moduleText
std::string moduleText(const Identifier &moduleId) const
Print data for one module.
Definition: SCT_CalibDefectData.cxx:62
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
SCT_CalibDefectData::CalibModuleDefects
Definition: SCT_CalibDefectData.h:32
SCT_CalibDefectData::m_defectMap
CalibConditions m_defectMap
Definition: SCT_CalibDefectData.h:70