source: trunk/examples/extended/eventgenerator/HepMC/HepMCEx01/src/ExN04PrimaryGeneratorMessenger.cc @ 1358

Last change on this file since 1358 was 807, checked in by garnier, 16 years ago

update

File size: 4.0 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26// ====================================================================
27//
28//   ExN04PrimaryGeneratorMessenger.cc
29//   $Id: ExN04PrimaryGeneratorMessenger.cc,v 1.3 2006/06/29 17:06:10 gunter Exp $
30//
31// ====================================================================
32#include "G4UIcommand.hh"
33#include "G4UIparameter.hh"
34#include "G4UIcmdWithoutParameter.hh"
35#include "G4UIcmdWithABool.hh"
36#include "G4UIcmdWithAnInteger.hh"
37#include "G4UIcmdWithAString.hh"
38#include "G4UIdirectory.hh"
39
40#include "ExN04PrimaryGeneratorMessenger.hh"
41#include "ExN04PrimaryGeneratorAction.hh"
42
43////////////////////////////////////////////////////////////////////
44ExN04PrimaryGeneratorMessenger::ExN04PrimaryGeneratorMessenger
45                            (ExN04PrimaryGeneratorAction* genaction)
46  : primaryAction(genaction)
47////////////////////////////////////////////////////////////////////
48{
49  mydetdir = new G4UIdirectory("/mydet/");
50  mydetdir-> SetGuidance("ExN04 detector control commands.");
51
52  dir= new G4UIdirectory("/generator/");
53  dir-> SetGuidance("Control commands for primary generator");
54
55  select= new G4UIcmdWithAString("/generator/select", this);
56  select-> SetGuidance("select generator type");
57  select-> SetParameterName("generator_type", false, false);
58  select-> SetCandidates("particleGun pythia hepmcAscii");
59  select-> SetDefaultValue("particleGun");
60}
61
62/////////////////////////////////////////////////////////////////
63ExN04PrimaryGeneratorMessenger::~ExN04PrimaryGeneratorMessenger()
64/////////////////////////////////////////////////////////////////
65{
66  delete select;
67
68  delete mydetdir;
69  delete dir;
70} 
71
72//////////////////////////////////////////////////////////////////////
73void ExN04PrimaryGeneratorMessenger::SetNewValue(G4UIcommand* command, 
74                                              G4String newValues)
75//////////////////////////////////////////////////////////////////////
76{
77  if ( command==select) {
78    primaryAction-> SetGenerator(newValues);
79    G4cout << "current generator type: " 
80            << primaryAction-> GetGeneratorName() << G4endl;
81  } else {
82  }
83}
84
85
86//////////////////////////////////////////////////////////////////////////////
87G4String ExN04PrimaryGeneratorMessenger::GetCurrentValue(G4UIcommand* command)
88//////////////////////////////////////////////////////////////////////////////
89{
90  G4String cv, st;
91  if (command == select) {
92    cv= primaryAction-> GetGeneratorName();
93  } 
94
95 return cv;
96}
97
Note: See TracBrowser for help on using the repository browser.