1 #-------------------------------------------------------------------------------------------
2 # Create XML file list expected by GENIE validation programs
5 # % perl make_genie_sim_file_list.pl <inputs>
7 # where inputs is a list of "file_paths,model_name" pairs.
8 # Multiple ':'-separated file paths can be specified.
11 # %perl make_genie_sim_file_list.pl /some/path/,model_name /another/path1:/another/path2,another_model_name ...
13 # Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
14 # STFC, Rutherford Appleton Lab
15 #-------------------------------------------------------------------------------------------
22 my ($file_paths, $model_name) = split(',', $_);
23 $data{$model_name} .= $file_paths;
26 print "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?> \n\n";
27 print "<genie_simulation_outputs> \n";
29 while( my ($model_name, $file_paths) = each %data )
31 #print "$model_name --> $file_paths \n";
33 print "\t <model name=\"$model_name\"> \n";
35 @file_path_array = split(':',$file_paths);
36 foreach(@file_path_array) {
38 opendir my $dir, $dirname or die "Can not open directory: $!";
39 my @files = grep { !/^\./ } readdir $dir;
43 if($filename =~ m/.ghep.root$/) {
44 print "\t\t <evt_file format=\"ghep\"> $dirname/$filename </evt_file> \n";
46 elsif($filename =~ m/.gst.root$/) {
47 print "\t\t <evt_file format=\"gst\"> $dirname/$filename </evt_file> \n";
49 elsif($filename =~ m/.root$/) {
50 print "\t\t <xsec_file> $dirname/$filename </xsec_file> \n";
54 print "\t </model> \n\n";
57 print "</genie_simulation_outputs> \n";