~maddevelopers/mg5amcnlo/WWW5_caching

« back to all changes in this revision

Viewing changes to users/mardelcourt/PROC_141512/PROC_141512/bin/internal/plot_page-pl

  • Committer: John Doe
  • Date: 2013-03-25 20:27:02 UTC
  • Revision ID: john.doe@gmail.com-20130325202702-5sk3t1r8h33ca4p4
first clean version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
 
 
3
if (-e "....//SubProcesses/procdef_mg5.dat"){
 
4
  open (INCARD,"../../SubProcesses/procdef_mg5.dat") || die "Error reading file proc_card.dat";
 
5
  @incard=<INCARD>;
 
6
  close (INCARD);
 
7
} elsif (open (INCARD,"../../Cards/proc_card.dat")){
 
8
  @incard=<INCARD>;
 
9
  close (INCARD);
 
10
}
 
11
if ($#incard > 0){
 
12
# process
 
13
$listpos = 0;
 
14
until($listpos>$#incard){
 
15
    if($incard[$listpos] =~ /^#(\s+)Begin(\s+)PROCESS/) {$ini=$listpos};
 
16
    if($incard[$listpos] =~ /^#(\s+)End(\s+)PROCESS/)   {$end=$listpos};
 
17
       $listpos = $listpos + 1;
 
18
   }
 
19
#
 
20
      ($interaction, $junk)=split(/#/ , $incard[$ini+1]);
 
21
      ($qcdOrder, $junk)   =split(/#/ , $incard[$ini+2]);
 
22
      ($qedOrder, $junk)   =split(/#/ , $incard[$ini+3]);
 
23
#model
 
24
                                  $listpos = 0;
 
25
                                  until($listpos>$#incard){
 
26
    if($incard[$listpos] =~ /^#(\s+)Begin(\s+)MODEL/) {$ini=$listpos};
 
27
    if($incard[$listpos] =~ /^#(\s+)End(\s+)MODEL/)   {$end=$listpos};
 
28
       $listpos = $listpos + 1;
 
29
   }
 
30
#
 
31
      ($model, $junk)   =split(/#/ , $incard[$ini+1]);
 
32
 
 
33
                               chomp($interaction);
 
34
                               chomp($qcdOrder);
 
35
                               chomp($qedOrder);
 
36
                               chomp($model);
 
37
     }
 
38
  else{
 
39
      $interaction = "Unknown";
 
40
      $qcdOrder = "";
 
41
      $qedOrder = "";
 
42
      $model    = "";
 
43
  }      
 
44
 
 
45
$extra = "";
 
46
if ($#ARGV >= 1){
 
47
  $extra = " at ".$ARGV[1]." level";
 
48
}
 
49
 
 
50
   open(PAGE,"> plots.html") || die "Error creating diagrams.html";
 
51
   print PAGE "\<HTML\> \n";
 
52
   print PAGE "\<HEAD\> \n";
 
53
   print PAGE "\<TITLE\>Plots \<\/TITLE\> \n";
 
54
   print PAGE "\<\/HEAD\> \n";
 
55
   print PAGE "\<BODY\> \n";
 
56
   print PAGE "<CENTER>\n";
 
57
   print PAGE "<H1 align=center> Plots for $interaction".$extra."</H1>\n";
 
58
   print PAGE "<p align=\"center\">";
 
59
   print PAGE "<table border=\"1\"  cellspacing=\"1\">";
 
60
   print PAGE "<tr  align=\"center\">";
 
61
   print PAGE "<TD> Name </TD>";
 
62
   print PAGE "<TD> Variable </TD>";
 
63
   print PAGE "<TR align=center><td bgcolor=\"#00FFFF\">weigth </td> <TD> weights of the events (normally 1)</td> ";
 
64
   print PAGE "<TR align=center><td bgcolor=\"#00FFFF\">Ht     </td> <TD> scalar sum of pt of all particles + missing Et</td> ";
 
65
   print PAGE "<TR align=center><td bgcolor=\"#00FFFF\">pt(i)  </td> <TD> transverse momentum</td> ";
 
66
   print PAGE "<TR align=center><td bgcolor=\"#00FFFF\">y(i)   </td> <TD> rapidity in the lab</td> ";
 
67
   print PAGE "<TR align=center><td bgcolor=\"#00FFFF\">R(i,j) </td> <TD> distance in the (y,phi) plane</td>"; 
 
68
   print PAGE "<TR align=center><td bgcolor=\"#00FFFF\">m(i,j) </td> <TD> invariant mass     </td> ";
 
69
   print PAGE "<TR align=center><td bgcolor=\"#00FFFF\">cos(i,j) </td> <TD> angle between direction of i in the resframe of i+j<BR>and the direction of i+j in the labframe </td> ";
 
70
   print PAGE "</table><BR>";
 
71
 
 
72
   foreach $f (<./$ARGV[0]/*.jpg>) { 
 
73
     print "$f\n";
 
74
     if ($f =~ /DJR/) {
 
75
       print PAGE "<font color=\"Dark Purple\">Differential jet rate (matching check plot)</font><br>\n";
 
76
     }
 
77
     print PAGE "\<IMG SRC=\"$f\" BORDER\=1\> \<BR\> \n";
 
78
     $fps=substr($f,0,-3)."ps";
 
79
     ($junk, $fname)   =split("$ARGV[0]\/" , $fps);
 
80
     print PAGE "\<A HREF\=\"$fps\"\>Download PS $fname\</A\> \<BR\> \<BR\> \<BR\>\n"; 
 
81
   }
 
82
 
 
83
   
 
84
   print PAGE "\<A HREF\=./$ARGV[0]/plots.ps>Download all plots in one postscript file\</A\> \<BR\> \<BR\> \<BR\>\n"; 
 
85
   print PAGE "\<A HREF\=./$ARGV[0]/plots.top>Download all plots in topdrawer format\</A\> \<BR\> \<BR\> \<BR\>\n"; 
 
86
   print PAGE "\<\/CENTER\>\n";
 
87
   print PAGE "\<\/BODY\> \n";
 
88
   print PAGE "\<\/HTML\> \n";
 
89
   close(PAGE)
 
90