3 std::string BaseDirectory,
5 void MakeCombinedFile(std::string FileList, std::string BaseDirectory, std::string OutputName);
7 void AssembleSingleFile(std::string FileList, std::string BaseDirectory, std::string OutputName)
10 TFile*
f = TFile::Open(OutputName.c_str(),
"RECREATE");
12 FileList.c_str(), BaseDirectory.c_str(),
"pmtresponse/PhotonLibraryData",
false);
14 Int_t Voxel, OpChannel;
16 ch->SetBranchAddress(
"Voxel", &Voxel);
17 ch->SetBranchAddress(
"OpChannel", &OpChannel);
18 ch->SetBranchAddress(
"Visibility", &Visibility);
20 TTree*
tt =
new TTree(
"PhotonLibraryData",
"PhotonLibraryData");
21 tt->Branch(
"Voxel", &Voxel,
"Voxel/I");
22 tt->Branch(
"OpChannel", &OpChannel,
"OpChannel/I");
23 tt->Branch(
"Visibility", &Visibility,
"Visibility/F");
25 for (
int i = 0; i != ch->GetEntries(); ++i) {
35 std::string BaseDirectory,
36 std::string ChainName,
39 std::ifstream InputFile(ListFileName.c_str());
42 TChain* TheChain =
new TChain(ChainName.c_str());
44 while (getline(InputFile, FileName)) {
45 FileName = BaseDirectory + FileName;
46 std::cout << FileName.c_str() << std::endl;
47 TheChain->Add(FileName.c_str());
51 while (getline(InputFile, FileName)) {
52 FileName = BaseDirectory + FileName;
53 TFile*
f = TFile::Open(FileName.c_str());
54 if (f->Get(ChainName.c_str())) {
55 std::cout << FileName.c_str() << std::endl;
56 TheChain->Add(FileName.c_str());
59 std::cout <<
"Chain " << ChainName <<
" not found in file " << FileName << std::endl;
TChain * CreateChainFromList_opt(std::string ListFileName, std::string ChainName, std::string BaseDirectory, bool DoCheck=false)
void AssembleSingleFile(std::string FileList, std::string BaseDirectory, std::string OutputName)
void MakeCombinedFile(std::string FileList, std::string BaseDirectory, std::string OutputName)