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 | #include "LXeEventMessenger.hh" |
---|
27 | #include "LXeEventAction.hh" |
---|
28 | |
---|
29 | #include "G4UIcmdWithABool.hh" |
---|
30 | #include "G4UIcmdWithAnInteger.hh" |
---|
31 | |
---|
32 | //_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ |
---|
33 | LXeEventMessenger::LXeEventMessenger(LXeEventAction* event) |
---|
34 | :LXeEvent(event) |
---|
35 | { |
---|
36 | saveThresholdCmd = new G4UIcmdWithAnInteger("/LXe/saveThreshold",this); |
---|
37 | saveThresholdCmd->SetGuidance("Set the photon count threshold for saving the random number seed for an event."); |
---|
38 | saveThresholdCmd->SetParameterName("photons",true); |
---|
39 | saveThresholdCmd->SetDefaultValue(4500); |
---|
40 | saveThresholdCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
41 | |
---|
42 | verboseCmd = new G4UIcmdWithAnInteger("/LXe/eventVerbose",this); |
---|
43 | verboseCmd->SetGuidance("Set the verbosity of event data."); |
---|
44 | verboseCmd->SetParameterName("verbose",true); |
---|
45 | verboseCmd->SetDefaultValue(1); |
---|
46 | |
---|
47 | pmtThresholdCmd = new G4UIcmdWithAnInteger("/LXe/pmtThreshold",this); |
---|
48 | pmtThresholdCmd->SetGuidance("Set the pmtThreshold (in # of photons)"); |
---|
49 | |
---|
50 | forceDrawPhotonsCmd=new G4UIcmdWithABool("/LXe/forceDrawPhotons",this); |
---|
51 | forceDrawPhotonsCmd->SetGuidance("Force drawing of photons."); |
---|
52 | forceDrawPhotonsCmd |
---|
53 | ->SetGuidance("(Higher priority than /LXe/forceDrawNoPhotons)"); |
---|
54 | |
---|
55 | forceDrawNoPhotonsCmd=new G4UIcmdWithABool("/LXe/forceDrawNoPhotons",this); |
---|
56 | forceDrawNoPhotonsCmd->SetGuidance("Force no drawing of photons."); |
---|
57 | forceDrawNoPhotonsCmd |
---|
58 | ->SetGuidance("(Lower priority than /LXe/forceDrawPhotons)"); |
---|
59 | } |
---|
60 | |
---|
61 | //_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ |
---|
62 | LXeEventMessenger::~LXeEventMessenger(){ |
---|
63 | delete saveThresholdCmd; |
---|
64 | delete verboseCmd; |
---|
65 | delete pmtThresholdCmd; |
---|
66 | delete forceDrawPhotonsCmd; |
---|
67 | delete forceDrawNoPhotonsCmd; |
---|
68 | } |
---|
69 | |
---|
70 | //_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ |
---|
71 | void LXeEventMessenger::SetNewValue(G4UIcommand* command, G4String newValue){ |
---|
72 | if( command == saveThresholdCmd ){ |
---|
73 | LXeEvent->SetSaveThreshold(saveThresholdCmd->GetNewIntValue(newValue)); |
---|
74 | } |
---|
75 | else if( command == verboseCmd ){ |
---|
76 | LXeEvent->SetEventVerbose(verboseCmd->GetNewIntValue(newValue)); |
---|
77 | } |
---|
78 | else if( command == pmtThresholdCmd ){ |
---|
79 | LXeEvent->SetPMTThreshold(pmtThresholdCmd->GetNewIntValue(newValue)); |
---|
80 | } |
---|
81 | else if(command == forceDrawPhotonsCmd){ |
---|
82 | LXeEvent->SetForceDrawPhotons(forceDrawPhotonsCmd |
---|
83 | ->GetNewBoolValue(newValue)); |
---|
84 | } |
---|
85 | else if(command == forceDrawNoPhotonsCmd){ |
---|
86 | LXeEvent->SetForceDrawNoPhotons(forceDrawNoPhotonsCmd |
---|
87 | ->GetNewBoolValue(newValue)); |
---|
88 | G4cout<<"TEST"<<G4endl; |
---|
89 | } |
---|
90 | } |
---|
91 | |
---|
92 | |
---|
93 | |
---|
94 | |
---|
95 | |
---|