CMS 3D CMS Logo

List of all members | Static Public Member Functions
EcalCommon Class Reference

#include <EcalCommon.h>

Static Public Member Functions

static int crystalToTriggerTower (int xtal) noexcept(false)
 

Detailed Description

General-purpose detector related functions

Definition at line 9 of file EcalCommon.h.

Member Function Documentation

◆ crystalToTriggerTower()

int EcalCommon::crystalToTriggerTower ( int  xtal)
staticnoexcept

Convert a supermodule crystal number to a trigger tower number

Definition at line 8 of file EcalCommon.cc.

References mps_fire::i, createfilelist::int, dqmiolumiharvest::j, and groupFilesInBlocks::tt.

8  {
9  if (xtal < 1 || xtal > 1700) {
10  throw(std::runtime_error("ERROR: crystalToTriggerTower: crystal number out of bounds"));
11  }
12 
13  int i = (int)floor((xtal - 1) / 20.0);
14  int j = (xtal - 1) - 20 * i;
15  int tti = (int)floor(i / 5.0);
16  int ttj = (int)floor(j / 5.0);
17  int tt = ttj + 4 * tti + 1;
18 
19  return tt;
20 }
Definition: TTTypes.h:54