--- UserCode/OSUT3Analysis/Configuration/scripts/makeYieldsTables.py 2013/08/16 14:45:45 1.3 +++ UserCode/OSUT3Analysis/Configuration/scripts/makeYieldsTables.py 2013/08/16 14:57:24 1.4 @@ -29,6 +29,9 @@ parser.remove_option("--2D") parser.remove_option("-y") parser.remove_option("-p") +parser.add_option("-s", "--standAlone", action="store_true", dest="standAlone", default=False, + help="adds the necessary header to be able to compile it") + (arguments, args) = parser.parse_args() @@ -118,6 +121,8 @@ for sample in processed_datasets: for channel in channels: outputFile = condor_dir + "/yields_" + plainTextString(channel) + ".tex" fout = open (outputFile, "w") + if(arguments.standAlone): + fout.write("\\documentclass{article}"+newLine+"\\begin{document}"+newLine) fout.write ("\\makebox[0pt]{\\renewcommand{\\arraystretch}{1.2}\\begin{tabular}{lr}"+newLine+hLine) fout.write("Event Source & Event Yield $\pm$ 1$\sigma$ (stat.)"+endLine+newLine+hLine) @@ -148,6 +153,9 @@ for channel in channels: label = rawlabel.replace("#","\\").replace("\\rightarrow","{\\rightarrow}").replace(" ","\\ ") fout.write(label + " & " + yields[sample][channel] + " $\pm$ " + errors[sample][channel] + endLine + newLine) - fout.write("\\end{tabular}}") + fout.write("\\end{tabular}}"+newLine) + if(arguments.standAlone): + fout.write("\\end{document}"+newLine) + fout.close()