00001
00002
00012 #include "DQM/EcalCommon/interface/LogicID.h"
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 EcalLogicID LogicID::getEcalLogicID( const char* name,
00023 const int id1,
00024 const int id2,
00025 const int id3 ) throw( std::runtime_error ) {
00026
00027
00028
00029 if( strcmp(name, "EB") == 0 ) {
00030 return( EcalLogicID( "EB",
00031 1000000000UL ) );
00032 }
00033 if( strcmp(name, "EB_crystal_number") == 0 ) {
00034 return( EcalLogicID( "EB_crystal_number",
00035 1011000000UL+10000*id1+id2,
00036 id1,
00037 id2 ) );
00038 }
00039 if( strcmp(name, "EB_trigger_tower") == 0 ) {
00040 return( EcalLogicID( "EB_trigger_tower",
00041 1021000000UL+10000*id1+id2,
00042 id1,
00043 id2 ) );
00044 }
00045 if( strcmp(name, "EB_mem_channel") == 0 ) {
00046 return( EcalLogicID( "EB_mem_channel",
00047 1191000000UL+10000*id1+id2,
00048 id1,
00049 id2 ) );
00050 }
00051 if( strcmp(name, "EB_mem_TT") == 0 ) {
00052 return( EcalLogicID( "EB_mem_TT",
00053 1181000000UL+10000*id1+id2,
00054 id1,
00055 id2 ) );
00056 }
00057 if( strcmp(name, "EB_LM_PN") == 0 ) {
00058 return( EcalLogicID( "EB_LM_PN",
00059 1131000000UL+10000*id1+id2,
00060 id1,
00061 id2 ) );
00062 }
00063
00064
00065
00066 if( strcmp(name, "EE") == 0 ) {
00067 return( EcalLogicID( "EE",
00068 2000000000UL ) );
00069 }
00070 if( strcmp(name, "EE_crystal_number") == 0 ) {
00071 return( EcalLogicID( "EE_crystal_number",
00072 2010000000UL+1000000*((id1>=1&&id1<=9)?2:0)+1000*int(id2/1000)+int(id2%1000),
00073 (id1>=1&&id1<=9)?+1:-1,
00074 int(id2/1000),
00075 int(id2%1000) ) );
00076 }
00077 if( strcmp(name, "EE_readout_tower") == 0 ) {
00078 return( EcalLogicID( "EE_readout_tower",
00079 2110000000UL+100*((id1>=1&&id1<=9)?(646+(id1-1)):(601+(id1-9)))+id2,
00080 ((id1>=1&&id1<=9)?(646+(id1-1)):(601+(id1-9))),
00081 id2 ) );
00082 }
00083 if( strcmp(name, "EE_mem_channel") == 0 ) {
00084 return( EcalLogicID( "EE_mem_channel", EcalLogicID::NULLID ) );
00085 }
00086 if( strcmp(name, "EE_mem_TT") == 0 ) {
00087 return( EcalLogicID( "EE_mem_TT", EcalLogicID::NULLID ) );
00088 }
00089 if( strcmp(name, "EE_LM_PN") == 0 ) {
00090 return( EcalLogicID( "EE_mem_TT", EcalLogicID::NULLID ) );
00091 }
00092
00093 throw( std::runtime_error( "Unknown 'name': " + std::string( name ) ) );
00094 return( EcalLogicID( std::string( "" ), EcalLogicID::NULLID ) );
00095
00096 }
00097