Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8308596
callHiggsBounds.cgi
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Subscribers
None
callHiggsBounds.cgi
View Options
#!/usr/bin/perl -T -w
use CGI;
use strict;
##use warnings; To see warnings while debugging, uncomment next line:
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use lib "/hepforge/home/higgsbounds/public_html/cgi-bin";
use Gettestdata qw(fillnewhash %newhash @effChi @partR @tevhadXS @Brhi @whichinputlist %option checksettings);
use DrawTables qw(newtable);
my $query = '';
my $str = '';
my $i = '';my $j = '';my $k = '';my $n = '';my $ii = '';my $jj = '';my $kk = '';my $nn = '';my $t = '';my $A = '';
my $myprogram = '';
my @myoutput = '';
my $mycommand = '';
my $testvar2 = '';
my $nelements = '';
print "Content-type: text/html\r\n\r\n";
print "<HTML>\n";
print '<HEAD><link rel="stylesheet" type="text/css"href="http://projects.hepforge.org/higgsbounds/HBstyle.css"><TITLE>HiggsBounds</TITLE></HEAD>'."\n";
print "<BODY>\n";
print '<table border="0">'."\n";
print "<tr>\n";
print "<td width=275>\n";
print "<h1>HiggsBounds</h1>\n";
#print '<img src="http://projects.hepforge.org/higgsbounds//HiggsBounds/HiggsBounds-logo-small.jpg" alt="HiggsBounds logo" height="180" align="right" vspace=18 hspace=18>'."\n";
print "<br>\n";
checksettings();
fillnewhash();
$query = new CGI;
sub getarraysingP{
my $str= $_[0];
$nelements = $newhash{$str}{nPj};
for ($i = 1; $i <= $nelements; ++$i){
if($newhash{$str}{req} ne 'Not needed'){
$newhash{$str}{array}[$i-1] = $query->param($newhash{$str}{label}[0].$i.$newhash{$str}{label}[1]);
}
else{
$newhash{$str}{array}[$i-1] = '0';
}
}
}
sub getarraydoubPTri{
my $str= $_[0];
$nelements = $newhash{$str}{nPj};
$k=0;
for ($j = 1; $j <= $nelements; ++$j){
for ($i = 1; $i <= $nelements; ++$i){
if ($j >= $i) {
$k=$k+1;
if($newhash{$str}{req} ne 'Not needed'){
$newhash{$str}{array}[$k-1] = $query->param($newhash{$str}{label}[0].$j.$newhash{$str}{label}[1].$i.$newhash{$str}{label}[2]);
}
else{
$newhash{$str}{array}[$k-1] = '0';
}
}
}
}
}
sub getarraydoubPNoDiag{
my $str= $_[0];
$nelements = $newhash{$str}{nPj};
$n=0;
for ($j = 1; $j <= $nelements; ++$j){
for ($i = 1; $i <= $nelements; ++$i){
if ($j != $i) {
$n=$n+1;
if($newhash{$str}{req} ne 'Not needed'){
$newhash{$str}{array}[$n-1] = $query->param($newhash{$str}{label}[0].$j.$newhash{$str}{label}[1].$i.$newhash{$str}{label}[2]);
}
else{
$newhash{$str}{array}[$n-1] = '0';
}
}
}
}
}
sub getarraydoubPRect{
my $str= $_[0];
my $nj = $newhash{$str}{nPj};
my $ni = $newhash{$str}{nPi};
$n=0;
for ($j = 1; $j <= $nj; ++$j){
for ($i = 1; $i <= $ni; ++$i){
$n=$n+1;
if($newhash{$str}{req} ne 'Not needed'){
$newhash{$str}{array}[$n-1] = $query->param($newhash{$str}{label}[0].$j.$newhash{$str}{label}[1].$i.$newhash{$str}{label}[2]);
}
else{
$newhash{$str}{array}[$n-1] = '0';
}
}
}
}
sub getarrayother{
my $str= $_[0];
if($newhash{$str}{req} ne 'Not needed'){
$newhash{$str}{array}[0] = $query->param($newhash{$str}{label});
}
else{
$newhash{$str}{array}[0] = '0';
}
}
sub getarray{
my $str = $_[0];
if($newhash{$str}{type} eq "singP"){
getarraysingP($str);
}
elsif($newhash{$str}{type} eq "doubPTri"){
getarraydoubPTri($str);
}
elsif($newhash{$str}{type} eq "doubPNoDiag"){
getarraydoubPNoDiag($str);
}
elsif($newhash{$str}{type} eq "doubPRect"){
getarraydoubPRect($str);
}
elsif($newhash{$str}{type} eq "other"){
getarrayother($str);
}
else{
print "Error in sub getarray. <br>~".$newhash{$str}{type}.'~';
die;
}
}
foreach my $t (@whichinputlist){
getarray($t);
}
##################################
my @commandlinenumbersarray="";
foreach $t (@whichinputlist) {
foreach $A (@{$newhash{$t}{array}}) {
if ( ($newhash{$t}{nPj}==1) && ($newhash{$t}{type} eq 'doubPNoDiag') ) {
}# i.e. no data required for this $t
else {
#if ((length($A) == 0)&&($nHneut>1)&&($k!=10)) {
if ( (length($A) == 0) ) {
print "Missing input data ".$t;
die;
}
if (length($A) > 20) {
print "Input data too long";
die;
}
if ($A =~ /^([0-9\.E\-\+]+)$/) {
$A = $1;
}
else {
print "Bad input data";
die;
}
$testvar2 = $A;
$testvar2 =~ s/[0-9E\-\+]//g;
if (length($testvar2) > 1) {
print "Too many decimal points";
die;
}
$testvar2 = $A;
$testvar2 =~ s/[0-9\.]//g;
if (($testvar2 != "" )||($testvar2 != "E-" )||($testvar2 != "E+")) {
print "Wrong input";
die;
}
@commandlinenumbersarray=(@commandlinenumbersarray,$A);
}
#print 'hello 1 t '.$t.'<br>';
#print 'hello 1 A '.$A.'<br>';
}
}
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; # Make %ENV safer
$ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin';
#$myprogram = '/usr/local/bin/HiggsBounds';
$myprogram = '/hepforge/home/higgsbounds/HBWebsiteExe/HiggsBounds';
my $commandlinenumbers="";
foreach $A (@commandlinenumbersarray){
$commandlinenumbers = $commandlinenumbers.' '.$A ;
}
$mycommand = $myprogram.' '.$option{whichanalyses}{selection}.' '.$option{whichinput}{selection}.' '
.$option{nHneut}{selection}.' '.$option{nHplus}{selection}.' '
.$option{nChineut}{selection}.' '.$option{nChiplus}{selection}.' '
.$option{debugmode}{selection}.' '
.$commandlinenumbers.' 2>&1';
# the 2>&1 means that it adds the standard error to the standard output
if( $option{debugmode}{selection} eq 'T'){ print '<pre>'.$mycommand.'</pre><br>'."\n";}
#print '<pre>'.$mycommand.'</pre><br>'."\n";
#print $whichanalyses.'<br>'."\n";
print "Calling program... <br>";
@myoutput = `$mycommand`;
print "program finished.";
print "</td>\n";
print "<td>\n";
print '<img src="http://projects.hepforge.org/higgsbounds/include/HiggsBounds-logo-tiny.jpg" alt="HiggsBounds logo">'."\n";
print "</td>\n";
print "</tr>\n";
print "</table>\n";
print "<H2>Results</H2>";
print "<PRE>\n";
print @myoutput;
print "</PRE>\n";
my $blankcell = '<td bgcolor="#F1F1F1" WIDTH = 110> </td>';
# can be different to HiggsBounds_input:
my $tdopt1 = 'align=center WIDTH = 150';
my $tdopt2 = 'WIDTH = 150 STYLE="border-width: 1px; border-style: solid; border-color:#CCCCCC"';
my $tdopt3 = 'bgcolor="#F1F1F1" WIDTH = 140 align=center';
#print "<H3>Input Values:</H3>";
#copied from HiggsBounds_input but wih the substitutions:
#~<INPUT VALUE="~ to ~~
#~" '.$inopt2.'>~ to ~~
#(look between ~)
#############################################################################
#print '<a href="http://projects.hepforge.org/higgsbounds//HiggsBounds.html">back to homepage</a></br>';
#if($getdebugmode eq 'T'){print '<a href="http://projects.hepforge.org/higgsbounds//HiggsBounds_debug.html">back to debugging page</a></br>';}
print '</BODY>'."\n";
print '</HTML>'."\n";
File Metadata
Details
Attached
Mime Type
text/html
Expires
Sat, Dec 21, 12:32 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4022784
Default Alt Text
callHiggsBounds.cgi (6 KB)
Attached To
rHIGGSBOUNDSSVN higgsboundssvn
Event Timeline
Log In to Comment