// File: DBCALGeometry.h // Created: Fri Nov 26 15:10:51 CST 2010 // Creator: dwbennet #include "DBCALGeometry.h" int DBCALGeometry::NBCALMODS = 48; // On each module there is a 10x4 (r/phi) array of SiPMs -- this factory // allows two different "rectangular" groupings, an inner (1) and an outer (2) #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::NBCALLAYS1 = 2; int DBCALGeometry::NBCALLAYS2 = 2; int DBCALGeometry::NBCALSECS1 = 4; int DBCALGeometry::NBCALSECS2 = 2; // end of summing configuration #else // The configuration below has no summing of SiPMs int DBCALGeometry::NBCALLAYS1 = 6; int DBCALGeometry::NBCALLAYS2 = 4; int DBCALGeometry::NBCALSECS1 = 4; int DBCALGeometry::NBCALSECS2 = 4; // end of no summing configuration #endif int DBCALGeometry::NSUMLAYS1 = 6/DBCALGeometry::NBCALLAYS1; int DBCALGeometry::NSUMLAYS2 = 4/DBCALGeometry::NBCALLAYS2; int DBCALGeometry::NSUMSECS1 = 4/DBCALGeometry::NBCALSECS1; int DBCALGeometry::NSUMSECS2 = 4/DBCALGeometry::NBCALSECS2; // Enter the index of the SiPM that designates the first // (counting radially outward) of the outer cells (default 7) int DBCALGeometry::BCALMID = 7; 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}; DBCALGeometry::DBCALGeometry() { BCALMIDRAD = m_radius[BCALMID-1]; /// End if groupings do not evenly divide SiPM cells if( (BCALMID-1) % NBCALLAYS1 != 0 || (11-BCALMID) % NBCALLAYS2 != 0 || 4 % NBCALSECS1 != 0 || 4 % NBCALSECS2 != 0) { std::cout<<"ERROR: Bad BCAL fADC groupings, do not evenly divide cells"; assert (false); } } int DBCALGeometry::module( int cellId ) { return ( cellId & MODULE_MASK ) >> MODULE_SHIFT; } int DBCALGeometry::layer( int cellId ) { return ( cellId & LAYER_MASK ) >> LAYER_SHIFT; } int DBCALGeometry::sector( int cellId ) { return ( cellId & SECTOR_MASK ) >> SECTOR_SHIFT; } int DBCALGeometry::cellId( int module, int layer, int sector ) { return ( ( module << MODULE_SHIFT ) | ( layer << LAYER_SHIFT ) | ( sector << SECTOR_SHIFT ) ); } int DBCALGeometry::fADCId( int module, int layer, int sector ) { // This is used to return the readout channel ID which may // differ from the cellID if summing is implemented. // // n.b. this method recycles the cellId() system so that the // valid fADCId values will not be contiguous when summing is // implemented! (4/13/2011 DL) #ifdef BCAL_SUM_CELL if(layer