Public Member Functions | Private Attributes | List of all members
EDepSim::VConstrainedPositionFactory Class Referenceabstract

#include <EDepSimVConstrainedPositionFactory.hh>

Inheritance diagram for EDepSim::VConstrainedPositionFactory:
EDepSim::VPositionFactory EDepSim::VPrimaryFactory EDepSim::DensityPositionFactory EDepSim::UniformPositionFactory

Public Member Functions

 VConstrainedPositionFactory (G4String name, EDepSim::UserPrimaryGeneratorMessenger *fParent, bool makeDirectory=true)
 
virtual ~VConstrainedPositionFactory ()
 
virtual EDepSim::VPositionGeneratorGetGenerator ()
 
virtual EDepSim::VPositionGeneratorCreateGenerator ()=0
 
void SetNewValue (G4UIcommand *, G4String)
 Handle messages from the UI processor. More...
 
- Public Member Functions inherited from EDepSim::VPositionFactory
 VPositionFactory (G4String name, EDepSim::UserPrimaryGeneratorMessenger *fParent, bool makeDirectory=true)
 
virtual ~VPositionFactory ()
 
- Public Member Functions inherited from EDepSim::VPrimaryFactory
 VPrimaryFactory (G4String subdir, G4String name, EDepSim::UserPrimaryGeneratorMessenger *parent, bool makeDirectory)
 
virtual ~VPrimaryFactory ()
 
G4String GetPath () const
 
G4String GetName () const
 
G4String GetSubDir () const
 

Private Attributes

EDepSim::VConstrainedPositionGeneratorfCurrent
 
G4UIcmdWithAString * fPositionSampleVolumeCMD
 
G4UIcmdWithoutParameter * fPositionClearCMD
 
G4UIcmdWithAString * fPositionVolumeCMD
 
G4UIcmdWithAString * fPositionNotVolumeCMD
 
G4UIcmdWithAString * fPositionMaterialCMD
 
G4UIcmdWithAString * fPositionNotMaterialCMD
 
G4UIcmdWithADoubleAndUnit * fPositionMinXCMD
 
G4UIcmdWithADoubleAndUnit * fPositionMinYCMD
 
G4UIcmdWithADoubleAndUnit * fPositionMinZCMD
 
G4UIcmdWithADoubleAndUnit * fPositionMinTCMD
 
G4UIcmdWithADoubleAndUnit * fPositionMaxXCMD
 
G4UIcmdWithADoubleAndUnit * fPositionMaxYCMD
 
G4UIcmdWithADoubleAndUnit * fPositionMaxZCMD
 
G4UIcmdWithADoubleAndUnit * fPositionMaxTCMD
 

Additional Inherited Members

- Protected Member Functions inherited from EDepSim::VPrimaryFactory
G4String CommandName (G4String cmd)
 Build a command name with the directory prefix. More...
 

Detailed Description

Definition at line 10 of file EDepSimVConstrainedPositionFactory.hh.

Constructor & Destructor Documentation

EDepSim::VConstrainedPositionFactory::VConstrainedPositionFactory ( G4String  name,
EDepSim::UserPrimaryGeneratorMessenger fParent,
bool  makeDirectory = true 
)

Definition at line 4 of file EDepSimVConstrainedPositionFactory.cc.

