Loading...
Searching...
No Matches
Par03EMShowerMessenger.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#include "Par03EMShowerModel.hh"
28
29#include "G4UIdirectory.hh"
30#include "G4UIcmdWithoutParameter.hh"
31#include "G4UIcmdWithADoubleAndUnit.hh"
32#include "G4UIcmdWithADouble.hh"
33#include "G4UIcmdWithAnInteger.hh"
34
36 : fModel(aModel)
37{
38 fDirectory = new G4UIdirectory("/Par03/fastSim/");
39 fDirectory->SetGuidance(
40 "Set mesh parameters for the example fast sim model.");
41
42 fPrintCmd = new G4UIcmdWithoutParameter("/Par03/fastSim/print", this);
43 fPrintCmd->SetGuidance("Print current settings.");
44
46 "/Par03/fastSim/transverseProfile/sigma", this);
47 fSigmaCmd->SetGuidance("Set sigma parameter of 2D Gaussian distribution.");
48 fSigmaCmd->SetParameterName("Sigma", false);
49 fSigmaCmd->SetUnitCategory("Length");
50
51 fAlphaCmd =
52 new G4UIcmdWithADouble("/Par03/fastSim/longitudinalProfile/alpha", this);
53 fAlphaCmd->SetGuidance("Set alpha parameter of Gamma distribution.");
54 fAlphaCmd->SetParameterName("Alpha", false);
55
56 fBetaCmd =
57 new G4UIcmdWithADouble("/Par03/fastSim/longitudinalProfile/beta", this);
58 fBetaCmd->SetGuidance("Set beta parameter of Gamma distribution.");
59 fBetaCmd->SetParameterName("Beta", false);
60
61 fNbOfHitsCmd = new G4UIcmdWithAnInteger("/Par03/fastSim/numberOfHits", this);
62 fNbOfHitsCmd->SetGuidance(
63 "Set number of (same energy) energy deposits created in fast simulation. "
64 "Those deposits will be scored in the detector according to the readout of "
65 "the sensitive detector.");
66 fNbOfHitsCmd->SetParameterName("Number", false);
67
69 new G4UIcmdWithADouble("/Par03/fastSim/longitudinalProfile/maxDepth", this);
70 fLongMaxDepthCmd->SetGuidance(
71 "Set maximum shower depth used in parametrisation.");
72 fLongMaxDepthCmd->SetGuidance("Expressed in units of radiation length.");
73 fLongMaxDepthCmd->SetParameterName("Depth", false);
74}
75
76//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77
79{
80 delete fPrintCmd;
81 delete fSigmaCmd;
82 delete fAlphaCmd;
83 delete fBetaCmd;
84 delete fNbOfHitsCmd;
85 delete fLongMaxDepthCmd;
86 delete fDirectory;
87}
88
89//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90
92 G4String aNewValues)
93{
94 if(aCommand == fPrintCmd)
95 {
96 fModel->Print();
97 }
98 else if(aCommand == fSigmaCmd)
99 {
100 fModel->SetSigma(fSigmaCmd->GetNewDoubleValue(aNewValues));
101 }
102 else if(aCommand == fAlphaCmd)
103 {
104 fModel->SetAlpha(fAlphaCmd->GetNewDoubleValue(aNewValues));
105 }
106 else if(aCommand == fBetaCmd)
107 {
108 fModel->SetBeta(fBetaCmd->GetNewDoubleValue(aNewValues));
109 }
110 else if(aCommand == fNbOfHitsCmd)
111 {
112 fModel->SetNbOfHits(fNbOfHitsCmd->GetNewIntValue(aNewValues));
113 }
114 else if(aCommand == fLongMaxDepthCmd)
115 {
116 fModel->SetLongMaxDepth(fLongMaxDepthCmd->GetNewDoubleValue(aNewValues));
117 }
118}
119
120//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
121
123{
124 G4String cv;
125
126 if(aCommand == fSigmaCmd)
127 {
128 cv = fSigmaCmd->ConvertToString(fModel->GetSigma());
129 }
130 else if(aCommand == fAlphaCmd)
131 {
132 cv = fAlphaCmd->ConvertToString(fModel->GetAlpha());
133 }
134 else if(aCommand == fBetaCmd)
135 {
136 cv = fBetaCmd->ConvertToString(fModel->GetBeta());
137 }
138 else if(aCommand == fNbOfHitsCmd)
139 {
140 cv = fNbOfHitsCmd->ConvertToString(fModel->GetNbOfHits());
141 }
142 else if(aCommand == fLongMaxDepthCmd)
143 {
144 cv = fLongMaxDepthCmd->ConvertToString(fModel->GetLongMaxDepth());
145 }
146 return cv;
147}
G4UIcmdWithADouble * fAlphaCmd
Command to set the alpha parameter of the Gamma distribution describing the longitudinal profile.
virtual G4String GetCurrentValue(G4UIcommand *aCommand) final
Retrieves the current settings.
G4UIcmdWithADouble * fBetaCmd
Command to set the beta parameter of the Gamma distribution describing the longitudinal profile.
G4UIcmdWithADouble * fLongMaxDepthCmd
Command to set the maximum shower depth.
virtual void SetNewValue(G4UIcommand *aCommand, G4String aNewValues) final
Invokes appropriate methods based on the typed command.
Par03EMShowerModel * fModel
Model to setup.
G4UIcmdWithoutParameter * fPrintCmd
Command printing current settings.
G4UIdirectory * fDirectory
Command to set the up a directory for model settings /Par03/fastSim.
Par03EMShowerMessenger(Par03EMShowerModel *aModel)
G4UIcmdWithADoubleAndUnit * fSigmaCmd
Command to set the sigma parameter of the Gaussian distribution describing the transverse profile.
G4UIcmdWithAnInteger * fNbOfHitsCmd
Command to set the number of (same energy) deposits to be created by fast simulation.
Example fast simulation model for EM showers.
G4double GetBeta() const
Get beta parameter of a Gamma distribution that describes the longitudinal shower profile.
void SetNbOfHits(const G4int aNumber)
Set number of (same energy) hits created in the parametrisation.
void Print() const
Print current settings.
void SetLongMaxDepth(const G4double aDepth)
Set maximum depth of shower created in fast simulation.
void SetSigma(const G4double aSigma)
Set standard deviation of a Gaussian distribution that describes the transverse shower profile.
void SetBeta(const G4double aBeta)
Set beta parameter of a Gamma distribution that describes the longitudinal shower profile.
G4double GetAlpha() const
Get alpha parameter of a Gamma distribution that describes the longitudinal shower profile.
G4int GetNbOfHits() const
Get number of (same energy) hits created in the parametrisation.s.
void SetAlpha(const G4double aAlpha)
Set alpha parameter of a Gamma distribution that describes the longitudinal shower profile.
G4double GetLongMaxDepth() const
Get maximum depth of shower created in fast simulation.
G4double GetSigma() const
Get standard deviation of a Gaussian distribution that describes the transverse shower profile.

Applications | User Support | Publications | Collaboration