Geant4_10
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 "G4HnMessenger.hh"
36 
37 #include "G4UIcmdWithABool.hh"
38 #include "G4UIcmdWithAnInteger.hh"
39 
40 //_____________________________________________________________________________
42  : G4UImessenger(),
43  fManager(manager),
44  fFileMessenger(0),
45  fH1Messenger(0),
46  fH2Messenger(0),
47  fH1HnMessenger(0),
48  fH2HnMessenger(0),
49  fAnalysisDir(0),
50  fSetActivationCmd(0),
51  fVerboseCmd(0)
52 {
53  fAnalysisDir = new G4UIdirectory("/analysis/");
54  fAnalysisDir->SetGuidance("analysis control");
55 
56  fSetActivationCmd = new G4UIcmdWithABool("/analysis/setActivation",this);
57  G4String guidance = "Set activation. \n";
58  guidance += "When this option is enabled, only the histograms marked as activated\n";
59  guidance += "are returned, filled or saved on file.\n";
60  guidance += "No warning is issued when Get or Fill is called on inactive histogram.";
61  fSetActivationCmd->SetGuidance(guidance);
62  fSetActivationCmd->SetParameterName("Activation",false);
63 
64  fVerboseCmd = new G4UIcmdWithAnInteger("/analysis/verbose",this);
65  fVerboseCmd->SetGuidance("Set verbose level");
66  fVerboseCmd->SetParameterName("VerboseLevel",false);
67  fVerboseCmd->SetRange("VerboseLevel>=0 && VerboseLevel<=4");
68 
69  fFileMessenger = new G4FileMessenger(manager);
70  fH1Messenger = new G4H1Messenger(manager);
71  fH2Messenger = new G4H2Messenger(manager);
72 }
73 
74 //_____________________________________________________________________________
76 {
77  delete fSetActivationCmd;
78  delete fVerboseCmd;
79  delete fAnalysisDir;
80  delete fFileMessenger;
81  delete fH1Messenger;
82  delete fH2Messenger;
83  delete fH1HnMessenger;
84  delete fH2HnMessenger;
85 }
86 
87 //
88 // public functions
89 //
90 
91 //_____________________________________________________________________________
93 {
94  fH1HnMessenger = new G4HnMessenger(h1HnManager);
95 }
96 
97 //_____________________________________________________________________________
99 {
100  fH2HnMessenger = new G4HnMessenger(h2HnManager);
101 }
102 
103 //_____________________________________________________________________________
105 {
106  if ( command == fSetActivationCmd ) {
108  }
109  else if ( command == fVerboseCmd ) {
111  }
112 }
G4H2Messenger * fH2Messenger
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIdirectory * fAnalysisDir
G4HnMessenger * fH2HnMessenger
static G4int GetNewIntValue(const char *paramString)
G4H1Messenger * fH1Messenger
void SetH2HnManager(G4HnManager *h2HnManager)
void SetVerboseLevel(G4int verboseLevel)
virtual void SetNewValue(G4UIcommand *command, G4String value)
G4FileMessenger * fFileMessenger
void SetH1HnManager(G4HnManager *h1HnManager)
static G4bool GetNewBoolValue(const char *paramString)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
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 SetActivation(G4bool activation)
G4AnalysisMessenger(G4VAnalysisManager *manager)
G4VAnalysisManager * fManager
Associated class.