8  : EDepSim::VPositionFactory(name,parent,makeDirectory),
9  fCurrent(NULL) {
10 
12  = new G4UIcmdWithAString(CommandName("sample"),this);
13  fPositionSampleVolumeCMD->SetGuidance("[REQUIRED] "
14  " Set volume to sample for a "
15  "primary vertex.");
16  fPositionSampleVolumeCMD->SetParameterName("SampleVolume",false);
17 
18  fPositionClearCMD = new G4UIcmdWithoutParameter(CommandName("clear"),
19  this);
20  fPositionClearCMD->SetGuidance("Start a new vertex generator.");
21 
22  fPositionVolumeCMD = new G4UIcmdWithAString(CommandName("volume"),this);
23  fPositionVolumeCMD->SetGuidance("Set the name of the vertex volume.");
24  fPositionVolumeCMD->SetParameterName("PositionVolume",false);
25 
26  fPositionNotVolumeCMD = new G4UIcmdWithAString(CommandName("notVolume"),
27  this);
28  fPositionNotVolumeCMD->SetGuidance("Set the name of the vertex"
29  " volume to avoid.");
30  fPositionNotVolumeCMD->SetParameterName("NotPositionVolume",false);
31 
32  fPositionMaterialCMD = new G4UIcmdWithAString(CommandName("material"),
33  this);
34  fPositionMaterialCMD->SetGuidance("Set the name of the vertex material.");
35  fPositionMaterialCMD->SetParameterName("PositionMaterial",false);
36 
38  = new G4UIcmdWithAString(CommandName("notMaterial"),this);
39  fPositionNotMaterialCMD->SetGuidance("Set the name of the"
40  " material to avoid.");
41  fPositionNotMaterialCMD->SetParameterName("PositionNotMaterial",false);
42 
43  fPositionMinXCMD = new G4UIcmdWithADoubleAndUnit(CommandName("minX"),
44  this);
45  fPositionMinXCMD->SetGuidance("Set the minimum position of the vertex.");
46  fPositionMinXCMD->SetParameterName("X",false);
47  fPositionMinXCMD->SetUnitCategory("Length");
48 
49  fPositionMinYCMD = new G4UIcmdWithADoubleAndUnit(CommandName("minY"),
50  this);
51  fPositionMinYCMD->SetGuidance("Set the minimum position of the vertex.");
52  fPositionMinYCMD->SetParameterName("Y",false);
53  fPositionMinYCMD->SetUnitCategory("Length");
54 
55  fPositionMinZCMD = new G4UIcmdWithADoubleAndUnit(CommandName("minZ"),
56  this);
57  fPositionMinZCMD->SetGuidance("Set the minimum position of the vertex.");
58  fPositionMinZCMD->SetParameterName("Z",false);
59  fPositionMinZCMD->SetUnitCategory("Length");
60 
61  fPositionMinTCMD = new G4UIcmdWithADoubleAndUnit(CommandName("minT"),
62  this);
63  fPositionMinTCMD->SetGuidance("Set the minimum time of the vertex.");
64  fPositionMinTCMD->SetParameterName("T",false);
65  fPositionMinTCMD->SetUnitCategory("Time");
66 
67 
68  fPositionMaxXCMD = new G4UIcmdWithADoubleAndUnit(CommandName("maxX"),
69  this);
70  fPositionMaxXCMD->SetGuidance("Set the maximum position of the vertex.");
71  fPositionMaxXCMD->SetParameterName("X",false);
72  fPositionMaxXCMD->SetUnitCategory("Length");
73 
74  fPositionMaxYCMD = new G4UIcmdWithADoubleAndUnit(CommandName("maxY"),
75  this);
76  fPositionMaxYCMD->SetGuidance("Set the maximum position of the vertex.");
77  fPositionMaxYCMD->SetParameterName("Y",false);
78  fPositionMaxYCMD->SetUnitCategory("Length");
79 
80  fPositionMaxZCMD = new G4UIcmdWithADoubleAndUnit(CommandName("maxZ"),
81  this);
82  fPositionMaxZCMD->SetGuidance("Set the maximum position of the vertex.");
83  fPositionMaxZCMD->SetParameterName("Z",false);
84  fPositionMaxZCMD->SetUnitCategory("Length");
85 
86  fPositionMaxTCMD = new G4UIcmdWithADoubleAndUnit(CommandName("maxT"),
87  this);
88  fPositionMaxTCMD->SetGuidance("Set the maximum position of the vertex.");
89  fPositionMaxTCMD->SetParameterName("T",false);
90  fPositionMaxTCMD->SetUnitCategory("Time");
91 }
static QCString name
Definition: declinfo.cpp:673
EDepSim::VConstrainedPositionGenerator * fCurrent
G4String CommandName(G4String cmd)
Build a command name with the directory prefix.
def parent(G, child, parent_type)
Definition: graph.py:67
EDepSim::VConstrainedPositionFactory::~VConstrainedPositionFactory ( )
virtual

