Skip to content

Commit

Permalink
Merge pull request #292 from kjvbrt/outdir
Browse files Browse the repository at this point in the history
Fixed hadling of empty outputDir
  • Loading branch information
kjvbrt authored Jun 16, 2023
2 parents 01cfc53 + a46cc28 commit c1f87b0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
7 changes: 7 additions & 0 deletions man/man7/fccanalysis-file.7
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ The analysis RDataFrame can be split into several chunks\&.
.br
Default value: 1
.RE
.RE
.PP
\fBoutputDir\fR
.RS 4
User can specify the directory for the output files. The output directory can be
overwriten by specifiing absolute path with `\-\-output` commandline argument\&.
.RE
.PP
This section is under construction. You are invited to help :)
.SH SEE ALSO
Expand Down
15 changes: 10 additions & 5 deletions python/FCCAnalysisRun.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,18 +371,23 @@ def runLocal(rdfModule, infile_list, args):
else:
print(f'----> Info: Number of local events: {nevents_local}')

outfilepath = getElement(rdfModule, "outputDir")
output_dir = getElement(rdfModule, "outputDir")
if not args.batch:
outfilepath += '/' + args.output
print(os.path.isabs(args.output))
if os.path.isabs(args.output):
print('----> Warning: Provided output path is absolute, "outputDir" from analysis script will be ignored!')
outfile_path = os.path.join(output_dir, args.output)
else:
outfilepath = args.output
outfile_path = args.output
print('----> Info: Output file path:')
print(' ' + outfile_path)

#Run RDF
start_time = time.time()
outn = runRDF(rdfModule, file_list, outfilepath, nevents_local, args)
outn = runRDF(rdfModule, file_list, outfile_path, nevents_local, args)
outn = outn.GetValue()

outfile = ROOT.TFile(outfilepath, 'update')
outfile = ROOT.TFile(outfile_path, 'update')
param = ROOT.TParameter(int)('eventsProcessed',
nevents_orig if nevents_orig != 0 else nevents_local)
param.Write()
Expand Down
2 changes: 1 addition & 1 deletion python/Parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def setup_build_parser(parser):
publicOptions.add_argument('-j','--build-threads',
type=int,
default=1,
help='bumber of threads when building (equivalent to `make -j`)')
help='number of threads when building (equivalent to `make -j`)')

def setup_pin_parser(parser):
publicOptions = parser.add_argument_group('User pin options')
Expand Down

0 comments on commit c1f87b0

Please sign in to comment.