]> git.uio.no Git - u/mrichter/AliRoot.git/blame - AliGeant4/AliStackingActionMessenger.cxx
Updated class description: added class title, author;
[u/mrichter/AliRoot.git] / AliGeant4 / AliStackingActionMessenger.cxx
CommitLineData
676fb573 1// $Id$
2// Category: event
3//
4// See the class description in the header file.
5
6#include "AliStackingActionMessenger.h"
7#include "AliStackingAction.h"
8#include "AliGlobals.h"
9
10#include <G4UIdirectory.hh>
11#include <G4UIcmdWithAnInteger.hh>
12#include <G4UIcmdWithoutParameter.hh>
13
78ca1e9c 14//_____________________________________________________________________________
676fb573 15AliStackingActionMessenger::AliStackingActionMessenger(
16 AliStackingAction* stackingAction)
17 :fStackingAction(stackingAction)
18{
19//
20 fStackingDirectory = new G4UIdirectory("/aliStacking/");
21 fStackingDirectory->SetGuidance("AliStackingAction control commands.");
22
676fb573 23 fVerboseCmd = new G4UIcmdWithAnInteger("/aliStacking/verbose", this);
24 fVerboseCmd->SetGuidance("Set verbose level for AliStackingAction");
25 fVerboseCmd->SetParameterName("VerboseLevel", true);
26 fVerboseCmd->SetDefaultValue(0);
27 fVerboseCmd->SetRange("VerboseLevel >= 0 && VerboseLevel <= 1");
28 fVerboseCmd->AvailableForStates(Idle);
29}
30
78ca1e9c 31//_____________________________________________________________________________
676fb573 32AliStackingActionMessenger::AliStackingActionMessenger() {
33//
34}
35
78ca1e9c 36//_____________________________________________________________________________
676fb573 37AliStackingActionMessenger::AliStackingActionMessenger(
38 const AliStackingActionMessenger& right) {
39//
40 AliGlobals::Exception("AliStackingActionMessenger is protected from copying.");
41}
42
78ca1e9c 43//_____________________________________________________________________________
676fb573 44AliStackingActionMessenger::~AliStackingActionMessenger() {
45//
46 delete fStackingDirectory;
676fb573 47 delete fVerboseCmd;
48}
49
50// operators
51
78ca1e9c 52//_____________________________________________________________________________
676fb573 53AliStackingActionMessenger&
54AliStackingActionMessenger::operator=(const AliStackingActionMessenger &right)
55{
56 // check assignement to self
57 if (this == &right) return *this;
58
59 AliGlobals::Exception(
60 "AliStackingActionMessenger is protected from assigning.");
61
62 return *this;
63}
64
65// public methods
66
78ca1e9c 67//_____________________________________________________________________________
676fb573 68void AliStackingActionMessenger::SetNewValue(G4UIcommand* command,
69 G4String newValue)
70{
71// Applies command to the associated object.
72// ---
73
4b47d52f 74 if (command == fVerboseCmd) {
676fb573 75 fStackingAction
76 ->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue));
77 }
78}