Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-04-05 08:08:19

0001 #!/usr/bin/perl
0002 
0003 use strict;
0004 use DBI; # Database interface 
0005 
0006 # Read file
0007 my $filename = 'RunList_ana450_2024p009_DSTs_available.txt';
0008 open(my $fh,'<',$filename) or die "Could not open file '$filename' $!";
0009 
0010 # connect to the database daq
0011 my $dbh = DBI->connect("dbi:ODBC:FileCatalog","") || die $DBI::error;
0012 
0013 while (my $line = <$fh>) {
0014     chomp($line);
0015     my $gettab = $dbh->prepare("SELECT runnumber FROM datasets WHERE runnumber=$line AND dataset LIKE 'ana450_2024p009' AND dsttype LIKE 'DST_CALO_run2pp'GROUP BY runnumber HAVING SUM(events) >= 500000;");
0016     $gettab->execute();
0017 # print the first entries:
0018     my @row;
0019     while (@row = $gettab->fetchrow_array) {
0020         print join(" ", @row), "\n";
0021     }
0022 }
0023 
0024 close($fh); # Close the file handle.
0025 
0026 $dbh->disconnect;