#!/usr/local/bin/perl # to run the plotter directly: # ./plotter leak /alice1/trd/TestROC/L1C1/025/L1C1#025g_leak_data.txt 025- if(!defined($ARGV[0])) {die "Please give me the ROC type!\n";} $roctype = $ARGV[0]; @tests = ("leak","cond","guni_1d","guni_2d","gabs","spec","stab"); $indir = "/alice1/trd/TestROC/".$roctype."/"; $outfile = ">>run_plotter.out"; open(OUTFILE,$outfile) or die "ERROR: Cannot open $outfile!\n"; $errfile = ">>run_plotter.err"; open(ERRFILE,$errfile) or die "ERROR: Cannot open $errfile!\n"; for($rocidx=0; $rocidx<100; $rocidx++){ $rocnum = $rocidx; if($rocidx<10) {$rocnum = "00".$rocidx;} if($rocidx>9) {$rocnum = "0".$rocidx;} $outpath = "OUTPUTS/trd-db-files/".$roctype."/".$rocnum."-"; foreach $testtype (@tests) { $infile = $indir.$rocnum."/".$roctype."#".$rocnum."g_".$testtype; if($testtype =~ /guni/) {$infile = $infile.".txt";} else {$infile = $infile."_data.txt";} if(!(-s $infile)) { print ERRFILE "ROC $roctype-$rocnum has no $testtype file. Skipping\n"; next; } else { print ERRFILE " Found $testtype file for ROC $roctype-$rocnum\n"; } `./plotter $testtype $infile $outpath`; undef($infile); } @allfiles = `ls $outpath*`; my $numfiles = scalar(@allfiles); print OUTFILE "ROC $roctype-$rocnum has $numfiles plots\n"; } close(OUTFILE); close(ERRFILE);