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

#include <PixelMaterialMap.h>

Collaboration diagram for PixelMaterialMap:

Classes

class  Key
 

Public Member Functions

 PixelMaterialMap (const IGeometryDBSvc *db, const IRDBRecordset_ptr &mapTable)
 
void addMaterial (int layerdisk, int typenum, const std::string &volumeName, const std::string &materialName)
 
std::string getMaterial (int layerdisk, int typenum, const std::string &volumeName) const
 

Private Types

typedef std::map< Key, std::string > mapType
 

Private Attributes

mapType m_matmap
 

Detailed Description

Definition at line 16 of file PixelMaterialMap.h.

Member Typedef Documentation

◆ mapType

typedef std::map<Key, std::string> PixelMaterialMap::mapType
private

Definition at line 36 of file PixelMaterialMap.h.

Constructor & Destructor Documentation

◆ PixelMaterialMap()

PixelMaterialMap::PixelMaterialMap ( const IGeometryDBSvc db,
const IRDBRecordset_ptr mapTable 
)

Definition at line 27 of file PixelMaterialMap.cxx.

28 {
29  for (unsigned int i = 0; i < db->getTableSize(mapTable); i++) {
30  int layerdisk = db->getInt(mapTable,"LAYERDISK",i);
31  int typenum = db->getInt(mapTable,"TYPENUM",i);
32  std::string volumeName = db->getString(mapTable,"VOLUMENAME",i);
33  std::string material = db->getString(mapTable,"MATERIAL",i);
34  addMaterial(layerdisk, typenum, volumeName, material);
35  }
36 }

Member Function Documentation

◆ addMaterial()

void PixelMaterialMap::addMaterial ( int  layerdisk,
int  typenum,
const std::string &  volumeName,
const std::string &  materialName 
)

Definition at line 63 of file PixelMaterialMap.cxx.

64 {
65  m_matmap[Key(layerdisk, typenum, volumeName)] = materialName;
66 }

◆ getMaterial()

std::string PixelMaterialMap::getMaterial ( int  layerdisk,
int  typenum,
const std::string &  volumeName 
) const

Definition at line 39 of file PixelMaterialMap.cxx.

40 {
41  // If not found try (layerdisk, 0) then (0, typenum), then (0,0)
42  mapType::const_iterator iter;
43  iter = m_matmap.find(Key(layerdisk, typenum, volumeName));
44  if (iter == m_matmap.end() && typenum) {
45  iter = m_matmap.find(Key(layerdisk, 0, volumeName));
46  }
47  if (iter == m_matmap.end() && layerdisk) {
48  iter = m_matmap.find(Key(0, typenum, volumeName));
49  }
50  if (iter == m_matmap.end() && typenum && layerdisk) {
51  iter = m_matmap.find(Key(0, 0, volumeName));
52  }
53  if (iter != m_matmap.end()) {
54  return iter->second;
55  } else {
56  std::cout << "ERROR: PixelMaterialMap::getMaterial Cannot find material for volumeName: " << volumeName << std::endl;
57  return "";
58  }
59 }

Member Data Documentation

◆ m_matmap

mapType PixelMaterialMap::m_matmap
private

Definition at line 37 of file PixelMaterialMap.h.


The documentation for this class was generated from the following files:
PixelMaterialMap::addMaterial
void addMaterial(int layerdisk, int typenum, const std::string &volumeName, const std::string &materialName)
Definition: PixelMaterialMap.cxx:63
AthenaPoolExample_ReadWrite.Key
Key
Definition: AthenaPoolExample_ReadWrite.py:53
CaloCondBlobAlgs_fillNoiseFromASCII.db
db
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:43
lumiFormat.i
int i
Definition: lumiFormat.py:85
PixelMaterialMap::m_matmap
mapType m_matmap
Definition: PixelMaterialMap.h:37