ATLAS Offline Software
Loading...
Searching...
No Matches
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}
std::map< int, int > m_maxSector
@ layer
Definition HitInfo.h:79
@ phiModule
Definition HitInfo.h:80

Member Function Documentation

◆ getBiStaveType()

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

Definition at line 57 of file PixelStaveTypes.cxx.

58{
59 return getData(layer, phiModule).biStaveType;
60}
const Datum & getData(int layer, int phiModule) const

◆ 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}
static const Datum s_defaultDatum

◆ getFluidType()

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

Definition at line 51 of file PixelStaveTypes.cxx.

52{
53 return getData(layer, phiModule).fluidType;
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: