133133) + str (options )
134134
135135file = ROOT .TFile (args [0 ])
136- if file == None :
136+ if file is None :
137137 raise RuntimeError ("Cannot open file %s" % args [0 ])
138138fit_s = file .Get ("fit_s" )
139139fit_b = file .Get ("fit_b" )
@@ -203,7 +203,7 @@ def getGraph(hist,shift):
203203 flag = False
204204 mean_p , sigma_p , sigma_pu , sigma_pd = 0 , 0 , 0 , 0
205205
206- if nuis_p == None :
206+ if nuis_p is None :
207207 # nuisance parameter NOT present in the prefit result
208208 if not options .absolute_values and not (options .pullDef == "unconstPullAsym" ):
209209 continue
@@ -231,15 +231,15 @@ def getGraph(hist,shift):
231231 row += ["%.6f +%.6f %.6f" % (nuis_p .getVal (), nuis_p .getErrorHi (), nuis_p .getErrorLo ())]
232232
233233 for fit_name , nuis_x in [("b" , nuis_b ), ("s" , nuis_s )]:
234- if nuis_x == None :
234+ if nuis_x is None :
235235 row += [" n/a " ]
236236 else :
237237 nuisIsSymm = abs (abs (nuis_x .getErrorLo ()) - abs (nuis_x .getErrorHi ())) < 0.01 or nuis_x .getErrorLo () == 0
238238 if nuisIsSymm :
239239 nuis_x .setError (nuis_x .getErrorHi ())
240240 nuiselo = abs (nuis_x .getErrorLo ()) if nuis_x .getErrorLo () > 0 else nuis_x .getError ()
241241 nuisehi = nuis_x .getErrorHi ()
242- if options .pullDef and nuis_p != None :
242+ if options .pullDef and nuis_p is not None :
243243 nx , ned , neu = CP .returnPullAsym (
244244 options .pullDef ,
245245 nuis_x .getVal (),
@@ -257,11 +257,11 @@ def getGraph(hist,shift):
257257 else :
258258 row += ["%+.2f +%.2f %.2f" % (nx , neu , ned )]
259259
260- if nuis_p != None :
260+ if nuis_p is not None :
261261 if options .plotfile :
262262 if fit_name == "b" :
263263 nuis_p_i += 1
264- if options .pullDef and nuis_p != None :
264+ if options .pullDef and nuis_p is not None :
265265 # nx,ned,neu = CP.returnPullAsym(options.pullDef,nuis_x.getVal(),mean_p,nuis_x.getErrorHi(),sigma_pu,abs(nuis_x.getErrorLo()),abs(sigma_pd))
266266 gr_fit_b .SetPoint (nuis_p_i - 1 , nuis_p_i - 0.5 + 0.1 , nx )
267267 gr_fit_b .SetPointError (nuis_p_i - 1 , 0 , 0 , ned , neu )
@@ -279,7 +279,7 @@ def getGraph(hist,shift):
279279 hist_fit_b .GetXaxis ().SetBinLabel (nuis_p_i , name )
280280 gr_fit_b .GetXaxis ().SetBinLabel (nuis_p_i , name )
281281 if fit_name == "s" :
282- if options .pullDef and nuis_p != None :
282+ if options .pullDef and nuis_p is not None :
283283 # nx,ned,neu = CP.returnPullAsym(options.pullDef,nuis_x.getVal(),mean_p,nuis_x.getErrorHi(),sigma_pu,abs(nuis_x.getErrorLo()),abs(sigma_pd))
284284 gr_fit_s .SetPoint (nuis_p_i - 1 , nuis_p_i - 0.5 - 0.1 , nx )
285285 gr_fit_s .SetPointError (nuis_p_i - 1 , 0 , 0 , ned , neu )
@@ -474,9 +474,9 @@ def getGraph(hist,shift):
474474 v = table [n ]
475475 if options .format == "latex" :
476476 n = n .replace (r"_" , r"\_" )
477- if pmsub != None :
477+ if pmsub is not None :
478478 v = [re .sub (pmsub [0 ], pmsub [1 ], i ) for i in v ]
479- if sigsub != None :
479+ if sigsub is not None :
480480 v = [re .sub (sigsub [0 ], sigsub [1 ], i ) for i in v ]
481481 if (n , "b" ) in isFlagged :
482482 v [- 3 ] = highlighters [isFlagged [(n , "b" )]] % v [- 3 ]
0 commit comments