Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-10-16 08:16:19

0001 #!/usr/bin/env perl
0002 use strict;
0003 use warnings;
0004 use DBI;
0005 
0006 my $dbname = "daq";
0007 my $host   = "sphnxdaqdbreplica";
0008 
0009 my $dbh = DBI->connect("dbi:Pg:dbname=$dbname;host=$host",
0010                        undef, undef,
0011                        { RaiseError => 1, AutoCommit => 1 })
0012           or die $DBI::errstr;
0013 
0014 my $sql = qq{
0015     SELECT DISTINCT runnumber
0016     FROM filelist
0017     WHERE runnumber BETWEEN 47289 AND 53880
0018       AND hostname = 'gl1daq'
0019       AND filename LIKE '%physics%'
0020     ORDER BY runnumber;
0021 };
0022 
0023 my $sth = $dbh->prepare($sql);
0024 $sth->execute();
0025 
0026 open my $out, ">", "gl1_physics_runlist.txt" or die $!;
0027 
0028 while (my ($run) = $sth->fetchrow_array) {
0029     print $out "$run\n";
0030 }
0031 
0032 close $out;
0033 $sth->finish;
0034 $dbh->disconnect;
0035 
0036 print "Done.. created runlist: gl1_physics_runlist.txt\n";