Page MenuHomeHEPForge

HiggsBounds_input.cgi
No OneTemporary

HiggsBounds_input.cgi

#!/usr/bin/perl -T -w
#=================================================================================================================
#
# This perl cgi script is used to create the form used to enter the input for the webversion of HiggsBounds.
#
#=================================================================================================================
{
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 lib "/var/www/cgi-bin";
#use Gettestdata;
use Gettestdata qw(fillnewhash %option @whichinputlist checksettings);
use DrawTables qw(newtable);
use Examples qw(fillwithexample $optionmenuattop);
#use GetinputfromFH qw(parseFHinput);
#-----------------------------------------------------------------------------------------------------------
# declare/initialise some variables
my $i = '';my $j = '';my $k = '';my $p = '';my $q = '';
my $y = '';my $n = '';my $x = '';my $z = '';
my $A = '';my $testvar2 = ''; my $t = '';my $MHiggsSM = '';
my $query = '';
my @topofpageopt='';
#-----------------------------------------------------------------------------------------------------------
# store some bits of html in strings, which will be useful later
my $tdopt1 = 'align=center';
my $tdopt2 = '';
my $tdopt3 = 'bgcolor="#F1F1F1" WIDTH = 140 align=center';
my $inopt1 = 'TYPE=TEXT SIZE=15 MAXLENGTH=20';
my $inopt2 = $inopt1; # will be changed further down...
my $blankcell = '<td bgcolor="#F1F1F1" WIDTH = 110>&nbsp;</td>';
#my $menuhilight='bordercolor=#rrggbb border="3" width=69 ';
#my $menuplain='bordercolor=#FFFFFF border="3" width=69 ';
my $menuhilight='class="menuhilight" ';
my $menuplain='class="menuplain" ';
#-----------------------------------------------------------------------------------------------------------
# start writing the html for the page
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">'."\n";
print '<meta http-equiv="content-type" content="text/html; charset=utf-8" >'."\n";
print '<TITLE>Higgs Bounds Input</TITLE>'."\n";
print '</HEAD>'."\n";
print '<BODY>'."\n";
#-----------------------------------------------------------------------------------------------------------
# call the subroutine that checks that the flags e,g, whichinput have been set to appropriate values
checksettings();
#-----------------------------------------------------------------------------------------------------------
print '<h1>HiggsBounds</h1>'."\n";
#-----------------------------------------------------------------------------------------------------------
# get MHiggsSM, which gives the Higgs mass entered by the user on index.html for the SM or 4th gen examples
$query = new CGI;
$MHiggsSM = $query->param('MHiggsSM');
foreach $A ($MHiggsSM){
if (length($A) > 20) {
print "Input data too long";
die;
}
if ($A =~ /^([0-9\.E\-\+]+)$/) {
$A = $1;
}
elsif ($A == "") {
$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;
}
$MHiggsSM = $A;
}
#-----------------------------------------------------------------------------------------------------------
# call the subroutine which fills %newhash with the information about the input which is needed
fillnewhash();
#-----------------------------------------------------------------------------------------------------------
$optionmenuattop ='T';# have assigned it an initial value, so is 'true' . An empty string is false.
# This may be changed by the subroutine fillwithexample, which is called next.
#-----------------------------------------------------------------------------------------------------------
# call the subroutine which sets the initial values put in the form
fillwithexample($MHiggsSM);
#-----------------------------------------------------------------------------------------------------------
# write the html for the rest of the webpage
if(($option{testdata}{selection} eq 'Clear Form')||($option{testdata}{selection} eq 'Show example data')){}
else {
print 'Step 2 and 3 have already been completed for this example. <a href="#step4">Skip straight to step 4</a>.'."\n";
}
print '<br>'."\n";
print '<hr>'."\n";
#____________________________________________________________________________________________________________________
print '<h2>Step 2 of 4: Choose the input options</h2>'."\n";
print '<p>'."\n";
print ' '."\n";
if($option{debugmode}{selection} eq 'T'){print '<p><H3><font color="blue">debugging page</font></H3></p>'."\n";}
if ($optionmenuattop) {
print 'Note that the input parameters required by HiggsBounds (in Step 3) vary depending on which options are picked here.'."\n";
# @topofpageopt is a list of the settings which will be able to be changed by clicking buttons at the top of the webpage
if($option{debugmode}{selection} eq "T"){
@topofpageopt= ("whichinput", "whichanalyses","testdata");
}
else{
@topofpageopt= ("whichinput", "whichanalyses");
}
for $x ( @topofpageopt ) {
print '<FORM METHOD=POST ACTION="http://projects.hepforge.org/higgsbounds/cgi-bin/HiggsBounds_input.cgi">'."\n";
print '<INPUT type=hidden NAME="MHiggsSM" value="'.$MHiggsSM.'" >'."\n";
print '<table border="0"> <!-- 1 --> '."\n";
if($option{$x}{question} ne ""){print $option{$x}{question}."\n";}
for $y ( keys %{ $option{$x}{possibilities} } ) {
if($option{$x}{possibilities}{$y} ne 'none'){
print ' <tr>'."\n";
print ' <td class="menublank"> <!-- 3 --> '."\n";
print ' &nbsp;'."\n";
print ' </td> <!-- 3 --> '."\n";
print ' <td align="center"> <!-- 4 --> '."\n";
if ($y eq $option{$x}{selection}) {
print ' <table '.$menuhilight.'> <!-- 2a --> '."\n";
}
else {
print ' <table '.$menuplain.'> <!-- 2b --> '."\n";
}
for $z ( keys %option ) {
if($x eq $z){
print ' <tr><td><INPUT TYPE=SUBMIT NAME="'.$z.'" VALUE="'.$y.'"></td></tr>'."\n";
}
else{
print ' <INPUT TYPE=hidden NAME="'.$z.'" VALUE="'.$option{$z}{selection}.'">'."\n";
}
}
print ' </table> <!-- 2 --> '."\n";
print ' </td> <!-- 4 --> '."\n";
print ' <td> <!-- 5 --> '."\n";
print ' '.$option{$x}{possibilities}{$y}."\n";
print ' </td> <!-- 5 --> '."\n";
print ' </tr>'."\n";
}
}
print '</table> <!-- 1 --> '."\n";
print '</FORM>'."\n";
}
}
else {
print 'For this example, the input options <br>'."\n";
print '&nbsp; &nbsp; whichinput=<b>'.$option{whichinput}{selection}.
'</b> (i.e. '.$option{whichinput}{possibilities}{$option{whichinput}{selection}}.') and<br>'."\n";
print '&nbsp; &nbsp; whichanalyses=<b>'.$option{whichanalyses}{selection}.
'</b> (i.e. '.$option{whichanalyses}{possibilities}{$option{whichanalyses}{selection}}.')<br>'."\n";
print 'have already been selected.'."\n";
}
print '<FORM METHOD=POST ACTION="http://projects.hepforge.org/higgsbounds/cgi-bin/callHiggsBounds.cgi">'."\n";
# write the hidden values into the html
for $y ( keys %option ) {
if($y eq "action"){
# we'll do print '<input type=hidden name="'.$y.'" value="Call HiggsBounds">'."\n"; later
}
else{
print '<input type=hidden name="'.$y.'" value="'.$option{$y}{selection}.'">'."\n";
}
}
print '<p><hr></p>'."\n";
#____________________________________________________________________________________________________________________
print '<h2>Step 3 of 4: Enter the input parameters</h2>'."\n";
print '<p>N.b. for our purposes, "normalised" means divided by a suitable reference quantity (this is the analogous Standard Model quantity, where this exists). See <a href="manual3.0.0beta.pdf" target="_blank">manual</a> for more details.</p>'."\n";
if($option{whichinput}{selection}eq'effC'){
print "<p>\n";
print "If whichinput=effC, all branching ratios which are not given explicitly as input to HiggsBounds are calculated from the effective couplings and the total decay width.\n";
print "Therefore, it is important to enter an accurate total decay width. ";
print '(you might wish to use <a href="http://projects.hepforge.org/higgsbounds/cgi-bin/HB_BRSM.cgi" target="_blank">these SM quantities</a> to help calculate this)';
print "</p>\n";
}
# now create all the input tables
foreach my $t (@whichinputlist){
newtable($t);
}
print '<p><hr></p>'."\n";
#____________________________________________________________________________________________________________________
print '<h2><a name="step4">Step</a> 4 of 4: Call HiggsBounds </h2>'."\n";
print '<table border="0">'."\n";
print '<td WIDTH=20></td>'."\n";
print '<td>'."\n";
print '<table border="0">'."\n";
print '<tr>'."\n";
print '<td align=center WIDTH = 110><INPUT TYPE=SUBMIT NAME="action" VALUE="Call HiggsBounds">'."\n";
print '</tr>'."\n";
print '</table>'."\n";
print '</td>'."\n";
print '</table>'."\n";
print '<p><hr></p>'."\n";
#____________________________________________________________________________________________________________________
print '</FORM>'."\n";
print '</p></BODY>'."\n";
print '</HTML>'."\n";
}

File Metadata

Mime Type
text/html
Expires
Wed, May 14, 10:19 AM (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5068788
Default Alt Text
HiggsBounds_input.cgi (9 KB)

Event Timeline