File indexing completed on 2026-04-06 08:08:19
0001
0002
0003 use strict;
0004 use DBI;
0005
0006
0007 my $filename = 'RunList_golden.txt';
0008 open(my $fh,'<',$filename) or die "Could not open file '$filename' $!";
0009
0010
0011 my $dbh = DBI->connect("dbi:ODBC:RawdataCatalog_read","") || die $DBI::error;
0012
0013 my @hostnames = ("seb00","seb01","seb02","seb03","seb04","seb05","seb06","seb07","seb08",
0014 "seb09","seb10","seb11","seb12","seb13","seb14","seb15");
0015
0016 while (my $line = <$fh>) {
0017 chomp($line);
0018 my $feminfoname = "FEM_folder/fem_${line}.txt";
0019 open(my $feminfofile,'<',$feminfoname) or die "Could not open '$feminfoname' $!";
0020
0021
0022 my $fem_matching = 1;
0023
0024
0025 my $clock_value = -1;
0026
0027
0028 my $current_seb = "sebXX";
0029
0030
0031
0032 my $checkClock = 0;
0033
0034 while (my $rawline = <$feminfofile>) {
0035 if ($rawline =~ /^(seb\S+)/) {
0036 $current_seb = $1;
0037
0038 if ($current_seb ~~ @hostnames) {
0039
0040 $checkClock = 1;
0041 }
0042
0043 else {
0044 $checkClock = 0;
0045 }
0046 }
0047
0048
0049 if ($checkClock) {
0050
0051 if ($rawline =~ /^FEM Clock: \s+(\S+)./) {
0052
0053 if ($clock_value == -1) {
0054 if (($current_seb eq "seb16") || ($current_seb eq "seb17") || ($current_seb eq "seb20")) {
0055 $clock_value = $1 - 1;
0056 }
0057 else {
0058 $clock_value = $1;
0059 }
0060 }
0061 else {
0062 if ((($current_seb eq "seb16") || ($current_seb eq "seb17") || ($current_seb eq "seb20")) && ($1 ne $clock_value + 1)) {
0063 $fem_matching = 0;
0064 last;
0065 }
0066 elsif ((($current_seb ne "seb16") && ($current_seb ne "seb17") || ($current_seb eq "seb20")) && ($1 ne $clock_value)) {
0067 $fem_matching = 0;
0068 last;
0069 }
0070 }
0071 }
0072
0073
0074 if ($rawline =~ /^FEM Clock:\s+(\S+)\s+(\S+)\s+(\S+)/) {
0075 if (($1 ne $2) || ($1 ne $3) || ($2 ne $3)) {
0076 $fem_matching = 0;
0077 last;
0078 }
0079 }
0080 elsif ($rawline =~ /^FEM Clock: \s+(\S+)\s+(\S+)/) {
0081 if ($1 ne $2) {
0082 $fem_matching = 0;
0083 last;
0084 }
0085 }
0086 }
0087 }
0088 close($feminfofile);
0089
0090 if ($fem_matching) {
0091 print "$line\n";
0092 }
0093 }
0094
0095 close($fh);
0096
0097 $dbh->disconnect;