Page MenuHomeHEPForge

convert2bibtex_collaborationnotes.pl
No OneTemporary

convert2bibtex_collaborationnotes.pl

#!/usr/bin/perl -T -w
# This script creates a bibtex file of the collaboration notes called collaborationnotes.bib
# It uses example_data/HB_randomtest50points_Key.dat-for-comparison
use strict;
my %cdf=();
my %d0=();
my %lhwg=();
my $correctsettings='no';
my $notenumber='';
open FILE1,"<", "example_data/HB_randomtest50points_Key.dat-for-comparison" or die $!; #Key generated by HB
open FILE3,">", "collaborationnotes.bib" or die $!; #
while (my $line = <FILE1>) { #goes through each line in the file
if($line =~ /(CDF\sNote\s\d\d\d\d)/i){$cdf{$1}=1;}
if($line =~ /(D0\sNote\s\d\d\d\d)/i){$d0{$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($correctsettings ne 'yes'){
print "Something wrong with Key file\n";
die;
}
foreach (keys %cdf){
print FILE3 "\n\n";
/CDF\sNote\s(\d\d\d\d)/;
$notenumber=$1;
print FILE3 '@misc{cdf'.$notenumber.','."\n";
#print FILE3 ' author = "CDF, Collaboration",'."\n";
print FILE3 ' collaboration = "CDF",'."\n";
#print FILE3 ' howpublished = "CDF Notes';
print FILE3 ' note = "CDF Notes';
print FILE3 '",'."\n";
print FILE3 ' year = ""'."\n";
print FILE3 '}'."\n\n";
}
foreach (keys %d0){
/D0\sNote\s(\d\d\d\d)/;
$notenumber=$1;
print FILE3 '@misc{dzero'.$notenumber.','."\n";
#print FILE3 ' author = "D0, Collaboration",'."\n";
print FILE3 ' collaboration = "D0",'."\n";
print FILE3 ' title = "",'."\n";
print FILE3 ' note = "D0 Notes';
print FILE3 '",'."\n";
print FILE3 ' year = ""'."\n";
print FILE3 '}'."\n\n";
}
foreach (keys %lhwg){
/LHWG\sNote\s(\d\d\d\d\-\d\d)/;
$notenumber=$1;
print FILE3 '@misc{LHWG'.$notenumber.','."\n";
#print FILE3 ' author = "LEP Higgs Working Group",'."\n";
print FILE3 ' collaboration = "LHWG",'."\n";
print FILE3 ' title = "",'."\n";
print FILE3 ' note = "LHWG Notes';
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 FILE3;

File Metadata

Mime Type
text/x-perl
Expires
Wed, May 14, 10:28 AM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5068985
Default Alt Text
convert2bibtex_collaborationnotes.pl (2 KB)

Event Timeline