CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Static Public Member Functions | Private Member Functions
LogicID Class Reference

#include <LogicID.h>

Static Public Member Functions

static EcalLogicID getEcalLogicID (const char *name, const int id1=EcalLogicID::NULLID, const int id2=EcalLogicID::NULLID, const int id3=EcalLogicID::NULLID) throw ( std::runtime_error )
 

Private Member Functions

 LogicID ()
 
 ~LogicID ()
 

Detailed Description

Definition at line 19 of file LogicID.h.

Constructor & Destructor Documentation

LogicID::LogicID ( )
inlineprivate

Definition at line 118 of file LogicID.h.

118 {}; // Hidden to force static use
LogicID::~LogicID ( )
inlineprivate

Definition at line 119 of file LogicID.h.

119 {}; // Hidden to force static use

Member Function Documentation

static EcalLogicID LogicID::getEcalLogicID ( const char *  name,
const int  id1 = EcalLogicID::NULLID,
const int  id2 = EcalLogicID::NULLID,
const int  id3 = EcalLogicID::NULLID 
)
throw (std::runtime_error
)
inlinestatic

Definition at line 31 of file LogicID.h.

References EcalLogicID::NULLID.

Referenced by EcalBarrelMonitorClient::endRunDb(), EcalEndcapMonitorClient::endRunDb(), EcalEndcapMonitorClient::writeDb(), and EcalBarrelMonitorClient::writeDb().

34  {
35 
36  // EcalBarrel
37 
38  if( strcmp(name, "EB") == 0 ) {
39  return( EcalLogicID( "EB",
40  1000000000UL ) );
41  }
42  if( strcmp(name, "EB_crystal_number") == 0 ) {
43  return( EcalLogicID( "EB_crystal_number",
44  1011000000UL+10000*id1+id2,
45  id1,
46  id2 ) );
47  }
48  if( strcmp(name, "EB_trigger_tower") == 0 ) {
49  return( EcalLogicID( "EB_trigger_tower",
50  1021000000UL+10000*id1+id2,
51  id1,
52  id2 ) );
53  }
54  if( strcmp(name, "EB_mem_channel") == 0 ) {
55  return( EcalLogicID( "EB_mem_channel",
56  1191000000UL+10000*id1+id2,
57  id1,
58  id2 ) );
59  }
60  if( strcmp(name, "EB_mem_TT") == 0 ) {
61  return( EcalLogicID( "EB_mem_TT",
62  1181000000UL+10000*id1+id2,
63  id1,
64  id2 ) );
65  }
66  if( strcmp(name, "EB_LM_PN") == 0 ) {
67  return( EcalLogicID( "EB_LM_PN",
68  1131000000UL+10000*id1+id2,
69  id1,
70  id2 ) );
71  }
72 
73  // EcalEndcap
74 
75  if( strcmp(name, "EE") == 0 ) {
76  return( EcalLogicID( "EE",
77  2000000000UL ) );
78  }
79  if( strcmp(name, "EE_crystal_number") == 0 ) {
80  return( EcalLogicID( "EE_crystal_number",
81  2010000000UL+1000000*((id1>=1&&id1<=9)?2:0)+1000*int(id2/1000)+int(id2%1000),
82  (id1>=1&&id1<=9)?+1:-1,
83  int(id2/1000),
84  int(id2%1000) ) );
85  }
86  if( strcmp(name, "EE_readout_tower") == 0 ) {
87  return( EcalLogicID( "EE_readout_tower",
88  2110000000UL+100*((id1>=1&&id1<=9)?(646+(id1-1)):(601+(id1-10)))+id2,
89  ((id1>=1&&id1<=9)?(646+(id1-1)):(601+(id1-10))),
90  id2 ) );
91  }
92  if( strcmp(name, "EE_mem_channel") == 0 ) {
93  return( EcalLogicID( "EE_mem_channel",
94  100*((id1>=1&&id1<=9)?(646+(id1-1)):(601+(id1-10)))+id2,
95  ((id1>=1&&id1<=9)?(646+(id1-1)):(601+(id1-10))),
96  id2 ) );
97  }
98  if( strcmp(name, "EE_mem_TT") == 0 ) {
99  return( EcalLogicID( "EE_mem_TT",
100  100*((id1>=1&&id1<=9)?(646+(id1-1)):(601+(id1-10)))+id2,
101  ((id1>=1&&id1<=9)?(646+(id1-1)):(601+(id1-10))),
102  id2 ) );
103  }
104  if( strcmp(name, "EE_LM_PN") == 0 ) {
105  return( EcalLogicID( "EE_LM_PN",
106  100*((id1>=1&&id1<=9)?(646+(id1-1)):(601+(id1-10)))+id2,
107  ((id1>=1&&id1<=9)?(646+(id1-1)):(601+(id1-10))),
108  id2 ) );
109  }
110 
111  throw( std::runtime_error( "Unknown 'name': " + std::string( name ) ) );
112  return( EcalLogicID( std::string( "" ), EcalLogicID::NULLID ) );
113 
114 }
static const int NULLID
Definition: EcalLogicID.h:43