Definition at line 93 of file EDepSimVConstrainedPositionFactory.cc.

93  {
95  delete fPositionClearCMD;
96  delete fPositionVolumeCMD;
97  delete fPositionNotVolumeCMD;
98  delete fPositionMaterialCMD;
100  delete fPositionMinXCMD;
101  delete fPositionMinYCMD;
102  delete fPositionMinZCMD;
103  delete fPositionMinTCMD;
104  delete fPositionMaxXCMD;
105  delete fPositionMaxYCMD;
106  delete fPositionMaxZCMD;
107  delete fPositionMaxTCMD;
108 }

Member Function Documentation

virtual EDepSim::VPositionGenerator* EDepSim::VConstrainedPositionFactory::CreateGenerator ( )
pure virtual

Create a new generator that can be initialized. This is a pure virtual function so it must be implemented in the derived class.

Implemented in EDepSim::DensityPositionFactory, and EDepSim::UniformPositionFactory.

EDepSim::VPositionGenerator * EDepSim::VConstrainedPositionFactory::GetGenerator ( )
virtual

Return a new generator enclosing the current factory state. The new generator method is pure virtual so it must be implemented by derived classes, but the derived generator must return the value from EDepSim::VConstrainedPositionFactory::GetGenerator().

Implements EDepSim::VPositionFactory.

Reimplemented in EDepSim::DensityPositionFactory, and EDepSim::UniformPositionFactory.

Definition at line 180 of file EDepSimVConstrainedPositionFactory.cc.

180  {
182  if (!stash) stash = CreateGenerator();
183  fCurrent = NULL;
184  return stash;
185 }
EDepSim::VConstrainedPositionGenerator * fCurrent
virtual EDepSim::VPositionGenerator * CreateGenerator()=0
void EDepSim::VConstrainedPositionFactory::SetNewValue ( G4UIcommand *  ,
G4String   
)
virtual

Handle messages from the UI processor.

Reimplemented from EDepSim::VPrimaryFactory.

Definition at line 110 of file EDepSimVConstrainedPositionFactory.cc.

111  {
112 
113  if (!fCurrent) {
115  CreateGenerator());
116  }
117 
118  if (command == fPositionClearCMD) {
119  if (fCurrent) {
121  }
122  }
123  else if (command == fPositionSampleVolumeCMD) {
124  if (fCurrent) {
125  fCurrent->SetVolumeName(newValue);
126  }
127  }
128  else if (command == fPositionVolumeCMD) {
129  if (fCurrent) {
130  fCurrent->CheckVolumeName(newValue);
131  }
132  }
133  else if (command == fPositionNotVolumeCMD) {
134  if (fCurrent) {
135  fCurrent->CheckNotVolumeName(newValue);
136  }
137  }
138  else if (command == fPositionMaterialCMD) {
139  if (fCurrent) {
140  fCurrent->CheckVolumeMaterial(newValue);
141  }
142  }
143  else if (command == fPositionNotMaterialCMD) {
144  if (fCurrent) {
145  fCurrent->CheckNotVolumeMaterial(newValue);
146  }
147  }
148  else if (command == fPositionMinXCMD) {
149  if (fCurrent) {
150  fCurrent->CheckMinX(fPositionMinXCMD->GetNewDoubleValue(newValue));
151  }
152  }
153  else if (command == fPositionMinYCMD) {
154  if (fCurrent) {
155  fCurrent->CheckMinY(fPositionMinYCMD->GetNewDoubleValue(newValue));
156  }
157  }
158  else if (command == fPositionMinZCMD) {
159  if (fCurrent) {
160  fCurrent->CheckMinZ(fPositionMinZCMD->GetNewDoubleValue(newValue));
161  }
162  }
163  else if (command == fPositionMaxXCMD) {
164  if (fCurrent) {
165  fCurrent->CheckMaxX(fPositionMaxXCMD->GetNewDoubleValue(newValue));
166  }
167  }
168  else if (command == fPositionMaxYCMD) {
169  if (fCurrent) {
170  fCurrent->CheckMaxY(fPositionMaxYCMD->GetNewDoubleValue(newValue));
171  }
172  }
173  else if (command == fPositionMaxZCMD) {
174  if (fCurrent) {
175  fCurrent->CheckMaxZ(fPositionMaxZCMD->GetNewDoubleValue(newValue));
176  }
177  }
178 }
void CheckMaxZ(double z)
Check that the vertex Z position is less than some value.
int command
EDepSim::VConstrainedPositionGenerator * fCurrent
void CheckMaxX(double x)
Check that the vertex X position is less than some value.
void SetVolumeName(const G4String &volume)
Set the name of the volume to be sampled for a vertex.
void CheckMinY(double y)
Check that the vertex Y position is greater than some value.
void CheckVolumeMaterial(const G4String &name)
Check that the vertex is inside of a material specified by name.
void CheckMaxY(double y)
Check that the vertex Y position is less than some value.
virtual EDepSim::VPositionGenerator * CreateGenerator()=0
void CheckMinX(double x)
Check that the vertex X position is greater than some value.
void ClearPositionTests(void)
Clear the current set of vertex checks.
void CheckMinZ(double z)
Check that the vertex Z position is greater than some value.
void CheckNotVolumeMaterial(const G4String &name)
Check that the vertex is not inside of a material specified by name.

