CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CalibCalorimetry/EcalLaserAnalyzer/interface/MEEBGeom.h

Go to the documentation of this file.
00001 #ifndef MEEBGeom_hh
00002 #define MEEBGeom_hh
00003 
00004 //
00005 // Authors  : Gautier Hamel de Monchenault and Julie Malcles, Saclay 
00006 //
00007 
00008 #include <vector>
00009 #include <map>
00010 
00011 #include <TPolyLine.h>
00012 #include <TGraph.h>
00013 #include <TString.h>
00014 
00015 class MEEBGeom
00016 {
00017   // static functions
00018 public:
00019 
00020   enum EBUnit { iEcalBarrel, iSuperModule, iDCC, iSide, iLMRegion, iLMModule, iTriggerTower, iCrystal };
00021 
00022   typedef int EBLocalCoord;    // ix from 0 to 84, iy from 0 to 19  (note ix=etaSM-1, iy=phiSM-1)
00023   typedef int EBGlobalCoord;   // ieta from 1 to 85 (EB+) or -85 to -1 (EB-) and iphi from 1 to 360 (or -9 to 350)
00024   typedef int EBTTLocalCoord;  // iX=ix/5 from 0 to 3, iY=iy/5 from 0 to 16
00025   typedef std::pair<float,float> EtaPhiPoint;
00026   typedef std::pair<EBGlobalCoord, EBGlobalCoord> EtaPhiCoord;
00027   typedef std::pair<EBLocalCoord, EBLocalCoord> XYCoord;
00028 
00029   static int     barrel( EBGlobalCoord ieta, EBGlobalCoord iphi );
00030   static int         sm( EBGlobalCoord ieta, EBGlobalCoord iphi );
00031   static int        dcc( EBGlobalCoord ieta, EBGlobalCoord iphi );
00032   static int       side( EBGlobalCoord ieta, EBGlobalCoord iphi );
00033   static int        lmr( EBGlobalCoord ieta, EBGlobalCoord iphi );
00034   static int      lmmod( EBGlobalCoord ieta, EBGlobalCoord iphi );
00035   static int         tt( EBGlobalCoord ieta, EBGlobalCoord iphi );
00036   static int    crystal( EBGlobalCoord ieta, EBGlobalCoord iphi );
00037 
00038   static TString  smName( int ism );
00039   static int   smFromDcc( int idcc );
00040   static int   dccFromSm( int ism );
00041 
00042   static std::pair<int, int> pn( int ilmmod );
00043   static std::pair<int,int> memFromLmr( int ilmr );
00044   static std::vector<int> lmmodFromLmr( int ilmr );
00045 
00046   static int apdRefTower( int ilmmod );
00047   static std::vector<int> apdRefChannels( int ilmmod );
00048 
00049   // get local from crystal number
00050   static XYCoord   localCoord( int icr );
00051 
00052   // get local from global 
00053   static XYCoord   localCoord( EBGlobalCoord ieta, EBGlobalCoord iphi );
00054 
00055   // get global from local 
00056   static EtaPhiCoord globalCoord( int ism, EBLocalCoord ix, EBLocalCoord iy );
00057   static EtaPhiPoint globalCoord( int ism, float x, float y );
00058   static EtaPhiCoord globalCoord( int ism, int icrystal );
00059 
00060 
00061   static TGraph* getGraphBoundary( int type, int num, bool global=false );
00062   static int    crystal_channel( EBLocalCoord ix, EBLocalCoord iy );
00063   static int electronic_channel( EBLocalCoord ix, EBLocalCoord iy );
00064 
00065   static int tt_type(    EBTTLocalCoord iX, EBTTLocalCoord iY );
00066   static int hv_channel( EBTTLocalCoord iX, EBTTLocalCoord iY );
00067   static int lv_channel( EBTTLocalCoord iX, EBTTLocalCoord iY );
00068   static int lm_channel( EBTTLocalCoord iX, EBTTLocalCoord iY );
00069   static int tt_channel( EBTTLocalCoord iX, EBTTLocalCoord iY );
00070 
00071   virtual ~MEEBGeom() {}
00072 
00073 private:
00074 
00075   //GHM  ClassDef(MEEBGeom,0) // MEEBGeom -- Monitoring utility for survey of Ecal
00076 };
00077 
00078 #endif
00079