Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/extended/optical/OpNovice2/src/DetectorMessenger.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/extended/optical/OpNovice2/src/DetectorMessenger.cc (Version 11.3.0) and /examples/extended/optical/OpNovice2/src/DetectorMessenger.cc (Version 10.6.p2)


  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 /// \file optical/OpNovice2/src/DetectorMessen     26 /// \file optical/OpNovice2/src/DetectorMessenger.cc
 27 /// \brief Implementation of the DetectorMesse     27 /// \brief Implementation of the DetectorMessenger class
 28 //                                                 28 //
 29 //                                                 29 //
 30 //....oooOO0OOooo........oooOO0OOooo........oo     30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 31 //....oooOO0OOooo........oooOO0OOooo........oo     31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 32                                                    32 
 33 #include "DetectorMessenger.hh"                    33 #include "DetectorMessenger.hh"
 34                                                    34 
 35 #include "DetectorConstruction.hh"             <<  35 #include <sstream>
                                                   >>  36 #include <iostream>
 36                                                    37 
 37 #include "G4OpticalSurface.hh"                     38 #include "G4OpticalSurface.hh"
 38 #include "G4UIcmdWithADouble.hh"               <<  39 
 39 #include "G4UIcmdWithADoubleAndUnit.hh"        <<  40 #include "DetectorConstruction.hh"
                                                   >>  41 #include "G4UIdirectory.hh"
                                                   >>  42 #include "G4UIcommand.hh"
                                                   >>  43 #include "G4UIparameter.hh"
 40 #include "G4UIcmdWithAString.hh"                   44 #include "G4UIcmdWithAString.hh"
                                                   >>  45 #include "G4UIcmdWithADouble.hh"
 41 #include "G4UIcmdWithAnInteger.hh"                 46 #include "G4UIcmdWithAnInteger.hh"
                                                   >>  47 #include "G4UIcmdWithADoubleAndUnit.hh"
 42 #include "G4UIcmdWithoutParameter.hh"              48 #include "G4UIcmdWithoutParameter.hh"
 43 #include "G4UIcommand.hh"                      << 
 44 #include "G4UIdirectory.hh"                    << 
 45 #include "G4UIparameter.hh"                    << 
 46                                                << 
 47 #include <iostream>                            << 
 48 #include <sstream>                             << 
 49                                                    49 
 50 //....oooOO0OOooo........oooOO0OOooo........oo     50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 51                                                    51 
 52 DetectorMessenger::DetectorMessenger(DetectorC <<  52 DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
                                                   >>  53 :G4UImessenger(),fDetector(Det)
 53 {                                                  54 {
 54   fOpticalDir = new G4UIdirectory("/opnovice2/     55   fOpticalDir = new G4UIdirectory("/opnovice2/");
 55   fOpticalDir->SetGuidance("Parameters for opt     56   fOpticalDir->SetGuidance("Parameters for optical simulation.");
 56                                                    57 
 57   fSurfaceTypeCmd = new G4UIcmdWithAString("/o     58   fSurfaceTypeCmd = new G4UIcmdWithAString("/opnovice2/surfaceType", this);
 58   fSurfaceTypeCmd->SetGuidance("Surface type."     59   fSurfaceTypeCmd->SetGuidance("Surface type.");
 59   fSurfaceTypeCmd->AvailableForStates(G4State_     60   fSurfaceTypeCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
 60   fSurfaceTypeCmd->SetToBeBroadcasted(false);      61   fSurfaceTypeCmd->SetToBeBroadcasted(false);
 61                                                    62 
 62   fSurfaceFinishCmd = new G4UIcmdWithAString("     63   fSurfaceFinishCmd = new G4UIcmdWithAString("/opnovice2/surfaceFinish", this);
 63   fSurfaceFinishCmd->SetGuidance("Surface fini     64   fSurfaceFinishCmd->SetGuidance("Surface finish.");
 64   fSurfaceFinishCmd->AvailableForStates(G4Stat     65   fSurfaceFinishCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
 65   fSurfaceFinishCmd->SetToBeBroadcasted(false)     66   fSurfaceFinishCmd->SetToBeBroadcasted(false);
 66                                                    67 
 67   fSurfaceModelCmd = new G4UIcmdWithAString("/ <<  68   fSurfaceModelCmd =
                                                   >>  69     new G4UIcmdWithAString("/opnovice2/surfaceModel", this);
 68   fSurfaceModelCmd->SetGuidance("surface model     70   fSurfaceModelCmd->SetGuidance("surface model.");
 69   fSurfaceModelCmd->AvailableForStates(G4State     71   fSurfaceModelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
 70   fSurfaceModelCmd->SetToBeBroadcasted(false);     72   fSurfaceModelCmd->SetToBeBroadcasted(false);
 71                                                    73 
 72   fSurfaceSigmaAlphaCmd = new G4UIcmdWithADoub <<  74   fSurfaceSigmaAlphaCmd =
                                                   >>  75     new G4UIcmdWithADouble("/opnovice2/surfaceSigmaAlpha", this);
 73   fSurfaceSigmaAlphaCmd->SetGuidance("surface      76   fSurfaceSigmaAlphaCmd->SetGuidance("surface sigma alpha");
 74   fSurfaceSigmaAlphaCmd->SetGuidance(" paramet     77   fSurfaceSigmaAlphaCmd->SetGuidance(" parameter.");
 75   fSurfaceSigmaAlphaCmd->AvailableForStates(G4     78   fSurfaceSigmaAlphaCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
 76   fSurfaceSigmaAlphaCmd->SetToBeBroadcasted(fa     79   fSurfaceSigmaAlphaCmd->SetToBeBroadcasted(false);
 77                                                    80 
 78   fSurfacePolishCmd = new G4UIcmdWithADouble(" <<  81   fSurfacePolishCmd =
                                                   >>  82     new G4UIcmdWithADouble("/opnovice2/surfacePolish", this);
 79   fSurfacePolishCmd->SetGuidance("surface poli     83   fSurfacePolishCmd->SetGuidance("surface polish");
 80   fSurfacePolishCmd->SetGuidance(" parameter (     84   fSurfacePolishCmd->SetGuidance(" parameter (for Glisur model).");
 81   fSurfacePolishCmd->AvailableForStates(G4Stat     85   fSurfacePolishCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
 82   fSurfacePolishCmd->SetToBeBroadcasted(false)     86   fSurfacePolishCmd->SetToBeBroadcasted(false);
 83                                                    87 
 84   fSurfaceMatPropVectorCmd = new G4UIcmdWithAS <<  88   fSurfaceMatPropVectorCmd =
                                                   >>  89     new G4UIcmdWithAString("/opnovice2/surfaceProperty", this);
 85   fSurfaceMatPropVectorCmd->SetGuidance("Set m     90   fSurfaceMatPropVectorCmd->SetGuidance("Set material property vector");
 86   fSurfaceMatPropVectorCmd->SetGuidance(" for      91   fSurfaceMatPropVectorCmd->SetGuidance(" for the surface.");
 87   fSurfaceMatPropVectorCmd->AvailableForStates     92   fSurfaceMatPropVectorCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
 88   fSurfaceMatPropVectorCmd->SetToBeBroadcasted     93   fSurfaceMatPropVectorCmd->SetToBeBroadcasted(false);
 89                                                    94 
 90   fSurfaceMatPropConstCmd = new G4UIcmdWithASt <<  95   fSurfaceMatPropConstCmd =
                                                   >>  96     new G4UIcmdWithAString("/opnovice2/surfaceConstProperty", this);
 91   fSurfaceMatPropConstCmd->SetGuidance("Set ma     97   fSurfaceMatPropConstCmd->SetGuidance("Set material constant property");
 92   fSurfaceMatPropConstCmd->SetGuidance(" for t     98   fSurfaceMatPropConstCmd->SetGuidance(" for the surface.");
 93   fSurfaceMatPropConstCmd->AvailableForStates(     99   fSurfaceMatPropConstCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
 94   fSurfaceMatPropConstCmd->SetToBeBroadcasted(    100   fSurfaceMatPropConstCmd->SetToBeBroadcasted(false);
 95                                                   101 
 96   fTankMatPropVectorCmd = new G4UIcmdWithAStri << 102   fTankMatPropVectorCmd =
                                                   >> 103     new G4UIcmdWithAString("/opnovice2/boxProperty", this);
 97   fTankMatPropVectorCmd->SetGuidance("Set mate    104   fTankMatPropVectorCmd->SetGuidance("Set material property vector for ");
 98   fTankMatPropVectorCmd->SetGuidance("the box.    105   fTankMatPropVectorCmd->SetGuidance("the box.");
 99   fTankMatPropVectorCmd->AvailableForStates(G4    106   fTankMatPropVectorCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
100   fTankMatPropVectorCmd->SetToBeBroadcasted(fa    107   fTankMatPropVectorCmd->SetToBeBroadcasted(false);
101                                                   108 
102   fTankMatPropConstCmd = new G4UIcmdWithAStrin << 109   fTankMatPropConstCmd =
                                                   >> 110     new G4UIcmdWithAString("/opnovice2/boxConstProperty", this);
103   fTankMatPropConstCmd->SetGuidance("Set mater    111   fTankMatPropConstCmd->SetGuidance("Set material constant property ");
104   fTankMatPropConstCmd->SetGuidance("for the b    112   fTankMatPropConstCmd->SetGuidance("for the box.");
105   fTankMatPropConstCmd->AvailableForStates(G4S    113   fTankMatPropConstCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
106   fTankMatPropConstCmd->SetToBeBroadcasted(fal    114   fTankMatPropConstCmd->SetToBeBroadcasted(false);
107                                                   115 
108   fTankMaterialCmd = new G4UIcmdWithAString("/    116   fTankMaterialCmd = new G4UIcmdWithAString("/opnovice2/boxMaterial", this);
109   fTankMaterialCmd->SetGuidance("Set material     117   fTankMaterialCmd->SetGuidance("Set material of box.");
110   fTankMaterialCmd->AvailableForStates(G4State    118   fTankMaterialCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
111   fTankMaterialCmd->SetToBeBroadcasted(false);    119   fTankMaterialCmd->SetToBeBroadcasted(false);
112                                                   120 
113   fWorldMatPropVectorCmd = new G4UIcmdWithAStr << 121   fWorldMatPropVectorCmd =
                                                   >> 122     new G4UIcmdWithAString("/opnovice2/worldProperty", this);
114   fWorldMatPropVectorCmd->SetGuidance("Set mat    123   fWorldMatPropVectorCmd->SetGuidance("Set material property vector ");
115   fWorldMatPropVectorCmd->SetGuidance("for the    124   fWorldMatPropVectorCmd->SetGuidance("for the world.");
116   fWorldMatPropVectorCmd->AvailableForStates(G    125   fWorldMatPropVectorCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
117   fWorldMatPropVectorCmd->SetToBeBroadcasted(f    126   fWorldMatPropVectorCmd->SetToBeBroadcasted(false);
118                                                   127 
119   fWorldMatPropConstCmd = new G4UIcmdWithAStri << 128   fWorldMatPropConstCmd =
                                                   >> 129     new G4UIcmdWithAString("/opnovice2/worldConstProperty", this);
120   fWorldMatPropConstCmd->SetGuidance("Set mate    130   fWorldMatPropConstCmd->SetGuidance("Set material constant property");
121   fWorldMatPropConstCmd->SetGuidance(" for the    131   fWorldMatPropConstCmd->SetGuidance(" for the world.");
122   fWorldMatPropConstCmd->AvailableForStates(G4 << 132   fWorldMatPropConstCmd->
                                                   >> 133     AvailableForStates(G4State_PreInit, G4State_Idle);
123   fWorldMatPropConstCmd->SetToBeBroadcasted(fa    134   fWorldMatPropConstCmd->SetToBeBroadcasted(false);
124                                                   135 
125   fWorldMaterialCmd = new G4UIcmdWithAString("    136   fWorldMaterialCmd = new G4UIcmdWithAString("/opnovice2/worldMaterial", this);
126   fWorldMaterialCmd->SetGuidance("Set material    137   fWorldMaterialCmd->SetGuidance("Set material of world.");
127   fWorldMaterialCmd->AvailableForStates(G4Stat    138   fWorldMaterialCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
128   fWorldMaterialCmd->SetToBeBroadcasted(false)    139   fWorldMaterialCmd->SetToBeBroadcasted(false);
                                                   >> 140 
129 }                                                 141 }
130                                                   142 
131 //....oooOO0OOooo........oooOO0OOooo........oo    143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
132                                                   144 
133 DetectorMessenger::~DetectorMessenger()           145 DetectorMessenger::~DetectorMessenger()
134 {                                                 146 {
135   delete fOpticalDir;                          << 
136   delete fSurfaceFinishCmd;                       147   delete fSurfaceFinishCmd;
137   delete fSurfaceTypeCmd;                         148   delete fSurfaceTypeCmd;
138   delete fSurfaceModelCmd;                        149   delete fSurfaceModelCmd;
139   delete fSurfaceSigmaAlphaCmd;                   150   delete fSurfaceSigmaAlphaCmd;
140   delete fSurfacePolishCmd;                       151   delete fSurfacePolishCmd;
141   delete fSurfaceMatPropVectorCmd;                152   delete fSurfaceMatPropVectorCmd;
142   delete fSurfaceMatPropConstCmd;                 153   delete fSurfaceMatPropConstCmd;
143   delete fTankMatPropVectorCmd;                   154   delete fTankMatPropVectorCmd;
144   delete fTankMatPropConstCmd;                    155   delete fTankMatPropConstCmd;
145   delete fTankMaterialCmd;                        156   delete fTankMaterialCmd;
146   delete fWorldMatPropVectorCmd;                  157   delete fWorldMatPropVectorCmd;
147   delete fWorldMatPropConstCmd;                   158   delete fWorldMatPropConstCmd;
148   delete fWorldMaterialCmd;                       159   delete fWorldMaterialCmd;
149 }                                                 160 }
150                                                   161 
151 //....oooOO0OOooo........oooOO0OOooo........oo    162 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
152                                                   163 
153 void DetectorMessenger::SetNewValue(G4UIcomman << 164 void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
154 {                                              << 165 {    
155   //    FINISH                                 << 166   //    FINISH              
156   if (command == fSurfaceFinishCmd) {             167   if (command == fSurfaceFinishCmd) {
157     if (newValue == "polished") {                 168     if (newValue == "polished") {
158       fDetector->SetSurfaceFinish(polished);      169       fDetector->SetSurfaceFinish(polished);
159     }                                             170     }
160     else if (newValue == "polishedfrontpainted    171     else if (newValue == "polishedfrontpainted") {
161       fDetector->SetSurfaceFinish(polishedfron    172       fDetector->SetSurfaceFinish(polishedfrontpainted);
162     }                                             173     }
163     else if (newValue == "polishedbackpainted"    174     else if (newValue == "polishedbackpainted") {
164       fDetector->SetSurfaceFinish(polishedback    175       fDetector->SetSurfaceFinish(polishedbackpainted);
165     }                                             176     }
166     else if (newValue == "ground") {              177     else if (newValue == "ground") {
167       fDetector->SetSurfaceFinish(ground);        178       fDetector->SetSurfaceFinish(ground);
168     }                                             179     }
169     else if (newValue == "groundfrontpainted")    180     else if (newValue == "groundfrontpainted") {
170       fDetector->SetSurfaceFinish(groundfrontp    181       fDetector->SetSurfaceFinish(groundfrontpainted);
171     }                                             182     }
172     else if (newValue == "groundbackpainted")     183     else if (newValue == "groundbackpainted") {
173       fDetector->SetSurfaceFinish(groundbackpa    184       fDetector->SetSurfaceFinish(groundbackpainted);
174     }                                             185     }
175     else if (newValue == "polishedlumirrorair"    186     else if (newValue == "polishedlumirrorair") {
176       fDetector->SetSurfaceFinish(polishedlumi    187       fDetector->SetSurfaceFinish(polishedlumirrorair);
177     }                                             188     }
178     else if (newValue == "polishedlumirrorglue    189     else if (newValue == "polishedlumirrorglue") {
179       fDetector->SetSurfaceFinish(polishedlumi    190       fDetector->SetSurfaceFinish(polishedlumirrorglue);
180     }                                             191     }
181     else if (newValue == "polishedair") {         192     else if (newValue == "polishedair") {
182       fDetector->SetSurfaceFinish(polishedair)    193       fDetector->SetSurfaceFinish(polishedair);
183     }                                             194     }
184     else if (newValue == "polishedteflonair")     195     else if (newValue == "polishedteflonair") {
185       fDetector->SetSurfaceFinish(polishedtefl    196       fDetector->SetSurfaceFinish(polishedteflonair);
186     }                                             197     }
187     else if (newValue == "polishedtioair") {      198     else if (newValue == "polishedtioair") {
188       fDetector->SetSurfaceFinish(polishedtioa    199       fDetector->SetSurfaceFinish(polishedtioair);
189     }                                             200     }
190     else if (newValue == "polishedtyvekair") {    201     else if (newValue == "polishedtyvekair") {
191       fDetector->SetSurfaceFinish(polishedtyve    202       fDetector->SetSurfaceFinish(polishedtyvekair);
192     }                                             203     }
193     else if (newValue == "polishedvm2000air")     204     else if (newValue == "polishedvm2000air") {
194       fDetector->SetSurfaceFinish(polishedvm20    205       fDetector->SetSurfaceFinish(polishedvm2000air);
195     }                                             206     }
196     else if (newValue == "polishedvm2000glue")    207     else if (newValue == "polishedvm2000glue") {
197       fDetector->SetSurfaceFinish(polishedvm20    208       fDetector->SetSurfaceFinish(polishedvm2000glue);
198     }                                             209     }
199     else if (newValue == "etchedlumirrorair")     210     else if (newValue == "etchedlumirrorair") {
200       fDetector->SetSurfaceFinish(etchedlumirr    211       fDetector->SetSurfaceFinish(etchedlumirrorair);
201     }                                             212     }
202     else if (newValue == "etchedlumirrorglue")    213     else if (newValue == "etchedlumirrorglue") {
203       fDetector->SetSurfaceFinish(etchedlumirr    214       fDetector->SetSurfaceFinish(etchedlumirrorglue);
204     }                                             215     }
205     else if (newValue == "etchedair") {           216     else if (newValue == "etchedair") {
206       fDetector->SetSurfaceFinish(etchedair);     217       fDetector->SetSurfaceFinish(etchedair);
207     }                                             218     }
208     else if (newValue == "etchedteflonair") {     219     else if (newValue == "etchedteflonair") {
209       fDetector->SetSurfaceFinish(etchedteflon    220       fDetector->SetSurfaceFinish(etchedteflonair);
210     }                                             221     }
211     else if (newValue == "etchedtioair") {        222     else if (newValue == "etchedtioair") {
212       fDetector->SetSurfaceFinish(etchedtioair    223       fDetector->SetSurfaceFinish(etchedtioair);
213     }                                             224     }
214     else if (newValue == "etchedtyvekair") {      225     else if (newValue == "etchedtyvekair") {
215       fDetector->SetSurfaceFinish(etchedtyveka    226       fDetector->SetSurfaceFinish(etchedtyvekair);
216     }                                             227     }
217     else if (newValue == "etchedvm2000air") {     228     else if (newValue == "etchedvm2000air") {
218       fDetector->SetSurfaceFinish(etchedvm2000    229       fDetector->SetSurfaceFinish(etchedvm2000air);
219     }                                             230     }
220     else if (newValue == "etchedvm2000glue") {    231     else if (newValue == "etchedvm2000glue") {
221       fDetector->SetSurfaceFinish(etchedvm2000    232       fDetector->SetSurfaceFinish(etchedvm2000glue);
222     }                                             233     }
223     else if (newValue == "groundlumirrorair")     234     else if (newValue == "groundlumirrorair") {
224       fDetector->SetSurfaceFinish(groundlumirr    235       fDetector->SetSurfaceFinish(groundlumirrorair);
225     }                                             236     }
226     else if (newValue == "groundlumirrorglue")    237     else if (newValue == "groundlumirrorglue") {
227       fDetector->SetSurfaceFinish(groundlumirr    238       fDetector->SetSurfaceFinish(groundlumirrorglue);
228     }                                             239     }
229     else if (newValue == "groundair") {           240     else if (newValue == "groundair") {
230       fDetector->SetSurfaceFinish(groundair);     241       fDetector->SetSurfaceFinish(groundair);
231     }                                             242     }
232     else if (newValue == "groundteflonair") {     243     else if (newValue == "groundteflonair") {
233       fDetector->SetSurfaceFinish(groundteflon    244       fDetector->SetSurfaceFinish(groundteflonair);
234     }                                             245     }
235     else if (newValue == "groundtioair") {        246     else if (newValue == "groundtioair") {
236       fDetector->SetSurfaceFinish(groundtioair    247       fDetector->SetSurfaceFinish(groundtioair);
237     }                                             248     }
238     else if (newValue == "groundtyvekair") {      249     else if (newValue == "groundtyvekair") {
239       fDetector->SetSurfaceFinish(groundtyveka    250       fDetector->SetSurfaceFinish(groundtyvekair);
240     }                                             251     }
241     else if (newValue == "groundvm2000air") {     252     else if (newValue == "groundvm2000air") {
242       fDetector->SetSurfaceFinish(groundvm2000    253       fDetector->SetSurfaceFinish(groundvm2000air);
243     }                                             254     }
244     else if (newValue == "groundvm2000glue") {    255     else if (newValue == "groundvm2000glue") {
245       fDetector->SetSurfaceFinish(groundvm2000    256       fDetector->SetSurfaceFinish(groundvm2000glue);
246     }                                             257     }
247     //         for Davis model                    258     //         for Davis model
248     else if (newValue == "Rough_LUT") {           259     else if (newValue == "Rough_LUT") {
249       fDetector->SetSurfaceFinish(Rough_LUT);     260       fDetector->SetSurfaceFinish(Rough_LUT);
250     }                                             261     }
251     else if (newValue == "RoughTeflon_LUT") {     262     else if (newValue == "RoughTeflon_LUT") {
252       fDetector->SetSurfaceFinish(RoughTeflon_    263       fDetector->SetSurfaceFinish(RoughTeflon_LUT);
253     }                                             264     }
254     else if (newValue == "RoughESR_LUT") {        265     else if (newValue == "RoughESR_LUT") {
255       fDetector->SetSurfaceFinish(RoughESR_LUT    266       fDetector->SetSurfaceFinish(RoughESR_LUT);
256     }                                             267     }
257     else if (newValue == "RoughESRGrease_LUT")    268     else if (newValue == "RoughESRGrease_LUT") {
258       fDetector->SetSurfaceFinish(RoughESRGrea    269       fDetector->SetSurfaceFinish(RoughESRGrease_LUT);
259     }                                             270     }
260     else if (newValue == "Polished_LUT") {        271     else if (newValue == "Polished_LUT") {
261       fDetector->SetSurfaceFinish(Polished_LUT    272       fDetector->SetSurfaceFinish(Polished_LUT);
262     }                                             273     }
263     else if (newValue == "PolishedTeflon_LUT")    274     else if (newValue == "PolishedTeflon_LUT") {
264       fDetector->SetSurfaceFinish(PolishedTefl    275       fDetector->SetSurfaceFinish(PolishedTeflon_LUT);
265     }                                             276     }
266     else if (newValue == "PolishedESR_LUT") {     277     else if (newValue == "PolishedESR_LUT") {
267       fDetector->SetSurfaceFinish(PolishedESR_    278       fDetector->SetSurfaceFinish(PolishedESR_LUT);
268     }                                             279     }
269     else if (newValue == "PolishedESRGrease_LU    280     else if (newValue == "PolishedESRGrease_LUT") {
270       fDetector->SetSurfaceFinish(PolishedESRG    281       fDetector->SetSurfaceFinish(PolishedESRGrease_LUT);
271     }                                             282     }
272     else if (newValue == "Detector_LUT") {        283     else if (newValue == "Detector_LUT") {
273       fDetector->SetSurfaceFinish(Detector_LUT    284       fDetector->SetSurfaceFinish(Detector_LUT);
274     }                                             285     }
275     else {                                        286     else {
276       G4ExceptionDescription ed;                  287       G4ExceptionDescription ed;
277       ed << "Invalid surface finish: " << newV    288       ed << "Invalid surface finish: " << newValue;
278       G4Exception("DetectorMessenger", "OpNovi << 289       G4Exception("DetectorMessenger", "OpNovice2_003", FatalException,ed);
279     }                                             290     }
280   }                                               291   }
281                                                   292 
282   //  MODEL                                       293   //  MODEL
283   else if (command == fSurfaceModelCmd) {         294   else if (command == fSurfaceModelCmd) {
284     if (newValue == "glisur") {                   295     if (newValue == "glisur") {
285       fDetector->SetSurfaceModel(glisur);         296       fDetector->SetSurfaceModel(glisur);
286     }                                             297     }
287     else if (newValue == "unified") {             298     else if (newValue == "unified") {
288       fDetector->SetSurfaceModel(unified);        299       fDetector->SetSurfaceModel(unified);
289     }                                             300     }
290     else if (newValue == "LUT") {                 301     else if (newValue == "LUT") {
291       fDetector->SetSurfaceModel(LUT);            302       fDetector->SetSurfaceModel(LUT);
292     }                                             303     }
293     else if (newValue == "DAVIS") {               304     else if (newValue == "DAVIS") {
294       fDetector->SetSurfaceModel(DAVIS);          305       fDetector->SetSurfaceModel(DAVIS);
295     }                                             306     }
296     else if (newValue == "dichroic") {            307     else if (newValue == "dichroic") {
297       fDetector->SetSurfaceModel(dichroic);       308       fDetector->SetSurfaceModel(dichroic);
298     }                                             309     }
299     else {                                        310     else {
300       G4ExceptionDescription ed;                  311       G4ExceptionDescription ed;
301       ed << "Invalid surface model: " << newVa    312       ed << "Invalid surface model: " << newValue;
302       G4Exception("DetectorMessenger", "ONovic << 313       G4Exception("DetectorMessenger", "ONovice2_001",
                                                   >> 314                   FatalException,ed);
303     }                                             315     }
304   }                                               316   }
305                                                   317 
306   // TYPE                                         318   // TYPE
307   else if (command == fSurfaceTypeCmd) {          319   else if (command == fSurfaceTypeCmd) {
308     if (newValue == "dielectric_metal") {         320     if (newValue == "dielectric_metal") {
309       fDetector->SetSurfaceType(dielectric_met    321       fDetector->SetSurfaceType(dielectric_metal);
310     }                                             322     }
311     else if (newValue == "dielectric_dielectri    323     else if (newValue == "dielectric_dielectric") {
312       fDetector->SetSurfaceType(dielectric_die    324       fDetector->SetSurfaceType(dielectric_dielectric);
313     }                                             325     }
314     else if (newValue == "dielectric_LUT") {      326     else if (newValue == "dielectric_LUT") {
315       fDetector->SetSurfaceType(dielectric_LUT    327       fDetector->SetSurfaceType(dielectric_LUT);
316     }                                             328     }
317     else if (newValue == "dielectric_LUTDAVIS"    329     else if (newValue == "dielectric_LUTDAVIS") {
318       fDetector->SetSurfaceType(dielectric_LUT    330       fDetector->SetSurfaceType(dielectric_LUTDAVIS);
319     }                                             331     }
320     else if (newValue == "coated") {           << 
321       fDetector->SetSurfaceType(coated);       << 
322     }                                          << 
323     else {                                        332     else {
324       G4ExceptionDescription ed;                  333       G4ExceptionDescription ed;
325       ed << "Invalid surface type: " << newVal    334       ed << "Invalid surface type: " << newValue;
326       G4Exception("DetectorMessenger", "OpNovi << 335       G4Exception("DetectorMessenger", "OpNovice2_002", FatalException,ed);
327     }                                             336     }
328   }                                               337   }
329   else if (command == fSurfaceSigmaAlphaCmd) {    338   else if (command == fSurfaceSigmaAlphaCmd) {
330     fDetector->SetSurfaceSigmaAlpha(G4UIcmdWit << 339     fDetector->SetSurfaceSigmaAlpha(
                                                   >> 340       G4UIcmdWithADouble::GetNewDoubleValue(newValue));
331   }                                               341   }
332   else if (command == fSurfacePolishCmd) {        342   else if (command == fSurfacePolishCmd) {
333     fDetector->SetSurfacePolish(G4UIcmdWithADo << 343     fDetector->SetSurfacePolish(
                                                   >> 344       G4UIcmdWithADouble::GetNewDoubleValue(newValue));
334   }                                               345   }
335   else if (command == fTankMatPropVectorCmd) {    346   else if (command == fTankMatPropVectorCmd) {
336     // got a string. need to convert it to phy    347     // got a string. need to convert it to physics vector.
337     // string format is property name, then pa    348     // string format is property name, then pairs of energy, value
338     // specify units for each value, eg 3.0*eV    349     // specify units for each value, eg 3.0*eV
339     // space delimited                            350     // space delimited
340     auto mpv = new G4MaterialPropertyVector(); << 351     G4MaterialPropertyVector* mpv = new G4MaterialPropertyVector();
341     std::istringstream instring(newValue);        352     std::istringstream instring(newValue);
342     G4String prop;                                353     G4String prop;
343     instring >> prop;                             354     instring >> prop;
344     while (instring) {                            355     while (instring) {
345       G4String tmp;                               356       G4String tmp;
346       instring >> tmp;                            357       instring >> tmp;
347       if (tmp == "") {                         << 358       if (tmp == "") { break; }
348         break;                                 << 
349       }                                        << 
350       G4double en = G4UIcommand::ConvertToDoub    359       G4double en = G4UIcommand::ConvertToDouble(tmp);
351       instring >> tmp;                            360       instring >> tmp;
352       G4double val = G4UIcommand::ConvertToDou << 361       G4double val;
                                                   >> 362       val = G4UIcommand::ConvertToDouble(tmp);
353       mpv->InsertValues(en, val);                 363       mpv->InsertValues(en, val);
354     }                                             364     }
                                                   >> 365     const char* c = prop.c_str();
355                                                   366 
356     fDetector->AddTankMPV(prop, mpv);          << 367     fDetector->AddTankMPV(c, mpv);
357   }                                               368   }
358   else if (command == fWorldMatPropVectorCmd)     369   else if (command == fWorldMatPropVectorCmd) {
359     // Convert string to physics vector           370     // Convert string to physics vector
360     // string format is property name, then pa    371     // string format is property name, then pairs of energy, value
361     auto mpv = new G4MaterialPropertyVector(); << 372     G4MaterialPropertyVector* mpv = new G4MaterialPropertyVector();
362     std::istringstream instring(newValue);        373     std::istringstream instring(newValue);
363     G4String prop;                                374     G4String prop;
364     instring >> prop;                             375     instring >> prop;
365     while (instring) {                            376     while (instring) {
366       G4String tmp;                               377       G4String tmp;
367       instring >> tmp;                            378       instring >> tmp;
368       if (tmp == "") {                         << 379       if (tmp == "") { break; }
369         break;                                 << 
370       }                                        << 
371       G4double en = G4UIcommand::ConvertToDoub    380       G4double en = G4UIcommand::ConvertToDouble(tmp);
372       instring >> tmp;                            381       instring >> tmp;
373       G4double val = G4UIcommand::ConvertToDou << 382       G4double val;
                                                   >> 383       val = G4UIcommand::ConvertToDouble(tmp);
374       mpv->InsertValues(en, val);                 384       mpv->InsertValues(en, val);
375     }                                          << 385     } 
376     fDetector->AddWorldMPV(prop, mpv);         << 386     const char* c = prop.c_str();
                                                   >> 387     fDetector->AddWorldMPV(c, mpv);
377   }                                               388   }
378   else if (command == fSurfaceMatPropVectorCmd    389   else if (command == fSurfaceMatPropVectorCmd) {
379     // Convert string to physics vector           390     // Convert string to physics vector
380     // string format is property name, then pa << 391     // string format is property name, then pairs of energy, value  
381     // space delimited                            392     // space delimited
382     auto mpv = new G4MaterialPropertyVector(); << 393     G4MaterialPropertyVector* mpv = new G4MaterialPropertyVector();
383     G4cout << newValue << G4endl;                 394     G4cout << newValue << G4endl;
384     std::istringstream instring(newValue);        395     std::istringstream instring(newValue);
385     G4String prop;                                396     G4String prop;
386     instring >> prop;                             397     instring >> prop;
387     while (instring) {                            398     while (instring) {
388       G4String tmp;                               399       G4String tmp;
389       instring >> tmp;                            400       instring >> tmp;
390       if (tmp == "") {                         << 401       if (tmp == "") { break; }
391         break;                                 << 
392       }                                        << 
393       G4double en = G4UIcommand::ConvertToDoub    402       G4double en = G4UIcommand::ConvertToDouble(tmp);
394       instring >> tmp;                            403       instring >> tmp;
395       G4double val = G4UIcommand::ConvertToDou << 404       G4double val;
                                                   >> 405       val = G4UIcommand::ConvertToDouble(tmp);
396       mpv->InsertValues(en, val);                 406       mpv->InsertValues(en, val);
397     }                                          << 407     } 
398     fDetector->AddSurfaceMPV(prop, mpv);       << 408     const char* c = prop.c_str();
                                                   >> 409     fDetector->AddSurfaceMPV(c, mpv);
399   }                                               410   }
400                                                   411 
401   else if (command == fTankMatPropConstCmd) {     412   else if (command == fTankMatPropConstCmd) {
402     // Convert string to physics vector           413     // Convert string to physics vector
403     // string format is property name, then va    414     // string format is property name, then value
404     // space delimited                            415     // space delimited
405     std::istringstream instring(newValue);        416     std::istringstream instring(newValue);
406     G4String prop;                                417     G4String prop;
407     G4String tmp;                                 418     G4String tmp;
408     instring >> prop;                             419     instring >> prop;
409     instring >> tmp;                              420     instring >> tmp;
410     G4double val = G4UIcommand::ConvertToDoubl    421     G4double val = G4UIcommand::ConvertToDouble(tmp);
411     fDetector->AddTankMPC(prop, val);          << 422     const char* c = prop.c_str();
                                                   >> 423     fDetector->AddTankMPC(c, val);
412   }                                               424   }
413   else if (command == fWorldMatPropConstCmd) {    425   else if (command == fWorldMatPropConstCmd) {
414     // Convert string to physics vector           426     // Convert string to physics vector
415     // string format is property name, then va    427     // string format is property name, then value
416     // space delimited                            428     // space delimited
417     std::istringstream instring(newValue);        429     std::istringstream instring(newValue);
418     G4String prop;                                430     G4String prop;
419     G4String tmp;                                 431     G4String tmp;
420     instring >> prop;                             432     instring >> prop;
421     instring >> tmp;                              433     instring >> tmp;
422     G4double val = G4UIcommand::ConvertToDoubl    434     G4double val = G4UIcommand::ConvertToDouble(tmp);
423     fDetector->AddWorldMPC(prop, val);         << 435     const char* c = prop.c_str();
                                                   >> 436     fDetector->AddTankMPC(c, val);
424   }                                               437   }
425   else if (command == fSurfaceMatPropConstCmd)    438   else if (command == fSurfaceMatPropConstCmd) {
426     // Convert string to physics vector           439     // Convert string to physics vector
427     // string format is property name, then va    440     // string format is property name, then value
428     // space delimited                            441     // space delimited
429     std::istringstream instring(newValue);        442     std::istringstream instring(newValue);
430     G4String prop;                                443     G4String prop;
431     G4String tmp;                                 444     G4String tmp;
432     instring >> prop;                             445     instring >> prop;
433     instring >> tmp;                              446     instring >> tmp;
434     G4double val = G4UIcommand::ConvertToDoubl    447     G4double val = G4UIcommand::ConvertToDouble(tmp);
435     fDetector->AddSurfaceMPC(prop, val);       << 448     const char* c = prop.c_str();
                                                   >> 449     fDetector->AddSurfaceMPC(c, val);
436   }                                               450   }
437   else if (command == fWorldMaterialCmd) {     << 451  else if (command == fWorldMaterialCmd) {
438     fDetector->SetWorldMaterial(newValue);        452     fDetector->SetWorldMaterial(newValue);
439   }                                               453   }
440   else if (command == fTankMaterialCmd) {         454   else if (command == fTankMaterialCmd) {
441     fDetector->SetTankMaterial(newValue);         455     fDetector->SetTankMaterial(newValue);
442   }                                               456   }
443 }                                                 457 }
444                                                   458 
445 //....oooOO0OOooo........oooOO0OOooo........oo    459 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
446                                                   460