<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.iac.isu.edu/index.php?action=history&amp;feed=atom&amp;title=BUILD_GEMC_SIMULATION.sh</id>
	<title>BUILD GEMC SIMULATION.sh - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.iac.isu.edu/index.php?action=history&amp;feed=atom&amp;title=BUILD_GEMC_SIMULATION.sh"/>
	<link rel="alternate" type="text/html" href="https://wiki.iac.isu.edu/index.php?title=BUILD_GEMC_SIMULATION.sh&amp;action=history"/>
	<updated>2026-05-10T01:54:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://wiki.iac.isu.edu/index.php?title=BUILD_GEMC_SIMULATION.sh&amp;diff=124574&amp;oldid=prev</id>
		<title>Vanwdani: Blanked the page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iac.isu.edu/index.php?title=BUILD_GEMC_SIMULATION.sh&amp;diff=124574&amp;oldid=prev"/>
		<updated>2018-08-23T21:43:14Z</updated>

		<summary type="html">&lt;p&gt;Blanked the page&lt;/p&gt;
&lt;a href=&quot;https://wiki.iac.isu.edu/index.php?title=BUILD_GEMC_SIMULATION.sh&amp;amp;diff=124574&amp;amp;oldid=121441&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Vanwdani</name></author>
	</entry>
	<entry>
		<id>https://wiki.iac.isu.edu/index.php?title=BUILD_GEMC_SIMULATION.sh&amp;diff=121441&amp;oldid=prev</id>
		<title>Vanwdani: Created page with &quot;&lt;pre&gt; #!/bin/bash bold=`tput bold` normal=`tput sgr0` echo &quot;+------------------------------------------------------+&quot; echo &quot;|...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.iac.isu.edu/index.php?title=BUILD_GEMC_SIMULATION.sh&amp;diff=121441&amp;oldid=prev"/>
		<updated>2018-02-10T02:36:44Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; #!/bin/bash bold=`tput bold` normal=`tput sgr0` echo &amp;quot;+------------------------------------------------------+&amp;quot; echo &amp;quot;|...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
