ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
HistoManagerMessenger.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file HistoManagerMessenger.cc
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
//
28
//
29
//
30
//
31
//
33
//
34
// HistoManagerMessenger
35
//
36
// Created: 20.06.08 V.Ivanchenko
37
//
38
// Modified:
39
//
41
//
42
43
#include "
HistoManagerMessenger.hh
"
44
45
#include "HistoManager.hh"
46
#include "
G4UIdirectory.hh
"
47
#include "
G4UIcmdWithABool.hh
"
48
#include "
G4UIcmdWithAString.hh
"
49
#include "
G4UIcmdWithAnInteger.hh
"
50
#include "
G4UIcmdWith3Vector.hh
"
51
#include "
G4UIcmdWithADoubleAndUnit.hh
"
52
#include "
G4UIcmdWithoutParameter.hh
"
53
#include "HistoManager.hh"
54
55
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56
57
HistoManagerMessenger::HistoManagerMessenger
(
HistoManager
*
p
)
58
:
G4UImessenger
(), fHisto(p)
59
{
60
fbinCmd
=
new
G4UIcmdWithAnInteger
(
"/testhadr/nBinsE"
,
this
);
61
fbinCmd
->
SetGuidance
(
"Set number of bins for energy"
);
62
fbinCmd
->
SetParameterName
(
"NEbins"
,
false
);
63
fbinCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
64
65
fnOfAbsCmd
=
new
G4UIcmdWithAnInteger
(
"/testhadr/nBinsP"
,
this
);
66
fnOfAbsCmd
->
SetGuidance
(
"Set number of bins for momentum"
);
67
fnOfAbsCmd
->
SetParameterName
(
"NPbins"
,
false
);
68
fnOfAbsCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
69
70
fpartCmd
=
new
G4UIcmdWithAString
(
"/testhadr/particle"
,
this
);
71
fpartCmd
->
SetGuidance
(
"Set particle name"
);
72
fpartCmd
->
SetParameterName
(
"Particle"
,
false
);
73
fpartCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
74
75
fcsCmd
=
new
G4UIcmdWithAString
(
"/testhadr/targetElm"
,
this
);
76
fcsCmd
->
SetGuidance
(
"Set element name"
);
77
fcsCmd
->
SetParameterName
(
"Elm"
,
false
);
78
fcsCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
79
80
fe1Cmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/testhadr/minEnergy"
,
this
);
81
fe1Cmd
->
SetGuidance
(
"Set min kinetic energy"
);
82
fe1Cmd
->
SetParameterName
(
"eMin"
,
false
);
83
fe1Cmd
->
SetUnitCategory
(
"Energy"
);
84
fe1Cmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
85
86
fe2Cmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/testhadr/maxEnergy"
,
this
);
87
fe2Cmd
->
SetGuidance
(
"Set max kinetic energy"
);
88
fe2Cmd
->
SetParameterName
(
"eMax"
,
false
);
89
fe2Cmd
->
SetUnitCategory
(
"Energy"
);
90
fe2Cmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
91
92
fp1Cmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/testhadr/minMomentum"
,
this
);
93
fp1Cmd
->
SetGuidance
(
"Set min momentum"
);
94
fp1Cmd
->
SetParameterName
(
"pMin"
,
false
);
95
fp1Cmd
->
SetUnitCategory
(
"Energy"
);
96
fp1Cmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
97
98
fp2Cmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/testhadr/maxMomentum"
,
this
);
99
fp2Cmd
->
SetGuidance
(
"Set max momentum"
);
100
fp2Cmd
->
SetParameterName
(
"pMax"
,
false
);
101
fp2Cmd
->
SetUnitCategory
(
"Energy"
);
102
fp2Cmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
103
104
fverbCmd
=
new
G4UIcmdWithAnInteger
(
"/testhadr/verbose"
,
this
);
105
fverbCmd
->
SetGuidance
(
"Set verbose for "
);
106
fverbCmd
->
SetParameterName
(
"verb"
,
false
);
107
fverbCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
108
109
fFCmd
=
new
G4UIcmdWithAString
(
"/testhadr/fileName"
,
this
);
110
fFCmd
->
SetGuidance
(
"set name for the histograms file"
);
111
}
112
113
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
114
115
HistoManagerMessenger::~HistoManagerMessenger
()
116
{
117
delete
fnOfAbsCmd
;
118
delete
fpartCmd
;
119
delete
fcsCmd
;
120
delete
fe1Cmd
;
121
delete
fe2Cmd
;
122
delete
fp1Cmd
;
123
delete
fp2Cmd
;
124
delete
fverbCmd
;
125
delete
fFCmd
;
126
}
127
128
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
129
130
void
HistoManagerMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
newValue)
131
{
132
if
( command ==
fbinCmd
) {
133
fHisto
->
SetNumberOfBinsE
(
fbinCmd
->
GetNewIntValue
(newValue));
134
}
else
if
( command ==
fnOfAbsCmd
) {
135
fHisto
->
SetNumberOfBinsP
(
fnOfAbsCmd
->
GetNewIntValue
(newValue));
136
}
else
if
( command ==
fverbCmd
) {
137
fHisto
->
SetVerbose
(
fverbCmd
->
GetNewIntValue
(newValue));
138
}
else
if
( command ==
fpartCmd
) {
139
fHisto
->
SetParticleName
(newValue);
140
}
else
if
( command ==
fcsCmd
) {
141
fHisto
->
SetElementName
(newValue);
142
}
else
if
( command ==
fe1Cmd
) {
143
fHisto
->
SetMinKinEnergy
(
fe1Cmd
->
GetNewDoubleValue
(newValue));
144
}
else
if
( command ==
fe2Cmd
) {
145
fHisto
->
SetMaxKinEnergy
(
fe2Cmd
->
GetNewDoubleValue
(newValue));
146
}
else
if
( command ==
fp1Cmd
) {
147
fHisto
->
SetMinMomentum
(
fp1Cmd
->
GetNewDoubleValue
(newValue));
148
}
else
if
( command ==
fp2Cmd
) {
149
fHisto
->
SetMaxMomentum
(
fp2Cmd
->
GetNewDoubleValue
(newValue));
150
}
else
if
( command ==
fFCmd
) {
151
fHisto
->
SetHistoName
(newValue);
152
}
153
}
154
155
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
156
geant4
tree
geant4-10.6-release
examples
extended
hadronic
Hadr00
src
HistoManagerMessenger.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:05
using
1.8.2 with
ECCE GitHub integration