CMS 3D CMS Logo

Static Public Member Functions

EcalCommon Class Reference

#include <EcalCommon.h>

List of all members.

Static Public Member Functions

static int crystalToTriggerTower (int xtal) throw (std::runtime_error)

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, j, and groupFilesInBlocks::tt.

{
  if (xtal < 1 || xtal > 1700) {
    throw(std::runtime_error("ERROR:  crystalToTriggerTower:  crystal number out of bounds"));
  }
  
  int i   = (int) floor((xtal-1)/20.0);
  int j   = (xtal-1) - 20*i;
  int tti = (int) floor(i/5.0);
  int ttj = (int) floor(j/5.0);
  int tt  = ttj + 4*tti + 1;

  return tt;
}