3 from __future__
import print_function
14 for file
in glob.glob(folder+
'/*.root'):
15 tag = file.split(
"RunII")[0]
16 tag = tag.split(
"13TeV")[0]
17 tag = tag.split(
"CUETP")[0]
18 tag = tag.split(
"-PromptReco")[0]
19 tag = tag.split(
"-23Sep2016")[0]
20 tag = tag.split(
"_runs")[0]
21 tag = tag.split(
"pythia")[0]
22 tag = tag.split(
"baby_")[1]
23 tag = tag.split(
"__")[0]
24 if tag[0] !=
'_': tag =
"_"+tag
25 if tag[-1] !=
'_' and "Tune" not in tag
and "Run2016" not in tag: tag = tag+
"_" 29 sortedfiles.append(file)
30 sortedfiles = sorted(sortedfiles)
35 return os.path.realpath(os.path.abspath(os.path.expanduser(path)))
41 if not os.path.isdir(path):
45 print(*args, file=sys.stderr, **kwargs)
55 return self.
path+
" is not a ROOT file" 62 return "Could not open "+self.
path+
" in "+self.
mode+
" mode" 66 if os.path.splitext(path)[1] !=
".root":
72 if self.file.IsZombie()
or not self.file.IsOpen():
def __init__(self, path, mode)
def findBaseSampleNames(folder)
Finding basename for each dataset.
def __init__(self, path, mode)
def __exit__(self, type, value, traceback)