22 std::unique_ptr<TChain> &passTree_chain_ptr,
23 std::unique_ptr<TChain> &allTree_chain_ptr)
25 passTree_chain_ptr = std::make_unique<TChain>(
"passTree");
26 allTree_chain_ptr = std::make_unique<TChain>(
"allTree");
28 std::regex re(R
"(.*run(\d+))");
31 std::string run_number;
32 std::filesystem::path icefinal_path;
35 for (
auto& p: std::filesystem::directory_iterator(PUEO_MC_DATA)){
40 if(std::regex_match(run_name, match, re)) {
41 run_number = match[1].str();
45 icefinal_path = p.path() / (
"IceFinal_" + run_number +
"_allTree.root");
46 if (!std::filesystem::exists(icefinal_path)){
47 std::cerr <<
"file not found: " << icefinal_path <<
"\n";
51 passTree_chain_ptr -> Add(icefinal_path.string().c_str());
52 allTree_chain_ptr -> Add(icefinal_path.string().c_str());
int prepare_icefinal_chain(std::filesystem::path PUEO_MC_DATA, std::unique_ptr< TChain > &passTree_chain_ptr, std::unique_ptr< TChain > &allTree_chain_ptr)
Prepares two TChains that combine all the IceFinal_*_allTree.root files in the simulation output dire...