// File: DBCALGeometry.h // Created: Fri Nov 26 15:10:51 CST 2010 // Creator: dwbennet #include "DBCALGeometry.h" // On each module there is a 10x4 (r/phi) array of SiPMs #ifdef BCAL_SUM_CELL // The configuration below has 3x1 (r/phi) summed cells in the inner // and 2x2 summed cells in the outer region //int DBCALGeometry::NSUMSECSIN = 1; //int DBCALGeometry::NSUMSECSOUT = 2; //int DBCALGeometry::NSUMLAYSIN[] = {3,3}; //int DBCALGeometry::NSUMLAYSOUT[] = {2,2}; // 1.2.3.4 summing configuration int DBCALGeometry::NSUMSECSIN = 1; int DBCALGeometry::NSUMSECSOUT = 1; int DBCALGeometry::NSUMLAYSIN[] = {1,2,3}; int DBCALGeometry::NSUMLAYSOUT[] = {4}; // end of summing configuration #else // The configuration below has no summing of SiPMs int DBCALGeometry::NSUMSECSIN = 1; int DBCALGeometry::NSUMSECSOUT = 1; int DBCALGeometry::NSUMLAYSIN[] = {1,1,1,1,1,1}; int DBCALGeometry::NSUMLAYSOUT[] = {1,1,1,1}; // end of no summing configuration #endif int DBCALGeometry::NBCALSECSIN = 4/DBCALGeometry::NSUMSECSIN; int DBCALGeometry::NBCALSECSOUT = 4/DBCALGeometry::NSUMSECSOUT; float DBCALGeometry::BCALINNERRAD = 64.3; float DBCALGeometry::BCALOUTERRAD = 86.17; float DBCALGeometry::BCALFIBERLENGTH = 390.0; float DBCALGeometry::GLOBAL_CENTER = 212; float DBCALGeometry::ATTEN_LENGTH = 300.; float DBCALGeometry::C_EFFECTIVE = 16.75; float DBCALGeometry::m_radius[] = { 64.3, 66.3, 68.3, 70.3, 72.3, 74.3, 76.3, 78.77, 81.24, 83.70, 86.17}; float DBCALGeometry::BCALMIDRAD = DBCALGeometry::m_radius[DBCALGeometry::BCALMID-1]; DBCALGeometry::DBCALGeometry() { /// End if groupings do not evenly divide SiPM cells bool goodGeometry=true; if (NSUMSECSIN <= 0) goodGeometry=false; if (4 % NSUMSECSIN != 0) goodGeometry=false; if (NSUMSECSOUT <= 0) goodGeometry=false; if (4 % NSUMSECSOUT != 0) goodGeometry=false; int totalLayersIn=0; for (int i=0;i> MODULE_SHIFT; } //-------------- // layer //-------------- int DBCALGeometry::layer( int cellId ) { return ( cellId & LAYER_MASK ) >> LAYER_SHIFT; } //-------------- // sector //-------------- int DBCALGeometry::sector( int cellId ) { return ( cellId & SECTOR_MASK ) >> SECTOR_SHIFT; } //-------------- // cellId //-------------- int DBCALGeometry::cellId( int module, int layer, int sector ) { return ( ( module << MODULE_SHIFT ) | ( layer << LAYER_SHIFT ) | ( sector << SECTOR_SHIFT ) ); } //-------------- // fADC_layer //-------------- int DBCALGeometry::fADC_layer( int SiPM_cellId ) { int cell_layer = DBCALGeometry::layer( SiPM_cellId ); int fADC_layer = 0; int tally=0; if (cell_layer < BCALMID) { for (int i=0;i