ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/nowaf/RootFilesInUse/MakeNLOPlot.py
Revision: 1.1.1.1 (vendor branch)
Committed: Tue Mar 20 13:12:08 2012 UTC (13 years, 1 month ago) by nowak
Content type: text/x-python
Branch: rootFilesInUse, MAIN
CVS Tags: start, HEAD
Changes since 1.1: +0 -0 lines
Log Message:
t files in use

File Contents

# User Rev Content
1 nowak 1.1 import ROOT
2     import sys, re
3     sys.path.append("/afs/naf.desy.de/user/n/nowaf/UserCode/nowaf/PythonScripts/")
4     import definitions as Def
5     import styles as Style
6    
7     if __name__ == "__main__":
8    
9     Def.SetGlobalStyles( withTitle=True )
10     ROOT.gStyle.SetPadRightMargin( 0.11 )
11     ROOT.gStyle.SetLabelSize( 0.03,"XYZ" )
12     lumi = 4.5
13     title = "NLO xSec [pb], #sqrt{s} = 7 TeV"
14     #title = "CMS Simulation, NLO xSec [pb], #sqrt{s} = 7 TeV"
15     xTitle = "m_{0} [GeV]"
16     yTitle = "m_{1/2} [GeV]"
17    
18     filename = "/scratch/hh/lustre/cms/user/nowaf/msugra_m0_m12_40_m500_1_NLO_1.0.txt"
19     f = open( filename, "r" )
20    
21     nBinsX = 140
22     nBinsY = 46
23     xmin = 210.
24     xmax = 3010.
25     #xmax = 800.
26     ymin = 90.
27     #ymax = 800.
28     ymax = 1010.
29     h_nlo = ROOT.TH2F( "nlo", "nlo", nBinsX, xmin, xmax, nBinsY, ymin, ymax )
30    
31     #counter = 0
32     for line in f.readlines():
33     ### ignore first line
34     #if re.search( "Sub-processes", line ):
35     if re.search( "Interactions", line ):
36     continue
37     #if counter > 0:
38     # continue
39     lineSnippets = line.split( "|" )
40     #print lineSnippets
41     pointDefs = lineSnippets[ 1 ].split( ", " )
42     #print pointDefs
43     m0 = int( pointDefs[ 0 ].split( "=" )[ 2 ] )
44     m12 = int( pointDefs[ 1 ].split( "=" )[ 1 ] )
45    
46     sum = 0
47     for i in range( 2, len( lineSnippets ) -1 ):
48     #print lineSnippets[ i ]
49     sum += float( lineSnippets[ i ] )
50     pass
51    
52     #counter += 1
53    
54     #print "m0=", m0, " m12=", m12, " sum=", sum
55     bin = h_nlo.FindBin( m0, m12 )
56     h_nlo.SetBinContent( bin, sum )
57    
58     pass
59    
60     cDict = {}
61     Style.setHistStyle( h_nlo,
62     xTitle=xTitle,
63     yTitle=yTitle,
64     title=title )
65     #h_nlo.GetXaxis().SetRangeUser( 210,810 )
66     #h_nlo.GetYaxis().SetRangeUser( 90,810 )
67     h_nlo.GetZaxis().SetRangeUser( 10**-4, 5 * 10**2 )
68     cDict[ h_nlo.GetName() ] = ROOT.TCanvas( h_nlo.GetName() + "Canv", h_nlo.GetName() + "Canv" )
69     cDict[ h_nlo.GetName() ].cd()
70     h_nlo.Draw( "COLZ" )
71    
72     ROOT.gPad.SetLogz()
73    
74     Def.DontQuit()