@@ -37,7 +37,7 @@ def main(config):
3737 infile_rawy = ROOT .TFile .Open (os .path .join (cfg ["rawyields" ]["inputdir" ], filename_rawy ))
3838 hist_rawy_name = cfg ["rawyields" ]["histoname" ]
3939 hist_rawy .append (infile_rawy .Get (hist_rawy_name ))
40- if (hist_rawy [- 1 ] is None ):
40+ if not isinstance (hist_rawy [- 1 ], ROOT . TH1 ):
4141 sys .exit (f"Fatal error: Histogram with raw yield \" { hist_rawy_name } \" is absent. Exit." )
4242 hist_rawy [- 1 ].SetDirectory (0 )
4343 infile_rawy .Close ()
@@ -47,9 +47,9 @@ def main(config):
4747 hist_effnp_name = cfg ["efficiencies" ]["histonames" ]["nonprompt" ]
4848 hist_effp .append (infile_eff .Get (hist_effp_name ))
4949 hist_effnp .append (infile_eff .Get (hist_effnp_name ))
50- if (hist_effp [- 1 ] is None ):
50+ if not isinstance (hist_effp [- 1 ], ROOT . TH1 ):
5151 sys .exit (f"Fatal error: Histogram with efficiency for prompt \" { hist_effp_name } \" is absent. Exit." )
52- if (hist_effnp [- 1 ] is None ):
52+ if not isinstance (hist_effnp [- 1 ], ROOT . TH1 ):
5353 sys .exit (f"Fatal error: Histogram with efficiency for nonprompt \" { hist_effnp } \" is absent. Exit." )
5454 hist_effp [- 1 ].SetDirectory (0 )
5555 hist_effnp [- 1 ].SetDirectory (0 )
@@ -66,11 +66,11 @@ def main(config):
6666 infile_central_eff = ROOT .TFile .Open (infile_name )
6767 hist_central_effp_name = cfg ["central_efficiency" ]["histonames" ]["prompt" ]
6868 hist_central_effp = infile_central_eff .Get (hist_central_effp_name )
69- if (hist_central_effp is None ):
69+ if not isinstance (hist_central_effp [ - 1 ], ROOT . TH1 ):
7070 sys .exit (f"Fatal error: Histogram with central efficiency for prompt \" { hist_central_effp_name } \" is absent. Exit." )
7171 hist_central_effnp_name = cfg ["central_efficiency" ]["histonames" ]["nonprompt" ]
7272 hist_central_effnp = infile_central_eff .Get (hist_central_effnp_name )
73- if (hist_central_effnp is None ):
73+ if not isinstance (hist_central_effnp [ - 1 ], ROOT . TH1 ):
7474 sys .exit (f"Fatal error: Histogram with central efficiency for nonprompt \" { hist_central_effnp_name } \" is absent. Exit." )
7575 hist_central_effp .SetDirectory (0 )
7676 hist_central_effnp .SetDirectory (0 )
0 commit comments