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 // $Id$ 26 // 27 // 27 /// \file eventgenerator/pythia/decayer6/src/G 28 /// \file eventgenerator/pythia/decayer6/src/G4Pythia6DecayerMessenger.cc 28 /// \brief Implementation of the G4Pythia6Deca 29 /// \brief Implementation of the G4Pythia6DecayerMessenger class 29 30 30 // ------------------------------------------- 31 // ---------------------------------------------------------------------------- 31 // Messenger class that defines commands for G 32 // Messenger class that defines commands for G4Pythia6Decayer. 32 // 33 // 33 // Implements command 34 // Implements command 34 // - /pythia6Decayer/verbose [level] 35 // - /pythia6Decayer/verbose [level] 35 // - /pythia6Decayer/forceDecayType [decayType 36 // - /pythia6Decayer/forceDecayType [decayType] 36 // ------------------------------------------- 37 // ---------------------------------------------------------------------------- 37 38 38 #include "G4Pythia6DecayerMessenger.hh" 39 #include "G4Pythia6DecayerMessenger.hh" 39 << 40 #include "EDecayType.hh" << 41 << 42 #include "G4Pythia6Decayer.hh" 40 #include "G4Pythia6Decayer.hh" >> 41 #include "EDecayType.hh" 43 42 44 #include <G4UIcmdWithAnInteger.hh> << 45 #include <G4UIdirectory.hh> 43 #include <G4UIdirectory.hh> >> 44 #include <G4UIcmdWithAnInteger.hh> >> 45 46 #include <sstream> 46 #include <sstream> 47 47 48 //....oooOO0OOooo........oooOO0OOooo........oo 48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 49 49 50 G4Pythia6DecayerMessenger::G4Pythia6DecayerMes << 50 G4Pythia6DecayerMessenger::G4Pythia6DecayerMessenger( >> 51 G4Pythia6Decayer* pythia6Decayer) 51 : G4UImessenger(), 52 : G4UImessenger(), 52 fPythia6Decayer(pythia6Decayer), 53 fPythia6Decayer(pythia6Decayer), 53 fDirectory(0), 54 fDirectory(0), 54 fVerboseCmd(0), 55 fVerboseCmd(0), 55 fDecayTypeCmd(0) 56 fDecayTypeCmd(0) 56 { 57 { 57 /// Standard constructor << 58 /// Standard constructor 58 59 59 fDirectory = new G4UIdirectory("/pythia6Deca 60 fDirectory = new G4UIdirectory("/pythia6Decayer/"); 60 fDirectory->SetGuidance("G4Pythia6Decayer co 61 fDirectory->SetGuidance("G4Pythia6Decayer control commands."); 61 62 62 fVerboseCmd = new G4UIcmdWithAnInteger("/pyt << 63 fVerboseCmd >> 64 = new G4UIcmdWithAnInteger("/pythia6Decayer/verbose", this); 63 fVerboseCmd->SetGuidance("Set Pythia6Decayer 65 fVerboseCmd->SetGuidance("Set Pythia6Decayer verbose level"); 64 fVerboseCmd->SetParameterName("VerboseLevel" 66 fVerboseCmd->SetParameterName("VerboseLevel", false); 65 fVerboseCmd->SetRange("VerboseLevel >= 0 && 67 fVerboseCmd->SetRange("VerboseLevel >= 0 && VerboseLevel <= 1"); 66 fVerboseCmd->AvailableForStates(G4State_Idle 68 fVerboseCmd->AvailableForStates(G4State_Idle); 67 69 68 fDecayTypeCmd = new G4UIcmdWithAnInteger("/p << 70 fDecayTypeCmd >> 71 = new G4UIcmdWithAnInteger("/pythia6Decayer/forceDecayType", this); 69 fDecayTypeCmd->SetGuidance("Force the specif 72 fDecayTypeCmd->SetGuidance("Force the specified decay type"); 70 fDecayTypeCmd->SetParameterName("DecayType", 73 fDecayTypeCmd->SetParameterName("DecayType", false); 71 std::ostringstream os; 74 std::ostringstream os; 72 os << "DecayType >= " << kSemiElectronic << << 75 os << "DecayType >= " << kSemiElectronic >> 76 << " && DecayType <= " << kMaxDecay; 73 fDecayTypeCmd->SetRange(os.str().c_str()); 77 fDecayTypeCmd->SetRange(os.str().c_str()); 74 fDecayTypeCmd->AvailableForStates(G4State_Id 78 fDecayTypeCmd->AvailableForStates(G4State_Idle); 75 } 79 } 76 80 77 //....oooOO0OOooo........oooOO0OOooo........oo 81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 78 82 79 G4Pythia6DecayerMessenger::~G4Pythia6DecayerMe << 83 G4Pythia6DecayerMessenger::~G4Pythia6DecayerMessenger() 80 { 84 { 81 /// Destructor << 85 /// Destructor 82 86 83 delete fDirectory; 87 delete fDirectory; 84 delete fVerboseCmd; 88 delete fVerboseCmd; 85 delete fDecayTypeCmd; 89 delete fDecayTypeCmd; 86 } 90 } 87 91 88 // 92 // 89 // public methods 93 // public methods 90 // 94 // 91 95 92 //....oooOO0OOooo........oooOO0OOooo........oo 96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 93 97 94 void G4Pythia6DecayerMessenger::SetNewValue(G4 << 98 void G4Pythia6DecayerMessenger::SetNewValue(G4UIcommand* command, 95 { << 99 G4String newValue) 96 /// Apply command to the associated object. << 100 { 97 << 101 /// Apply command to the associated object. 98 if (command == fVerboseCmd) { << 102 99 fPythia6Decayer->SetVerboseLevel(fVerboseC << 103 if(command == fVerboseCmd) { 100 } << 104 fPythia6Decayer 101 else if (command == fDecayTypeCmd) { << 105 ->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue)); 102 fPythia6Decayer->ForceDecayType(EDecayType << 106 } 103 } << 107 else if(command == fDecayTypeCmd) { >> 108 fPythia6Decayer >> 109 ->ForceDecayType(EDecayType(fDecayTypeCmd->GetNewIntValue(newValue))); >> 110 } 104 } 111 } 105 112 106 //....oooOO0OOooo........oooOO0OOooo........oo 113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 107 114