15 |
|
#=================================================================================================== |
16 |
|
def filesExist(path,filenameExpression): |
17 |
|
exists = False |
18 |
+ |
|
19 |
+ |
if not os.path.exists(path): |
20 |
+ |
return exists; |
21 |
+ |
|
22 |
|
for fileName in os.listdir(path): |
23 |
|
if fnmatch.fnmatch (fileName,filenameExpression): |
24 |
|
exists = True |
39 |
|
|
40 |
|
outputMergedFilename = filenameHeader + '_' + dataset + '_' + skimNameList[n] + '.root' |
41 |
|
inputFilenameRegExp = filenameHeader + '_' + dataset + '_' + skimNameList[n] + '_????.root' |
42 |
< |
command = setupCmsswCommand + 'hadd -f ' + outputPath + outputMergedFilename \ |
42 |
> |
# command = setupCmsswCommand + 'hadd -f ' + outputPath + outputMergedFilename \ |
43 |
> |
command = 'hadd -f7 ' + outputPath + outputMergedFilename \ |
44 |
|
+ ' ' + inputPath + '/' + versionList[n] + '/' + dataset + '/' \ |
45 |
|
+ inputFilenameRegExp + ' >& ./merging.tmp' |
46 |
|
# command = 'hadd -f ' + outputPath + \ |
122 |
|
print "Error: The specified dataset list file " + datasetListFile + " could not be opened." |
123 |
|
sys.exit() |
124 |
|
|
125 |
+ |
print datasetListFile |
126 |
|
#=================================================================================================== |
127 |
|
# Read in list of datasets and skim names |
128 |
|
#=================================================================================================== |
130 |
|
templine = inputFile.readline() |
131 |
|
while len(templine.split()) > 0: |
132 |
|
|
133 |
+ |
# print "reading line" |
134 |
+ |
# print templine |
135 |
+ |
|
136 |
|
# ignore commented lines |
137 |
|
if (templine[0] == '#'): |
138 |
|
templine = inputFile.readline() |
139 |
|
lineNumber += 1 |
140 |
|
continue; |
141 |
|
|
142 |
+ |
|
143 |
+ |
# print "processing line" |
144 |
|
# check what type of list was provided and assume 'noskim' as default |
145 |
|
if (len(templine.split()) == 7) : |
146 |
|
tempInputList = templine.split() |