Skip to content

Commit

Permalink
Merge pull request #15 from ireed3597/master
Browse files Browse the repository at this point in the history
Updates to local path creation
  • Loading branch information
jkguiang authored Nov 14, 2023
2 parents 9f36748 + a6bffef commit f5f0956
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions rapido/src/hepcli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,23 @@ void HEPCLI::parse(int argc, char** argv)
is_signal = is_signal_flag;
debug = debug_flag;

// Make local directories as needed for the output
std::vector<std::string> sub_dirs;
size_t start = 0;
size_t end;

while ((end = output_dir.find('/',start)) != std::string::npos)
{
sub_dirs.push_back(output_dir.substr(0,end));
start = end + 1;
}
sub_dirs.push_back(output_dir);

for (const std::string& sub_dir : sub_dirs)
{
mkdir(sub_dir.c_str(), 0777);
}

// Read all non-optioned arguments as input file paths
int n_input_files = 0;
input_tchain = new TChain(input_ttree.c_str());
Expand Down
4 changes: 4 additions & 0 deletions rapido/src/hepcli.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#include <stdlib.h>
#include <getopt.h>

#include <sys/stat.h>
#include <sys/types.h>
#include <vector>

#include "TChain.h"

/**
Expand Down

0 comments on commit f5f0956

Please sign in to comment.