bold=`tput bold`&lt;br /&gt;
normal=`tput sgr0`&lt;br /&gt;
echo &amp;quot;+------------------------------------------------------+&amp;quot;&lt;br /&gt;
echo &amp;quot;|                                                      |&amp;quot;&lt;br /&gt;
echo &amp;quot;|  GEMC Simulations with root  V1.0                    |&amp;quot;&lt;br /&gt;
echo &amp;quot;|  Daniel VanWasshenova                                |&amp;quot;&lt;br /&gt;
echo &amp;quot;|                                                      |&amp;quot;&lt;br /&gt;
echo &amp;quot;+------------------------------------------------------+&amp;quot;&lt;br /&gt;
#Source root for c++ programs&lt;br /&gt;
source /home/lds/src/ROOT/root/bin/thisroot.sh&lt;br /&gt;
#Get Conditions&lt;br /&gt;
echo &amp;quot;********************************************************&amp;quot;&lt;br /&gt;
echo &amp;quot;Target material (${bold}LH2${normal}, NH3, NO) ?&amp;quot;&lt;br /&gt;
read TargetMaterial&lt;br /&gt;
echo &amp;quot;Solenoid Field (-1 to ${bold}1${normal}, NO) ?&amp;quot;&lt;br /&gt;
read SolenoidField&lt;br /&gt;
echo &amp;quot;Torus Field (${bold}-1${normal} to 1) ?&amp;quot;&lt;br /&gt;
read TorusField&lt;br /&gt;
echo &amp;quot;Incident Electron Energy (GeV) ?&amp;quot;&lt;br /&gt;
read IncidentEnergy&lt;br /&gt;
echo &amp;quot;Phi Distribution (${bold}Isotropic${normal} or set value) ?&amp;quot;&lt;br /&gt;
read PhiDistribution&lt;br /&gt;
echo &amp;quot;GEMC Version (4 or ${bold}6${normal}) ?&amp;quot;&lt;br /&gt;
read GEMCversion&lt;br /&gt;
echo &amp;quot;Shield Status (${bold}In${normal}/Out) ?&amp;quot;&lt;br /&gt;
read ShieldStatus&lt;br /&gt;
if [ $ShieldStatus = &amp;quot;In&amp;quot; ]&lt;br /&gt;
then&lt;br /&gt;
echo &amp;quot;FT Status (ON/${bold}OFF${normal}) ?&amp;quot;&lt;br /&gt;
read FTStatus&lt;br /&gt;
echo &amp;quot;Beamline Status (${bold}In${normal}/Out) ?&amp;quot;&lt;br /&gt;
read BeamlineStatus&lt;br /&gt;
echo &amp;quot;VacuumLine Status (${bold}In${normal}/Out) ?&amp;quot;&lt;br /&gt;
read VacuumLineStatus&lt;br /&gt;
echo &amp;quot;CadBeamline Status (${bold}In${normal}/Out) ?&amp;quot;&lt;br /&gt;
read CadBeamlineStatus&lt;br /&gt;
nameOFpath=&amp;quot;${TargetMaterial}&amp;quot;Tar_&amp;quot;${SolenoidField}&amp;quot;Sol_&amp;quot;${TorusField}&amp;quot;Tor_&amp;quot;${IncidentEnergy}&amp;quot;GeV_&amp;quot;${PhiDistribution}&amp;quot;Phi_v2_&amp;quot;${GEMCversion}&amp;quot;_Shield&amp;quot;${ShieldStatus}&amp;quot;_FT&amp;quot;${FTStatus}&amp;quot;_Beamline&amp;quot;${BeamlineStatus}&amp;quot;_VacuumLine&amp;quot;${VacuumLineStatus}&amp;quot;_CadBeamline&amp;quot;${CadBeamlineStatus}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
if [ $ShieldStatus = &amp;quot;Out&amp;quot; ]&lt;br /&gt;
then&lt;br /&gt;
nameOFpath=&amp;quot;${TargetMaterial}&amp;quot;Tar_&amp;quot;${SolenoidField}&amp;quot;Sol_&amp;quot;${TorusField}&amp;quot;Tor_&amp;quot;${IncidentEnergy}&amp;quot;GeV_&amp;quot;${PhiDistribution}&amp;quot;Phi_v2_&amp;quot;${GEMCversion}&amp;quot;_Shield&amp;quot;${ShieldStatus}&amp;quot;&lt;br /&gt;
FTStatus=&amp;quot;x&amp;quot;&lt;br /&gt;
BeamlineStatus=&amp;quot;x&amp;quot;&lt;br /&gt;
VacuumLineStatus=&amp;quot;x&amp;quot;&lt;br /&gt;
CadBeamlineStatus=&amp;quot;x&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
#Make directory&lt;br /&gt;
echo &amp;quot;Creating directory &amp;quot;${nameOFpath}&lt;br /&gt;
mkdir ${nameOFpath}&lt;br /&gt;
echo &amp;quot;*********************************************************&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#Copy needed files to directory&lt;br /&gt;
cp gcard_builder.C ${nameOFpath}&lt;br /&gt;
cp LUND_Spread_IsotropicPhi.C ${nameOFpath}&lt;br /&gt;
cp Block_builder.C ${nameOFpath}&lt;br /&gt;
cp submit_builder.C ${nameOFpath}&lt;br /&gt;
&lt;br /&gt;
#Move into directory&lt;br /&gt;
cd ${nameOFpath}&lt;br /&gt;
&lt;br /&gt;
#Execute LUND creation file&lt;br /&gt;
echo &amp;quot;Creating LUND files......&amp;quot;&lt;br /&gt;
root -l -b -q LUND_Spread_IsotropicPhi.C&lt;br /&gt;
&lt;br /&gt;
#Move LUND file into directory named path&lt;br /&gt;
mv LUND_Spread_IsotropicPhi.LUND ${nameOFpath}.LUND&lt;br /&gt;
&lt;br /&gt;
#Split LUND file&lt;br /&gt;
split -d -l 3000 -a 3 ${nameOFpath}.LUND ${nameOFpath}_&lt;br /&gt;
#Name these components LUND files&lt;br /&gt;
find . -type f  ! -name &amp;quot;*.*&amp;quot; -exec mv {} {}.LUND \;&lt;br /&gt;
#Place the LUND files in individual directories&lt;br /&gt;
find . -name &amp;quot;*.LUND&amp;quot; -exec sh -c 'mkdir &amp;quot;${1%.*}&amp;quot; ; mv &amp;quot;$1&amp;quot; &amp;quot;${1%.*}&amp;quot; ' _ {} \;&lt;br /&gt;
#Execute gcard builder and place gcards in each directory&lt;br /&gt;
echo &amp;quot;*********************************************************&amp;quot;&lt;br /&gt;
echo &amp;quot;Building specific gcards.....&amp;quot;&lt;br /&gt;
root -l -b -q 'gcard_builder.C(&amp;quot;'${TargetMaterial}'&amp;quot;,&amp;quot;'${SolenoidField}'&amp;quot;,&amp;quot;'${TorusField}'&amp;quot;,&amp;quot;'${IncidentEnergy}'&amp;quot;,&amp;quot;'${PhiDistribution}'&amp;quot;,&amp;quot;'${GEMCversion}'&amp;quot;,&amp;quot;'${ShieldStatus}'&amp;quot;,&amp;quot;'${FTStatus}'&amp;quot;,&amp;quot;'${BeamlineStatus}'&amp;quot;,&amp;quot;'${VacuumLineStatus}'&amp;quot;,&amp;quot;'${CadBeamlineStatus}'&amp;quot;)'&lt;br /&gt;
echo &amp;quot;Creating submit files........&amp;quot;&lt;br /&gt;
mkdir submit&lt;br /&gt;
root -l -b -q 'submit_builder.C(&amp;quot;'${nameOFpath}'&amp;quot;)'&lt;br /&gt;
root -l -b -q Block_builder.C&lt;br /&gt;
cd submit&lt;br /&gt;
echo &amp;quot;Changed directory to:${PWD}&amp;quot;&lt;br /&gt;
chmod +x submit*&lt;br /&gt;
chmod +x Block*&lt;br /&gt;
&lt;br /&gt;
#Open screen enviroments to run GEMC for each Block(10 sets of submits at 1000 events each)&lt;br /&gt;
echo &amp;quot;&amp;quot;&lt;br /&gt;
echo &amp;quot;*********************************************************&amp;quot;&lt;br /&gt;
screen -dmS zeroth tcsh&lt;br /&gt;
screen -dmS first tcsh&lt;br /&gt;
screen -dmS second tcsh&lt;br /&gt;
screen -dmS third tcsh&lt;br /&gt;
if [ $PhiDistribution = &amp;quot;Isotropic&amp;quot; ]&lt;br /&gt;
then&lt;br /&gt;
screen -dmS fourth tcsh&lt;br /&gt;
screen -dmS fifth tcsh&lt;br /&gt;
screen -dmS sixth tcsh&lt;br /&gt;
screen -dmS seventh tcsh&lt;br /&gt;
screen -dmS eighth tcsh&lt;br /&gt;
screen -dmS ninth tcsh&lt;br /&gt;
screen -dmS tenth tcsh&lt;br /&gt;
fi&lt;br /&gt;
#Allow enough time for screens to open&lt;br /&gt;
sleep 10&lt;br /&gt;
screen -S zeroth -X stuff &amp;quot;source ~/src/CLAS/GEMC/setup&lt;br /&gt;
&amp;quot;&lt;br /&gt;
screen -S first -X stuff &amp;quot;source ~/src/CLAS/GEMC/setup&lt;br /&gt;
&amp;quot;&lt;br /&gt;
screen -S second -X stuff &amp;quot;source ~/src/CLAS/GEMC/setup&lt;br /&gt;
&amp;quot;&lt;br /&gt;
screen -S third -X stuff &amp;quot;source ~/src/CLAS/GEMC/setup&lt;br /&gt;
&amp;quot;&lt;br /&gt;
if [ $PhiDistribution = &amp;quot;Isotropic&amp;quot; ]&lt;br /&gt;
then&lt;br /&gt;
screen -S fourth -X stuff &amp;quot;source ~/src/CLAS/GEMC/setup&lt;br /&gt;
&amp;quot;&lt;br /&gt;
screen -S fifth -X stuff &amp;quot;source ~/src/CLAS/GEMC/setup&lt;br /&gt;
&amp;quot;&lt;br /&gt;
screen -S sixth -X stuff &amp;quot;source ~/src/CLAS/GEMC/setup&lt;br /&gt;
&amp;quot;&lt;br /&gt;
screen -S seventh -X stuff &amp;quot;source ~/src/CLAS/GEMC/setup&lt;br /&gt;
&amp;quot;&lt;br /&gt;
screen -S eighth -X stuff &amp;quot;source ~/src/CLAS/GEMC/setup&lt;br /&gt;
&amp;quot;&lt;br /&gt;
screen -S ninth -X stuff &amp;quot;source ~/src/CLAS/GEMC/setup&lt;br /&gt;
&amp;quot;&lt;br /&gt;
screen -S tenth -X stuff &amp;quot;source ~/src/CLAS/GEMC/setup&lt;br /&gt;
&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
#Allow time for setup to finish&lt;br /&gt;
sleep 10&lt;br /&gt;
echo &amp;quot;CREATING SCREEN: Name&amp;quot;&lt;br /&gt;
echo &amp;quot;screen: zeroth&amp;quot;&lt;br /&gt;
screen -S zeroth -X stuff &amp;quot;./Block000.csh&lt;br /&gt;
&amp;quot;&lt;br /&gt;
echo &amp;quot;screen: first&amp;quot;&lt;br /&gt;
screen -S first -X stuff &amp;quot;./Block001.csh&lt;br /&gt;
&amp;quot;&lt;br /&gt;
echo &amp;quot;screen: second&amp;quot;&lt;br /&gt;
screen -S second -X stuff &amp;quot;./Block002.csh&lt;br /&gt;
&amp;quot;&lt;br /&gt;
echo &amp;quot;screen: third&amp;quot;&lt;br /&gt;
screen -S third -X stuff &amp;quot;./Block003.csh&lt;br /&gt;
&amp;quot;&lt;br /&gt;
if [ $PhiDistribution = &amp;quot;Isotropic&amp;quot; ]&lt;br /&gt;
then&lt;br /&gt;
echo &amp;quot;screen: fourth&amp;quot;&lt;br /&gt;
screen -S fourth -X stuff &amp;quot;./Block004.csh&lt;br /&gt;
&amp;quot;&lt;br /&gt;
echo &amp;quot;screen: fifth&amp;quot;&lt;br /&gt;
screen -S fifth -X stuff &amp;quot;./Block005.csh&lt;br /&gt;
&amp;quot;&lt;br /&gt;
echo &amp;quot;screen: sixth&amp;quot;&lt;br /&gt;
screen -S sixth -X stuff &amp;quot;./Block006.csh&lt;br /&gt;
&amp;quot;&lt;br /&gt;
echo &amp;quot;screen: seventh&amp;quot;&lt;br /&gt;
screen -S seventh -X stuff &amp;quot;./Block007.csh&lt;br /&gt;
&amp;quot;&lt;br /&gt;
echo &amp;quot;screen: eighth&amp;quot;&lt;br /&gt;
screen -S eighth -X stuff &amp;quot;./Block008.csh&lt;br /&gt;
&amp;quot;&lt;br /&gt;
echo &amp;quot;screen: ninth&amp;quot;&lt;br /&gt;
screen -S ninth -X stuff &amp;quot;./Block009.csh&lt;br /&gt;
&amp;quot;&lt;br /&gt;
echo &amp;quot;screen: tenth&amp;quot;&lt;br /&gt;
screen -S tenth -X stuff &amp;quot;./Block010.csh&lt;br /&gt;
&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;Creating evio files!&amp;quot;&lt;br /&gt;
touch count.txt&lt;br /&gt;
&lt;br /&gt;
Completed=$(numsum count.txt)&lt;br /&gt;
loopcounter=&amp;quot;0&amp;quot;&lt;br /&gt;
if [ $PhiDistribution = &amp;quot;Isotropic&amp;quot; ]&lt;br /&gt;
then&lt;br /&gt;
NumberOfFiles=106&lt;br /&gt;
fi&lt;br /&gt;
if [ $PhiDistribution != &amp;quot;Isotropic&amp;quot; ]&lt;br /&gt;
then&lt;br /&gt;
NumberOfFiles=34&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;[$Completed %] finished&amp;quot;&lt;br /&gt;
while [ $Completed -ne $NumberOfFiles ]&lt;br /&gt;
do&lt;br /&gt;
Completed=$(numsum count.txt)&lt;br /&gt;
loopcounter=$((loopcounter+1))      &lt;br /&gt;
sleep 10&lt;br /&gt;
if [ $((loopcounter%5)) -eq 0 ]&lt;br /&gt;
then&lt;br /&gt;
Pcent=$( echo &amp;quot;scale=1 ; $Completed / $NumberOfFiles / .01&amp;quot; | bc -l)&lt;br /&gt;
echo -n &amp;quot;[$Pcent %] finished&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;.&amp;quot;&lt;br /&gt;
done&lt;br /&gt;
echo $Completed&amp;quot; GEMC evio files created&amp;quot;&lt;br /&gt;
echo &amp;quot;Closing screens&amp;quot;&lt;br /&gt;
killall screen&lt;br /&gt;
echo &amp;quot;***********************************************************&amp;quot;&lt;br /&gt;
echo &amp;quot;&amp;quot;&lt;br /&gt;
echo &amp;quot;Creating virtual folder on lds2&amp;quot;&lt;br /&gt;
sshpass -p 'c0d/\2.0' ssh -o StrictHostKeyChecking=no lds@lds2.physics.isu.edu &amp;quot;./first_commands.tcsh&amp;quot;&lt;br /&gt;
echo &amp;quot;Run evio2Root&amp;quot;&lt;br /&gt;
sleep 2&lt;br /&gt;
sshpass -p 'c0d/\2.0' ssh -o StrictHostKeyChecking=no lds@lds2.physics.isu.edu &amp;quot;./second_commands.tcsh $nameOFpath&amp;quot;&lt;br /&gt;
sleep 2&lt;br /&gt;
sshpass -p 'c0d/\2.0' ssh -o StrictHostKeyChecking=no lds@lds2.physics.isu.edu &amp;quot;./last_commands.tcsh&amp;quot;&lt;br /&gt;
echo &amp;quot;GEMC Program finished!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Vanwdani</name></author>
	</entry>
</feed>