Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /* 26 /* 27 * =========================================== 27 * ============================================================================ 28 * 28 * 29 * Filename: CexmcEnergyDepositDigitize 29 * Filename: CexmcEnergyDepositDigitizerMessenger.cc 30 * 30 * 31 * Description: energy deposit digitizer m 31 * Description: energy deposit digitizer messenger 32 * 32 * 33 * Version: 1.0 33 * Version: 1.0 34 * Created: 29.11.2009 19:07:05 34 * Created: 29.11.2009 19:07:05 35 * Revision: none 35 * Revision: none 36 * Compiler: gcc 36 * Compiler: gcc 37 * 37 * 38 * Author: Alexey Radkov (), 38 * Author: Alexey Radkov (), 39 * Company: PNPI 39 * Company: PNPI 40 * 40 * 41 * =========================================== 41 * ============================================================================ 42 */ 42 */ 43 43 44 #include <G4UIcmdWithADouble.hh> 44 #include <G4UIcmdWithADouble.hh> 45 #include <G4UIcmdWithADoubleAndUnit.hh> 45 #include <G4UIcmdWithADoubleAndUnit.hh> 46 #include <G4UIcmdWithAString.hh> 46 #include <G4UIcmdWithAString.hh> 47 #include <G4UIcmdWithABool.hh> 47 #include <G4UIcmdWithABool.hh> 48 #include <G4UIcmdWith3Vector.hh> 48 #include <G4UIcmdWith3Vector.hh> 49 #include <G4UIcmdWithoutParameter.hh> 49 #include <G4UIcmdWithoutParameter.hh> 50 #include "CexmcEnergyDepositDigitizer.hh" 50 #include "CexmcEnergyDepositDigitizer.hh" 51 #include "CexmcEnergyDepositDigitizerMessenger 51 #include "CexmcEnergyDepositDigitizerMessenger.hh" 52 #include "CexmcMessenger.hh" 52 #include "CexmcMessenger.hh" 53 #include "CexmcCommon.hh" 53 #include "CexmcCommon.hh" 54 54 55 55 56 CexmcEnergyDepositDigitizerMessenger::CexmcEne 56 CexmcEnergyDepositDigitizerMessenger::CexmcEnergyDepositDigitizerMessenger( 57 CexmcEnergyDepositDigitizer * energyD << 57 CexmcEnergyDepositDigitizer * energyDepositDigitizer ) : 58 energyDepositDigitizer( energyDepositDigit << 58 energyDepositDigitizer( energyDepositDigitizer ), 59 setMonitorThreshold( NULL ), setVetoCounte 59 setMonitorThreshold( NULL ), setVetoCountersThreshold( NULL ), 60 setLeftVetoCounterThreshold( NULL ), setRi 60 setLeftVetoCounterThreshold( NULL ), setRightVetoCounterThreshold( NULL ), 61 setCalorimetersThreshold( NULL ), setLeftC 61 setCalorimetersThreshold( NULL ), setLeftCalorimeterThreshold( NULL ), 62 setRightCalorimeterThreshold( NULL ), 62 setRightCalorimeterThreshold( NULL ), 63 setCalorimeterTriggerAlgorithm( NULL ), 63 setCalorimeterTriggerAlgorithm( NULL ), 64 setOuterCrystalsVetoAlgorithm( NULL ), set 64 setOuterCrystalsVetoAlgorithm( NULL ), setOuterCrystalsVetoFraction( NULL ), 65 applyFiniteCrystalResolution( NULL ), addC 65 applyFiniteCrystalResolution( NULL ), addCrystalResolutionRange( NULL ), 66 clearCrystalResolutionData( NULL ) 66 clearCrystalResolutionData( NULL ) 67 { 67 { 68 setMonitorThreshold = new G4UIcmdWithADoub 68 setMonitorThreshold = new G4UIcmdWithADoubleAndUnit( 69 ( CexmcMessenger::monitorEDDirName 69 ( CexmcMessenger::monitorEDDirName + "threshold" ).c_str(), this ); 70 setMonitorThreshold->SetGuidance( "Monitor 70 setMonitorThreshold->SetGuidance( "Monitor trigger threshold" ); 71 setMonitorThreshold->SetParameterName( "Mo 71 setMonitorThreshold->SetParameterName( "MonitorThreshold", false ); 72 setMonitorThreshold->SetDefaultValue( 0 ); 72 setMonitorThreshold->SetDefaultValue( 0 ); 73 setMonitorThreshold->SetUnitCandidates( "e << 74 setMonitorThreshold->SetDefaultUnit( "MeV" 73 setMonitorThreshold->SetDefaultUnit( "MeV" ); >> 74 setMonitorThreshold->SetUnitCandidates( "ev keV MeV GeV" ); 75 setMonitorThreshold->AvailableForStates( G 75 setMonitorThreshold->AvailableForStates( G4State_PreInit, G4State_Idle ); 76 76 77 setVetoCountersThreshold = new G4UIcmdWith 77 setVetoCountersThreshold = new G4UIcmdWithADoubleAndUnit( 78 ( CexmcMessenger::vetoCounterEDDir 78 ( CexmcMessenger::vetoCounterEDDirName + "threshold" ).c_str(), 79 this ); 79 this ); 80 setVetoCountersThreshold->SetGuidance( "Ve 80 setVetoCountersThreshold->SetGuidance( "Veto counters trigger threshold" ); 81 setVetoCountersThreshold->SetParameterName 81 setVetoCountersThreshold->SetParameterName( "VetoCountersThreshold", 82 82 false ); 83 setVetoCountersThreshold->SetDefaultValue( 83 setVetoCountersThreshold->SetDefaultValue( 0 ); 84 setVetoCountersThreshold->SetUnitCandidate << 85 setVetoCountersThreshold->SetDefaultUnit( 84 setVetoCountersThreshold->SetDefaultUnit( "MeV" ); >> 85 setVetoCountersThreshold->SetUnitCandidates( "ev keV MeV GeV" ); 86 setVetoCountersThreshold->AvailableForStat 86 setVetoCountersThreshold->AvailableForStates( G4State_PreInit, 87 87 G4State_Idle ); 88 88 89 setLeftVetoCounterThreshold = new G4UIcmdW 89 setLeftVetoCounterThreshold = new G4UIcmdWithADoubleAndUnit( 90 ( CexmcMessenger::vetoCounterLeftE 90 ( CexmcMessenger::vetoCounterLeftEDDirName + "threshold" ).c_str(), 91 this ); 91 this ); 92 setLeftVetoCounterThreshold->SetGuidance( 92 setLeftVetoCounterThreshold->SetGuidance( 93 "Left veto 93 "Left veto counter trigger threshold" ); 94 setLeftVetoCounterThreshold->SetParameterN 94 setLeftVetoCounterThreshold->SetParameterName( "LeftVetoCounterThreshold", 95 95 false ); 96 setLeftVetoCounterThreshold->SetDefaultVal 96 setLeftVetoCounterThreshold->SetDefaultValue( 0 ); 97 setLeftVetoCounterThreshold->SetUnitCandid << 98 setLeftVetoCounterThreshold->SetDefaultUni 97 setLeftVetoCounterThreshold->SetDefaultUnit( "MeV" ); >> 98 setLeftVetoCounterThreshold->SetUnitCandidates( "ev keV MeV GeV" ); 99 setLeftVetoCounterThreshold->AvailableForS 99 setLeftVetoCounterThreshold->AvailableForStates( G4State_PreInit, 100 100 G4State_Idle ); 101 101 102 setRightVetoCounterThreshold = new G4UIcmd 102 setRightVetoCounterThreshold = new G4UIcmdWithADoubleAndUnit( 103 ( CexmcMessenger::vetoCounterRight 103 ( CexmcMessenger::vetoCounterRightEDDirName + "threshold" ).c_str(), 104 this ); 104 this ); 105 setRightVetoCounterThreshold->SetGuidance( 105 setRightVetoCounterThreshold->SetGuidance( 106 "Right vet 106 "Right veto counter trigger threshold" ); 107 setRightVetoCounterThreshold->SetParameter 107 setRightVetoCounterThreshold->SetParameterName( "RightVetoCounterThreshold", 108 108 false ); 109 setRightVetoCounterThreshold->SetDefaultVa 109 setRightVetoCounterThreshold->SetDefaultValue( 0 ); 110 setRightVetoCounterThreshold->SetUnitCandi << 111 setRightVetoCounterThreshold->SetDefaultUn 110 setRightVetoCounterThreshold->SetDefaultUnit( "MeV" ); >> 111 setRightVetoCounterThreshold->SetUnitCandidates( "ev keV MeV GeV" ); 112 setRightVetoCounterThreshold->AvailableFor 112 setRightVetoCounterThreshold->AvailableForStates( G4State_PreInit, 113 113 G4State_Idle ); 114 114 115 setCalorimetersThreshold = new G4UIcmdWith 115 setCalorimetersThreshold = new G4UIcmdWithADoubleAndUnit( 116 ( CexmcMessenger::calorimeterEDDir 116 ( CexmcMessenger::calorimeterEDDirName + "threshold" ).c_str(), 117 this ); 117 this ); 118 setCalorimetersThreshold->SetGuidance( "Ca 118 setCalorimetersThreshold->SetGuidance( "Calorimeters trigger threshold" ); 119 setCalorimetersThreshold->SetParameterName 119 setCalorimetersThreshold->SetParameterName( "CalorimetersThreshold", 120 120 false ); 121 setCalorimetersThreshold->SetDefaultValue( 121 setCalorimetersThreshold->SetDefaultValue( 0 ); 122 setCalorimetersThreshold->SetUnitCandidate << 123 setCalorimetersThreshold->SetDefaultUnit( 122 setCalorimetersThreshold->SetDefaultUnit( "MeV" ); >> 123 setCalorimetersThreshold->SetUnitCandidates( "ev keV MeV GeV" ); 124 setCalorimetersThreshold->AvailableForStat 124 setCalorimetersThreshold->AvailableForStates( G4State_PreInit, 125 125 G4State_Idle ); 126 126 127 setLeftCalorimeterThreshold = new G4UIcmdW 127 setLeftCalorimeterThreshold = new G4UIcmdWithADoubleAndUnit( 128 ( CexmcMessenger::calorimeterLeftE 128 ( CexmcMessenger::calorimeterLeftEDDirName + "threshold" ).c_str(), 129 this ); 129 this ); 130 setLeftCalorimeterThreshold->SetGuidance( 130 setLeftCalorimeterThreshold->SetGuidance( 131 "Left calo 131 "Left calorimeter trigger threshold" ); 132 setLeftCalorimeterThreshold->SetParameterN 132 setLeftCalorimeterThreshold->SetParameterName( "LeftCalorimeterThreshold", 133 133 false ); 134 setLeftCalorimeterThreshold->SetDefaultVal 134 setLeftCalorimeterThreshold->SetDefaultValue( 0 ); 135 setLeftCalorimeterThreshold->SetUnitCandid << 136 setLeftCalorimeterThreshold->SetDefaultUni 135 setLeftCalorimeterThreshold->SetDefaultUnit( "MeV" ); >> 136 setLeftCalorimeterThreshold->SetUnitCandidates( "ev keV MeV GeV" ); 137 setLeftCalorimeterThreshold->AvailableForS 137 setLeftCalorimeterThreshold->AvailableForStates( G4State_PreInit, 138 138 G4State_Idle ); 139 139 140 setRightCalorimeterThreshold = new G4UIcmd 140 setRightCalorimeterThreshold = new G4UIcmdWithADoubleAndUnit( 141 ( CexmcMessenger::calorimeterRight 141 ( CexmcMessenger::calorimeterRightEDDirName + "threshold" ).c_str(), 142 this ); 142 this ); 143 setRightCalorimeterThreshold->SetGuidance( 143 setRightCalorimeterThreshold->SetGuidance( 144 "Right cal 144 "Right calorimeter trigger threshold" ); 145 setRightCalorimeterThreshold->SetParameter 145 setRightCalorimeterThreshold->SetParameterName( "RightCalorimeterThreshold", 146 146 false ); 147 setRightCalorimeterThreshold->SetDefaultVa 147 setRightCalorimeterThreshold->SetDefaultValue( 0 ); 148 setRightCalorimeterThreshold->SetUnitCandi << 149 setRightCalorimeterThreshold->SetDefaultUn 148 setRightCalorimeterThreshold->SetDefaultUnit( "MeV" ); >> 149 setRightCalorimeterThreshold->SetUnitCandidates( "ev keV MeV GeV" ); 150 setRightCalorimeterThreshold->AvailableFor 150 setRightCalorimeterThreshold->AvailableForStates( G4State_PreInit, 151 151 G4State_Idle ); 152 152 153 setCalorimeterTriggerAlgorithm = new G4UIc 153 setCalorimeterTriggerAlgorithm = new G4UIcmdWithAString( 154 ( CexmcMessenger::detectorDirName 154 ( CexmcMessenger::detectorDirName + 155 "calorimeterTriggerAlgorithm" ). 155 "calorimeterTriggerAlgorithm" ).c_str(), this ); 156 setCalorimeterTriggerAlgorithm->SetGuidanc 156 setCalorimeterTriggerAlgorithm->SetGuidance( "\n" 157 " all - energy deposit in a 157 " all - energy deposit in all crystals in a calorimeter\n" 158 " will be checked aga 158 " will be checked against calorimeter threshold " 159 "value,\n" 159 "value,\n" 160 " inner - energy deposit in 160 " inner - energy deposit in only inner crystals\n" 161 " will be checked a 161 " will be checked against calorimeter threshold " 162 "value" ); 162 "value" ); 163 setCalorimeterTriggerAlgorithm->SetParamet 163 setCalorimeterTriggerAlgorithm->SetParameterName( 164 "Calor 164 "CalorimeterTriggerAlgorithm", false ); 165 setCalorimeterTriggerAlgorithm->SetCandida << 166 setCalorimeterTriggerAlgorithm->SetDefault 165 setCalorimeterTriggerAlgorithm->SetDefaultValue( "inner" ); >> 166 setCalorimeterTriggerAlgorithm->SetCandidates( "all inner" ); 167 setCalorimeterTriggerAlgorithm->AvailableF 167 setCalorimeterTriggerAlgorithm->AvailableForStates( G4State_PreInit, 168 168 G4State_Idle ); 169 169 170 setOuterCrystalsVetoAlgorithm = new G4UIcm 170 setOuterCrystalsVetoAlgorithm = new G4UIcmdWithAString( 171 ( CexmcMessenger::detectorDirName 171 ( CexmcMessenger::detectorDirName + 172 "outerCrystalsVetoAlgorithm" ).c 172 "outerCrystalsVetoAlgorithm" ).c_str(), this ); 173 setOuterCrystalsVetoAlgorithm->SetGuidance 173 setOuterCrystalsVetoAlgorithm->SetGuidance( "\n" 174 " none - events will not be 174 " none - events will not be rejected by any algorithm,\n" 175 " max - reject event trigge 175 " max - reject event trigger if crystal with maximum energy " 176 "\n deposit is on 176 "\n deposit is one of outer crystals,\n" 177 " fraction - reject event t 177 " fraction - reject event trigger if energy deposit " 178 "fraction in\n 178 "fraction in\n outer crystals is more than " 179 "value of\n 179 "value of\n 'outerCrystalsVetoFraction'" ); 180 setOuterCrystalsVetoAlgorithm->SetParamete 180 setOuterCrystalsVetoAlgorithm->SetParameterName( 181 "Outer 181 "OuterCrystalsVetoAlgorithm", false ); 182 setOuterCrystalsVetoAlgorithm->SetCandidat << 183 setOuterCrystalsVetoAlgorithm->SetDefaultV 182 setOuterCrystalsVetoAlgorithm->SetDefaultValue( "none" ); >> 183 setOuterCrystalsVetoAlgorithm->SetCandidates( "none max fraction" ); 184 setOuterCrystalsVetoAlgorithm->AvailableFo 184 setOuterCrystalsVetoAlgorithm->AvailableForStates( G4State_PreInit, 185 185 G4State_Idle ); 186 186 187 setOuterCrystalsVetoFraction = new G4UIcmd 187 setOuterCrystalsVetoFraction = new G4UIcmdWithADouble( 188 ( CexmcMessenger::detectorDirName 188 ( CexmcMessenger::detectorDirName + 189 "outerCrystalsVetoFraction" ).c_ 189 "outerCrystalsVetoFraction" ).c_str(), this ); 190 setOuterCrystalsVetoFraction->SetGuidance( 190 setOuterCrystalsVetoFraction->SetGuidance( "\n Fraction of whole energy " 191 "deposit in one calorimeter\n t 191 "deposit in one calorimeter\n that belongs to outer crystals.\n" 192 " If 'outerCrystalsVetoAlgorith 192 " If 'outerCrystalsVetoAlgorithm' is 'fraction' and\n" 193 " the outer crystals energy dep 193 " the outer crystals energy deposit fraction exceeds " 194 "this\n value then event wo 194 "this\n value then event won't trigger" ); 195 setOuterCrystalsVetoFraction->SetParameter 195 setOuterCrystalsVetoFraction->SetParameterName( 196 "Outer 196 "OuterCrystalsVetoFraction", false ); 197 setOuterCrystalsVetoFraction->SetDefaultVa 197 setOuterCrystalsVetoFraction->SetDefaultValue( 0 ); 198 setOuterCrystalsVetoFraction->AvailableFor 198 setOuterCrystalsVetoFraction->AvailableForStates( G4State_PreInit, 199 199 G4State_Idle ); 200 200 201 applyFiniteCrystalResolution = new G4UIcmd 201 applyFiniteCrystalResolution = new G4UIcmdWithABool( 202 ( CexmcMessenger::detectorDirName 202 ( CexmcMessenger::detectorDirName + 203 "applyFiniteCrystalResolution" ) 203 "applyFiniteCrystalResolution" ).c_str(), this ); 204 applyFiniteCrystalResolution->SetGuidance( 204 applyFiniteCrystalResolution->SetGuidance( "\n Specify if finite " 205 "energy resolution of the crystals 205 "energy resolution of the crystals\n will be accounted" ); 206 applyFiniteCrystalResolution->SetParameter 206 applyFiniteCrystalResolution->SetParameterName( 207 "Apply << 207 "ApplyFiniteCrystalResolution", false ); 208 applyFiniteCrystalResolution->SetDefaultVa << 208 applyFiniteCrystalResolution->SetDefaultValue( false ); 209 applyFiniteCrystalResolution->AvailableFor 209 applyFiniteCrystalResolution->AvailableForStates( G4State_PreInit, 210 210 G4State_Idle ); 211 211 212 addCrystalResolutionRange = new G4UIcmdWit 212 addCrystalResolutionRange = new G4UIcmdWith3Vector( 213 ( CexmcMessenger::detectorDirName 213 ( CexmcMessenger::detectorDirName + 214 "addCrystalResolutionRange" ).c_ 214 "addCrystalResolutionRange" ).c_str(), this ); 215 addCrystalResolutionRange->SetGuidance( "\ 215 addCrystalResolutionRange->SetGuidance( "\n Add new energy range " 216 "(in GeV!) with fwhm percentage\n 216 "(in GeV!) with fwhm percentage\n value of crystal resolution " 217 "in this range" ); 217 "in this range" ); 218 addCrystalResolutionRange->SetParameterNam 218 addCrystalResolutionRange->SetParameterName( 219 "CrystalResolutionRangeBottom", "C 219 "CrystalResolutionRangeBottom", "CrystalResolutionRangeTop", 220 "CrystalResolutionRangeValue", fal 220 "CrystalResolutionRangeValue", false ); 221 addCrystalResolutionRange->SetRange( "Crys 221 addCrystalResolutionRange->SetRange( "CrystalResolutionRangeBottom >= 0. " 222 "&& CrystalResolutionRangeTop >= 0 222 "&& CrystalResolutionRangeTop >= 0. && " 223 "CrystalResolutionRangeValue >= 0. 223 "CrystalResolutionRangeValue >= 0." ); 224 addCrystalResolutionRange->AvailableForSta 224 addCrystalResolutionRange->AvailableForStates( G4State_PreInit, 225 225 G4State_Idle ); 226 226 227 clearCrystalResolutionData = new G4UIcmdWi 227 clearCrystalResolutionData = new G4UIcmdWithoutParameter( 228 ( CexmcMessenger::detectorDirName 228 ( CexmcMessenger::detectorDirName + 229 "clearCrystalResolutionData" ).c 229 "clearCrystalResolutionData" ).c_str(), this ); 230 clearCrystalResolutionData->SetGuidance( " 230 clearCrystalResolutionData->SetGuidance( "\n Clear all crystal " 231 "resolution ranges.\n Can be 231 "resolution ranges.\n Can be used to redefine crystal " 232 "resolution data" ); 232 "resolution data" ); 233 clearCrystalResolutionData->AvailableForSt 233 clearCrystalResolutionData->AvailableForStates( G4State_PreInit, 234 234 G4State_Idle ); 235 } 235 } 236 236 237 237 238 CexmcEnergyDepositDigitizerMessenger::~CexmcEn 238 CexmcEnergyDepositDigitizerMessenger::~CexmcEnergyDepositDigitizerMessenger() 239 { 239 { 240 delete setMonitorThreshold; 240 delete setMonitorThreshold; 241 delete setVetoCountersThreshold; 241 delete setVetoCountersThreshold; 242 delete setLeftVetoCounterThreshold; 242 delete setLeftVetoCounterThreshold; 243 delete setRightVetoCounterThreshold; 243 delete setRightVetoCounterThreshold; 244 delete setCalorimetersThreshold; 244 delete setCalorimetersThreshold; 245 delete setLeftCalorimeterThreshold; 245 delete setLeftCalorimeterThreshold; 246 delete setRightCalorimeterThreshold; 246 delete setRightCalorimeterThreshold; 247 delete setCalorimeterTriggerAlgorithm; 247 delete setCalorimeterTriggerAlgorithm; 248 delete setOuterCrystalsVetoAlgorithm; 248 delete setOuterCrystalsVetoAlgorithm; 249 delete setOuterCrystalsVetoFraction; 249 delete setOuterCrystalsVetoFraction; 250 delete applyFiniteCrystalResolution; 250 delete applyFiniteCrystalResolution; 251 delete addCrystalResolutionRange; 251 delete addCrystalResolutionRange; 252 delete clearCrystalResolutionData; 252 delete clearCrystalResolutionData; 253 } 253 } 254 254 255 255 256 void CexmcEnergyDepositDigitizerMessenger::Se 256 void CexmcEnergyDepositDigitizerMessenger::SetNewValue( G4UIcommand * cmd, 257 257 G4String value ) 258 { 258 { 259 do 259 do 260 { 260 { 261 if ( cmd == setMonitorThreshold ) 261 if ( cmd == setMonitorThreshold ) 262 { 262 { 263 energyDepositDigitizer->SetMonitor 263 energyDepositDigitizer->SetMonitorThreshold( 264 G4UIcmdWithADoubleAndU 264 G4UIcmdWithADoubleAndUnit::GetNewDoubleValue( value ) ); 265 break; 265 break; 266 } 266 } 267 if ( cmd == setVetoCountersThreshold ) 267 if ( cmd == setVetoCountersThreshold ) 268 { 268 { 269 energyDepositDigitizer->SetVetoCou 269 energyDepositDigitizer->SetVetoCountersThreshold( 270 G4UIcmdWithADoubleAndU 270 G4UIcmdWithADoubleAndUnit::GetNewDoubleValue( value ) ); 271 break; 271 break; 272 } 272 } 273 if ( cmd == setLeftVetoCounterThreshol 273 if ( cmd == setLeftVetoCounterThreshold ) 274 { 274 { 275 energyDepositDigitizer->SetVetoCou 275 energyDepositDigitizer->SetVetoCounterLeftThreshold( 276 G4UIcmdWithADoubleAndU 276 G4UIcmdWithADoubleAndUnit::GetNewDoubleValue( value ) ); 277 break; 277 break; 278 } 278 } 279 if ( cmd == setRightVetoCounterThresho 279 if ( cmd == setRightVetoCounterThreshold ) 280 { 280 { 281 energyDepositDigitizer->SetVetoCou 281 energyDepositDigitizer->SetVetoCounterRightThreshold( 282 G4UIcmdWithADoubleAndU 282 G4UIcmdWithADoubleAndUnit::GetNewDoubleValue( value ) ); 283 break; 283 break; 284 } 284 } 285 if ( cmd == setCalorimetersThreshold ) 285 if ( cmd == setCalorimetersThreshold ) 286 { 286 { 287 energyDepositDigitizer->SetCalorim 287 energyDepositDigitizer->SetCalorimetersThreshold( 288 G4UIcmdWithADoubleAndU 288 G4UIcmdWithADoubleAndUnit::GetNewDoubleValue( value ) ); 289 break; 289 break; 290 } 290 } 291 if ( cmd == setLeftCalorimeterThreshol 291 if ( cmd == setLeftCalorimeterThreshold ) 292 { 292 { 293 energyDepositDigitizer->SetCalorim 293 energyDepositDigitizer->SetCalorimeterLeftThreshold( 294 G4UIcmdWithADoubleAndU 294 G4UIcmdWithADoubleAndUnit::GetNewDoubleValue( value ) ); 295 break; 295 break; 296 } 296 } 297 if ( cmd == setRightCalorimeterThresho 297 if ( cmd == setRightCalorimeterThreshold ) 298 { 298 { 299 energyDepositDigitizer->SetCalorim 299 energyDepositDigitizer->SetCalorimeterRightThreshold( 300 G4UIcmdWithADoubleAndU 300 G4UIcmdWithADoubleAndUnit::GetNewDoubleValue( value ) ); 301 break; 301 break; 302 } 302 } 303 if ( cmd == setCalorimeterTriggerAlgor 303 if ( cmd == setCalorimeterTriggerAlgorithm ) 304 { 304 { 305 CexmcCalorimeterTriggerAlgorithm << 305 CexmcCalorimeterTriggerAlgorithm calorimeterTriggerAlgorithm( 306 CexmcAllCr 306 CexmcAllCrystalsMakeEDTriggerThreshold ); 307 do 307 do 308 { 308 { 309 if ( value == "inner" ) 309 if ( value == "inner" ) 310 { 310 { 311 calorimeterTriggerAlgorith 311 calorimeterTriggerAlgorithm = 312 CexmcInner 312 CexmcInnerCrystalsMakeEDTriggerThreshold; 313 break; 313 break; 314 } 314 } 315 } while ( false ); 315 } while ( false ); 316 energyDepositDigitizer->SetCalorim 316 energyDepositDigitizer->SetCalorimeterTriggerAlgorithm( 317 317 calorimeterTriggerAlgorithm ); 318 break; 318 break; 319 } 319 } 320 if ( cmd == setOuterCrystalsVetoAlgori 320 if ( cmd == setOuterCrystalsVetoAlgorithm ) 321 { 321 { 322 CexmcOuterCrystalsVetoAlgorithm o << 322 CexmcOuterCrystalsVetoAlgorithm outerCrystalsVetoAlgorithm( 323 323 CexmcNoOuterCrystalsVeto ); 324 do 324 do 325 { 325 { 326 if ( value == "max" ) 326 if ( value == "max" ) 327 { 327 { 328 outerCrystalsVetoAlgorithm 328 outerCrystalsVetoAlgorithm = 329 CexmcM 329 CexmcMaximumEDInASingleOuterCrystalVeto; 330 break; 330 break; 331 } 331 } 332 if ( value == "fraction" ) 332 if ( value == "fraction" ) 333 { 333 { 334 outerCrystalsVetoAlgorithm 334 outerCrystalsVetoAlgorithm = 335 CexmcF 335 CexmcFractionOfEDInOuterCrystalsVeto; 336 break; 336 break; 337 } 337 } 338 } while ( false ); 338 } while ( false ); 339 energyDepositDigitizer->SetOuterCr 339 energyDepositDigitizer->SetOuterCrystalsVetoAlgorithm( 340 340 outerCrystalsVetoAlgorithm ); 341 break; 341 break; 342 } 342 } 343 if ( cmd == setOuterCrystalsVetoFracti 343 if ( cmd == setOuterCrystalsVetoFraction ) 344 { 344 { 345 energyDepositDigitizer->SetOuterCr 345 energyDepositDigitizer->SetOuterCrystalsVetoFraction( 346 G4UIcmdWithADouble::Ge 346 G4UIcmdWithADouble::GetNewDoubleValue( value ) ); 347 break; 347 break; 348 } 348 } 349 if ( cmd == applyFiniteCrystalResoluti 349 if ( cmd == applyFiniteCrystalResolution ) 350 { 350 { 351 energyDepositDigitizer->ApplyFinit 351 energyDepositDigitizer->ApplyFiniteCrystalResolution( 352 G4UIcmdWithABool::GetN 352 G4UIcmdWithABool::GetNewBoolValue( value ) ); 353 break; 353 break; 354 } 354 } 355 if ( cmd == addCrystalResolutionRange 355 if ( cmd == addCrystalResolutionRange ) 356 { 356 { 357 G4ThreeVector vec( G4UIcmdWith3Ve 357 G4ThreeVector vec( G4UIcmdWith3Vector::GetNew3VectorValue( 358 358 value ) ); 359 G4double bottom( std::min( v 359 G4double bottom( std::min( vec.x(), vec.y() ) ); 360 G4double top( std::max( vec. 360 G4double top( std::max( vec.x(), vec.y() ) ); 361 energyDepositDigitizer->AddCrystal 361 energyDepositDigitizer->AddCrystalResolutionRange( bottom, top, 362 362 vec.z() ); 363 break; 363 break; 364 } 364 } 365 if ( cmd == clearCrystalResolutionData 365 if ( cmd == clearCrystalResolutionData ) 366 { 366 { 367 energyDepositDigitizer->ClearCryst 367 energyDepositDigitizer->ClearCrystalResolutionData(); 368 break; 368 break; 369 } 369 } 370 } while ( false ); 370 } while ( false ); 371 } 371 } 372 372 373 373