@@ -1225,6 +1225,9 @@ def MakeOneDHist(pathToDir,histogramName,integrateDir):
12251225 if arguments .savePDFs :
12261226 pathToDirString = plainTextString (pathToDir )
12271227 Canvas .SaveAs (condor_dir + "/stacked_histograms_pdfs/" + pathToDirString + "/" + histogramName + ".pdf" )
1228+ if arguments .savePNGs :
1229+ pathToDirString = plainTextString (pathToDir )
1230+ Canvas .SaveAs (condor_dir + "/stacked_histograms_pngs/" + pathToDirString + "/" + histogramName + ".png" )
12281231
12291232
12301233##########################################################################################################################################
@@ -1518,6 +1521,9 @@ def MakeTwoDHist(pathToDir,histogramName):
15181521 if arguments .savePDFs :
15191522 pathToDirString = plainTextString (pathToDir )
15201523 Canvas .SaveAs (condor_dir + "/stacked_histograms_pdfs/" + pathToDirString + "/" + histogramName + ".pdf" )
1524+ if arguments .savePNGs :
1525+ pathToDirString = plainTextString (pathToDir )
1526+ Canvas .SaveAs (condor_dir + "/stacked_histograms_pngs/" + pathToDirString + "/" + histogramName + ".png" )
15211527
15221528
15231529
@@ -1581,6 +1587,13 @@ def MakeTwoDHist(pathToDir,histogramName):
15811587 pass
15821588 os .mkdir ("%s/stacked_histograms_pdfs" % (condor_dir ))
15831589
1590+ if arguments .savePNGs :
1591+ try :
1592+ shutil .rmtree ("%s/stacked_histograms_pngs" % (condor_dir ))
1593+ except OSError :
1594+ pass
1595+ os .mkdir ("%s/stacked_histograms_pngs" % (condor_dir ))
1596+
15841597#### make output file
15851598outputFileString = ''
15861599if arguments .rebinFactor :
@@ -1613,6 +1626,8 @@ def MakeTwoDHist(pathToDir,histogramName):
16131626 outputFile .mkdir (rootDirectory )
16141627 if arguments .savePDFs :
16151628 os .mkdir ("%s/stacked_histograms_pdfs/%s" % (condor_dir ,plainTextString (rootDirectory )))
1629+ if arguments .savePNGs :
1630+ os .mkdir ("%s/stacked_histograms_pngs/%s" % (condor_dir ,plainTextString (rootDirectory )))
16161631
16171632 #cd to root directory and look for histograms
16181633 inputFile .cd (rootDirectory )
@@ -1635,6 +1650,8 @@ def MakeTwoDHist(pathToDir,histogramName):
16351650 gDirectory .mkdir (key2 .GetName ())
16361651 if arguments .savePDFs :
16371652 os .mkdir ("%s/stacked_histograms_pdfs/%s" % (condor_dir ,plainTextString (level2Directory )))
1653+ if arguments .savePNGs :
1654+ os .mkdir ("%s/stacked_histograms_pngs/%s" % (condor_dir ,plainTextString (level2Directory )))
16381655
16391656 #####################################################
16401657 ### This layer is typically the "channels" layer ###
@@ -1662,6 +1679,8 @@ def MakeTwoDHist(pathToDir,histogramName):
16621679 gDirectory .mkdir (key3 .GetName ())
16631680 if arguments .savePDFs :
16641681 os .mkdir ("%s/stacked_histograms_pdfs/%s" % (condor_dir ,plainTextString (level3Directory )))
1682+ if arguments .savePNGs :
1683+ os .mkdir ("%s/stacked_histograms_pngs/%s" % (condor_dir ,plainTextString (level3Directory )))
16651684
16661685 #################################################
16671686 ### This layer is typically the "cuts" layer ###
0 commit comments