CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/Geometry/CaloTopology/interface/HcalTopologyMode.h

Go to the documentation of this file.
00001 #ifndef CALO_TOPOLOGY_HCAL_TOPOLOGY_MODE_H
00002 # define CALO_TOPOLOGY_HCAL_TOPOLOGY_MODE_H
00003 
00004 #include "FWCore/Utilities/interface/Exception.h"
00005 #include <map>
00006 #include <string>
00007 #include <algorithm>
00008 
00009 template< typename T >
00010 class StringToEnumParser
00011 {
00012     std::map< std::string, T > enumMap;
00013 public:
00014     
00015     StringToEnumParser( void );
00016 
00017     T parseString( const std::string &value )
00018         { 
00019             typename std::map<std::string, T>::const_iterator iValue = enumMap.find( value );
00020             if( iValue  == enumMap.end())
00021                 throw cms::Exception( "Configuration" )
00022                     << "the value " << value << " is not defined.";
00023             
00024             return iValue->second;
00025         }
00026 };
00027 
00028 namespace HcalTopologyMode {
00029     enum Mode {
00030         LHC=0, H2=1, SLHC=2, H2HE=3 };
00031 
00032     enum TriggerMode {
00033       tm_LHC_PreLS1=0  // HF is summed in 3x2 regions
00034     };
00035 }
00036 
00037 
00038 #endif // CALO_TOPOLOGY_HCAL_TOPOLOGY_MODE_H