Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 /* 27 * =========================================== 28 * 29 * Filename: CexmcException.cc 30 * 31 * Description: cexmc exceptions 32 * 33 * Version: 1.0 34 * Created: 23.12.2009 13:42:26 35 * Revision: none 36 * Compiler: gcc 37 * 38 * Author: Alexey Radkov (), 39 * Company: PNPI 40 * 41 * =========================================== 42 */ 43 44 #include "CexmcException.hh" 45 #include "CexmcRunManager.hh" 46 #include "CexmcCommon.hh" 47 48 49 CexmcException::CexmcException( CexmcException 50 { 51 } 52 53 54 CexmcException::~CexmcException() throw() 55 { 56 } 57 58 59 const char * CexmcException::what( void ) con 60 { 61 switch ( type ) 62 { 63 case CexmcSystemException : 64 return CEXMC_LINE_START "Unspecified s 65 case CexmcEventActionIsNotInitialized : 66 return CEXMC_LINE_START "Event action 67 case CexmcCmdLineParseException : 68 return CEXMC_LINE_START "Exception in 69 "Check your command line argume 70 case CexmcPreinitException : 71 return CEXMC_LINE_START "Exception in 72 "Probably you did not specify p 73 "in it."; 74 case CexmcFileCompressException : 75 return CEXMC_LINE_START "File compress 76 "Check if the file exists and o 77 case CexmcReadProjectIncomplete : 78 return CEXMC_LINE_START "Read project 79 "Check if the read project has 80 case CexmcProjectExists : 81 return CEXMC_LINE_START "Project you t 82 "Use command line option '-y' t 83 case CexmcCmdIsNotAllowed : 84 return CEXMC_LINE_START "Command is no 85 "Probably you tried to issue a 86 "read-only settings in the rea 87 case CexmcBadAngularRange : 88 return CEXMC_LINE_START "Bad angular r 89 "Check specified angular range 90 "in the read project)."; 91 case CexmcBadThreshold : 92 return CEXMC_LINE_START "Bad threshold 93 "Check specified thresholds (p 94 "in the read project)."; 95 case CexmcBadCalorimeterTriggerAlgorithm : 96 return CEXMC_LINE_START "Bad calorimet 97 "Check specified calorimeter t 98 "mismatches algorithm in the r 99 case CexmcBadOCVetoAlgorithm : 100 return CEXMC_LINE_START "Bad outer cry 101 "Check specified outer crystal 102 "mismatches algorithm in the r 103 case CexmcBadOCVetoFraction : 104 return CEXMC_LINE_START "Bad outer cry 105 "Check specified outer crystal 106 "has higher value than in the 107 case CexmcCalorimeterRegionNotInitialized 108 return CEXMC_LINE_START "Calorimeter s 109 "initialized. Check gdml sourc 110 case CexmcCalorimeterGeometryDataNotInitia 111 return CEXMC_LINE_START "Calorimeter g 112 "initialized. Check gdml sourc 113 case CexmcMultipleDetectorRoles : 114 return CEXMC_LINE_START "Multiple dete 115 "volume. Check gdml source fil 116 case CexmcKinematicsException : 117 return CEXMC_LINE_START "Kinematics ex 118 "Check your production model." 119 case CexmcPoorEventData : 120 return CEXMC_LINE_START "Cannot create 121 "original data. Set less value 122 case CexmcIncompatibleGeometry : 123 return CEXMC_LINE_START "Incompatible 124 "Check your geometry data."; 125 case CexmcIncompleteProductionModel : 126 return CEXMC_LINE_START "Production mo 127 "Check that your production mo 128 case CexmcIncompatibleProductionModel : 129 return CEXMC_LINE_START "Production mo 130 "with physical process that tr 131 case CexmcBeamAndIncidentParticlesMismatch 132 return CEXMC_LINE_START "Beam and inci 133 "Instantiated reconstructor wi 134 "this case. Make sure that bea 135 "of provided production model 136 case CexmcInvalidAngularRange : 137 return CEXMC_LINE_START "An angular ra 138 "Check specified angular range 139 #ifdef CEXMC_USE_CUSTOM_FILTER 140 case CexmcCFBadSource : 141 return CEXMC_LINE_START "Custom filter 142 "damaged. Check your command l 143 case CexmcCFParseError : 144 return CEXMC_LINE_START "Custom filter 145 "Check your custom filter sour 146 case CexmcCFUninitialized : 147 return CEXMC_LINE_START "Custom filter 148 case CexmcCFUninitializedVector : 149 return CEXMC_LINE_START "Custom filter 150 "initialized."; 151 case CexmcCFUnexpectedContext : 152 return CEXMC_LINE_START "Custom filter 153 "in wrong type context (scalar 154 "vice versa). Check your custo 155 case CexmcCFUnexpectedFunction : 156 return CEXMC_LINE_START "Custom filter 157 "wrong type context. Check you 158 case CexmcCFUnexpectedVariable : 159 return CEXMC_LINE_START "Custom filter 160 "wrong type context. Check you 161 case CexmcCFUnexpectedVariableUsage : 162 return CEXMC_LINE_START "Custom filter 163 "type context (scalar when a v 164 "versa). Check your custom fil 165 case CexmcCFUnexpectedVectorIndex : 166 return CEXMC_LINE_START "Custom filter 167 "index. Indices of vectors sho 168 "custom filter script."; 169 #endif 170 case CexmcWeirdException : 171 return CEXMC_LINE_START "A weird excep 172 "The world must collapse now." 173 default : 174 return CEXMC_LINE_START "Unknown excep 175 } 176 } 177 178 179 void ThrowExceptionIfProjectIsRead( CexmcExce 180 G4bool e 181 { 182 CexmcRunManager * runManager( static_cast 183 G4 184 if ( runManager->ProjectIsRead() && extraC 185 throw CexmcException( type ); 186 } 187 188