]> git.uio.no Git - u/mrichter/AliRoot.git/blame - AliGeant4/AliTrackingActionMessenger.cxx
Smaller changes
[u/mrichter/AliRoot.git] / AliGeant4 / AliTrackingActionMessenger.cxx
CommitLineData
676fb573 1// $Id$
2// Category: event
3//
7005154f 4// Author: I. Hrivnacova
5//
6// Class AliTrackingActionMessenger
7// --------------------------------
676fb573 8// See the class description in the header file.
462d51e9 9
676fb573 10#include "AliTrackingActionMessenger.h"
11#include "AliTrackingAction.h"
12#include "AliGlobals.h"
13
14#include <G4UIdirectory.hh>
15#include <G4UIcmdWithAnInteger.hh>
16
78ca1e9c 17//_____________________________________________________________________________
676fb573 18AliTrackingActionMessenger::AliTrackingActionMessenger(
19 AliTrackingAction* trackingAction)
20 :fTrackingAction(trackingAction)
21{
22//
23 fTrackingDirectory = new G4UIdirectory("/aliTracking/");
24 fTrackingDirectory->SetGuidance("AliTrackingAction control commands.");
25
aafc96be 26 fNewVerboseCmd = new G4UIcmdWithAnInteger("/aliTracking/newVerbose", this);
27 fNewVerboseCmd->SetGuidance("Set new verbose level (/tracking/verbose)");
28 fNewVerboseCmd->SetGuidance("when a track with specified track ID ");
29 fNewVerboseCmd->SetGuidance("(/aliTracking/newVerboseTrack)\n starts tracking");
30 fNewVerboseCmd->SetParameterName("NewVerboseLevel", false);
31 fNewVerboseCmd->SetRange("NewVerboseLevel >= 0 && NewVerboseLevel <= 5");
32 fNewVerboseCmd->AvailableForStates(PreInit, Init, Idle);
33
34 fNewVerboseTrackCmd = new G4UIcmdWithAnInteger("/aliTracking/newVerboseTrack", this);
35 fNewVerboseTrackCmd->SetGuidance("Set the track ID for which the new verbose level");
36 fNewVerboseTrackCmd->SetGuidance("(/aliTracking/newVerbose) will be applied.");
37 fNewVerboseTrackCmd->SetParameterName("NewVerboseLevelTrackID", false);
38 fNewVerboseTrackCmd->SetRange("NewVerboseLevelTrackID >= 0");
39 fNewVerboseTrackCmd->AvailableForStates(PreInit, Init, Idle);
676fb573 40}
41
78ca1e9c 42//_____________________________________________________________________________
676fb573 43AliTrackingActionMessenger::AliTrackingActionMessenger() {
44//
45}
46
78ca1e9c 47//_____________________________________________________________________________
676fb573 48AliTrackingActionMessenger::AliTrackingActionMessenger(
49 const AliTrackingActionMessenger& right) {
50//
51 AliGlobals::Exception(
52 "AliTrackingActionMessenger is protected from copying.");
53}
54
78ca1e9c 55//_____________________________________________________________________________
676fb573 56AliTrackingActionMessenger::~AliTrackingActionMessenger() {
57//
58 delete fTrackingDirectory;
aafc96be 59 delete fNewVerboseCmd;
60 delete fNewVerboseTrackCmd;
676fb573 61}
62
63// operators
64
78ca1e9c 65//_____________________________________________________________________________
676fb573 66AliTrackingActionMessenger&
67AliTrackingActionMessenger::operator=(const AliTrackingActionMessenger &right)
68{
69 // check assignement to self
70 if (this == &right) return *this;
71
72 AliGlobals::Exception(
73 "AliTrackingActionMessenger is protected from assigning.");
74
75 return *this;
76}
77
78// public methods
79
78ca1e9c 80//_____________________________________________________________________________
676fb573 81void AliTrackingActionMessenger::SetNewValue(G4UIcommand* command,
82 G4String newValue)
83{
84// Applies command to the associated object.
85// ---
86
32fa3aec 87 if(command == fNewVerboseCmd) {
aafc96be 88 fTrackingAction
89 ->SetNewVerboseLevel(fNewVerboseCmd->GetNewIntValue(newValue));
90 }
91 else if(command == fNewVerboseTrackCmd) {
92 fTrackingAction
93 ->SetNewVerboseTrackID(fNewVerboseTrackCmd->GetNewIntValue(newValue));
94 }
676fb573 95}