Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:05

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