ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/Configuration/scripts/makeBNTreePlot.py
(Generate patch)

Comparing UserCode/OSUT3Analysis/Configuration/scripts/makeBNTreePlot.py (file contents):
Revision 1.7 by wulsin, Thu Jun 6 23:34:29 2013 UTC vs.
Revision 1.9 by wulsin, Tue Jun 11 11:40:12 2013 UTC

# Line 15 | Line 15 | import subprocess
15   from OSUT3Analysis.Configuration.configurationOptions import *
16   from OSUT3Analysis.Configuration.processingUtilities import *
17  
18 < from ROOT import TChain, TCut, TDirectory, TFile, TH1D, TStopwatch, TTree, gROOT  
18 > from ROOT import TChain, TCut, TDirectory, TFile, TH1D, TH2D, TStopwatch, TTree, gROOT  
19  
20   gROOT.SetBatch(True)  # This is to prevent pop-up graphical windows
21  
# Line 47 | Line 47 | def RunOnCondor(arguments, split_dataset
47  
48      for dataset in split_datasets:  
49          MakeCondorSubmitFile(arguments, dataset)  
50 <        # Now submit the condor job
51 <        # os.system("condor_submit condor/"+arguments.condorDir+"/"+dataset+"condorBNTree.sub")  
52 <        print "Submitted job for: %s/%s" % (arguments.condorDir, dataset)
50 >        cmd = "condor_submit condor/"+arguments.condorDir+"/"+dataset+"/condorBNTree.sub"
51 >        os.system(cmd)
52 >        print "Submitting job: %s " % cmd
53          
54      return
55  
# Line 103 | Line 103 | for dataset in split_datasets:
103          currentDir = outputFile.GetDirectory("OSUAnalysis/"+hist['channel']);
104          if not currentDir: print "Could not find directory OSUAnalysis/%s in file %s" % (hist['channel'], outputFile.GetName())  
105          currentDir.Delete(deleteString);
106 <        
107 <        h = TH1D(hist['histName'], hist['histName'], hist['nbins'], hist['xMin'], hist['xMax'])
106 >        if 'nbinsY' in hist:  # only make a 2D histogram if the key "nbinsY" is defined  
107 >            h = TH2D(hist['histName'], hist['histName'],
108 >                     hist['nbins'],  hist['xMin'], hist['xMax'],
109 >                     hist['nbinsY'], hist['yMin'], hist['yMax'])
110 >        else:            
111 >            h = TH1D(hist['histName'], hist['histName'], hist['nbins'], hist['xMin'], hist['xMax'])
112          h.Sumw2()  # Needed to get weights correct.  
113          cut = TCut(hist['cutString'])
114          ch.Draw(hist['varToPlot']+">>"+hist['histName'], cut)  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines