ECCE @ EIC Software
 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"
53 #include "HistoManager.hh"
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 
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);
64 
65  fnOfAbsCmd = new G4UIcmdWithAnInteger("/testhadr/nBinsP",this);
66  fnOfAbsCmd->SetGuidance("Set number of bins for momentum");
67  fnOfAbsCmd->SetParameterName("NPbins",false);
69 
70  fpartCmd = new G4UIcmdWithAString("/testhadr/particle",this);
71  fpartCmd->SetGuidance("Set particle name");
72  fpartCmd->SetParameterName("Particle",false);
74 
75  fcsCmd = new G4UIcmdWithAString("/testhadr/targetElm",this);
76  fcsCmd->SetGuidance("Set element name");
77  fcsCmd->SetParameterName("Elm",false);
79 
80  fe1Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/minEnergy",this);
81  fe1Cmd->SetGuidance("Set min kinetic energy");
82  fe1Cmd->SetParameterName("eMin",false);
83  fe1Cmd->SetUnitCategory("Energy");
85 
86  fe2Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/maxEnergy",this);
87  fe2Cmd->SetGuidance("Set max kinetic energy");
88  fe2Cmd->SetParameterName("eMax",false);
89  fe2Cmd->SetUnitCategory("Energy");
91 
92  fp1Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/minMomentum",this);
93  fp1Cmd->SetGuidance("Set min momentum");
94  fp1Cmd->SetParameterName("pMin",false);
95  fp1Cmd->SetUnitCategory("Energy");
97 
98  fp2Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/maxMomentum",this);
99  fp2Cmd->SetGuidance("Set max momentum");
100  fp2Cmd->SetParameterName("pMax",false);
101  fp2Cmd->SetUnitCategory("Energy");
103 
104  fverbCmd = new G4UIcmdWithAnInteger("/testhadr/verbose",this);
105  fverbCmd->SetGuidance("Set verbose for ");
106  fverbCmd->SetParameterName("verb",false);
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 
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 
131 {
132  if( command == fbinCmd ) {
134  } else if( command == fnOfAbsCmd ) {
136  } else if( command == fverbCmd ) {
138  } else if( command == fpartCmd ) {
139  fHisto->SetParticleName(newValue);
140  } else if( command == fcsCmd ) {
141  fHisto->SetElementName(newValue);
142  } else if( command == fe1Cmd ) {
144  } else if( command == fe2Cmd ) {
146  } else if( command == fp1Cmd ) {
148  } else if( command == fp2Cmd ) {
150  } else if( command == fFCmd ) {
151  fHisto->SetHistoName(newValue);
152  }
153 }
154 
155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
156