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