Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:10

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 /// \file eventgenerator/pythia/decayer6/src/G4Pythia6DecayerMessenger.cc
0028 /// \brief Implementation of the G4Pythia6DecayerMessenger class
0029 
0030 // ----------------------------------------------------------------------------
0031 // Messenger class that defines commands for G4Pythia6Decayer.
0032 //
0033 // Implements command
0034 // - /pythia6Decayer/verbose [level]
0035 // - /pythia6Decayer/forceDecayType [decayType]
0036 // ----------------------------------------------------------------------------
0037 
0038 #include "G4Pythia6DecayerMessenger.hh"
0039 
0040 #include "EDecayType.hh"
0041 
0042 #include "G4Pythia6Decayer.hh"
0043 
0044 #include <G4UIcmdWithAnInteger.hh>
0045 #include <G4UIdirectory.hh>
0046 #include <sstream>
0047 
0048 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0049 
0050 G4Pythia6DecayerMessenger::G4Pythia6DecayerMessenger(G4Pythia6Decayer* pythia6Decayer)
0051   : G4UImessenger(),
0052     fPythia6Decayer(pythia6Decayer),
0053     fDirectory(0),
0054     fVerboseCmd(0),
0055     fDecayTypeCmd(0)
0056 {
0057   /// Standard constructor
0058 
0059   fDirectory = new G4UIdirectory("/pythia6Decayer/");
0060   fDirectory->SetGuidance("G4Pythia6Decayer control commands.");
0061 
0062   fVerboseCmd = new G4UIcmdWithAnInteger("/pythia6Decayer/verbose", this);
0063   fVerboseCmd->SetGuidance("Set Pythia6Decayer verbose level");
0064   fVerboseCmd->SetParameterName("VerboseLevel", false);
0065   fVerboseCmd->SetRange("VerboseLevel >= 0 && VerboseLevel <= 1");
0066   fVerboseCmd->AvailableForStates(G4State_Idle);
0067 
0068   fDecayTypeCmd = new G4UIcmdWithAnInteger("/pythia6Decayer/forceDecayType", this);
0069   fDecayTypeCmd->SetGuidance("Force the specified decay type");
0070   fDecayTypeCmd->SetParameterName("DecayType", false);
0071   std::ostringstream os;
0072   os << "DecayType >=  " << kSemiElectronic << " && DecayType <= " << kMaxDecay;
0073   fDecayTypeCmd->SetRange(os.str().c_str());
0074   fDecayTypeCmd->AvailableForStates(G4State_Idle);
0075 }
0076 
0077 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0078 
0079 G4Pythia6DecayerMessenger::~G4Pythia6DecayerMessenger()
0080 {
0081   /// Destructor
0082 
0083   delete fDirectory;
0084   delete fVerboseCmd;
0085   delete fDecayTypeCmd;
0086 }
0087 
0088 //
0089 // public methods
0090 //
0091 
0092 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0093 
0094 void G4Pythia6DecayerMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0095 {
0096   /// Apply command to the associated object.
0097 
0098   if (command == fVerboseCmd) {
0099     fPythia6Decayer->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue));
0100   }
0101   else if (command == fDecayTypeCmd) {
0102     fPythia6Decayer->ForceDecayType(EDecayType(fDecayTypeCmd->GetNewIntValue(newValue)));
0103   }
0104 }
0105 
0106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......