Page MenuHomeHEPForge

convert2bibtex.pl
No OneTemporary

convert2bibtex.pl

#!/usr/bin/perl -T -w
# This script creates minipaper.tex and preliminary minipaper.bib from example_data/HB_randomtest50points_Key.dat
# After running it:
# * copy and paste minipaper.tex to an email, subject 'generate bibtex', send to slaclib2@slac.stanford.edu
# * copy the response to minipaper.bib but make sure you don't copy over CDFnotes,D0notes,LHWGnotes
# * you may have to edit some of the bibtex e.g. in 1003.3363 need to change:
# Tevatron New Phenomena & Higgs Working Group -> Tevatron New Phenomena and Higgs Working Group
# and 'collaboration = "The '->'collaboration = "'
# * do
# latex minipaper.tex ; bibtex minipaper ; latex minipaper.tex ; bibtex minipaper ; latex minipaper.tex
# dvipdf minipaper
use strict;
my $ref='';
my $x=0;
my %arxiv=();
my %cdf=();
my %d0=();
my %cms=();
my %atl=();
my %lhwg=();
my $correctsettings='no';
my $vers='';
open FILE1,"<", "example_data/HB_randomtest50points_Key.dat" or die $!; #Key generated by HB
open FILE2,">", "minipaper.tex" or die $!; #
open FILE3,">", "minipaper.bib" or die $!; #
while (my $line = <FILE1>) { #goes through each line in the file
if($line =~ /(arxiv\:\d\d\d\d\.\d\d\d\d|hep\-ex\/\d\d\d\d\d\d\d)/i){$arxiv{$1}=1;}
if($line =~ /(CDF\sNote\s\d\d\d\d\d|CDF\sNote\s\d\d\d\d)/i){$cdf{$1}=1;}#can be 4 or 5 digit numbers
if($line =~ /(D0\sNote\s\d\d\d\d)/i){$d0{$1}=1;}
if($line =~ /(CMS\sPAS\sHIG\-\d\d\-\d\d\d)/i){$cms{$1}=1;}
if($line =~ /(ATLAS\-CONF\-\d\d\d\d\-\d\d\d)/i){$atl{$1}=1;}
if($line =~ /(LHWG\sNote\s\d\d\d\d\-\d\d)/i){$lhwg{$1}=1;}
if($line =~ m/\swith\sthe\ssetting\swhichanalyses\=LandH/){$correctsettings='yes';}
if($line =~ m/This\skey\shas\sbeen\sgenerated\swith\sHiggsBounds\sversion\s([\.\w]+)\s/){$vers=$1;}
}
if($correctsettings ne 'yes'){
print "Something wrong with Key file\n";
die;
}
print "vers= ~".$vers."~\n";
print FILE2 '\documentclass{article}'."\n\n";
print FILE2 '\usepackage{cite}'."\n\n";
print FILE2 '\begin{document}'."\n\n";
print FILE2 'HiggsBounds\cite{arXiv:0811.4169,arXiv:1102.1898,arXiv:1301.2345} version '.$vers.' uses the following experimental analyses: \cite{';
foreach my $t (keys %arxiv){
print FILE2 $t.",";
}
print FILE2 'CDFnotes,D0notes,CMSnotes,ATLASnotes,LHWGnotes} '."\n";
print FILE2 '.'."\n";
print FILE2 ' '."\n";
print FILE2 'Internally, {\tt HiggsBounds} uses a number of Standard Model results for the Higgs sector\cite{hep-ph/9704448,hep-ph/0102227,hep-ph/0102241,hep-ph/0201206,hep-ph/0207004,hep-ph/0302135,arXiv:0811.3458,Dawson:1990zj,Djouadi:1991tka,hep-ph/9504378,hep-ph/0404071,hep-ph/0407249,arXiv:0809.1301,arXiv:0809.3667,hep-ph/0306211,arXiv:0901.2427,hep-ph/0307206,hep-ph/0306234,hep-ph/0406152,hep-ph/0304035,hep-ph/9206246,hep-ph/9905386,hep-ph/0306109,hep-ph/0403194,hep-ph/0612172,hep-ph/0107081,hep-ph/0107101,hep-ph/0211438,hep-ph/0305321,arXiv:0705.2744,arXiv:0707.0381,arXiv:0710.4749,arXiv:1101.0593,arXiv:1201.3084,hep-ph/0304035}'."\n";
print FILE2 'to convert between experimental limits with different normalisations.'."\n\n";
print FILE2 '\bibliographystyle{h-elsevier3-newarxivid-leftjust}'."\n\n";
print FILE2 '\bibliography{minipaper}'."\n\n";
print FILE2 '\end{document}'."\n";
print FILE3 "\n\n";
print FILE3 '@misc{CDFnotes,'."\n";
#print FILE3 ' author = "CDF, Collaboration",'."\n";
print FILE3 ' collaboration = "CDF",'."\n";
#print FILE3 ' howpublished = "CDF Notes';
print FILE3 ' note = "CDF Notes';
foreach (keys %cdf){
/CDF\sNote\s(\d\d\d\d\d|\d\d\d\d)/;#can be 4 or 5 digit numbers
print FILE3 " ".$1;
}
print FILE3 '",'."\n";
print FILE3 ' year = ""'."\n";
print FILE3 '}'."\n\n";
print FILE3 '@misc{D0notes,'."\n";
#print FILE3 ' author = "D0, Collaboration",'."\n";
print FILE3 ' collaboration = "D0",'."\n";
print FILE3 ' title = "",'."\n";
print FILE3 ' note = "D0 Notes';
foreach (keys %d0){
/D0\sNote\s(\d\d\d\d)/;
print FILE3 " ".$1;
}
print FILE3 '",'."\n";
print FILE3 ' year = ""'."\n";
print FILE3 '}'."\n\n";
print FILE3 '@misc{CMSnotes,'."\n";
#print FILE3 ' author = "CMS, Collaboration",'."\n";
print FILE3 ' collaboration = "CMS",'."\n";
print FILE3 ' title = "",'."\n";
print FILE3 ' note = "CMS Physics Analysis Summaries';
foreach (keys %cms){
/CMS\sPAS\s(HIG\-\d\d\-\d\d\d)/;
print FILE3 " ".$1;
}
print FILE3 '",'."\n";
print FILE3 ' year = ""'."\n";
print FILE3 '}'."\n\n";
print FILE3 '@misc{ATLASnotes,'."\n";
#print FILE3 ' author = "ATLAS, Collaboration",'."\n";
print FILE3 ' collaboration = "ATLAS",'."\n";
print FILE3 ' title = "",'."\n";
print FILE3 ' note = "ATLAS CONF Notes';
foreach (keys %atl){
/ATLAS\-CONF\-(\d\d\d\d\-\d\d\d)/;
print FILE3 " ".$1;
}
print FILE3 '",'."\n";
print FILE3 ' year = ""'."\n";
print FILE3 '}'."\n\n";
print FILE3 '@misc{LHWGnotes,'."\n";
#print FILE3 ' author = "LEP Higgs Working Group",'."\n";
print FILE3 ' collaboration = "LHWG",'."\n";
print FILE3 ' title = "",'."\n";
print FILE3 ' note = "LHWG Notes';
foreach (keys %lhwg){
/LHWG\sNote\s(\d\d\d\d\-\d\d)/;
print FILE3 " ".$1;
}
print FILE3 '",'."\n";
print FILE3 ' year = ""'."\n";
print FILE3 '}'."\n\n";
#\d means match any digit character
#/i means case independent
#| means 'or'
close FILE1;
close FILE2;
close FILE3;

File Metadata

Mime Type
text/x-tex
Expires
Wed, May 14, 11:23 AM (17 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5111416
Default Alt Text
convert2bibtex.pl (5 KB)

Event Timeline