Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExN04StackingActionMessenger.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 //
28 //
29 
30 #include "ExN04StackingActionMessenger.hh"
31 #include "ExN04StackingAction.hh"
32 #include "G4UIcmdWithAnInteger.hh"
34 #include "G4ios.hh"
35 
37 :myAction(msa)
38 {
39  muonCmd = new G4UIcmdWithAnInteger("/mydet/reqmuon",this);
40  muonCmd->SetGuidance("Number of muon for the trigger.");
41  muonCmd->SetParameterName("N",true);
42  muonCmd->SetDefaultValue(2);
43  muonCmd->SetRange("N>=0");
44 
45  isomuonCmd = new G4UIcmdWithAnInteger("/mydet/isomuon",this);
46  isomuonCmd->SetGuidance("Number of isolated muon for the trigger.");
47  isomuonCmd->SetParameterName("N",true);
48  isomuonCmd->SetDefaultValue(2);
49  isomuonCmd->SetRange("N>=0");
50 
51  isoCmd = new G4UIcmdWithAnInteger("/mydet/isolation",this);
52  isoCmd->SetGuidance("Maximum allowed number of hits in tracker");
53  isoCmd->SetGuidance(" for an isolated muon track (includes hits by muon)");
54  isoCmd->SetParameterName("N",true);
55  isoCmd->SetDefaultValue(10);
56  isoCmd->SetRange("N>=0");
57 
58  roiCmd = new G4UIcmdWithADoubleAndUnit("/mydet/RoIangle",this);
59  roiCmd->SetGuidance("Define RoI angle");
60  roiCmd->SetParameterName("theta",true,true);
61  roiCmd->SetDefaultUnit("deg");
62 }
63 
65 {
66  delete muonCmd;
67  delete isomuonCmd;
68  delete isoCmd;
69  delete roiCmd;
70 }
71 
73 {
74  if( command==muonCmd )
75  { myAction->SetNRequestMuon(muonCmd->GetNewIntValue(newValue)); }
76  else if( command==isomuonCmd )
77  { myAction->SetNRequestIsoMuon(isomuonCmd->GetNewIntValue(newValue)); }
78  else if( command==isoCmd )
79  { myAction->SetNIsolation(isoCmd->GetNewIntValue(newValue)); }
80  else if( command==roiCmd )
81  { myAction->SetRoIAngle(roiCmd->GetNewDoubleValue(newValue)); }
82 }
83 
85 {
86  G4String cv;
87 
88  if( command==muonCmd )
89  { cv = muonCmd->ConvertToString(myAction->GetNRequestMuon()); }
90  else if( command==isomuonCmd )
91  { cv = isomuonCmd->ConvertToString(myAction->GetNRequestIsoMuon()); }
92  else if( command==isoCmd )
93  { cv = isoCmd->ConvertToString(myAction->GetNIsolation()); }
94  else if( command==roiCmd )
95  { cv = roiCmd->ConvertToString(myAction->GetRoIAngle(),"deg"); }
96 
97  return cv;
98 }
99