Geant4-11
source
analysis
hntools
src
G4ToolsAnalysisMessenger.cc
Go to the documentation of this file.
1
//
2
// ********************************************************************
3
// * License and Disclaimer *
4
// * *
5
// * The Geant4 software is copyright of the Copyright Holders of *
6
// * the Geant4 Collaboration. It is provided under the terms and *
7
// * conditions of the Geant4 Software License, included in the file *
8
// * LICENSE and available at http://cern.ch/geant4/license . These *
9
// * include a list of copyright holders. *
10
// * *
11
// * Neither the authors of this software system, nor their employing *
12
// * institutes,nor the agencies providing financial support for this *
13
// * work make any representation or warranty, express or implied, *
14
// * regarding this software system or assume any liability for its *
15
// * use. Please see the license in the file LICENSE and URL above *
16
// * for the full disclaimer and the limitation of liability. *
17
// * *
18
// * This code implementation is the result of the scientific and *
19
// * technical work of the GEANT4 collaboration. *
20
// * By using, copying, modifying or distributing the software (or *
21
// * any work based on the software) you agree to acknowledge its *
22
// * use in resulting scientific publications, and indicate your *
23
// * acceptance of all terms of the Geant4 Software license. *
24
// ********************************************************************
25
//
26
27
// Author: Ivana Hrivnacova, 29/10/2021 (ivana@ipno.in2p3.fr)
28
29
#include "
G4ToolsAnalysisMessenger.hh
"
30
#include "
G4ToolsAnalysisManager.hh
"
31
#include "
G4AnalysisUtilities.hh
"
32
#include "
G4AnalysisMessengerHelper.hh
"
33
34
#include "
G4UIcommand.hh
"
35
#include "
G4UIparameter.hh
"
36
37
using namespace
G4Analysis
;
38
39
//_____________________________________________________________________________
40
G4ToolsAnalysisMessenger::G4ToolsAnalysisMessenger
(
G4ToolsAnalysisManager
* manager)
41
:
G4UImessenger
(),
42
fManager(manager)
43
{
44
// Create get commands
45
G4AnalysisMessengerHelper
helper(
"h1"
);
46
fGetH1Cmd
= helper.
CreateGetCommand
(
this
);
47
48
helper.
SetHnType
(
"h2"
);
49
fGetH2Cmd
= helper.
CreateGetCommand
(
this
);
50
51
helper.
SetHnType
(
"h3"
);
52
fGetH3Cmd
= helper.
CreateGetCommand
(
this
);
53
54
helper.
SetHnType
(
"p1"
);
55
fGetP1Cmd
= helper.
CreateGetCommand
(
this
);
56
57
helper.
SetHnType
(
"p2"
);
58
fGetP2Cmd
= helper.
CreateGetCommand
(
this
);
59
}
60
61
//_____________________________________________________________________________
62
G4ToolsAnalysisMessenger::~G4ToolsAnalysisMessenger
() =
default
;
63
65
// public functions
66
//
67
68
//_____________________________________________________________________________
69
G4String
G4ToolsAnalysisMessenger::GetCurrentValue
(
G4UIcommand
* command)
70
{
71
if
( command ==
fGetH1Cmd
.get() )
return
fH1Value
;
72
if
( command ==
fGetH2Cmd
.get() )
return
fH2Value
;
73
if
( command ==
fGetH3Cmd
.get() )
return
fH3Value
;
74
if
( command ==
fGetP1Cmd
.get() )
return
fP1Value
;
75
if
( command ==
fGetP2Cmd
.get() )
return
fP2Value
;
76
return
""
;
77
}
78
79
//_____________________________________________________________________________
80
void
G4ToolsAnalysisMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
value)
81
{
82
auto
id
=
G4UIcommand::ConvertToInt
(value);
83
if
( command ==
fGetH1Cmd
.get() ) {
84
fH1Value
=
GetHnAddress
(
id
,
fManager
->
fH1Manager
);
85
}
86
else
if
( command ==
fGetH2Cmd
.get() ) {
87
fH2Value
=
GetHnAddress
(
id
,
fManager
->
fH2Manager
);
88
}
89
else
if
( command ==
fGetH3Cmd
.get() ) {
90
fH3Value
=
GetHnAddress
(
id
,
fManager
->
fH3Manager
);
91
}
92
else
if
( command ==
fGetP1Cmd
.get() ) {
93
fP1Value
=
GetHnAddress
(
id
,
fManager
->
fP1Manager
);
94
}
95
else
if
( command ==
fGetP2Cmd
.get() ) {
96
fP2Value
=
GetHnAddress
(
id
,
fManager
->
fP2Manager
);
97
}
98
}
G4AnalysisMessengerHelper.hh
G4AnalysisUtilities.hh
G4ToolsAnalysisManager.hh
G4ToolsAnalysisMessenger.hh
G4UIcommand.hh
G4UIparameter.hh
G4AnalysisMessengerHelper
Definition:
G4AnalysisMessengerHelper.hh:46
G4AnalysisMessengerHelper::SetHnType
void SetHnType(const G4String &hnType)
Definition:
G4AnalysisMessengerHelper.hh:119
G4AnalysisMessengerHelper::CreateGetCommand
std::unique_ptr< G4UIcommand > CreateGetCommand(G4UImessenger *messenger) const
Definition:
G4AnalysisMessengerHelper.cc:135
G4String
Definition:
G4String.hh:62
G4ToolsAnalysisManager
Definition:
G4ToolsAnalysisManager.hh:59
G4ToolsAnalysisManager::fH3Manager
G4H3ToolsManager * fH3Manager
Definition:
G4ToolsAnalysisManager.hh:129
G4ToolsAnalysisManager::fP2Manager
G4P2ToolsManager * fP2Manager
Definition:
G4ToolsAnalysisManager.hh:131
G4ToolsAnalysisManager::fH2Manager
G4H2ToolsManager * fH2Manager
Definition:
G4ToolsAnalysisManager.hh:128
G4ToolsAnalysisManager::fP1Manager
G4P1ToolsManager * fP1Manager
Definition:
G4ToolsAnalysisManager.hh:130
G4ToolsAnalysisManager::fH1Manager
G4H1ToolsManager * fH1Manager
Definition:
G4ToolsAnalysisManager.hh:127
G4ToolsAnalysisMessenger::fP2Value
G4String fP2Value
Definition:
G4ToolsAnalysisMessenger.hh:69
G4ToolsAnalysisMessenger::fGetH1Cmd
std::unique_ptr< G4UIcommand > fGetH1Cmd
Definition:
G4ToolsAnalysisMessenger.hh:60
G4ToolsAnalysisMessenger::fH1Value
G4String fH1Value
Definition:
G4ToolsAnalysisMessenger.hh:65
G4ToolsAnalysisMessenger::GetHnAddress
G4String GetHnAddress(G4int id, G4THnManager< HT > *htManager) const
Definition:
G4ToolsAnalysisMessenger.hh:76
G4ToolsAnalysisMessenger::GetCurrentValue
G4String GetCurrentValue(G4UIcommand *command)
Definition:
G4ToolsAnalysisMessenger.cc:69
G4ToolsAnalysisMessenger::~G4ToolsAnalysisMessenger
virtual ~G4ToolsAnalysisMessenger()
G4ToolsAnalysisMessenger::fGetP2Cmd
std::unique_ptr< G4UIcommand > fGetP2Cmd
Definition:
G4ToolsAnalysisMessenger.hh:64
G4ToolsAnalysisMessenger::fGetH2Cmd
std::unique_ptr< G4UIcommand > fGetH2Cmd
Definition:
G4ToolsAnalysisMessenger.hh:61
G4ToolsAnalysisMessenger::fGetP1Cmd
std::unique_ptr< G4UIcommand > fGetP1Cmd
Definition:
G4ToolsAnalysisMessenger.hh:63
G4ToolsAnalysisMessenger::SetNewValue
virtual void SetNewValue(G4UIcommand *command, G4String value) final
Definition:
G4ToolsAnalysisMessenger.cc:80
G4ToolsAnalysisMessenger::fH3Value
G4String fH3Value
Definition:
G4ToolsAnalysisMessenger.hh:67
G4ToolsAnalysisMessenger::fP1Value
G4String fP1Value
Definition:
G4ToolsAnalysisMessenger.hh:68
G4ToolsAnalysisMessenger::fGetH3Cmd
std::unique_ptr< G4UIcommand > fGetH3Cmd
Definition:
G4ToolsAnalysisMessenger.hh:62
G4ToolsAnalysisMessenger::G4ToolsAnalysisMessenger
G4ToolsAnalysisMessenger(G4ToolsAnalysisManager *manager)
Definition:
G4ToolsAnalysisMessenger.cc:40
G4ToolsAnalysisMessenger::fManager
G4ToolsAnalysisManager * fManager
Associated class.
Definition:
G4ToolsAnalysisMessenger.hh:59
G4ToolsAnalysisMessenger::fH2Value
G4String fH2Value
Definition:
G4ToolsAnalysisMessenger.hh:66
G4UIcommand
Definition:
G4UIcommand.hh:52
G4UIcommand::ConvertToInt
static G4int ConvertToInt(const char *st)
Definition:
G4UIcommand.cc:557
G4UImessenger
Definition:
G4UImessenger.hh:47
G4Analysis
Definition:
G4BaseHistoUtilities.hh:39
Generated by
1.9.3