Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClusteringAlgoMessenger.cc
Go to the documentation of this file.
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 // This example is provided by the Geant4-DNA collaboration
27 // Any report or published results obtained using the Geant4-DNA software
28 // shall cite the following Geant4-DNA collaboration publication:
29 // Med. Phys. 37 (2010) 4692-4708
30 // The Geant4-DNA web site is available at http://geant4-dna.org
31 //
32 // $Id$
33 //
36 
38 
39 #include "ClusteringAlgo.hh"
40 
41 #include "G4UIcmdWithAnInteger.hh"
42 #include "G4UIcmdWithADouble.hh"
44 #include "G4UIdirectory.hh"
45 
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48 
50 :G4UImessenger(),fpClusteringAlgo(pClustAlgo)
51 {
52  fpAppliDir = new G4UIdirectory("/clustering/");
53  fpAppliDir->SetGuidance("commands specific to this example");
54 
55  fpMinPtsCmd = new G4UIcmdWithAnInteger("/clustering/algo/setMinPts",this);
56  fpMinPtsCmd->SetGuidance("Minimal number of points to create a cluster");
57  fpMinPtsCmd->SetParameterName("MinPts",false);
58  fpMinPtsCmd->SetRange("MinPts>0");
59  fpMinPtsCmd->AvailableForStates(G4State_Idle);
60 
61  fpProbCmd = new G4UIcmdWithADouble("/clustering/algo/setSelectionProb",this);
62  fpProbCmd->SetGuidance("Probability to select potential "
63  "damage according to the geometry");
64  fpProbCmd->SetParameterName("Prob",false);
65  fpProbCmd->SetRange("Prob>0");
66  fpProbCmd->AvailableForStates(G4State_Idle);
67 
68  fpEpsCmd = new G4UIcmdWithADoubleAndUnit("/clustering/algo/setEps",this);
69  fpEpsCmd->SetGuidance("Maximal distance between points to create a cluster");
70  fpEpsCmd->SetParameterName("Eps",false);
71  fpEpsCmd->SetRange("Eps>0");
73 
74  fpEminCmd = new G4UIcmdWithADoubleAndUnit("/clustering/algo/setEmin",this);
75  fpEminCmd->SetGuidance("Energy to have a probability "
76  "to create a strand break = 0");
77  fpEminCmd->SetParameterName("Emin",false);
78  fpEminCmd->SetRange("Emin>=0");
79  fpEminCmd->AvailableForStates(G4State_Idle);
80 
81  fpEmaxCmd = new G4UIcmdWithADoubleAndUnit("/clustering/algo/setEmax",this);
82  fpEmaxCmd->SetGuidance("Energy to have a probability "
83  "to create a strand break = 1");
84  fpEmaxCmd->SetParameterName("Emax",false);
85  fpEmaxCmd->SetRange("Emax>=0");
86  fpEmaxCmd->AvailableForStates(G4State_Idle);
87 }
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90 
92 {
93  delete fpMinPtsCmd;
94  delete fpProbCmd;
95  delete fpEpsCmd;
96  delete fpEminCmd;
97  delete fpEmaxCmd;
98  delete fpAppliDir;
99 }
100 
101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
102 
104  G4String pNewValue)
105 {
106  if(pCommand == fpMinPtsCmd)
107  {
108  fpClusteringAlgo->SetMinPts(fpMinPtsCmd->GetNewIntValue(pNewValue));
109  }
110  if(pCommand == fpProbCmd)
111  {
112  fpClusteringAlgo->SetSPointsProb(fpProbCmd->GetNewDoubleValue(pNewValue));
113  }
114  if(pCommand == fpEpsCmd)
115  {
116  fpClusteringAlgo->SetEps(fpEpsCmd->GetNewDoubleValue(pNewValue));
117  }
118  if(pCommand == fpEminCmd)
119  {
120  fpClusteringAlgo->SetEMinDamage(fpEminCmd->GetNewDoubleValue(pNewValue));
121  }
122  if(pCommand == fpEmaxCmd)
123  {
124  fpClusteringAlgo->SetEMaxDamage(fpEmaxCmd->GetNewDoubleValue(pNewValue));
125  }
126 }
127 
void SetEMinDamage(G4double val)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetEps(G4double val)
static G4double GetNewDoubleValue(const char *paramString)
virtual void SetNewValue(G4UIcommand *, G4String)
Definition of the ClusteringAlgoMessenger class.
static G4double GetNewDoubleValue(const char *paramString)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
void SetEMaxDamage(G4double val)
void SetSPointsProb(G4double val)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetMinPts(G4int val)
ClusteringAlgoMessenger(ClusteringAlgo *)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
Definition of the ClustreringAlgo class.