30 #include "StSvtGeometry.hh"
31 #include "StMessMgr.h"
33 #include "tables/St_svg_geom_Table.h"
34 #include "tables/St_svg_shape_Table.h"
35 #include "tables/St_srs_srspar_Table.h"
48 StSvtGeometry::StSvtGeometry(srs_srspar_st* param, svg_geom_st *geom, svg_shape_st *shape) :
StSvtWaferCollection()
53 StSvtGeometry::~StSvtGeometry()
64 int StSvtGeometry::getBarrelID(
int layer,
int ladder)
67 static const int tbBarrel[6][2]={
68 {1,-1},{-1,1},{2,-1},{-1,2},{3,-1},{-1,3}};
70 if (layer>0 && layer<=6) barrel = tbBarrel[layer-1][ladder&1];
75 int StSvtGeometry::getWaferIndex(
int barrel,
int ladder,
int wafer)
77 return StSvtWaferCollection::getWaferIndex( barrel, ladder, wafer);
80 int StSvtGeometry::getWaferIndex(
int HardWarePos)
82 int layer = (int)(HardWarePos/1000);
83 int wafer = (int)(HardWarePos/100 )%10;
84 int ladder = (int)(HardWarePos%100 );
85 int barrel = getBarrelID(layer,ladder);
88 return getWaferIndex(barrel,ladder,wafer);