Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/extended/eventgenerator/pythia/decayer6/src/G4Pythia6DecayerMessenger.cc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 /// \file G4Pythia6DecayerMessenger.cc
0027 /// \brief Implementation of the G4Pythia6DecayerMessenger class
0028 
0029 // ----------------------------------------------------------------------------
0030 // Messenger class that defines commands for G4Pythia6Decayer.
0031 //
0032 // Implements command
0033 // - /pythia6Decayer/verbose [level]
0034 // - /pythia6Decayer/forceDecayType [decayType]
0035 // ----------------------------------------------------------------------------
0036 
0037 #include "G4Pythia6DecayerMessenger.hh"
0038 
0039 #include "EDecayType.hh"
0040 
0041 #include "G4Pythia6Decayer.hh"
0042 
0043 #include <G4UIcmdWithAnInteger.hh>
0044 #include <G4UIdirectory.hh>
0045 #include <sstream>
0046 
0047 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0048 
0049 G4Pythia6DecayerMessenger::G4Pythia6DecayerMessenger(G4Pythia6Decayer* pythia6Decayer)
0050   : G4UImessenger(),
0051     fPythia6Decayer(pythia6Decayer),
0052     fDirectory(0),
0053     fVerboseCmd(0),
0054     fDecayTypeCmd(0)
0055 {
0056   /// Standard constructor
0057 
0058   fDirectory = new G4UIdirectory("/pythia6Decayer/");
0059   fDirectory->SetGuidance("G4Pythia6Decayer control commands.");
0060 
0061   fVerboseCmd = new G4UIcmdWithAnInteger("/pythia6Decayer/verbose", this);
0062   fVerboseCmd->SetGuidance("Set Pythia6Decayer verbose level");
0063   fVerboseCmd->SetParameterName("VerboseLevel", false);
0064   fVerboseCmd->SetRange("VerboseLevel >= 0 && VerboseLevel <= 1");
0065   fVerboseCmd->AvailableForStates(G4State_Idle);
0066 
0067   fDecayTypeCmd = new G4UIcmdWithAnInteger("/pythia6Decayer/forceDecayType", this);
0068   fDecayTypeCmd->SetGuidance("Force the specified decay type");
0069   fDecayTypeCmd->SetParameterName("DecayType", false);
0070   std::ostringstream os;
0071   os << "DecayType >=  " << kSemiElectronic << " && DecayType <= " << kMaxDecay;
0072   fDecayTypeCmd->SetRange(os.str().c_str());
0073   fDecayTypeCmd->AvailableForStates(G4State_Idle);
0074 }
0075 
0076 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0077 
0078 G4Pythia6DecayerMessenger::~G4Pythia6DecayerMessenger()
0079 {
0080   /// Destructor
0081 
0082   delete fDirectory;
0083   delete fVerboseCmd;
0084   delete fDecayTypeCmd;
0085 }
0086 
0087 //
0088 // public methods
0089 //
0090 
0091 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0092 
0093 void G4Pythia6DecayerMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0094 {
0095   /// Apply command to the associated object.
0096 
0097   if (command == fVerboseCmd) {
0098     fPythia6Decayer->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue));
0099   }
0100   else if (command == fDecayTypeCmd) {
0101     fPythia6Decayer->ForceDecayType(EDecayType(fDecayTypeCmd->GetNewIntValue(newValue)));
0102   }
0103 }
0104 
0105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......