Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:17:51

0001 #include "PHG4ScintillatorSlatDefs.h"
0002 
0003 PHG4ScintillatorSlatDefs::keytype
0004 PHG4ScintillatorSlatDefs::genkey(const short irow, const short icolumn)
0005 {
0006   keytype key = irow;              // lower bits used by row
0007 // NOLINTNEXTLINE(hicpp-signed-bitwise)
0008   key |= (icolumn << columnbits);  // upper bits used by column, so we can easily extract
0009                                    // slats by column which are combined to towers
0010   return key;
0011 }
0012 
0013 std::pair<short, short>
0014 PHG4ScintillatorSlatDefs::getrowcol(const keytype key)
0015 {
0016   short irow = key & 0xFFFFU;
0017 // NOLINTNEXTLINE(hicpp-signed-bitwise)
0018   short icolumn = key >> columnbits;
0019   return std::make_pair(irow, icolumn);
0020 }