#include <OnlineDB/EcalCondDB/interface/EcalCommon.h>
Static Public Member Functions | |
static int | crystalToTriggerTower (int xtal) throw (std::runtime_error) |
Convert a supermodule crystal number to a trigger tower number. |
Definition at line 9 of file EcalCommon.h.
Convert a supermodule crystal number to a trigger tower number.
Definition at line 8 of file EcalCommon.cc.
00010 { 00011 if (xtal < 1 || xtal > 1700) { 00012 throw(runtime_error("ERROR: crystalToTriggerTower: crystal number out of bounds")); 00013 } 00014 00015 int i = (int) floor((xtal-1)/20.0); 00016 int j = (xtal-1) - 20*i; 00017 int tti = (int) floor(i/5.0); 00018 int ttj = (int) floor(j/5.0); 00019 int tt = ttj + 4*tti + 1; 00020 00021 return tt; 00022 }