Running Expanded LUND files in GEMC

From New IAC Wiki
Revision as of 16:28, 6 June 2016 by Vanwdani (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Since the LUND file is limited to 75000 particles (225000 lines), the gemc will have to be run in batch mode;

Creating a batch directory, with two subdirectories; 1)Phi_Parts, 2)submit.

1)Once the LUND file is broken into 178 parts, they can have the LUND extension added by:

prename 's/(Phi_Parts_\d{4})/$1.LUND/' Phi_Parts_*

Placing each of these files into its own directory, within a directory named Phi_Parts

find . -name "*.LUND" -exec sh -c 'mkdir "${1%.*}" ; mv "$1" "${1%.*}" ' _ {} \;

2)Creating the submit directory, and using a c++ program, creating the needed 178

#include <iomanip>
#include <sstream>
#include <iostream>
#include <fstream>

using namespace std;

void submit() {

        for(int a=0;a<2;a++)
                for(int b=0;b<10;b++)
                        for(int c=0;c<10;c++)
                                string filename="submit0";
                                stringstream hundreds;
                                        hundreds << a;
                                stringstream tens;
                                        tens << b;
                                stringstream ones;
                                        ones << c;
                                string fullname="";
                                fullname=filename + hundreds.str() + tens.str() + ones.str();
                        //              cout << fullname << "\n";
                                ofstream myfile;
                                myfile << "#!/bin/sh\n";
                                myfile << "#PBS -l nodes=1\n";
                                myfile << "#PBS -A FIAC\n";   
                                myfile << "#PBS -M\n";
                                myfile << "#PBS -m abe\n";
                                myfile << "#\n";
                                myfile << "cd /home/lds/src/CLAS/GEMC\n";
                                myfile << "tcsh\n";
                                myfile << "source setup\n";
                                myfile << "cd /home/lds/src/GEANT/geant4.9.6/geant4.9.6-install/bin/\n";
                                myfile << "cd /home/vanwdani/src/GEANT4/geant4.9.6/Simulations/Research/Moller/batch/Phi_Parts/Phi_Parts_0";
                                        myfile <<a<<b<<c<<"\n";
                                myfile << "gemc -USE_GUI=0 -Hall_Material=\"Vacuum\" -INPUT_GEN_FILE=\"LUND, Phi_Parts_0";
                                        myfile <<a<<b<<c;
                                        myfile << ".LUND\" -N=75000 eg12.gcard\n";
                                myfile << "~/src/CLAS/coatjava-1.0/bin/clas12-reconstruction -i eg12.ev -config DCHB::torus=1.0 ";
                                        myfile << "-config DCHB::solenoid=0.0 -config DCTB::kalman=true -o eg12_rec.ev  -s DCHB:DCTB:EC:FTOF:EB\n";
                                myfile << "~/src/CLAS/coatjava-1.0/bin/run-groovy Analysis.groovy eg12_rec.0.evio\n";

This creates the submitXXXX file

#PBS -l nodes=1
#PBS -m abe
cd /home/lds/src/CLAS/GEMC
source setup
cd /home/lds/src/GEANT/geant4.9.6/geant4.9.6-install/bin/
cd /home/vanwdani/src/GEANT4/geant4.9.6/Simulations/Research/Moller/batch/Phi_Parts/Phi_Parts_0000
gemc -USE_GUI=0 -Hall_Material="Vacuum" -INPUT_GEN_FILE="LUND, Phi_Parts_0000.LUND" -N=75000 eg12.gcard
~/src/CLAS/coatjava-1.0/bin/clas12-reconstruction -i eg12.ev -config DCHB::torus=1.0 -config DCHB::solenoid=0.0 -config DCTB::kalman=true -o eg12_rec.ev  -s DCHB:DCTB:EC:FTOF:EB
~/src/CLAS/coatjava-1.0/bin/run-groovy Analysis.groovy eg12_rec.0.evio

Creating a file named lds-submit

Screen Shot 2016-03-15 at 2.36.26 PM.png