Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:47

0001 /*
0002  *  See header file for a description of this class.
0003  *
0004  *  $Date: 2008/08/15 13:46:37 $
0005  *  $Revision: 1.1 $
0006  *  \author Paolo Ronchese INFN Padova
0007  *
0008  */
0009 
0010 //-----------------------
0011 // This Class' Header --
0012 //-----------------------
0013 #include "CondTools/DT/interface/DTPosNeg.h"
0014 
0015 //-------------------------------
0016 // Collaborating Class Headers --
0017 //-------------------------------
0018 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0019 
0020 //---------------
0021 // C++ Headers --
0022 //---------------
0023 #include <iostream>
0024 
0025 //-------------------
0026 // Initializations --
0027 //-------------------
0028 bool DTPosNeg::initRequest = true;
0029 std::map<int, int> DTPosNeg::geomMap;
0030 
0031 //----------------
0032 // Constructors --
0033 //----------------
0034 DTPosNeg::DTPosNeg() {}
0035 
0036 //--------------
0037 // Destructor --
0038 //--------------
0039 DTPosNeg::~DTPosNeg() {}
0040 
0041 //--------------
0042 // Operations --
0043 //--------------
0044 /*
0045 DTPosNegCompare::operator()( const DTCCBId& idl,
0046                              const DTCCBId& idr ) {
0047 
0048 
0049 }
0050 */
0051 
0052 void DTPosNeg::dump() {
0053   if (initRequest)
0054     fillMap();
0055   std::map<int, int>::const_iterator iter = geomMap.begin();
0056   std::map<int, int>::const_iterator iend = geomMap.end();
0057   while (iter != iend) {
0058     const std::pair<int, int>& entry = *iter++;
0059     int cha = entry.first;
0060     int pnt = entry.second;
0061     int whe;
0062     int sec;
0063     int sta;
0064     decode(cha, whe, sec, sta);
0065     int p_n;
0066     int c_t;
0067     decode(pnt, p_n, c_t);
0068     if (whe >= 0)
0069       std::cout << " ";
0070     std::cout << whe << " ";
0071     if (sec < 10)
0072       std::cout << " ";
0073     std::cout << sec << " " << sta << " " << p_n << " " << c_t << std::endl;
0074     int pnc = getPN(whe, sec, sta);
0075     int ctc = getCT(whe, sec, sta);
0076     if ((pnc != p_n) || (ctc != c_t))
0077       std::cout << "****************** " << pnc << " " << ctc << std::endl;
0078   }
0079   return;
0080 }
0081 
0082 int DTPosNeg::getPN(int whe, int sec, int sta) {
0083   int p_n;
0084   int c_t;
0085   decode(getData(whe, sec, sta), p_n, c_t);
0086   return p_n;
0087 }
0088 
0089 int DTPosNeg::getPN(const DTChamberId& cha) { return getPN(cha.wheel(), cha.sector(), cha.station()); }
0090 
0091 int DTPosNeg::getCT(int whe, int sec, int sta) {
0092   int p_n;
0093   int c_t;
0094   decode(getData(whe, sec, sta), p_n, c_t);
0095   return c_t;
0096 }
0097 
0098 int DTPosNeg::getCT(const DTChamberId& cha) { return getCT(cha.wheel(), cha.sector(), cha.station()); }
0099 
0100 void DTPosNeg::fillMap() {
0101   //std::cout << "DTPosNeg::fillMap()" << std::endl;
0102   geomMap.clear();
0103   //  DTChamberId().rawId() ,
0104 
0105   // ---
0106   geomMap.insert(std::pair<int, int>(idCode(-2, 1, 1), pnCode(1, 1)));
0107   geomMap.insert(std::pair<int, int>(idCode(-2, 1, 2), pnCode(2, 2)));
0108   geomMap.insert(std::pair<int, int>(idCode(-2, 1, 3), pnCode(0, 3)));
0109   geomMap.insert(std::pair<int, int>(idCode(-2, 1, 4), pnCode(2, 4)));
0110   geomMap.insert(std::pair<int, int>(idCode(-2, 2, 1), pnCode(1, 1)));
0111   geomMap.insert(std::pair<int, int>(idCode(-2, 2, 2), pnCode(2, 2)));
0112   geomMap.insert(std::pair<int, int>(idCode(-2, 2, 3), pnCode(0, 3)));
0113   geomMap.insert(std::pair<int, int>(idCode(-2, 2, 4), pnCode(2, 4)));
0114   geomMap.insert(std::pair<int, int>(idCode(-2, 3, 1), pnCode(1, 1)));
0115   geomMap.insert(std::pair<int, int>(idCode(-2, 3, 2), pnCode(2, 2)));
0116   geomMap.insert(std::pair<int, int>(idCode(-2, 3, 3), pnCode(0, 3)));
0117   geomMap.insert(std::pair<int, int>(idCode(-2, 3, 4), pnCode(2, 4)));
0118   geomMap.insert(std::pair<int, int>(idCode(-2, 4, 1), pnCode(1, 1)));
0119   geomMap.insert(std::pair<int, int>(idCode(-2, 4, 2), pnCode(2, 2)));
0120   geomMap.insert(std::pair<int, int>(idCode(-2, 4, 3), pnCode(0, 3)));
0121   geomMap.insert(std::pair<int, int>(idCode(-2, 4, 4), pnCode(0, 6)));
0122   geomMap.insert(std::pair<int, int>(idCode(-2, 5, 1), pnCode(1, 1)));
0123   geomMap.insert(std::pair<int, int>(idCode(-2, 5, 2), pnCode(2, 2)));
0124   geomMap.insert(std::pair<int, int>(idCode(-2, 5, 3), pnCode(0, 3)));
0125   geomMap.insert(std::pair<int, int>(idCode(-2, 5, 4), pnCode(1, 4)));
0126   geomMap.insert(std::pair<int, int>(idCode(-2, 6, 1), pnCode(1, 1)));
0127   geomMap.insert(std::pair<int, int>(idCode(-2, 6, 2), pnCode(2, 2)));
0128   geomMap.insert(std::pair<int, int>(idCode(-2, 6, 3), pnCode(0, 3)));
0129   geomMap.insert(std::pair<int, int>(idCode(-2, 6, 4), pnCode(1, 4)));
0130   geomMap.insert(std::pair<int, int>(idCode(-2, 7, 1), pnCode(1, 1)));
0131   geomMap.insert(std::pair<int, int>(idCode(-2, 7, 2), pnCode(2, 2)));
0132   geomMap.insert(std::pair<int, int>(idCode(-2, 7, 3), pnCode(0, 3)));
0133   geomMap.insert(std::pair<int, int>(idCode(-2, 7, 4), pnCode(1, 4)));
0134   geomMap.insert(std::pair<int, int>(idCode(-2, 8, 1), pnCode(1, 1)));
0135   geomMap.insert(std::pair<int, int>(idCode(-2, 8, 2), pnCode(2, 2)));
0136   geomMap.insert(std::pair<int, int>(idCode(-2, 8, 3), pnCode(0, 3)));
0137   geomMap.insert(std::pair<int, int>(idCode(-2, 8, 4), pnCode(1, 4)));
0138   geomMap.insert(std::pair<int, int>(idCode(-2, 9, 1), pnCode(1, 1)));
0139   geomMap.insert(std::pair<int, int>(idCode(-2, 9, 2), pnCode(2, 2)));
0140   geomMap.insert(std::pair<int, int>(idCode(-2, 9, 3), pnCode(0, 3)));
0141   geomMap.insert(std::pair<int, int>(idCode(-2, 9, 4), pnCode(0, 5)));
0142   geomMap.insert(std::pair<int, int>(idCode(-2, 10, 1), pnCode(1, 1)));
0143   geomMap.insert(std::pair<int, int>(idCode(-2, 10, 2), pnCode(2, 2)));
0144   geomMap.insert(std::pair<int, int>(idCode(-2, 10, 3), pnCode(0, 3)));
0145   geomMap.insert(std::pair<int, int>(idCode(-2, 10, 4), pnCode(2, 7)));
0146   geomMap.insert(std::pair<int, int>(idCode(-2, 11, 1), pnCode(1, 1)));
0147   geomMap.insert(std::pair<int, int>(idCode(-2, 11, 2), pnCode(2, 2)));
0148   geomMap.insert(std::pair<int, int>(idCode(-2, 11, 3), pnCode(0, 3)));
0149   geomMap.insert(std::pair<int, int>(idCode(-2, 11, 4), pnCode(0, 5)));
0150   geomMap.insert(std::pair<int, int>(idCode(-2, 12, 1), pnCode(1, 1)));
0151   geomMap.insert(std::pair<int, int>(idCode(-2, 12, 2), pnCode(2, 2)));
0152   geomMap.insert(std::pair<int, int>(idCode(-2, 12, 3), pnCode(0, 3)));
0153   geomMap.insert(std::pair<int, int>(idCode(-2, 12, 4), pnCode(2, 4)));
0154   geomMap.insert(std::pair<int, int>(idCode(-2, 13, 4), pnCode(0, 6)));
0155   geomMap.insert(std::pair<int, int>(idCode(-2, 14, 4), pnCode(1, 7)));
0156   geomMap.insert(std::pair<int, int>(idCode(-1, 1, 1), pnCode(1, 1)));
0157   geomMap.insert(std::pair<int, int>(idCode(-1, 1, 2), pnCode(2, 2)));
0158   geomMap.insert(std::pair<int, int>(idCode(-1, 1, 3), pnCode(0, 3)));
0159   geomMap.insert(std::pair<int, int>(idCode(-1, 1, 4), pnCode(2, 4)));
0160   geomMap.insert(std::pair<int, int>(idCode(-1, 2, 1), pnCode(1, 1)));
0161   geomMap.insert(std::pair<int, int>(idCode(-1, 2, 2), pnCode(2, 2)));
0162   geomMap.insert(std::pair<int, int>(idCode(-1, 2, 3), pnCode(0, 3)));
0163   geomMap.insert(std::pair<int, int>(idCode(-1, 2, 4), pnCode(2, 4)));
0164   geomMap.insert(std::pair<int, int>(idCode(-1, 3, 1), pnCode(1, 1)));
0165   geomMap.insert(std::pair<int, int>(idCode(-1, 3, 2), pnCode(2, 2)));
0166   geomMap.insert(std::pair<int, int>(idCode(-1, 3, 3), pnCode(0, 3)));
0167   geomMap.insert(std::pair<int, int>(idCode(-1, 3, 4), pnCode(2, 4)));
0168   geomMap.insert(std::pair<int, int>(idCode(-1, 4, 1), pnCode(1, 1)));
0169   geomMap.insert(std::pair<int, int>(idCode(-1, 4, 2), pnCode(2, 2)));
0170   geomMap.insert(std::pair<int, int>(idCode(-1, 4, 3), pnCode(0, 3)));
0171   geomMap.insert(std::pair<int, int>(idCode(-1, 4, 4), pnCode(0, 6)));
0172   geomMap.insert(std::pair<int, int>(idCode(-1, 5, 1), pnCode(1, 1)));
0173   geomMap.insert(std::pair<int, int>(idCode(-1, 5, 2), pnCode(2, 2)));
0174   geomMap.insert(std::pair<int, int>(idCode(-1, 5, 3), pnCode(0, 3)));
0175   geomMap.insert(std::pair<int, int>(idCode(-1, 5, 4), pnCode(1, 4)));
0176   geomMap.insert(std::pair<int, int>(idCode(-1, 6, 1), pnCode(1, 1)));
0177   geomMap.insert(std::pair<int, int>(idCode(-1, 6, 2), pnCode(2, 2)));
0178   geomMap.insert(std::pair<int, int>(idCode(-1, 6, 3), pnCode(0, 3)));
0179   geomMap.insert(std::pair<int, int>(idCode(-1, 6, 4), pnCode(1, 4)));
0180   geomMap.insert(std::pair<int, int>(idCode(-1, 7, 1), pnCode(1, 1)));
0181   geomMap.insert(std::pair<int, int>(idCode(-1, 7, 2), pnCode(2, 2)));
0182   geomMap.insert(std::pair<int, int>(idCode(-1, 7, 3), pnCode(0, 3)));
0183   geomMap.insert(std::pair<int, int>(idCode(-1, 7, 4), pnCode(1, 4)));
0184   geomMap.insert(std::pair<int, int>(idCode(-1, 8, 1), pnCode(1, 1)));
0185   geomMap.insert(std::pair<int, int>(idCode(-1, 8, 2), pnCode(2, 2)));
0186   geomMap.insert(std::pair<int, int>(idCode(-1, 8, 3), pnCode(0, 3)));
0187   geomMap.insert(std::pair<int, int>(idCode(-1, 8, 4), pnCode(1, 4)));
0188   geomMap.insert(std::pair<int, int>(idCode(-1, 9, 1), pnCode(1, 1)));
0189   geomMap.insert(std::pair<int, int>(idCode(-1, 9, 2), pnCode(2, 2)));
0190   geomMap.insert(std::pair<int, int>(idCode(-1, 9, 3), pnCode(0, 3)));
0191   geomMap.insert(std::pair<int, int>(idCode(-1, 9, 4), pnCode(0, 5)));
0192   geomMap.insert(std::pair<int, int>(idCode(-1, 10, 1), pnCode(1, 1)));
0193   geomMap.insert(std::pair<int, int>(idCode(-1, 10, 2), pnCode(2, 2)));
0194   geomMap.insert(std::pair<int, int>(idCode(-1, 10, 3), pnCode(0, 3)));
0195   geomMap.insert(std::pair<int, int>(idCode(-1, 10, 4), pnCode(2, 7)));
0196   geomMap.insert(std::pair<int, int>(idCode(-1, 11, 1), pnCode(1, 1)));
0197   geomMap.insert(std::pair<int, int>(idCode(-1, 11, 2), pnCode(2, 2)));
0198   geomMap.insert(std::pair<int, int>(idCode(-1, 11, 3), pnCode(0, 3)));
0199   geomMap.insert(std::pair<int, int>(idCode(-1, 11, 4), pnCode(0, 5)));
0200   geomMap.insert(std::pair<int, int>(idCode(-1, 12, 1), pnCode(1, 1)));
0201   geomMap.insert(std::pair<int, int>(idCode(-1, 12, 2), pnCode(2, 2)));
0202   geomMap.insert(std::pair<int, int>(idCode(-1, 12, 3), pnCode(0, 3)));
0203   geomMap.insert(std::pair<int, int>(idCode(-1, 12, 4), pnCode(2, 4)));
0204   geomMap.insert(std::pair<int, int>(idCode(-1, 13, 4), pnCode(0, 6)));
0205   geomMap.insert(std::pair<int, int>(idCode(-1, 14, 4), pnCode(1, 7)));
0206   geomMap.insert(std::pair<int, int>(idCode(0, 1, 1), pnCode(1, 1)));
0207   geomMap.insert(std::pair<int, int>(idCode(0, 1, 2), pnCode(2, 2)));
0208   geomMap.insert(std::pair<int, int>(idCode(0, 1, 3), pnCode(0, 3)));
0209   geomMap.insert(std::pair<int, int>(idCode(0, 1, 4), pnCode(2, 4)));
0210   geomMap.insert(std::pair<int, int>(idCode(0, 2, 1), pnCode(2, 1)));
0211   geomMap.insert(std::pair<int, int>(idCode(0, 2, 2), pnCode(1, 2)));
0212   geomMap.insert(std::pair<int, int>(idCode(0, 2, 3), pnCode(0, 3)));
0213   geomMap.insert(std::pair<int, int>(idCode(0, 2, 4), pnCode(1, 4)));
0214   geomMap.insert(std::pair<int, int>(idCode(0, 3, 1), pnCode(2, 1)));
0215   geomMap.insert(std::pair<int, int>(idCode(0, 3, 2), pnCode(1, 2)));
0216   geomMap.insert(std::pair<int, int>(idCode(0, 3, 3), pnCode(0, 3)));
0217   geomMap.insert(std::pair<int, int>(idCode(0, 3, 4), pnCode(1, 4)));
0218   geomMap.insert(std::pair<int, int>(idCode(0, 4, 1), pnCode(1, 1)));
0219   geomMap.insert(std::pair<int, int>(idCode(0, 4, 2), pnCode(2, 2)));
0220   geomMap.insert(std::pair<int, int>(idCode(0, 4, 3), pnCode(0, 3)));
0221   geomMap.insert(std::pair<int, int>(idCode(0, 4, 4), pnCode(0, 6)));
0222   geomMap.insert(std::pair<int, int>(idCode(0, 5, 1), pnCode(1, 1)));
0223   geomMap.insert(std::pair<int, int>(idCode(0, 5, 2), pnCode(2, 2)));
0224   geomMap.insert(std::pair<int, int>(idCode(0, 5, 3), pnCode(0, 3)));
0225   geomMap.insert(std::pair<int, int>(idCode(0, 5, 4), pnCode(1, 4)));
0226   geomMap.insert(std::pair<int, int>(idCode(0, 6, 1), pnCode(2, 1)));
0227   geomMap.insert(std::pair<int, int>(idCode(0, 6, 2), pnCode(1, 2)));
0228   geomMap.insert(std::pair<int, int>(idCode(0, 6, 3), pnCode(0, 3)));
0229   geomMap.insert(std::pair<int, int>(idCode(0, 6, 4), pnCode(2, 4)));
0230   geomMap.insert(std::pair<int, int>(idCode(0, 7, 1), pnCode(2, 1)));
0231   geomMap.insert(std::pair<int, int>(idCode(0, 7, 2), pnCode(1, 2)));
0232   geomMap.insert(std::pair<int, int>(idCode(0, 7, 3), pnCode(0, 3)));
0233   geomMap.insert(std::pair<int, int>(idCode(0, 7, 4), pnCode(2, 4)));
0234   geomMap.insert(std::pair<int, int>(idCode(0, 8, 1), pnCode(1, 1)));
0235   geomMap.insert(std::pair<int, int>(idCode(0, 8, 2), pnCode(2, 2)));
0236   geomMap.insert(std::pair<int, int>(idCode(0, 8, 3), pnCode(0, 3)));
0237   geomMap.insert(std::pair<int, int>(idCode(0, 8, 4), pnCode(1, 4)));
0238   geomMap.insert(std::pair<int, int>(idCode(0, 9, 1), pnCode(1, 1)));
0239   geomMap.insert(std::pair<int, int>(idCode(0, 9, 2), pnCode(2, 2)));
0240   geomMap.insert(std::pair<int, int>(idCode(0, 9, 3), pnCode(0, 3)));
0241   geomMap.insert(std::pair<int, int>(idCode(0, 9, 4), pnCode(0, 5)));
0242   geomMap.insert(std::pair<int, int>(idCode(0, 10, 1), pnCode(2, 1)));
0243   geomMap.insert(std::pair<int, int>(idCode(0, 10, 2), pnCode(1, 2)));
0244   geomMap.insert(std::pair<int, int>(idCode(0, 10, 3), pnCode(0, 3)));
0245   geomMap.insert(std::pair<int, int>(idCode(0, 10, 4), pnCode(2, 7)));
0246   geomMap.insert(std::pair<int, int>(idCode(0, 11, 1), pnCode(2, 1)));
0247   geomMap.insert(std::pair<int, int>(idCode(0, 11, 2), pnCode(1, 2)));
0248   geomMap.insert(std::pair<int, int>(idCode(0, 11, 3), pnCode(0, 3)));
0249   geomMap.insert(std::pair<int, int>(idCode(0, 11, 4), pnCode(0, 5)));
0250   geomMap.insert(std::pair<int, int>(idCode(0, 12, 1), pnCode(1, 1)));
0251   geomMap.insert(std::pair<int, int>(idCode(0, 12, 2), pnCode(2, 2)));
0252   geomMap.insert(std::pair<int, int>(idCode(0, 12, 3), pnCode(0, 3)));
0253   geomMap.insert(std::pair<int, int>(idCode(0, 12, 4), pnCode(2, 4)));
0254   geomMap.insert(std::pair<int, int>(idCode(0, 13, 4), pnCode(0, 6)));
0255   geomMap.insert(std::pair<int, int>(idCode(0, 14, 4), pnCode(1, 7)));
0256   geomMap.insert(std::pair<int, int>(idCode(1, 1, 1), pnCode(2, 1)));
0257   geomMap.insert(std::pair<int, int>(idCode(1, 1, 2), pnCode(1, 2)));
0258   geomMap.insert(std::pair<int, int>(idCode(1, 1, 3), pnCode(0, 3)));
0259   geomMap.insert(std::pair<int, int>(idCode(1, 1, 4), pnCode(1, 4)));
0260   geomMap.insert(std::pair<int, int>(idCode(1, 2, 1), pnCode(2, 1)));
0261   geomMap.insert(std::pair<int, int>(idCode(1, 2, 2), pnCode(1, 2)));
0262   geomMap.insert(std::pair<int, int>(idCode(1, 2, 3), pnCode(0, 3)));
0263   geomMap.insert(std::pair<int, int>(idCode(1, 2, 4), pnCode(1, 4)));
0264   geomMap.insert(std::pair<int, int>(idCode(1, 3, 1), pnCode(2, 1)));
0265   geomMap.insert(std::pair<int, int>(idCode(1, 3, 2), pnCode(1, 2)));
0266   geomMap.insert(std::pair<int, int>(idCode(1, 3, 3), pnCode(0, 3)));
0267   geomMap.insert(std::pair<int, int>(idCode(1, 3, 4), pnCode(1, 4)));
0268   geomMap.insert(std::pair<int, int>(idCode(1, 4, 1), pnCode(2, 1)));
0269   geomMap.insert(std::pair<int, int>(idCode(1, 4, 2), pnCode(1, 2)));
0270   geomMap.insert(std::pair<int, int>(idCode(1, 4, 3), pnCode(0, 3)));
0271   geomMap.insert(std::pair<int, int>(idCode(1, 4, 4), pnCode(0, 6)));
0272   geomMap.insert(std::pair<int, int>(idCode(1, 5, 1), pnCode(2, 1)));
0273   geomMap.insert(std::pair<int, int>(idCode(1, 5, 2), pnCode(1, 2)));
0274   geomMap.insert(std::pair<int, int>(idCode(1, 5, 3), pnCode(0, 3)));
0275   geomMap.insert(std::pair<int, int>(idCode(1, 5, 4), pnCode(2, 4)));
0276   geomMap.insert(std::pair<int, int>(idCode(1, 6, 1), pnCode(2, 1)));
0277   geomMap.insert(std::pair<int, int>(idCode(1, 6, 2), pnCode(1, 2)));
0278   geomMap.insert(std::pair<int, int>(idCode(1, 6, 3), pnCode(0, 3)));
0279   geomMap.insert(std::pair<int, int>(idCode(1, 6, 4), pnCode(2, 4)));
0280   geomMap.insert(std::pair<int, int>(idCode(1, 7, 1), pnCode(2, 1)));
0281   geomMap.insert(std::pair<int, int>(idCode(1, 7, 2), pnCode(1, 2)));
0282   geomMap.insert(std::pair<int, int>(idCode(1, 7, 3), pnCode(0, 3)));
0283   geomMap.insert(std::pair<int, int>(idCode(1, 7, 4), pnCode(2, 4)));
0284   geomMap.insert(std::pair<int, int>(idCode(1, 8, 1), pnCode(2, 1)));
0285   geomMap.insert(std::pair<int, int>(idCode(1, 8, 2), pnCode(1, 2)));
0286   geomMap.insert(std::pair<int, int>(idCode(1, 8, 3), pnCode(0, 3)));
0287   geomMap.insert(std::pair<int, int>(idCode(1, 8, 4), pnCode(1, 4)));
0288   geomMap.insert(std::pair<int, int>(idCode(1, 9, 1), pnCode(2, 1)));
0289   geomMap.insert(std::pair<int, int>(idCode(1, 9, 2), pnCode(1, 2)));
0290   geomMap.insert(std::pair<int, int>(idCode(1, 9, 3), pnCode(0, 3)));
0291   geomMap.insert(std::pair<int, int>(idCode(1, 9, 4), pnCode(0, 5)));
0292   geomMap.insert(std::pair<int, int>(idCode(1, 10, 1), pnCode(2, 1)));
0293   geomMap.insert(std::pair<int, int>(idCode(1, 10, 2), pnCode(1, 2)));
0294   geomMap.insert(std::pair<int, int>(idCode(1, 10, 3), pnCode(0, 3)));
0295   geomMap.insert(std::pair<int, int>(idCode(1, 10, 4), pnCode(2, 7)));
0296   geomMap.insert(std::pair<int, int>(idCode(1, 11, 1), pnCode(2, 1)));
0297   geomMap.insert(std::pair<int, int>(idCode(1, 11, 2), pnCode(1, 2)));
0298   geomMap.insert(std::pair<int, int>(idCode(1, 11, 3), pnCode(0, 3)));
0299   geomMap.insert(std::pair<int, int>(idCode(1, 11, 4), pnCode(0, 5)));
0300   geomMap.insert(std::pair<int, int>(idCode(1, 12, 1), pnCode(2, 1)));
0301   geomMap.insert(std::pair<int, int>(idCode(1, 12, 2), pnCode(1, 2)));
0302   geomMap.insert(std::pair<int, int>(idCode(1, 12, 3), pnCode(0, 3)));
0303   geomMap.insert(std::pair<int, int>(idCode(1, 12, 4), pnCode(2, 4)));
0304   geomMap.insert(std::pair<int, int>(idCode(1, 13, 4), pnCode(0, 6)));
0305   geomMap.insert(std::pair<int, int>(idCode(1, 14, 4), pnCode(1, 7)));
0306   geomMap.insert(std::pair<int, int>(idCode(2, 1, 1), pnCode(2, 1)));
0307   geomMap.insert(std::pair<int, int>(idCode(2, 1, 2), pnCode(1, 2)));
0308   geomMap.insert(std::pair<int, int>(idCode(2, 1, 3), pnCode(0, 3)));
0309   geomMap.insert(std::pair<int, int>(idCode(2, 1, 4), pnCode(1, 4)));
0310   geomMap.insert(std::pair<int, int>(idCode(2, 2, 1), pnCode(2, 1)));
0311   geomMap.insert(std::pair<int, int>(idCode(2, 2, 2), pnCode(1, 2)));
0312   geomMap.insert(std::pair<int, int>(idCode(2, 2, 3), pnCode(0, 3)));
0313   geomMap.insert(std::pair<int, int>(idCode(2, 2, 4), pnCode(1, 4)));
0314   geomMap.insert(std::pair<int, int>(idCode(2, 3, 1), pnCode(2, 1)));
0315   geomMap.insert(std::pair<int, int>(idCode(2, 3, 2), pnCode(1, 2)));
0316   geomMap.insert(std::pair<int, int>(idCode(2, 3, 3), pnCode(0, 3)));
0317   geomMap.insert(std::pair<int, int>(idCode(2, 3, 4), pnCode(1, 4)));
0318   geomMap.insert(std::pair<int, int>(idCode(2, 4, 1), pnCode(2, 1)));
0319   geomMap.insert(std::pair<int, int>(idCode(2, 4, 2), pnCode(1, 2)));
0320   geomMap.insert(std::pair<int, int>(idCode(2, 4, 3), pnCode(0, 3)));
0321   geomMap.insert(std::pair<int, int>(idCode(2, 4, 4), pnCode(0, 6)));
0322   geomMap.insert(std::pair<int, int>(idCode(2, 5, 1), pnCode(2, 1)));
0323   geomMap.insert(std::pair<int, int>(idCode(2, 5, 2), pnCode(1, 2)));
0324   geomMap.insert(std::pair<int, int>(idCode(2, 5, 3), pnCode(0, 3)));
0325   geomMap.insert(std::pair<int, int>(idCode(2, 5, 4), pnCode(2, 4)));
0326   geomMap.insert(std::pair<int, int>(idCode(2, 6, 1), pnCode(2, 1)));
0327   geomMap.insert(std::pair<int, int>(idCode(2, 6, 2), pnCode(1, 2)));
0328   geomMap.insert(std::pair<int, int>(idCode(2, 6, 3), pnCode(0, 3)));
0329   geomMap.insert(std::pair<int, int>(idCode(2, 6, 4), pnCode(2, 4)));
0330   geomMap.insert(std::pair<int, int>(idCode(2, 7, 1), pnCode(2, 1)));
0331   geomMap.insert(std::pair<int, int>(idCode(2, 7, 2), pnCode(1, 2)));
0332   geomMap.insert(std::pair<int, int>(idCode(2, 7, 3), pnCode(0, 3)));
0333   geomMap.insert(std::pair<int, int>(idCode(2, 7, 4), pnCode(2, 4)));
0334   geomMap.insert(std::pair<int, int>(idCode(2, 8, 1), pnCode(2, 1)));
0335   geomMap.insert(std::pair<int, int>(idCode(2, 8, 2), pnCode(1, 2)));
0336   geomMap.insert(std::pair<int, int>(idCode(2, 8, 3), pnCode(0, 3)));
0337   geomMap.insert(std::pair<int, int>(idCode(2, 8, 4), pnCode(2, 4)));
0338   geomMap.insert(std::pair<int, int>(idCode(2, 9, 1), pnCode(2, 1)));
0339   geomMap.insert(std::pair<int, int>(idCode(2, 9, 2), pnCode(1, 2)));
0340   geomMap.insert(std::pair<int, int>(idCode(2, 9, 3), pnCode(0, 3)));
0341   geomMap.insert(std::pair<int, int>(idCode(2, 9, 4), pnCode(0, 5)));
0342   geomMap.insert(std::pair<int, int>(idCode(2, 10, 1), pnCode(2, 1)));
0343   geomMap.insert(std::pair<int, int>(idCode(2, 10, 2), pnCode(1, 2)));
0344   geomMap.insert(std::pair<int, int>(idCode(2, 10, 3), pnCode(0, 3)));
0345   geomMap.insert(std::pair<int, int>(idCode(2, 10, 4), pnCode(2, 7)));
0346   geomMap.insert(std::pair<int, int>(idCode(2, 11, 1), pnCode(2, 1)));
0347   geomMap.insert(std::pair<int, int>(idCode(2, 11, 2), pnCode(1, 2)));
0348   geomMap.insert(std::pair<int, int>(idCode(2, 11, 3), pnCode(0, 3)));
0349   geomMap.insert(std::pair<int, int>(idCode(2, 11, 4), pnCode(0, 5)));
0350   geomMap.insert(std::pair<int, int>(idCode(2, 12, 1), pnCode(2, 1)));
0351   geomMap.insert(std::pair<int, int>(idCode(2, 12, 2), pnCode(1, 2)));
0352   geomMap.insert(std::pair<int, int>(idCode(2, 12, 3), pnCode(0, 3)));
0353   geomMap.insert(std::pair<int, int>(idCode(2, 12, 4), pnCode(1, 4)));
0354   geomMap.insert(std::pair<int, int>(idCode(2, 13, 4), pnCode(0, 6)));
0355   geomMap.insert(std::pair<int, int>(idCode(2, 14, 4), pnCode(1, 7)));
0356   //
0357   initRequest = false;
0358 }
0359 
0360 int DTPosNeg::idCode(int whe, int sec, int sta) { return ((((whe + 3) * 100) + sec) * 10) + sta; }
0361 
0362 int DTPosNeg::pnCode(int p, int t) { return (p * 1000) + t; }
0363 
0364 void DTPosNeg::decode(int code, int& whe, int& sec, int& sta) {
0365   whe = (code / 1000) - 3;
0366   sec = (code / 10) % 100;
0367   sta = code % 10;
0368   return;
0369 }
0370 
0371 void DTPosNeg::decode(int code, int& p, int& t) {
0372   p = code / 1000;
0373   t = code % 1000;
0374   return;
0375 }
0376 
0377 int DTPosNeg::getData(int whe, int sec, int sta) {
0378   if (initRequest)
0379     fillMap();
0380   std::map<int, int>::const_iterator iter = geomMap.find(idCode(whe, sec, sta));
0381   std::map<int, int>::const_iterator iend = geomMap.end();
0382   if (iter == iend)
0383     return 999999;
0384   return iter->second;
0385 }