my $Statistics;
my $PMap;
my $hitcount;
+my $pixelcount;
###############################################################################
## Configuration ##############################################################
my $opt_picpath = "./";
my $totalevents = 1E9;
my $opt_movie = 0;
+my $opt_hitrates = 0;
my $mode = "";
my $system = "null";
'f|file=s' => \$file,
'v|verb' => \$opt_verb,
'i|info' => \$opt_frameinfo,
+ 'r|hitrate' => \$opt_hitrates,
'd|debug' => \$opt_debug,
'p|picpath=s' => \$opt_picpath,
'm|movie=i' => \$opt_movie,
printf("[-d|--debug] More debugging output\n");
printf("[-m|--movie] Make a slideshow of frames\n");
printf("[-s|--system] <name>Name of the system\n");
+ printf("[-r|hitrate] Show statistics of pixels per bank\n");
printf("[-p|--picpath] Set where to write plots\n");
printf("\n");
exit;
$column = ($d >> 2) & 0x7FF;
printf("\t$line, $column x %d\n",$pixels+1) if $opt_frameinfo;
$hitcount->{$SensorId}++;
+ $pixelcount->{$SensorId}->[$column/288]+=$pixels;
$matrix->[$line]->[$column]++;
if ($pixels > 0) {
$matrix->[$line]->[$column+1]++;
my ($num ) = @_;
$num = "_".$num if defined $num;
$num = "" unless defined $num;
-
+
+ if($opt_hitrates) {
+ printf ("===============\n");
+ printf ("== Summary ==\n");
+ printf ("===============\n");
+ printf ("Sensor\tStates\tGood\tBroken\tInvalid\t\tBank0\t\tBank1\t\tBank2\t\tBank3\n");
+ }
foreach my $id (keys $Statistics) {
#No frames? No plot!
if(!defined $Statistics->{$id}->{Valid}) {next;}
+ if($opt_hitrates) {
+
+ printf("%s\t%i\t%i\t%i\t%i\t%10i\t%10i\t%10i\t%10i\n",
+ $id,
+ $hitcount->{$id},
+ $Statistics->{$id}->{Valid}||0,
+ $Statistics->{$id}->{Broken}||0,
+ $Statistics->{$id}->{RealBroken}||0,
+ $pixelcount->{$id}->[0]||0,
+ $pixelcount->{$id}->[1]||0,
+ $pixelcount->{$id}->[2]||0,
+ $pixelcount->{$id}->[3]||0
+ );
+ }
+
if(!defined $fg) {
$fg = new FileHandle ("|gnuplot") or die "error: no gnuplot";
$fg->autoflush(1);
$fg->close();
$fg = undef;
}
- print DumpTree $Statistics;
+ #print DumpTree $Statistics;
}