17 #ifndef _ST_EEMC_GEO_ID_
18 #define _ST_EEMC_GEO_ID_
23 #include "StEEmcUtil/EEmcGeom/EEmcGeomDefs.h"
32 static Short_t encodeSmd( Short_t sector, Bool_t layerIsV, Short_t strip );
33 static void decodeSmd( Short_t geoId, Short_t& sector, Bool_t& layerIsV, Short_t& strip );
34 static Int_t getMaxSmdGeoId();
36 static Short_t encodeTow( Short_t sector, Short_t subsector, Short_t etaBin );
37 static void decodeTow( Short_t geoId, Short_t& sector, Short_t& subsector, Short_t& etaBin );
39 static Short_t encodeTow( Short_t phiBin, Short_t etaBin );
40 static void decodeTow( Short_t geoId, Short_t& phiBin, Short_t& etaBin );
43 enum { kMaxSmdGeoId = kEEmcNumStrips*kEEmcNumSmdUVs*kEEmcNumSectors };
53 inline Short_t StEEmcGeoId_t::encodeSmd( Short_t sector, Bool_t layerIsV, Short_t strip ){
54 return kEEmcNumStrips*( 2*sector + layerIsV ) + strip;
57 inline void StEEmcGeoId_t::decodeSmd( Short_t geoId, Short_t& sector, Bool_t& layerIsV, Short_t& strip ){
58 strip = geoId % kEEmcNumStrips;
59 geoId /= kEEmcNumStrips;
64 inline Int_t StEEmcGeoId_t::getMaxSmdGeoId(){
68 inline Short_t StEEmcGeoId_t::encodeTow( Short_t sector, Short_t subsector, Short_t etaBin ){
69 return kEEmcNumEtas*( kEEmcNumSubSectors*sector + subsector ) + etaBin;
72 inline void StEEmcGeoId_t::decodeTow( Short_t geoId, Short_t& sector, Short_t& subsector, Short_t& etaBin ){
73 etaBin = geoId % kEEmcNumEtas;
74 geoId /= kEEmcNumEtas;
75 subsector = geoId % kEEmcNumSubSectors;
76 sector = geoId / kEEmcNumSubSectors;
79 inline Short_t StEEmcGeoId_t::encodeTow( Short_t phiBin, Short_t etaBin ){
80 return kEEmcNumEtas*phiBin + etaBin;
83 inline void StEEmcGeoId_t::decodeTow( Short_t geoId, Short_t& phiBin, Short_t& etaBin ){
84 etaBin = geoId % kEEmcNumEtas;
85 phiBin = geoId / kEEmcNumEtas;