Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Luter 345 Experiments
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Adjusting Variables at Run-Time
(section)
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Get shortened URL
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Input Files== '''Example:''' Initialization File #X-length of both scintillators (in cm) scintX 30.5 #Y-length of both scintillators (in cm) scintY 17.0 #Z-length of both scintillators (in cm) scintZ 1.0 #height(POSITION) of bottom scintillator (in cm) bottomScintPos -30.0 #height(POSITION) of top scintillator (in cm) topScintPos 30 #thickness of the Lead layer (in cm) blockThickness 15.0 #the material the block will be made of (must be a valid G4Material name) blockMaterial G4_Pb #name of the output file(ONLY THE BASE NAME, THICKNIESS WILL BE ADDED AS A SUFFIX IN THE PROGRAM) #outFileBase S1_thickness_ outFileBase S1_uncert_ #the run number (for finding an uncertainty in positron count) runNum 10 As seen above, the initialization file is essentially a list of all variables in the program that may be necessary to change between runs. The benefit to using this type of file is that it can be changed without having to recompile the program. Obviously it is crucial to know what type these variable should be, what units the number should be in if applicable, and what order these variables should be in. The hash-tagged lines are comments, and should be used gratuitously if some other person may end up using the program so the requirements of the input file are clear. Input files get read at run-time by the variables class via the main file. In other words, the main calls a read file function of the variables class that then reads and saves the appropriate variables. Typically this is the first, or one of the first, actions to occurs in the main. A quick example of the line in the main is provided below, and a more robust explanation of the variables class is provided in another section farther below. int main(int argc,char** argv) { //The first object to load should be the variables, since they are read externally //Create a variables object to read and store the variables Variables = new S1Variables(); //Insert the input file here, ours is called S1.ini G4String dataname = "S1.ini"; //call the function to read the data from the file Variables->loadFromFile(dataname);
Summary:
Please note that all contributions to Luter 345 Experiments may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Luter 345 Experiments:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)