Skip to content

Commit efd25e4

Browse files
committed
Modified sample shell scripts, but they may need more explantions how to
use modified: shell/Launcher.sh modified: shell/Launcher_analyzeWCSim.sh modified: shell/Merger_analyzeWCSim.sh modified: shell/generateShell.c deleted: shell/generateShell.c~ modified: shell/generateShell_analyzeWCSim.c
1 parent c46afe6 commit efd25e4

File tree

6 files changed

+45
-88
lines changed

6 files changed

+45
-88
lines changed

shell/Launcher.sh

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
#!/bin/zsh +x
2+
# Sampele shell scripts showing how to process in queue system in sukap
3+
# This assums to be used with generateShell.c
4+
5+
if [ ! -d ${LEAFDIR}/jobs ];then
6+
mkdir ${LEAFDIR}/jobs
7+
fi
8+
29
neventPerFile=500
3-
for e in 10;do
4-
#for e in 3 4 5 6;do
5-
#for e in 3 4 5 6 8 10 15;do
6-
#for e in 3;do
7-
#for e in 8;do
8-
#for e in 6 8;do
9-
#for e in 8 10 15;do
10-
#for e in 2;do
11-
# for i in {0..0};do
10+
for e in 3 4 5 6 8 10 15;do
1211
for i in {0..49999};do
13-
# for i in {50000..99999};do
14-
# for i in {0..9999};do
1512
f=$((${i}/$neventPerFile))
1613
q=$(($i - ${f}*${neventPerFile}))
1714
if [ $q -eq 0 ];
1815
then
1916
echo $i
20-
# qsub -q all -e ${LEAFDIR}/jobs/fitLE_e${e}_start${i}.err -o ${LEAFDIR}/jobs/fitLE_e${e}_start${i}.log ${LEAFDIR}/jobs/fitLE_e${e}_start${i}.sh
21-
#mv /disk01/usr5/bquilain/LEAF_hkhybridmpmt10pc14374100Hz_4.2kHzbl_10MeV_tmp${i}.root /disk01/usr5/bquilain/LEAF_hkhybridmpmt10pc14374100Hz_4.2kHzbl_10MeV_tmpdir_${i}.root
2217
qsub -q all -e ${LEAFDIR}/jobs/fitLE_e${e}_start${i}.err -o ${LEAFDIR}/jobs/fitLE_e${e}_start${i}.log ${LEAFDIR}/jobs/fitLE_e${e}_start${i}.sh
2318
fi
2419
done
2520
done
21+

shell/Launcher_analyzeWCSim.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
#!/bin/zsh +x
2+
# Sampele shell scripts showing how to process in queue system in sukap
3+
# This assums to be used with generateShell_analyzeWCSim.c
4+
#
25
neventPerFile=1000
3-
for e in 10;do
4-
#for e in 3 4 5 6 8 10 15;do
5-
# for i in {0..0};do
6+
for e in 3 4 5 6 8 10 15;do
67
for i in {0..99999};do
78
f=$((${i}/$neventPerFile))
89
q=$(($i - ${f}*${neventPerFile}))
910
if [ $q -eq 0 ];
1011
then
1112
echo $i
12-
qsub -q atmpd -e ${LEAFDIR}/jobs/analyzeLE_e${e}_start${i}.err -o ${LEAFDIR}/jobs/analyzeLE_e${e}_start${i}.log ${LEAFDIR}/jobs/analyzeLE_e${e}_start${i}.sh
13+
qsub -q all -e ${LEAFDIR}/jobs/analyzeLE_e${e}_start${i}.err -o ${LEAFDIR}/jobs/analyzeLE_e${e}_start${i}.log ${LEAFDIR}/jobs/analyzeLE_e${e}_start${i}.sh
1314
fi
1415
done
1516
done

