CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/L1TriggerConfig/DTTPGConfigProducers/src/DTPosNegType.cc

Go to the documentation of this file.
00001 /*
00002  *  See header file for a description of this class.
00003  *
00004  *  $Date: 2009/06/12 10:58:46 $
00005  *  $Revision: 1.1 $
00006  *  \author Paolo Ronchese INFN Padova
00007  *
00008  */
00009 
00010 //-----------------------
00011 // This Class' Header --
00012 //-----------------------
00013 #include "L1TriggerConfig/DTTPGConfigProducers/src/DTPosNegType.h"
00014 //#include "CondTools/DT/interface/DTPosNeg.h"
00015 
00016 //-------------------------------
00017 // Collaborating Class Headers --
00018 //-------------------------------
00019 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
00020 
00021 //---------------
00022 // C++ Headers --
00023 //---------------
00024 #include <iostream>
00025 
00026 //-------------------
00027 // Initializations --
00028 //-------------------
00029 bool DTPosNegType::initRequest = true;
00030 std::map<int,int> DTPosNegType::geomMap;
00031 
00032 //----------------
00033 // Constructors --
00034 //----------------
00035 DTPosNegType::DTPosNegType() {
00036 }
00037 
00038 //--------------
00039 // Destructor --
00040 //--------------
00041 DTPosNegType::~DTPosNegType() {
00042 }
00043 
00044 //--------------
00045 // Operations --
00046 //--------------
00047 /*
00048 DTPosNegCompare::operator()( const DTCCBId& idl,
00049                              const DTCCBId& idr ) {
00050 
00051 
00052 }
00053 */
00054 
00055 void DTPosNegType::dump() {
00056 
00057   if ( initRequest ) fillMap();
00058   std::map<int,int>::const_iterator iter = geomMap.begin();
00059   std::map<int,int>::const_iterator iend = geomMap.end();
00060   while ( iter != iend ) {
00061     const std::pair<int,int>& entry = *iter++;
00062     int cha = entry.first;
00063     int pnt = entry.second;
00064     int whe;
00065     int sec;
00066     int sta;
00067     decode( cha, whe, sec, sta );
00068     int p_n;
00069     int c_t;
00070     decode( pnt, p_n, c_t );
00071     if ( whe >= 0 ) std::cout << " ";
00072     std::cout << whe << " ";
00073     if ( sec < 10 ) std::cout << " ";
00074     std::cout << sec << " "
00075               << sta << " "
00076               << p_n << " "
00077               << c_t << std::endl;
00078     int pnc = getPN( whe, sec, sta );
00079     int ctc = getCT( whe, sec, sta );
00080     if ( ( pnc != p_n ) ||
00081          ( ctc != c_t ) ) std::cout << "****************** "
00082                                     << pnc << " " << ctc << std::endl;
00083   }
00084   return;
00085 
00086 }
00087 
00088 
00089 int DTPosNegType::getPN( int whe, int sec, int sta ) {
00090   int p_n;
00091   int c_t;
00092   decode( getData( whe, sec, sta ), p_n, c_t );
00093   return p_n;
00094 }
00095 
00096 
00097 int DTPosNegType::getPN( const DTChamberId& cha ) {
00098   return getPN( cha.wheel(),
00099                 cha.sector(),
00100                 cha.station() );
00101 }
00102 
00103 
00104 int DTPosNegType::getCT( int whe, int sec, int sta ) {
00105   int p_n;
00106   int c_t;
00107   decode( getData( whe, sec, sta ), p_n, c_t );
00108   return c_t;
00109 }
00110 
00111 
00112 int DTPosNegType::getCT( const DTChamberId& cha ) {
00113   return getCT( cha.wheel(),
00114                 cha.sector(),
00115                 cha.station() );
00116 }
00117 
00118 
00119 void DTPosNegType::fillMap() {
00120   //std::cout << "DTPosNeg::fillMap()" << std::endl;
00121   geomMap.clear();
00122 //  DTChamberId().rawId() , 
00123 
00124 
00125 
00126 // ---
00127   geomMap.insert( std::pair<int,int>( idCode( -2,  1, 1 ), pnCode(      1, 1 ) ) );
00128   geomMap.insert( std::pair<int,int>( idCode( -2,  1, 2 ),  pnCode(      2, 2 ) ) );
00129   geomMap.insert( std::pair<int,int>( idCode( -2,  1, 3 ),  pnCode(      0, 3 ) ) );
00130   geomMap.insert( std::pair<int,int>( idCode( -2,  1, 4 ),  pnCode(      2, 4 ) ) );
00131   geomMap.insert( std::pair<int,int>( idCode( -2,  2, 1 ),  pnCode(      1, 1 ) ) );
00132   geomMap.insert( std::pair<int,int>( idCode( -2,  2, 2 ),  pnCode(      2, 2 ) ) );
00133   geomMap.insert( std::pair<int,int>( idCode( -2,  2, 3 ),  pnCode(      0, 3 ) ) );
00134   geomMap.insert( std::pair<int,int>( idCode( -2,  2, 4 ),  pnCode(      2, 4 ) ) );
00135   geomMap.insert( std::pair<int,int>( idCode( -2,  3, 1 ),  pnCode(      1, 1 ) ) );
00136   geomMap.insert( std::pair<int,int>( idCode( -2,  3, 2 ),  pnCode(      2, 2 ) ) );
00137   geomMap.insert( std::pair<int,int>( idCode( -2,  3, 3 ),  pnCode(      0, 3 ) ) );
00138   geomMap.insert( std::pair<int,int>( idCode( -2,  3, 4 ),  pnCode(      2, 4 ) ) );
00139   geomMap.insert( std::pair<int,int>( idCode( -2,  4, 1 ),  pnCode(      1, 1 ) ) );
00140   geomMap.insert( std::pair<int,int>( idCode( -2,  4, 2 ),  pnCode(      2, 2 ) ) );
00141   geomMap.insert( std::pair<int,int>( idCode( -2,  4, 3 ),  pnCode(      0, 3 ) ) );
00142   geomMap.insert( std::pair<int,int>( idCode( -2,  4, 4 ),  pnCode(      0, 6 ) ) );
00143   geomMap.insert( std::pair<int,int>( idCode( -2,  5, 1 ),  pnCode(      1, 1 ) ) );
00144   geomMap.insert( std::pair<int,int>( idCode( -2,  5, 2 ),  pnCode(      2, 2 ) ) );
00145   geomMap.insert( std::pair<int,int>( idCode( -2,  5, 3 ),  pnCode(      0, 3 ) ) );
00146   geomMap.insert( std::pair<int,int>( idCode( -2,  5, 4 ),  pnCode(      1, 4 ) ) );
00147   geomMap.insert( std::pair<int,int>( idCode( -2,  6, 1 ),  pnCode(      1, 1 ) ) );
00148   geomMap.insert( std::pair<int,int>( idCode( -2,  6, 2 ),  pnCode(      2, 2 ) ) );
00149   geomMap.insert( std::pair<int,int>( idCode( -2,  6, 3 ),  pnCode(      0, 3 ) ) );
00150   geomMap.insert( std::pair<int,int>( idCode( -2,  6, 4 ),  pnCode(      1, 4 ) ) );
00151   geomMap.insert( std::pair<int,int>( idCode( -2,  7, 1 ),  pnCode(      1, 1 ) ) );
00152   geomMap.insert( std::pair<int,int>( idCode( -2,  7, 2 ),  pnCode(      2, 2 ) ) );
00153   geomMap.insert( std::pair<int,int>( idCode( -2,  7, 3 ),  pnCode(      0, 3 ) ) );
00154   geomMap.insert( std::pair<int,int>( idCode( -2,  7, 4 ),  pnCode(      1, 4 ) ) );
00155   geomMap.insert( std::pair<int,int>( idCode( -2,  8, 1 ),  pnCode(      1, 1 ) ) );
00156   geomMap.insert( std::pair<int,int>( idCode( -2,  8, 2 ),  pnCode(      2, 2 ) ) );
00157   geomMap.insert( std::pair<int,int>( idCode( -2,  8, 3 ),  pnCode(      0, 3 ) ) );
00158   geomMap.insert( std::pair<int,int>( idCode( -2,  8, 4 ),  pnCode(      1, 4 ) ) );
00159   geomMap.insert( std::pair<int,int>( idCode( -2,  9, 1 ),  pnCode(      1, 1 ) ) );
00160   geomMap.insert( std::pair<int,int>( idCode( -2,  9, 2 ),  pnCode(      2, 2 ) ) );
00161   geomMap.insert( std::pair<int,int>( idCode( -2,  9, 3 ),  pnCode(      0, 3 ) ) );
00162   geomMap.insert( std::pair<int,int>( idCode( -2,  9, 4 ),  pnCode(      0, 5 ) ) );
00163   geomMap.insert( std::pair<int,int>( idCode( -2, 10, 1 ),  pnCode(      1, 1 ) ) );
00164   geomMap.insert( std::pair<int,int>( idCode( -2, 10, 2 ),  pnCode(      2, 2 ) ) );
00165   geomMap.insert( std::pair<int,int>( idCode( -2, 10, 3 ),  pnCode(      0, 3 ) ) );
00166   geomMap.insert( std::pair<int,int>( idCode( -2, 10, 4 ),  pnCode(      2, 7 ) ) );
00167   geomMap.insert( std::pair<int,int>( idCode( -2, 11, 1 ),  pnCode(      1, 1 ) ) );
00168   geomMap.insert( std::pair<int,int>( idCode( -2, 11, 2 ),  pnCode(      2, 2 ) ) );
00169   geomMap.insert( std::pair<int,int>( idCode( -2, 11, 3 ),  pnCode(      0, 3 ) ) );
00170   geomMap.insert( std::pair<int,int>( idCode( -2, 11, 4 ),  pnCode(      0, 5 ) ) );
00171   geomMap.insert( std::pair<int,int>( idCode( -2, 12, 1 ),  pnCode(      1, 1 ) ) );
00172   geomMap.insert( std::pair<int,int>( idCode( -2, 12, 2 ),  pnCode(      2, 2 ) ) );
00173   geomMap.insert( std::pair<int,int>( idCode( -2, 12, 3 ),  pnCode(      0, 3 ) ) );
00174   geomMap.insert( std::pair<int,int>( idCode( -2, 12, 4 ),  pnCode(      2, 4 ) ) );
00175   geomMap.insert( std::pair<int,int>( idCode( -2, 13, 4 ),  pnCode(      0, 6 ) ) );
00176   geomMap.insert( std::pair<int,int>( idCode( -2, 14, 4 ),  pnCode(      1, 7 ) ) );
00177   geomMap.insert( std::pair<int,int>( idCode( -1,  1, 1 ),  pnCode(      1, 1 ) ) );
00178   geomMap.insert( std::pair<int,int>( idCode( -1,  1, 2 ),  pnCode(      2, 2 ) ) );
00179   geomMap.insert( std::pair<int,int>( idCode( -1,  1, 3 ),  pnCode(      0, 3 ) ) );
00180   geomMap.insert( std::pair<int,int>( idCode( -1,  1, 4 ),  pnCode(      2, 4 ) ) );
00181   geomMap.insert( std::pair<int,int>( idCode( -1,  2, 1 ),  pnCode(      1, 1 ) ) );
00182   geomMap.insert( std::pair<int,int>( idCode( -1,  2, 2 ),  pnCode(      2, 2 ) ) );
00183   geomMap.insert( std::pair<int,int>( idCode( -1,  2, 3 ),  pnCode(      0, 3 ) ) );
00184   geomMap.insert( std::pair<int,int>( idCode( -1,  2, 4 ),  pnCode(      2, 4 ) ) );
00185   geomMap.insert( std::pair<int,int>( idCode( -1,  3, 1 ),  pnCode(      1, 1 ) ) );
00186   geomMap.insert( std::pair<int,int>( idCode( -1,  3, 2 ),  pnCode(      2, 2 ) ) );
00187   geomMap.insert( std::pair<int,int>( idCode( -1,  3, 3 ),  pnCode(      0, 3 ) ) );
00188   geomMap.insert( std::pair<int,int>( idCode( -1,  3, 4 ),  pnCode(      2, 4 ) ) );
00189   geomMap.insert( std::pair<int,int>( idCode( -1,  4, 1 ),  pnCode(      1, 1 ) ) );
00190   geomMap.insert( std::pair<int,int>( idCode( -1,  4, 2 ),  pnCode(      2, 2 ) ) );
00191   geomMap.insert( std::pair<int,int>( idCode( -1,  4, 3 ),  pnCode(      0, 3 ) ) );
00192   geomMap.insert( std::pair<int,int>( idCode( -1,  4, 4 ),  pnCode(      0, 6 ) ) );
00193   geomMap.insert( std::pair<int,int>( idCode( -1,  5, 1 ),  pnCode(      1, 1 ) ) );
00194   geomMap.insert( std::pair<int,int>( idCode( -1,  5, 2 ),  pnCode(      2, 2 ) ) );
00195   geomMap.insert( std::pair<int,int>( idCode( -1,  5, 3 ),  pnCode(      0, 3 ) ) );
00196   geomMap.insert( std::pair<int,int>( idCode( -1,  5, 4 ),  pnCode(      1, 4 ) ) );
00197   geomMap.insert( std::pair<int,int>( idCode( -1,  6, 1 ),  pnCode(      1, 1 ) ) );
00198   geomMap.insert( std::pair<int,int>( idCode( -1,  6, 2 ),  pnCode(      2, 2 ) ) );
00199   geomMap.insert( std::pair<int,int>( idCode( -1,  6, 3 ),  pnCode(      0, 3 ) ) );
00200   geomMap.insert( std::pair<int,int>( idCode( -1,  6, 4 ),  pnCode(      1, 4 ) ) );
00201   geomMap.insert( std::pair<int,int>( idCode( -1,  7, 1 ),  pnCode(      1, 1 ) ) );
00202   geomMap.insert( std::pair<int,int>( idCode( -1,  7, 2 ),  pnCode(      2, 2 ) ) );
00203   geomMap.insert( std::pair<int,int>( idCode( -1,  7, 3 ),  pnCode(      0, 3 ) ) );
00204   geomMap.insert( std::pair<int,int>( idCode( -1,  7, 4 ),  pnCode(      1, 4 ) ) );
00205   geomMap.insert( std::pair<int,int>( idCode( -1,  8, 1 ),  pnCode(      1, 1 ) ) );
00206   geomMap.insert( std::pair<int,int>( idCode( -1,  8, 2 ),  pnCode(      2, 2 ) ) );
00207   geomMap.insert( std::pair<int,int>( idCode( -1,  8, 3 ),  pnCode(      0, 3 ) ) );
00208   geomMap.insert( std::pair<int,int>( idCode( -1,  8, 4 ),  pnCode(      1, 4 ) ) );
00209   geomMap.insert( std::pair<int,int>( idCode( -1,  9, 1 ),  pnCode(      1, 1 ) ) );
00210   geomMap.insert( std::pair<int,int>( idCode( -1,  9, 2 ),  pnCode(      2, 2 ) ) );
00211   geomMap.insert( std::pair<int,int>( idCode( -1,  9, 3 ),  pnCode(      0, 3 ) ) );
00212   geomMap.insert( std::pair<int,int>( idCode( -1,  9, 4 ),  pnCode(      0, 5 ) ) );
00213   geomMap.insert( std::pair<int,int>( idCode( -1, 10, 1 ),  pnCode(      1, 1 ) ) );
00214   geomMap.insert( std::pair<int,int>( idCode( -1, 10, 2 ),  pnCode(      2, 2 ) ) );
00215   geomMap.insert( std::pair<int,int>( idCode( -1, 10, 3 ),  pnCode(      0, 3 ) ) );
00216   geomMap.insert( std::pair<int,int>( idCode( -1, 10, 4 ),  pnCode(      2, 7 ) ) );
00217   geomMap.insert( std::pair<int,int>( idCode( -1, 11, 1 ),  pnCode(      1, 1 ) ) );
00218   geomMap.insert( std::pair<int,int>( idCode( -1, 11, 2 ),  pnCode(      2, 2 ) ) );
00219   geomMap.insert( std::pair<int,int>( idCode( -1, 11, 3 ),  pnCode(      0, 3 ) ) );
00220   geomMap.insert( std::pair<int,int>( idCode( -1, 11, 4 ),  pnCode(      0, 5 ) ) );
00221   geomMap.insert( std::pair<int,int>( idCode( -1, 12, 1 ),  pnCode(      1, 1 ) ) );
00222   geomMap.insert( std::pair<int,int>( idCode( -1, 12, 2 ),  pnCode(      2, 2 ) ) );
00223   geomMap.insert( std::pair<int,int>( idCode( -1, 12, 3 ),  pnCode(      0, 3 ) ) );
00224   geomMap.insert( std::pair<int,int>( idCode( -1, 12, 4 ),  pnCode(      2, 4 ) ) );
00225   geomMap.insert( std::pair<int,int>( idCode( -1, 13, 4 ),  pnCode(      0, 6 ) ) );
00226   geomMap.insert( std::pair<int,int>( idCode( -1, 14, 4 ),  pnCode(      1, 7 ) ) );
00227   geomMap.insert( std::pair<int,int>( idCode(  0,  1, 1 ),  pnCode(      1, 1 ) ) );
00228   geomMap.insert( std::pair<int,int>( idCode(  0,  1, 2 ),  pnCode(      2, 2 ) ) );
00229   geomMap.insert( std::pair<int,int>( idCode(  0,  1, 3 ),  pnCode(      0, 3 ) ) );
00230   geomMap.insert( std::pair<int,int>( idCode(  0,  1, 4 ),  pnCode(      2, 4 ) ) );
00231   geomMap.insert( std::pair<int,int>( idCode(  0,  2, 1 ),  pnCode(      2, 1 ) ) );
00232   geomMap.insert( std::pair<int,int>( idCode(  0,  2, 2 ),  pnCode(      1, 2 ) ) );
00233   geomMap.insert( std::pair<int,int>( idCode(  0,  2, 3 ),  pnCode(      0, 3 ) ) );
00234   geomMap.insert( std::pair<int,int>( idCode(  0,  2, 4 ),  pnCode(      1, 4 ) ) );
00235   geomMap.insert( std::pair<int,int>( idCode(  0,  3, 1 ),  pnCode(      2, 1 ) ) );
00236   geomMap.insert( std::pair<int,int>( idCode(  0,  3, 2 ),  pnCode(      1, 2 ) ) );
00237   geomMap.insert( std::pair<int,int>( idCode(  0,  3, 3 ),  pnCode(      0, 3 ) ) );
00238   geomMap.insert( std::pair<int,int>( idCode(  0,  3, 4 ),  pnCode(      1, 4 ) ) );
00239   geomMap.insert( std::pair<int,int>( idCode(  0,  4, 1 ),  pnCode(      1, 1 ) ) );
00240   geomMap.insert( std::pair<int,int>( idCode(  0,  4, 2 ),  pnCode(      2, 2 ) ) );
00241   geomMap.insert( std::pair<int,int>( idCode(  0,  4, 3 ),  pnCode(      0, 3 ) ) );
00242   geomMap.insert( std::pair<int,int>( idCode(  0,  4, 4 ),  pnCode(      0, 6 ) ) );
00243   geomMap.insert( std::pair<int,int>( idCode(  0,  5, 1 ),  pnCode(      1, 1 ) ) );
00244   geomMap.insert( std::pair<int,int>( idCode(  0,  5, 2 ),  pnCode(      2, 2 ) ) );
00245   geomMap.insert( std::pair<int,int>( idCode(  0,  5, 3 ),  pnCode(      0, 3 ) ) );
00246   geomMap.insert( std::pair<int,int>( idCode(  0,  5, 4 ),  pnCode(      1, 4 ) ) );
00247   geomMap.insert( std::pair<int,int>( idCode(  0,  6, 1 ),  pnCode(      2, 1 ) ) );
00248   geomMap.insert( std::pair<int,int>( idCode(  0,  6, 2 ),  pnCode(      1, 2 ) ) );
00249   geomMap.insert( std::pair<int,int>( idCode(  0,  6, 3 ),  pnCode(      0, 3 ) ) );
00250   geomMap.insert( std::pair<int,int>( idCode(  0,  6, 4 ),  pnCode(      2, 4 ) ) );
00251   geomMap.insert( std::pair<int,int>( idCode(  0,  7, 1 ),  pnCode(      2, 1 ) ) );
00252   geomMap.insert( std::pair<int,int>( idCode(  0,  7, 2 ),  pnCode(      1, 2 ) ) );
00253   geomMap.insert( std::pair<int,int>( idCode(  0,  7, 3 ),  pnCode(      0, 3 ) ) );
00254   geomMap.insert( std::pair<int,int>( idCode(  0,  7, 4 ),  pnCode(      2, 4 ) ) );
00255   geomMap.insert( std::pair<int,int>( idCode(  0,  8, 1 ),  pnCode(      1, 1 ) ) );
00256   geomMap.insert( std::pair<int,int>( idCode(  0,  8, 2 ),  pnCode(      2, 2 ) ) );
00257   geomMap.insert( std::pair<int,int>( idCode(  0,  8, 3 ),  pnCode(      0, 3 ) ) );
00258   geomMap.insert( std::pair<int,int>( idCode(  0,  8, 4 ),  pnCode(      1, 4 ) ) );
00259   geomMap.insert( std::pair<int,int>( idCode(  0,  9, 1 ),  pnCode(      1, 1 ) ) );
00260   geomMap.insert( std::pair<int,int>( idCode(  0,  9, 2 ),  pnCode(      2, 2 ) ) );
00261   geomMap.insert( std::pair<int,int>( idCode(  0,  9, 3 ),  pnCode(      0, 3 ) ) );
00262   geomMap.insert( std::pair<int,int>( idCode(  0,  9, 4 ),  pnCode(      0, 5 ) ) );
00263   geomMap.insert( std::pair<int,int>( idCode(  0, 10, 1 ),  pnCode(      2, 1 ) ) );
00264   geomMap.insert( std::pair<int,int>( idCode(  0, 10, 2 ),  pnCode(      1, 2 ) ) );
00265   geomMap.insert( std::pair<int,int>( idCode(  0, 10, 3 ),  pnCode(      0, 3 ) ) );
00266   geomMap.insert( std::pair<int,int>( idCode(  0, 10, 4 ),  pnCode(      2, 7 ) ) );
00267   geomMap.insert( std::pair<int,int>( idCode(  0, 11, 1 ),  pnCode(      2, 1 ) ) );
00268   geomMap.insert( std::pair<int,int>( idCode(  0, 11, 2 ),  pnCode(      1, 2 ) ) );
00269   geomMap.insert( std::pair<int,int>( idCode(  0, 11, 3 ),  pnCode(      0, 3 ) ) );
00270   geomMap.insert( std::pair<int,int>( idCode(  0, 11, 4 ),  pnCode(      0, 5 ) ) );
00271   geomMap.insert( std::pair<int,int>( idCode(  0, 12, 1 ),  pnCode(      1, 1 ) ) );
00272   geomMap.insert( std::pair<int,int>( idCode(  0, 12, 2 ),  pnCode(      2, 2 ) ) );
00273   geomMap.insert( std::pair<int,int>( idCode(  0, 12, 3 ),  pnCode(      0, 3 ) ) );
00274   geomMap.insert( std::pair<int,int>( idCode(  0, 12, 4 ),  pnCode(      2, 4 ) ) );
00275   geomMap.insert( std::pair<int,int>( idCode(  0, 13, 4 ),  pnCode(      0, 6 ) ) );
00276   geomMap.insert( std::pair<int,int>( idCode(  0, 14, 4 ),  pnCode(      1, 7 ) ) );
00277   geomMap.insert( std::pair<int,int>( idCode(  1,  1, 1 ),  pnCode(      2, 1 ) ) );
00278   geomMap.insert( std::pair<int,int>( idCode(  1,  1, 2 ),  pnCode(      1, 2 ) ) );
00279   geomMap.insert( std::pair<int,int>( idCode(  1,  1, 3 ),  pnCode(      0, 3 ) ) );
00280   geomMap.insert( std::pair<int,int>( idCode(  1,  1, 4 ),  pnCode(      1, 4 ) ) );
00281   geomMap.insert( std::pair<int,int>( idCode(  1,  2, 1 ),  pnCode(      2, 1 ) ) );
00282   geomMap.insert( std::pair<int,int>( idCode(  1,  2, 2 ),  pnCode(      1, 2 ) ) );
00283   geomMap.insert( std::pair<int,int>( idCode(  1,  2, 3 ),  pnCode(      0, 3 ) ) );
00284   geomMap.insert( std::pair<int,int>( idCode(  1,  2, 4 ),  pnCode(      1, 4 ) ) );
00285   geomMap.insert( std::pair<int,int>( idCode(  1,  3, 1 ),  pnCode(      2, 1 ) ) );
00286   geomMap.insert( std::pair<int,int>( idCode(  1,  3, 2 ),  pnCode(      1, 2 ) ) );
00287   geomMap.insert( std::pair<int,int>( idCode(  1,  3, 3 ),  pnCode(      0, 3 ) ) );
00288   geomMap.insert( std::pair<int,int>( idCode(  1,  3, 4 ),  pnCode(      1, 4 ) ) );
00289   geomMap.insert( std::pair<int,int>( idCode(  1,  4, 1 ),  pnCode(      2, 1 ) ) );
00290   geomMap.insert( std::pair<int,int>( idCode(  1,  4, 2 ),  pnCode(      1, 2 ) ) );
00291   geomMap.insert( std::pair<int,int>( idCode(  1,  4, 3 ),  pnCode(      0, 3 ) ) );
00292   geomMap.insert( std::pair<int,int>( idCode(  1,  4, 4 ),  pnCode(      0, 6 ) ) );
00293   geomMap.insert( std::pair<int,int>( idCode(  1,  5, 1 ),  pnCode(      2, 1 ) ) );
00294   geomMap.insert( std::pair<int,int>( idCode(  1,  5, 2 ),  pnCode(      1, 2 ) ) );
00295   geomMap.insert( std::pair<int,int>( idCode(  1,  5, 3 ),  pnCode(      0, 3 ) ) );
00296   geomMap.insert( std::pair<int,int>( idCode(  1,  5, 4 ),  pnCode(      2, 4 ) ) );
00297   geomMap.insert( std::pair<int,int>( idCode(  1,  6, 1 ),  pnCode(      2, 1 ) ) );
00298   geomMap.insert( std::pair<int,int>( idCode(  1,  6, 2 ),  pnCode(      1, 2 ) ) );
00299   geomMap.insert( std::pair<int,int>( idCode(  1,  6, 3 ),  pnCode(      0, 3 ) ) );
00300   geomMap.insert( std::pair<int,int>( idCode(  1,  6, 4 ),  pnCode(      2, 4 ) ) );
00301   geomMap.insert( std::pair<int,int>( idCode(  1,  7, 1 ),  pnCode(      2, 1 ) ) );
00302   geomMap.insert( std::pair<int,int>( idCode(  1,  7, 2 ),  pnCode(      1, 2 ) ) );
00303   geomMap.insert( std::pair<int,int>( idCode(  1,  7, 3 ),  pnCode(      0, 3 ) ) );
00304   geomMap.insert( std::pair<int,int>( idCode(  1,  7, 4 ),  pnCode(      2, 4 ) ) );
00305   geomMap.insert( std::pair<int,int>( idCode(  1,  8, 1 ),  pnCode(      2, 1 ) ) );
00306   geomMap.insert( std::pair<int,int>( idCode(  1,  8, 2 ),  pnCode(      1, 2 ) ) );
00307   geomMap.insert( std::pair<int,int>( idCode(  1,  8, 3 ),  pnCode(      0, 3 ) ) );
00308   geomMap.insert( std::pair<int,int>( idCode(  1,  8, 4 ),  pnCode(      1, 4 ) ) );
00309   geomMap.insert( std::pair<int,int>( idCode(  1,  9, 1 ),  pnCode(      2, 1 ) ) );
00310   geomMap.insert( std::pair<int,int>( idCode(  1,  9, 2 ),  pnCode(      1, 2 ) ) );
00311   geomMap.insert( std::pair<int,int>( idCode(  1,  9, 3 ),  pnCode(      0, 3 ) ) );
00312   geomMap.insert( std::pair<int,int>( idCode(  1,  9, 4 ),  pnCode(      0, 5 ) ) );
00313   geomMap.insert( std::pair<int,int>( idCode(  1, 10, 1 ),  pnCode(      2, 1 ) ) );
00314   geomMap.insert( std::pair<int,int>( idCode(  1, 10, 2 ),  pnCode(      1, 2 ) ) );
00315   geomMap.insert( std::pair<int,int>( idCode(  1, 10, 3 ),  pnCode(      0, 3 ) ) );
00316   geomMap.insert( std::pair<int,int>( idCode(  1, 10, 4 ),  pnCode(      2, 7 ) ) );
00317   geomMap.insert( std::pair<int,int>( idCode(  1, 11, 1 ),  pnCode(      2, 1 ) ) );
00318   geomMap.insert( std::pair<int,int>( idCode(  1, 11, 2 ),  pnCode(      1, 2 ) ) );
00319   geomMap.insert( std::pair<int,int>( idCode(  1, 11, 3 ),  pnCode(      0, 3 ) ) );
00320   geomMap.insert( std::pair<int,int>( idCode(  1, 11, 4 ),  pnCode(      0, 5 ) ) );
00321   geomMap.insert( std::pair<int,int>( idCode(  1, 12, 1 ),  pnCode(      2, 1 ) ) );
00322   geomMap.insert( std::pair<int,int>( idCode(  1, 12, 2 ),  pnCode(      1, 2 ) ) );
00323   geomMap.insert( std::pair<int,int>( idCode(  1, 12, 3 ),  pnCode(      0, 3 ) ) );
00324   geomMap.insert( std::pair<int,int>( idCode(  1, 12, 4 ),  pnCode(      2, 4 ) ) );
00325   geomMap.insert( std::pair<int,int>( idCode(  1, 13, 4 ),  pnCode(      0, 6 ) ) );
00326   geomMap.insert( std::pair<int,int>( idCode(  1, 14, 4 ),  pnCode(      1, 7 ) ) );
00327   geomMap.insert( std::pair<int,int>( idCode(  2,  1, 1 ),  pnCode(      2, 1 ) ) );
00328   geomMap.insert( std::pair<int,int>( idCode(  2,  1, 2 ),  pnCode(      1, 2 ) ) );
00329   geomMap.insert( std::pair<int,int>( idCode(  2,  1, 3 ),  pnCode(      0, 3 ) ) );
00330   geomMap.insert( std::pair<int,int>( idCode(  2,  1, 4 ),  pnCode(      1, 4 ) ) );
00331   geomMap.insert( std::pair<int,int>( idCode(  2,  2, 1 ),  pnCode(      2, 1 ) ) );
00332   geomMap.insert( std::pair<int,int>( idCode(  2,  2, 2 ),  pnCode(      1, 2 ) ) );
00333   geomMap.insert( std::pair<int,int>( idCode(  2,  2, 3 ),  pnCode(      0, 3 ) ) );
00334   geomMap.insert( std::pair<int,int>( idCode(  2,  2, 4 ),  pnCode(      1, 4 ) ) );
00335   geomMap.insert( std::pair<int,int>( idCode(  2,  3, 1 ),  pnCode(      2, 1 ) ) );
00336   geomMap.insert( std::pair<int,int>( idCode(  2,  3, 2 ),  pnCode(      1, 2 ) ) );
00337   geomMap.insert( std::pair<int,int>( idCode(  2,  3, 3 ),  pnCode(      0, 3 ) ) );
00338   geomMap.insert( std::pair<int,int>( idCode(  2,  3, 4 ),  pnCode(      1, 4 ) ) );
00339   geomMap.insert( std::pair<int,int>( idCode(  2,  4, 1 ),  pnCode(      2, 1 ) ) );
00340   geomMap.insert( std::pair<int,int>( idCode(  2,  4, 2 ),  pnCode(      1, 2 ) ) );
00341   geomMap.insert( std::pair<int,int>( idCode(  2,  4, 3 ),  pnCode(      0, 3 ) ) );
00342   geomMap.insert( std::pair<int,int>( idCode(  2,  4, 4 ),  pnCode(      0, 6 ) ) );
00343   geomMap.insert( std::pair<int,int>( idCode(  2,  5, 1 ),  pnCode(      2, 1 ) ) );
00344   geomMap.insert( std::pair<int,int>( idCode(  2,  5, 2 ),  pnCode(      1, 2 ) ) );
00345   geomMap.insert( std::pair<int,int>( idCode(  2,  5, 3 ),  pnCode(      0, 3 ) ) );
00346   geomMap.insert( std::pair<int,int>( idCode(  2,  5, 4 ),  pnCode(      2, 4 ) ) );
00347   geomMap.insert( std::pair<int,int>( idCode(  2,  6, 1 ),  pnCode(      2, 1 ) ) );
00348   geomMap.insert( std::pair<int,int>( idCode(  2,  6, 2 ),  pnCode(      1, 2 ) ) );
00349   geomMap.insert( std::pair<int,int>( idCode(  2,  6, 3 ),  pnCode(      0, 3 ) ) );
00350   geomMap.insert( std::pair<int,int>( idCode(  2,  6, 4 ),  pnCode(      2, 4 ) ) );
00351   geomMap.insert( std::pair<int,int>( idCode(  2,  7, 1 ),  pnCode(      2, 1 ) ) );
00352   geomMap.insert( std::pair<int,int>( idCode(  2,  7, 2 ),  pnCode(      1, 2 ) ) );
00353   geomMap.insert( std::pair<int,int>( idCode(  2,  7, 3 ),  pnCode(      0, 3 ) ) );
00354   geomMap.insert( std::pair<int,int>( idCode(  2,  7, 4 ),  pnCode(      2, 4 ) ) );
00355   geomMap.insert( std::pair<int,int>( idCode(  2,  8, 1 ),  pnCode(      2, 1 ) ) );
00356   geomMap.insert( std::pair<int,int>( idCode(  2,  8, 2 ),  pnCode(      1, 2 ) ) );
00357   geomMap.insert( std::pair<int,int>( idCode(  2,  8, 3 ),  pnCode(      0, 3 ) ) );
00358   geomMap.insert( std::pair<int,int>( idCode(  2,  8, 4 ),  pnCode(      2, 4 ) ) );
00359   geomMap.insert( std::pair<int,int>( idCode(  2,  9, 1 ),  pnCode(      2, 1 ) ) );
00360   geomMap.insert( std::pair<int,int>( idCode(  2,  9, 2 ),  pnCode(      1, 2 ) ) );
00361   geomMap.insert( std::pair<int,int>( idCode(  2,  9, 3 ),  pnCode(      0, 3 ) ) );
00362   geomMap.insert( std::pair<int,int>( idCode(  2,  9, 4 ),  pnCode(      0, 5 ) ) );
00363   geomMap.insert( std::pair<int,int>( idCode(  2, 10, 1 ),  pnCode(      2, 1 ) ) );
00364   geomMap.insert( std::pair<int,int>( idCode(  2, 10, 2 ),  pnCode(      1, 2 ) ) );
00365   geomMap.insert( std::pair<int,int>( idCode(  2, 10, 3 ),  pnCode(      0, 3 ) ) );
00366   geomMap.insert( std::pair<int,int>( idCode(  2, 10, 4 ),  pnCode(      2, 7 ) ) );
00367   geomMap.insert( std::pair<int,int>( idCode(  2, 11, 1 ),  pnCode(      2, 1 ) ) );
00368   geomMap.insert( std::pair<int,int>( idCode(  2, 11, 2 ),  pnCode(      1, 2 ) ) );
00369   geomMap.insert( std::pair<int,int>( idCode(  2, 11, 3 ),  pnCode(      0, 3 ) ) );
00370   geomMap.insert( std::pair<int,int>( idCode(  2, 11, 4 ),  pnCode(      0, 5 ) ) );
00371   geomMap.insert( std::pair<int,int>( idCode(  2, 12, 1 ),  pnCode(      2, 1 ) ) );
00372   geomMap.insert( std::pair<int,int>( idCode(  2, 12, 2 ),  pnCode(      1, 2 ) ) );
00373   geomMap.insert( std::pair<int,int>( idCode(  2, 12, 3 ),  pnCode(      0, 3 ) ) );
00374   geomMap.insert( std::pair<int,int>( idCode(  2, 12, 4 ),  pnCode(      1, 4 ) ) );
00375   geomMap.insert( std::pair<int,int>( idCode(  2, 13, 4 ),  pnCode(      0, 6 ) ) );
00376   geomMap.insert( std::pair<int,int>( idCode(  2, 14, 4 ),  pnCode(      1, 7 ) ) );
00377 //
00378   initRequest = false;
00379 }
00380 
00381 
00382 int DTPosNegType::idCode( int whe, int sec, int sta ) {
00383   return ( ( ( ( whe + 3 ) * 100 ) + sec ) * 10 ) + sta;
00384 }
00385 
00386 
00387 int DTPosNegType::pnCode( int p, int t ) {
00388   return ( p * 1000 ) + t;
00389 }
00390 
00391 
00392 void DTPosNegType::decode( int code, int& whe, int& sec, int& sta ) {
00393   whe = ( code / 1000 ) - 3;
00394   sec = ( code /   10 ) % 100;
00395   sta =   code          % 10;
00396   return;
00397 }
00398 
00399 
00400 void DTPosNegType::decode( int code, int& p, int& t ) {
00401   p = code / 1000;
00402   t = code % 1000;
00403   return;
00404 }
00405 
00406 int DTPosNegType::getData( int whe, int sec, int sta ) {
00407   if ( initRequest ) fillMap();
00408   std::map<int,int>::const_iterator iter = geomMap.find( idCode( whe,                             sec,                             sta ) );
00409   std::map<int,int>::const_iterator iend = geomMap.end();
00410   if ( iter == iend ) return 999999;
00411   return iter->second;
00412 }
00413