Member Data Documentation

EDepSim::VConstrainedPositionGenerator* EDepSim::VConstrainedPositionFactory::fCurrent
private

Definition at line 31 of file EDepSimVConstrainedPositionFactory.hh.

G4UIcmdWithoutParameter* EDepSim::VConstrainedPositionFactory::fPositionClearCMD
private

Definition at line 34 of file EDepSimVConstrainedPositionFactory.hh.

G4UIcmdWithAString* EDepSim::VConstrainedPositionFactory::fPositionMaterialCMD
private

Definition at line 37 of file EDepSimVConstrainedPositionFactory.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::VConstrainedPositionFactory::fPositionMaxTCMD
private

Definition at line 46 of file EDepSimVConstrainedPositionFactory.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::VConstrainedPositionFactory::fPositionMaxXCMD
private

Definition at line 43 of file EDepSimVConstrainedPositionFactory.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::VConstrainedPositionFactory::fPositionMaxYCMD
private

Definition at line 44 of file EDepSimVConstrainedPositionFactory.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::VConstrainedPositionFactory::fPositionMaxZCMD
private

Definition at line 45 of file EDepSimVConstrainedPositionFactory.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::VConstrainedPositionFactory::fPositionMinTCMD
private

Definition at line 42 of file EDepSimVConstrainedPositionFactory.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::VConstrainedPositionFactory::fPositionMinXCMD
private

Definition at line 39 of file EDepSimVConstrainedPositionFactory.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::VConstrainedPositionFactory::fPositionMinYCMD
private

Definition at line 40 of file EDepSimVConstrainedPositionFactory.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::VConstrainedPositionFactory::fPositionMinZCMD
private

Definition at line 41 of file EDepSimVConstrainedPositionFactory.hh.

G4UIcmdWithAString* EDepSim::VConstrainedPositionFactory::fPositionNotMaterialCMD
private

Definition at line 38 of file EDepSimVConstrainedPositionFactory.hh.

G4UIcmdWithAString* EDepSim::VConstrainedPositionFactory::fPositionNotVolumeCMD
private

Definition at line 36 of file EDepSimVConstrainedPositionFactory.hh.

G4UIcmdWithAString* EDepSim::VConstrainedPositionFactory::fPositionSampleVolumeCMD
private

Definition at line 33 of file EDepSimVConstrainedPositionFactory.hh.

G4UIcmdWithAString* EDepSim::VConstrainedPositionFactory::fPositionVolumeCMD
private

Definition at line 35 of file EDepSimVConstrainedPositionFactory.hh.


The documentation for this class was generated from the following files: