| 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of *
|
|---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and *
|
|---|
| 7 | // * conditions of the Geant4 Software License, included in the file *
|
|---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These *
|
|---|
| 9 | // * include a list of copyright holders. *
|
|---|
| 10 | // * *
|
|---|
| 11 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 12 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 13 | // * work make any representation or warranty, express or implied, *
|
|---|
| 14 | // * regarding this software system or assume any liability for its *
|
|---|
| 15 | // * use. Please see the license in the file LICENSE and URL above *
|
|---|
| 16 | // * for the full disclaimer and the limitation of liability. *
|
|---|
| 17 | // * *
|
|---|
| 18 | // * This code implementation is the result of the scientific and *
|
|---|
| 19 | // * technical work of the GEANT4 collaboration. *
|
|---|
| 20 | // * By using, copying, modifying or distributing the software (or *
|
|---|
| 21 | // * any work based on the software) you agree to acknowledge its *
|
|---|
| 22 | // * use in resulting scientific publications, and indicate your *
|
|---|
| 23 | // * acceptance of all terms of the Geant4 Software license. *
|
|---|
| 24 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | //
|
|---|
| 27 | // FredTest3Messenger.hh
|
|---|
| 28 | //
|
|---|
| 29 | // Definition of the messenger for controlling test 3
|
|---|
| 30 | //
|
|---|
| 31 | #ifndef FredTest3Messenger_hh
|
|---|
| 32 | #define FredTest3Messenger_hh
|
|---|
| 33 |
|
|---|
| 34 | #include "G4UImessenger.hh"
|
|---|
| 35 | #include "globals.hh"
|
|---|
| 36 | #include <fstream>
|
|---|
| 37 |
|
|---|
| 38 | class FredTest3;
|
|---|
| 39 | class G4VSolid;
|
|---|
| 40 |
|
|---|
| 41 | class G4UIdirectory;
|
|---|
| 42 | class G4UIcommand;
|
|---|
| 43 | class G4UIcmdWith3VectorAndUnit;
|
|---|
| 44 | class G4UIcmdWithAnInteger;
|
|---|
| 45 | class G4UIcmdWithAString;
|
|---|
| 46 | class G4UIcmdWithoutParameter;
|
|---|
| 47 |
|
|---|
| 48 | class FredTest3Messenger : public G4UImessenger
|
|---|
| 49 | {
|
|---|
| 50 | public:
|
|---|
| 51 | FredTest3Messenger();
|
|---|
| 52 | ~FredTest3Messenger();
|
|---|
| 53 |
|
|---|
| 54 | void SetNewValue( G4UIcommand *command, G4String newValues );
|
|---|
| 55 | G4String GetCurrentValue( G4UIcommand *command );
|
|---|
| 56 |
|
|---|
| 57 | inline void SetTestVolume( const G4VSolid *newTestVolume ) { testVolume = newTestVolume; }
|
|---|
| 58 | inline const G4VSolid *GetTestVolume() const { return testVolume; }
|
|---|
| 59 |
|
|---|
| 60 | protected:
|
|---|
| 61 | class Debugger {
|
|---|
| 62 | public:
|
|---|
| 63 | Debugger( const G4VSolid *aVolume, const FredTest3 *aTester )
|
|---|
| 64 | { testVolume = aVolume; tester = aTester; }
|
|---|
| 65 | virtual ~Debugger() {;}
|
|---|
| 66 |
|
|---|
| 67 | virtual G4int DebugMe( std::ifstream &logFile, const G4int errorIndex ) = 0;
|
|---|
| 68 |
|
|---|
| 69 | protected:
|
|---|
| 70 | const G4VSolid *testVolume;
|
|---|
| 71 | const FredTest3 *tester;
|
|---|
| 72 | };
|
|---|
| 73 |
|
|---|
| 74 | class DebugError : public FredTest3Messenger::Debugger {
|
|---|
| 75 | public:
|
|---|
| 76 | DebugError( const G4VSolid *aVolume, const FredTest3 *aTester ) : Debugger(aVolume,aTester) {;}
|
|---|
| 77 | G4int DebugMe( std::ifstream &logFile, const G4int errorIndex );
|
|---|
| 78 | };
|
|---|
| 79 | class DebugInside : public FredTest3Messenger::Debugger {
|
|---|
| 80 | public:
|
|---|
| 81 | DebugInside( const G4VSolid *aVolume, const FredTest3 *aTester ) : Debugger(aVolume,aTester) {;}
|
|---|
| 82 | G4int DebugMe( std::ifstream &logFile, const G4int errorIndex );
|
|---|
| 83 | };
|
|---|
| 84 | class DebugToInP : public FredTest3Messenger::Debugger {
|
|---|
| 85 | public:
|
|---|
| 86 | DebugToInP( const G4VSolid *aVolume, const FredTest3 *aTester ) : Debugger(aVolume,aTester) {;}
|
|---|
| 87 | G4int DebugMe( std::ifstream &logFile, const G4int errorIndex );
|
|---|
| 88 | };
|
|---|
| 89 | class DebugToInPV : public FredTest3Messenger::Debugger {
|
|---|
| 90 | public:
|
|---|
| 91 | DebugToInPV( const G4VSolid *aVolume, const FredTest3 *aTester ) : Debugger(aVolume,aTester) {;}
|
|---|
| 92 | G4int DebugMe( std::ifstream &logFile, const G4int errorIndex );
|
|---|
| 93 | };
|
|---|
| 94 | class DebugToOutP : public FredTest3Messenger::Debugger {
|
|---|
| 95 | public:
|
|---|
| 96 | DebugToOutP( const G4VSolid *aVolume, const FredTest3 *aTester ) : Debugger(aVolume,aTester) {;}
|
|---|
| 97 | G4int DebugMe( std::ifstream &logFile, const G4int errorIndex );
|
|---|
| 98 | };
|
|---|
| 99 | class DebugToOutPV : public FredTest3Messenger::Debugger {
|
|---|
| 100 | public:
|
|---|
| 101 | DebugToOutPV( const G4VSolid *aVolume, const FredTest3 *aTester ) : Debugger(aVolume,aTester) {;}
|
|---|
| 102 | G4int DebugMe( std::ifstream &logFile, const G4int errorIndex );
|
|---|
| 103 | };
|
|---|
| 104 |
|
|---|
| 105 | void InvokeTest3();
|
|---|
| 106 | void InvokeRunDebug();
|
|---|
| 107 | void Debug( const G4int errorIndex, FredTest3Messenger::Debugger *debugger );
|
|---|
| 108 |
|
|---|
| 109 | private:
|
|---|
| 110 | FredTest3 *tester;
|
|---|
| 111 | const G4VSolid *testVolume;
|
|---|
| 112 |
|
|---|
| 113 | G4String errorFile;
|
|---|
| 114 |
|
|---|
| 115 | G4UIdirectory *test3Directory;
|
|---|
| 116 | G4UIcmdWith3VectorAndUnit *targetCmd;
|
|---|
| 117 | G4UIcmdWith3VectorAndUnit *widthsCmd;
|
|---|
| 118 | G4UIcmdWith3VectorAndUnit *gridSizesCmd;
|
|---|
| 119 | G4UIcmdWithAnInteger *maxPointsCmd;
|
|---|
| 120 | G4UIcmdWithAnInteger *maxErrorsCmd;
|
|---|
| 121 | G4UIcmdWithAString *errorFileCmd;
|
|---|
| 122 | G4UIcmdWithoutParameter *runCmd;
|
|---|
| 123 | G4UIcmdWithoutParameter *runDebugCmd;
|
|---|
| 124 | G4UIcmdWithAnInteger *debugCmd;
|
|---|
| 125 | G4UIcmdWithAnInteger *debugInsideCmd;
|
|---|
| 126 | G4UIcmdWithAnInteger *debugToInPCmd;
|
|---|
| 127 | G4UIcmdWithAnInteger *debugToInPVCmd;
|
|---|
| 128 | G4UIcmdWithAnInteger *debugToOutPCmd;
|
|---|
| 129 | G4UIcmdWithAnInteger *debugToOutPVCmd;
|
|---|
| 130 | };
|
|---|
| 131 |
|
|---|
| 132 | #endif
|
|---|