shell/Merger_analyzeWCSim.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/zsh +x
2-
for e in 10;do
3-
#for e in 3 4 5 6 8 10 15;do
2+
# Sampele shell scripts showing how to process in queue system in sukap
3+
# This assums to be used with Launcher_analyzeWCSim.sh and generateShell_analyzeWCSim.c
4+
#
5+
# This just merge generated root-files by them
6+
7+
for e in 3 4 5 6 8 10 15;do
48
hadd -f /disk01/usr5/bquilain/Analyze_hkhybridmpmt10pc14374100Hz_4.2kHzbl_${e}MeV.root /disk01/usr5/bquilain/Analyze_hkhybridmpmt10pc14374100Hz_4.2kHzbl_${e}MeV_tmp*.root
59
done

shell/generateShell.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// This is a sample script to be executed in root
2+
// Usage: root generateShell.c
3+
14
{
25
char * ShellName = new char[256];
36
ofstream ShellFile(ShellName);
@@ -7,27 +10,24 @@
710
double dr = 0;
811
bool mPMT = true;
912
double dr_mPMT = 0;
10-
13+
1114
int nevents=50000;
1215
int neventsPerFile=500;
13-
//for(int nrj=10;nrj<11;nrj++){
14-
for(int nrj=3;nrj<16;nrj++){
15-
//sprintf(infilename,"/disk01/usr5/bquilain/wcsim_hkhybridmpmt10pc14374100Hz_4.2kHzBL_e%d_center_nominal_closewall_0hitstrigger_100000.root",nrj);
16-
sprintf(infilename,"/disk01/usr5/bquilain/wcsim_hkhybridmpmt10pc14374100Hz_4.2kHzBL_e%d_center_nominal_fulltank_0hitstrigger_100000.root",nrj);
16+
for(int nrj=3;nrj<16;nrj++){ // nrj -> energy
17+
sprintf(infilename,"/disk01/usr5/bquilain/wcsim_hkhybridmpmt10pc14374100Hz_4.2kHzBL_e%d_center_nominal_fulltank_0hitstrigger_100000.root",nrj); // WCSim file to be analyzed
1718

1819
for(int startBin=0;startBin<nevents;startBin+=neventsPerFile){
19-
sprintf(ShellName,"%s/jobs/fitLE_e%d_start%d.sh",LEAFDIR,nrj,startBin);
20-
sprintf(outfilename,"/disk01/usr5/bquilain/LEAFv2_hkhybridmpmt10pc14374100Hz_4.2kHzbl_%dMeV_tmp%d.root",nrj,startBin);
21-
20+
sprintf(ShellName,"%s/jobs/fitLE_e%d_start%d.sh",LEAFDIR,nrj,startBin); // shell file to be submitted to queue system
21+
sprintf(outfilename,"%s/jobs/root/hkhybridmpmt10pc14374100Hz_4.2kHzbl_%dMeV_tmp%d.root",LEAFDIR, nrj,startBin); // outpu t file name of process
22+
2223
ofstream ShellFile(ShellName);
2324
if(ShellFile){
24-
ShellFile<<"#!/bin/bash"<<endl;
25-
ShellFile<<Form("rm -f %s",outfilename)<<endl;
26-
ShellFile<<Form("source /disk01/usr5/bquilain/LEAF/LEAF_v1.5/LEAF/RunAtStart_sukap.sh")<<endl;
27-
ShellFile<<Form("%s/app/analysis %s %s %d %d %2.2f %s",LEAFDIR,infilename,outfilename,startBin,startBin+neventsPerFile,dr,mPMT?Form("%2.2f",dr_mPMT),"")<<endl;
28-
//ShellFile<<Form("/home/bquilain/nuPRISM/BenjaminAnalysis/FitVertexLE_v2 -f %s -o %s -s %d -e %d",infilename,outfilename,startBin,startBin+neventsPerFile)<<endl;
29-
//ShellFile<<Form("%s/app/FitVertexLE -f %s -o %s -s %d -e %d",LEAFDIR,infilename2,outfilename2,startBin,startBin+neventsPerFile)<<endl;
25+
ShellFile<<"#!/bin/bash"<<endl;
26+
ShellFile<<Form("rm -f %s",outfilename)<<endl;
27+
ShellFile<<Form("source %s/RunAtStart_sukap.sh", LEAFDIR)<<endl;
28+
ShellFile<<Form("%s/example/analysis %s %s %d %d %2.2f %s",LEAFDIR,infilename,outfilename,startBin,startBin+neventsPerFile,dr,mPMT?Form("%2.2f",dr_mPMT),"")<<endl;
3029
}
30+
ShellFile.close();
3131
}
3232
}
3333
}

shell/generateShell.c~

Lines changed: 0 additions & 44 deletions
This file was deleted.

shell/generateShell_analyzeWCSim.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1+
// This is a sample script to be executed in root
2+
// Usage: root generateShell_analyzeWCSim.c
3+
14
{
25
char * ShellName = new char[256];
36
ofstream ShellFile(ShellName);
47
char * infilename = new char[512];char * infilename2 = new char[512];
58
char * outfilename = new char[512];char * outfilename2 = new char[512];
69
char * LEAFDIR = getenv("LEAFDIR");
7-
10+
811
int nevents=100000;
912
int neventsPerFile=1000;
1013

1114
for(int nrj=10;nrj<11;nrj++){
12-
//sprintf(infilename,"/disk01/usr5/bquilain/wcsim_hkhybridmpmt10pc14374100Hz_4.2kHzBL_e%d_center_nominal_fulltank_0hitstrigger_100000_nodr.root",nrj);
13-
//sprintf(infilename,"/disk01/usr5/bquilain/wcsim_hkhybridmpmt10pc14374100Hz_4.2kHzBL_e%d_center_nominal_fulltank_0hitstrigger_100000.root",nrj);
14-
sprintf(infilename,"/disk01/usr5/bquilain/wcsim_hkhybridmpmt10pc14374100Hz_4.2kHzBL_e%d_center_nominal_fulltank_0hitstrigger_100000_nodr.root",nrj);
15-
//sprintf(infilename,"/disk01/usr5/bquilain/wcsim_hkhybridmpmt10pc14374100Hz_4.2kHzBL_e%d_center_nominal_closewall_0hitstrigger_100000.root",nrj);
16-
15+
sprintf(infilename,"/disk01/usr5/bquilain/wcsim_hkhybridmpmt10pc14374100Hz_4.2kHzBL_e%d_center_nominal_fulltank_0hitstrigger_100000_nodr.root",nrj); // WCSim file to be analyzed
16+
1717
for(int startBin=0;startBin<nevents;startBin+=neventsPerFile){
18-
sprintf(ShellName,"%s/jobs/analyzeLE_e%d_start%d.sh",LEAFDIR,nrj,startBin);
18+
sprintf(ShellName,"%s/jobs/analyzeLE_e%d_start%d.sh",LEAFDIR,nrj,startBin); // Shell file to be submitted in queue system
1919
sprintf(outfilename,"/disk01/usr5/bquilain/Analyze_hkhybridmpmt10pc14374100Hz_4.2kHzbl_%dMeV_tmp%d.root",nrj,startBin);
20-
20+
2121
ofstream ShellFile(ShellName);
2222
if(ShellFile){
23-
ShellFile<<"#!/bin/bash"<<endl;
24-
ShellFile<<Form("rm -f %s",outfilename)<<endl;
25-
ShellFile<<Form("%s/app/AnalyzeWSHierarchy -h -f %s -o %s -s %d -e %d",LEAFDIR,infilename,outfilename,startBin,startBin+neventsPerFile)<<endl;
23+
ShellFile<<"#!/bin/bash"<<endl;
24+
ShellFile<<Form("rm -f %s",outfilename)<<endl;
25+
ShellFile<<Form("%s/macros/AnalyzeWSHierarchy -h -f %s -o %s -s %d -e %d",LEAFDIR,infilename,outfilename,startBin,startBin+neventsPerFile)<<endl;
2626
}
2727
}
2828
}

0 commit comments

Comments
 (0)