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

#include <PixelStaveTypes.h>

Collaboration diagram for PixelStaveTypes:

Classes

class  Datum
 
class  Key
 

Public Member Functions

 PixelStaveTypes (const IGeometryDBSvc *db, const IRDBRecordset_ptr &table)
 
int getFluidType (int layer, int phiModule) const
 
int getBiStaveType (int layer, int phiModule) const
 

Private Types

typedef std::map< Key, DatumMapType
 

Private Member Functions

const DatumgetData (int layer, int phiModule) const
 

Private Attributes

MapType m_dataLookup
 
std::map< int, int > m_maxSector
 

Static Private Attributes

static const Datum s_defaultDatum
 

Detailed Description

Definition at line 14 of file PixelStaveTypes.h.

Member Typedef Documentation

◆ MapType

typedef std::map<Key, Datum> PixelStaveTypes::MapType
private

Definition at line 41 of file PixelStaveTypes.h.

Constructor & Destructor Documentation

◆ PixelStaveTypes()

PixelStaveTypes::PixelStaveTypes ( const IGeometryDBSvc db,
const IRDBRecordset_ptr table 
)

Definition at line 37 of file PixelStaveTypes.cxx.

38 {
39  for (unsigned int i = 0; i < db->getTableSize(table); i++) {
40  int layer = db->getInt(table,"LAYER",i);
41  int phiModule = db->getInt(table,"SECTOR",i);
42  int fluidType = db->getInt(table,"FLUIDTYPE",i);
43  int biStaveType = db->getInt(table,"BISTAVETYPE",i);
44 
45  m_dataLookup[Key(layer,phiModule)] = Datum(fluidType,biStaveType);
46  m_maxSector[layer] = std::max(phiModule, m_maxSector[layer]); // Store the max sector for each layer.
47  }
48 }

Member Function Documentation

◆ getBiStaveType()

int PixelStaveTypes::getBiStaveType ( int  layer,
int  phiModule 
) const

Definition at line 57 of file PixelStaveTypes.cxx.

58 {
60 }

◆ getData()

const PixelStaveTypes::Datum & PixelStaveTypes::getData ( int  layer,
int  phiModule 
) const
private

Definition at line 64 of file PixelStaveTypes.cxx.

65 {
66  int layerTmp = layer;
67 
68  // If no entries for layer, use layer 0.
69  std::map<int,int>::const_iterator iterMaxSector;
70  iterMaxSector = m_maxSector.find(layerTmp);
71  if (iterMaxSector == m_maxSector.end() && layerTmp) {
72  layerTmp = 0;
73  iterMaxSector = m_maxSector.find(layerTmp);
74  }
75 
76  if (iterMaxSector != m_maxSector.end()) {
77  int maxSector = iterMaxSector->second;
78  // if phiModule is greater than max Sector in table then assume pattern repeats.
79  // NB This is not the case as the pattern is not very regular and there is an entery
80  // for each layer and phi sector.
81  int phiModuleTmp = phiModule % (maxSector+1);
82 
83  MapType::const_iterator iter;
84  iter = m_dataLookup.find(Key(layerTmp, phiModuleTmp));
85 
86  if (iter != m_dataLookup.end()) return iter->second;
87  }
88 
89  std::cout << "ERROR: PixelStaveTypes cannot find type for layer,phiModule: " << layer << ", " << phiModule << std::endl;
90  return s_defaultDatum;
91 }

◆ getFluidType()

int PixelStaveTypes::getFluidType ( int  layer,
int  phiModule 
) const

Definition at line 51 of file PixelStaveTypes.cxx.

52 {
54 }

Member Data Documentation

◆ m_dataLookup

MapType PixelStaveTypes::m_dataLookup
private

Definition at line 42 of file PixelStaveTypes.h.

◆ m_maxSector

std::map<int,int> PixelStaveTypes::m_maxSector
private

Definition at line 44 of file PixelStaveTypes.h.

◆ s_defaultDatum

const PixelStaveTypes::Datum PixelStaveTypes::s_defaultDatum
staticprivate

Definition at line 46 of file PixelStaveTypes.h.


The documentation for this class was generated from the following files:
PixelStaveTypes::Datum::fluidType
int fluidType
Definition: PixelStaveTypes.h:35
max
#define max(a, b)
Definition: cfImp.cxx:41
AthenaPoolExample_ReadWrite.Key
Key
Definition: AthenaPoolExample_ReadWrite.py:53
PixelStaveTypes::m_dataLookup
MapType m_dataLookup
Definition: PixelStaveTypes.h:42
CaloCondBlobAlgs_fillNoiseFromASCII.db
db
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:43
lumiFormat.i
int i
Definition: lumiFormat.py:92
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
PixelStaveTypes::s_defaultDatum
static const Datum s_defaultDatum
Definition: PixelStaveTypes.h:46
PixelStaveTypes::m_maxSector
std::map< int, int > m_maxSector
Definition: PixelStaveTypes.h:44
python.ext.table_printer.table
list table
Definition: table_printer.py:81
TRT::Hit::phiModule
@ phiModule
Definition: HitInfo.h:80
PixelStaveTypes::Datum::biStaveType
int biStaveType
Definition: PixelStaveTypes.h:36
PixelStaveTypes::getData
const Datum & getData(int layer, int phiModule) const
Definition: PixelStaveTypes.cxx:64