Geant4  10.01
G4AnalysisMessenger.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 // $Id: G4AnalysisMessenger.cc 66310 2012-12-17 11:56:35Z ihrivnac $
27 
28 // Author: Ivana Hrivnacova, 24/06/2013 (ivana@ipno.in2p3.fr)
29 
30 #include "G4AnalysisMessenger.hh"
31 #include "G4VAnalysisManager.hh"
32 #include "G4FileMessenger.hh"
33 #include "G4H1Messenger.hh"
34 #include "G4H2Messenger.hh"
35 #include "G4H3Messenger.hh"
36 #include "G4P1Messenger.hh"
37 #include "G4P2Messenger.hh"
38 #include "G4HnMessenger.hh"
39 
40 #include "G4UIcmdWithABool.hh"
41 #include "G4UIcmdWithAnInteger.hh"
42 
43 //_____________________________________________________________________________
45  : G4UImessenger(),
46  fManager(manager),
47  fFileMessenger(0),
48  fH1Messenger(0),
49  fH2Messenger(0),
50  fH3Messenger(0),
51  fP1Messenger(0),
52  fP2Messenger(0),
53  fH1HnMessenger(0),
54  fH2HnMessenger(0),
55  fH3HnMessenger(0),
56  fP1HnMessenger(0),
57  fP2HnMessenger(0),
58  fAnalysisDir(0),
59  fSetActivationCmd(0),
60  fVerboseCmd(0)
61 {
62  fAnalysisDir = new G4UIdirectory("/analysis/");
63  fAnalysisDir->SetGuidance("analysis control");
64 
65  fSetActivationCmd = new G4UIcmdWithABool("/analysis/setActivation",this);
66  G4String guidance = "Set activation. \n";
67  guidance += "When this option is enabled, only the histograms marked as activated\n";
68  guidance += "are returned, filled or saved on file.\n";
69  guidance += "No warning is issued when Get or Fill is called on inactive histogram.";
70  fSetActivationCmd->SetGuidance(guidance);
71  fSetActivationCmd->SetParameterName("Activation",false);
72 
73  fVerboseCmd = new G4UIcmdWithAnInteger("/analysis/verbose",this);
74  fVerboseCmd->SetGuidance("Set verbose level");
75  fVerboseCmd->SetParameterName("VerboseLevel",false);
76  fVerboseCmd->SetRange("VerboseLevel>=0 && VerboseLevel<=4");
77 
78  fFileMessenger = new G4FileMessenger(manager);
79  fH1Messenger = new G4H1Messenger(manager);
80  fH2Messenger = new G4H2Messenger(manager);
81  fH3Messenger = new G4H3Messenger(manager);
82  fP1Messenger = new G4P1Messenger(manager);
83  fP2Messenger = new G4P2Messenger(manager);
84 }
85 
86 //_____________________________________________________________________________
88 {
89  delete fSetActivationCmd;
90  delete fVerboseCmd;
91  delete fAnalysisDir;
92  delete fFileMessenger;
93  delete fH1Messenger;
94  delete fH2Messenger;
95  delete fH3Messenger;
96  delete fP1Messenger;
97  delete fP2Messenger;
98  delete fH1HnMessenger;
99  delete fH2HnMessenger;
100  delete fH3HnMessenger;
101  delete fP1HnMessenger;
102  delete fP2HnMessenger;
103 }
104 
105 //
106 // public functions
107 //
108 
109 //_____________________________________________________________________________
111 {
112  fH1HnMessenger = new G4HnMessenger(h1HnManager);
113 }
114 
115 //_____________________________________________________________________________
117 {
118  fH2HnMessenger = new G4HnMessenger(h2HnManager);
119 }
120 
121 //_____________________________________________________________________________
123 {
124  fH2HnMessenger = new G4HnMessenger(h2HnManager);
125 }
126 
127 //_____________________________________________________________________________
129 {
130  fP1HnMessenger = new G4HnMessenger(p1HnManager);
131 }
132 
133 //_____________________________________________________________________________
135 {
136  fP2HnMessenger = new G4HnMessenger(p2HnManager);
137 }
138 
139 //_____________________________________________________________________________
141 {
142  if ( command == fSetActivationCmd ) {
144  }
145  else if ( command == fVerboseCmd ) {
147  }
148 }
G4H2Messenger * fH2Messenger
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetP1HnManager(G4HnManager *h1HnManager)
G4UIdirectory * fAnalysisDir
G4HnMessenger * fH2HnMessenger
static G4int GetNewIntValue(const char *paramString)
G4H1Messenger * fH1Messenger
void SetH2HnManager(G4HnManager *h2HnManager)
void SetVerboseLevel(G4int verboseLevel)
G4P1Messenger * fP1Messenger
virtual void SetNewValue(G4UIcommand *command, G4String value)
G4HnMessenger * fH3HnMessenger
G4FileMessenger * fFileMessenger
void SetH1HnManager(G4HnManager *h1HnManager)
static G4bool GetNewBoolValue(const char *paramString)
void SetP2HnManager(G4HnManager *h2HnManager)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4P2Messenger * fP2Messenger
G4UIcmdWithABool * fSetActivationCmd
G4UIcmdWithAnInteger * fVerboseCmd
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
G4HnMessenger * fH1HnMessenger
void SetH3HnManager(G4HnManager *h2HnManager)
void SetActivation(G4bool activation)
G4HnMessenger * fP2HnMessenger
G4AnalysisMessenger(G4VAnalysisManager *manager)
G4HnMessenger * fP1HnMessenger
G4H3Messenger * fH3Messenger
G4VAnalysisManager * fManager
Associated class.