CMS 3D CMS Logo

EcalCommon Class Reference

General-purpose detector related functions. More...

#include <OnlineDB/EcalCondDB/interface/EcalCommon.h>

List of all members.

Static Public Member Functions

static int crystalToTriggerTower (int xtal) throw (std::runtime_error)
 Convert a supermodule crystal number to a trigger tower number.


Detailed Description

General-purpose detector related functions.

Definition at line 9 of file EcalCommon.h.


Member Function Documentation

int EcalCommon::crystalToTriggerTower ( int  xtal  )  throw (std::runtime_error) [static]

Convert a supermodule crystal number to a trigger tower number.

Definition at line 8 of file EcalCommon.cc.

References i, int, j, and tt.

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 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:19:27 2009 for CMSSW by  doxygen 1.5.4