CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/CaloOnlineTools/HcalOnlineDb/interface/LMap.h

Go to the documentation of this file.
00001 #ifndef HCALConfigDBTools_XMLTools_LMap_h
00002 #define HCALConfigDBTools_XMLTools_LMap_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     XMLTools
00006 // Class  :     LMap
00007 // 
00019 //
00020 // Original Author:  Gena Kukartsev, kukarzev@fnal.gov
00021 //         Created:  Tue Nov 06 14:30:33 CDT 2007
00022 // $Id: LMap.h,v 1.7 2010/08/06 20:24:10 wmtan Exp $
00023 //
00024 
00025 // system include files
00026 #include<vector>
00027 #include <string.h>
00028 #include <fstream>
00029 #include <boost/shared_ptr.hpp>
00030 
00031 #include "CaloOnlineTools/HcalOnlineDb/interface/ConfigurationDatabase.hh"
00032 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00033 #include "CondFormats/HcalObjects/interface/HcalElectronicsMap.h"
00034 
00035 class LMapRow
00036 {
00037  public:
00038   LMapRow(){};
00039   ~LMapRow(){};
00040   
00041   int side;
00042   int eta, phi, dphi, depth;
00043   //string det;
00044   HcalSubdetector det;
00045   std::string rbx;
00046   int wedge, rm, pixel, qie, adc, rm_fi, fi_ch;
00047   int crate, htr; // crate-slot
00048   std::string fpga;    // top-bottom
00049   int htr_fi;     // fiber
00050   int dcc_sl, spigo, dcc, slb;
00051   std::string slbin, slbin2, slnam;
00052   int rctcra, rctcar, rctcon;
00053   std::string rctnam;
00054   int fedid;
00055 
00056   std::string let_code; // specific to HO
00057 
00058  private:
00059 
00060 };
00061 
00062 
00063 
00064 class LMapDetId
00065 {
00066  public:
00067   LMapDetId(){};
00068   ~LMapDetId(){};
00069 
00070   int side;
00071   int eta, phi, depth;
00072   std::string subdetector;
00073 
00074 };
00075 
00076 class LMap
00077 {
00078   
00079  public:
00080     
00081   LMap();
00082   ~LMap();
00083 
00084   // type = "HNEF" or "HO", matters for
00085   int read( std::string accessor, std::string type = "HBEF" );
00086   std::map<int,LMapRow> & get_map( void );
00087   
00088  private:
00089   class impl;
00090   boost::shared_ptr<impl> p_impl;
00091 };
00092 
00093 
00094 
00095 class EMap
00096 {
00097  public:
00098   EMap(){}
00099   EMap( std::string filename ){ read_map(filename); }
00100   EMap( const HcalElectronicsMap * map );
00101   ~EMap(){}
00102 
00103   class EMapRow
00104   {
00105   public:
00106     int rawId,crate,slot,dcc,spigot,fiber,fiberchan,ieta,iphi,idepth;
00107     std::string topbottom,subdet;
00108     // ZDC channels:
00109     // section: ZDC EM, ZDC HAD, ZDC LUM(?)
00110     int zdc_zside,zdc_channel;
00111     std::string zdc_section;
00112     
00113     EMapRow(){
00114       rawId=0;
00115       crate=0;
00116       slot=0;
00117       dcc=0;
00118       spigot=0;
00119       fiber=0;
00120       fiberchan=0;
00121       ieta=0;
00122       iphi=0;
00123       idepth=0;
00124       topbottom="";
00125       subdet="";
00126       zdc_zside=0;
00127       zdc_channel = 0;
00128       zdc_section = "UNKNOWN";
00129     }
00130     ~EMapRow(){};  
00131 
00132     bool operator<( const EMapRow & other) const;
00133     
00134   }; // end of class EMapRow
00135 
00136   int read_map( std::string filename );
00137 
00138   std::vector<EMap::EMapRow> & get_map( void );
00139 
00140  protected:
00141   std::vector<EMapRow> map;
00142 }; // end of class EMap
00143 
00144 
00145 class LMap_test {
00146 public:
00147   LMap_test();
00148   ~LMap_test(){ }
00149 
00150   int test_read( std::string accessor, std::string type="HBEF" );
00151 
00152 private:
00153   boost::shared_ptr<LMap> _lmap;
00154 };
00155 
00156 
00157 class EMap_test {
00158 public:
00159   EMap_test(){}
00160   ~EMap_test(){}
00161 
00162   int test_read_map( std::string filename );
00163 }; // end of class EMap_test
00164 
00165 #endif