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: CexmcEnergyDepositDigitize 30 * 31 * Description: energy deposit digitizer m 32 * 33 * Version: 1.0 34 * Created: 29.11.2009 19:07:05 35 * Revision: none 36 * Compiler: gcc 37 * 38 * Author: Alexey Radkov (), 39 * Company: PNPI 40 * 41 * =========================================== 42 */ 43 44 #include <G4UIcmdWithADouble.hh> 45 #include <G4UIcmdWithADoubleAndUnit.hh> 46 #include <G4UIcmdWithAString.hh> 47 #include <G4UIcmdWithABool.hh> 48 #include <G4UIcmdWith3Vector.hh> 49 #include <G4UIcmdWithoutParameter.hh> 50 #include "CexmcEnergyDepositDigitizer.hh" 51 #include "CexmcEnergyDepositDigitizerMessenger 52 #include "CexmcMessenger.hh" 53 #include "CexmcCommon.hh" 54 55 56 CexmcEnergyDepositDigitizerMessenger::CexmcEne 57 CexmcEnergyDepositDigitizer * energyD 58 energyDepositDigitizer( energyDepositDigit 59 setMonitorThreshold( NULL ), setVetoCounte 60 setLeftVetoCounterThreshold( NULL ), setRi 61 setCalorimetersThreshold( NULL ), setLeftC 62 setRightCalorimeterThreshold( NULL ), 63 setCalorimeterTriggerAlgorithm( NULL ), 64 setOuterCrystalsVetoAlgorithm( NULL ), set 65 applyFiniteCrystalResolution( NULL ), addC 66 clearCrystalResolutionData( NULL ) 67 { 68 setMonitorThreshold = new G4UIcmdWithADoub 69 ( CexmcMessenger::monitorEDDirName 70 setMonitorThreshold->SetGuidance( "Monitor 71 setMonitorThreshold->SetParameterName( "Mo 72 setMonitorThreshold->SetDefaultValue( 0 ); 73 setMonitorThreshold->SetUnitCandidates( "e 74 setMonitorThreshold->SetDefaultUnit( "MeV" 75 setMonitorThreshold->AvailableForStates( G 76 77 setVetoCountersThreshold = new G4UIcmdWith 78 ( CexmcMessenger::vetoCounterEDDir 79 this ); 80 setVetoCountersThreshold->SetGuidance( "Ve 81 setVetoCountersThreshold->SetParameterName 82 83 setVetoCountersThreshold->SetDefaultValue( 84 setVetoCountersThreshold->SetUnitCandidate 85 setVetoCountersThreshold->SetDefaultUnit( 86 setVetoCountersThreshold->AvailableForStat 87 88 89 setLeftVetoCounterThreshold = new G4UIcmdW 90 ( CexmcMessenger::vetoCounterLeftE 91 this ); 92 setLeftVetoCounterThreshold->SetGuidance( 93 "Left veto 94 setLeftVetoCounterThreshold->SetParameterN 95 96 setLeftVetoCounterThreshold->SetDefaultVal 97 setLeftVetoCounterThreshold->SetUnitCandid 98 setLeftVetoCounterThreshold->SetDefaultUni 99 setLeftVetoCounterThreshold->AvailableForS 100 101 102 setRightVetoCounterThreshold = new G4UIcmd 103 ( CexmcMessenger::vetoCounterRight 104 this ); 105 setRightVetoCounterThreshold->SetGuidance( 106 "Right vet 107 setRightVetoCounterThreshold->SetParameter 108 109 setRightVetoCounterThreshold->SetDefaultVa 110 setRightVetoCounterThreshold->SetUnitCandi 111 setRightVetoCounterThreshold->SetDefaultUn 112 setRightVetoCounterThreshold->AvailableFor 113 114 115 setCalorimetersThreshold = new G4UIcmdWith 116 ( CexmcMessenger::calorimeterEDDir 117 this ); 118 setCalorimetersThreshold->SetGuidance( "Ca 119 setCalorimetersThreshold->SetParameterName 120 121 setCalorimetersThreshold->SetDefaultValue( 122 setCalorimetersThreshold->SetUnitCandidate 123 setCalorimetersThreshold->SetDefaultUnit( 124 setCalorimetersThreshold->AvailableForStat 125 126 127 setLeftCalorimeterThreshold = new G4UIcmdW 128 ( CexmcMessenger::calorimeterLeftE 129 this ); 130 setLeftCalorimeterThreshold->SetGuidance( 131 "Left calo 132 setLeftCalorimeterThreshold->SetParameterN 133 134 setLeftCalorimeterThreshold->SetDefaultVal 135 setLeftCalorimeterThreshold->SetUnitCandid 136 setLeftCalorimeterThreshold->SetDefaultUni 137 setLeftCalorimeterThreshold->AvailableForS 138 139 140 setRightCalorimeterThreshold = new G4UIcmd 141 ( CexmcMessenger::calorimeterRight 142 this ); 143 setRightCalorimeterThreshold->SetGuidance( 144 "Right cal 145 setRightCalorimeterThreshold->SetParameter 146 147 setRightCalorimeterThreshold->SetDefaultVa 148 setRightCalorimeterThreshold->SetUnitCandi 149 setRightCalorimeterThreshold->SetDefaultUn 150 setRightCalorimeterThreshold->AvailableFor 151 152 153 setCalorimeterTriggerAlgorithm = new G4UIc 154 ( CexmcMessenger::detectorDirName 155 "calorimeterTriggerAlgorithm" ). 156 setCalorimeterTriggerAlgorithm->SetGuidanc 157 " all - energy deposit in a 158 " will be checked aga 159 "value,\n" 160 " inner - energy deposit in 161 " will be checked a 162 "value" ); 163 setCalorimeterTriggerAlgorithm->SetParamet 164 "Calor 165 setCalorimeterTriggerAlgorithm->SetCandida 166 setCalorimeterTriggerAlgorithm->SetDefault 167 setCalorimeterTriggerAlgorithm->AvailableF 168 169 170 setOuterCrystalsVetoAlgorithm = new G4UIcm 171 ( CexmcMessenger::detectorDirName 172 "outerCrystalsVetoAlgorithm" ).c 173 setOuterCrystalsVetoAlgorithm->SetGuidance 174 " none - events will not be 175 " max - reject event trigge 176 "\n deposit is on 177 " fraction - reject event t 178 "fraction in\n 179 "value of\n 180 setOuterCrystalsVetoAlgorithm->SetParamete 181 "Outer 182 setOuterCrystalsVetoAlgorithm->SetCandidat 183 setOuterCrystalsVetoAlgorithm->SetDefaultV 184 setOuterCrystalsVetoAlgorithm->AvailableFo 185 186 187 setOuterCrystalsVetoFraction = new G4UIcmd 188 ( CexmcMessenger::detectorDirName 189 "outerCrystalsVetoFraction" ).c_ 190 setOuterCrystalsVetoFraction->SetGuidance( 191 "deposit in one calorimeter\n t 192 " If 'outerCrystalsVetoAlgorith 193 " the outer crystals energy dep 194 "this\n value then event wo 195 setOuterCrystalsVetoFraction->SetParameter 196 "Outer 197 setOuterCrystalsVetoFraction->SetDefaultVa 198 setOuterCrystalsVetoFraction->AvailableFor 199 200 201 applyFiniteCrystalResolution = new G4UIcmd 202 ( CexmcMessenger::detectorDirName 203 "applyFiniteCrystalResolution" ) 204 applyFiniteCrystalResolution->SetGuidance( 205 "energy resolution of the crystals 206 applyFiniteCrystalResolution->SetParameter 207 "Apply 208 applyFiniteCrystalResolution->SetDefaultVa 209 applyFiniteCrystalResolution->AvailableFor 210 211 212 addCrystalResolutionRange = new G4UIcmdWit 213 ( CexmcMessenger::detectorDirName 214 "addCrystalResolutionRange" ).c_ 215 addCrystalResolutionRange->SetGuidance( "\ 216 "(in GeV!) with fwhm percentage\n 217 "in this range" ); 218 addCrystalResolutionRange->SetParameterNam 219 "CrystalResolutionRangeBottom", "C 220 "CrystalResolutionRangeValue", fal 221 addCrystalResolutionRange->SetRange( "Crys 222 "&& CrystalResolutionRangeTop >= 0 223 "CrystalResolutionRangeValue >= 0. 224 addCrystalResolutionRange->AvailableForSta 225 226 227 clearCrystalResolutionData = new G4UIcmdWi 228 ( CexmcMessenger::detectorDirName 229 "clearCrystalResolutionData" ).c 230 clearCrystalResolutionData->SetGuidance( " 231 "resolution ranges.\n Can be 232 "resolution data" ); 233 clearCrystalResolutionData->AvailableForSt 234 235 } 236 237 238 CexmcEnergyDepositDigitizerMessenger::~CexmcEn 239 { 240 delete setMonitorThreshold; 241 delete setVetoCountersThreshold; 242 delete setLeftVetoCounterThreshold; 243 delete setRightVetoCounterThreshold; 244 delete setCalorimetersThreshold; 245 delete setLeftCalorimeterThreshold; 246 delete setRightCalorimeterThreshold; 247 delete setCalorimeterTriggerAlgorithm; 248 delete setOuterCrystalsVetoAlgorithm; 249 delete setOuterCrystalsVetoFraction; 250 delete applyFiniteCrystalResolution; 251 delete addCrystalResolutionRange; 252 delete clearCrystalResolutionData; 253 } 254 255 256 void CexmcEnergyDepositDigitizerMessenger::Se 257 258 { 259 do 260 { 261 if ( cmd == setMonitorThreshold ) 262 { 263 energyDepositDigitizer->SetMonitor 264 G4UIcmdWithADoubleAndU 265 break; 266 } 267 if ( cmd == setVetoCountersThreshold ) 268 { 269 energyDepositDigitizer->SetVetoCou 270 G4UIcmdWithADoubleAndU 271 break; 272 } 273 if ( cmd == setLeftVetoCounterThreshol 274 { 275 energyDepositDigitizer->SetVetoCou 276 G4UIcmdWithADoubleAndU 277 break; 278 } 279 if ( cmd == setRightVetoCounterThresho 280 { 281 energyDepositDigitizer->SetVetoCou 282 G4UIcmdWithADoubleAndU 283 break; 284 } 285 if ( cmd == setCalorimetersThreshold ) 286 { 287 energyDepositDigitizer->SetCalorim 288 G4UIcmdWithADoubleAndU 289 break; 290 } 291 if ( cmd == setLeftCalorimeterThreshol 292 { 293 energyDepositDigitizer->SetCalorim 294 G4UIcmdWithADoubleAndU 295 break; 296 } 297 if ( cmd == setRightCalorimeterThresho 298 { 299 energyDepositDigitizer->SetCalorim 300 G4UIcmdWithADoubleAndU 301 break; 302 } 303 if ( cmd == setCalorimeterTriggerAlgor 304 { 305 CexmcCalorimeterTriggerAlgorithm 306 CexmcAllCr 307 do 308 { 309 if ( value == "inner" ) 310 { 311 calorimeterTriggerAlgorith 312 CexmcInner 313 break; 314 } 315 } while ( false ); 316 energyDepositDigitizer->SetCalorim 317 318 break; 319 } 320 if ( cmd == setOuterCrystalsVetoAlgori 321 { 322 CexmcOuterCrystalsVetoAlgorithm o 323 324 do 325 { 326 if ( value == "max" ) 327 { 328 outerCrystalsVetoAlgorithm 329 CexmcM 330 break; 331 } 332 if ( value == "fraction" ) 333 { 334 outerCrystalsVetoAlgorithm 335 CexmcF 336 break; 337 } 338 } while ( false ); 339 energyDepositDigitizer->SetOuterCr 340 341 break; 342 } 343 if ( cmd == setOuterCrystalsVetoFracti 344 { 345 energyDepositDigitizer->SetOuterCr 346 G4UIcmdWithADouble::Ge 347 break; 348 } 349 if ( cmd == applyFiniteCrystalResoluti 350 { 351 energyDepositDigitizer->ApplyFinit 352 G4UIcmdWithABool::GetN 353 break; 354 } 355 if ( cmd == addCrystalResolutionRange 356 { 357 G4ThreeVector vec( G4UIcmdWith3Ve 358 359 G4double bottom( std::min( v 360 G4double top( std::max( vec. 361 energyDepositDigitizer->AddCrystal 362 363 break; 364 } 365 if ( cmd == clearCrystalResolutionData 366 { 367 energyDepositDigitizer->ClearCryst 368 break; 369 } 370 } while ( false ); 371 } 372 373