Go to the source code of this file.
|
TChain * | CreateChainFromList_opt (std::string ListFileName, std::string ChainName, std::string BaseDirectory, bool DoCheck=false) |
|
void | MakeCombinedFile (std::string FileList, std::string BaseDirectory, std::string OutputName) |
|
void | AssembleSingleFile (std::string FileList, std::string BaseDirectory, std::string OutputName) |
|
void AssembleSingleFile |
( |
std::string |
FileList, |
|
|
std::string |
BaseDirectory, |
|
|
std::string |
OutputName |
|
) |
| |
Definition at line 5 of file AssembleSingleFile.C.
References CreateChainFromList_opt(), and f.
8 TFile *
f = TFile::Open(OutputName.c_str(),
"RECREATE");
9 TChain * ch =
CreateChainFromList_opt(FileList.c_str(),BaseDirectory.c_str(),
"pmtresponse/PhotonLibraryData",
false);
11 Int_t Voxel, OpChannel;
13 ch->SetBranchAddress(
"Voxel", &Voxel);
14 ch->SetBranchAddress(
"OpChannel", &OpChannel);
15 ch->SetBranchAddress(
"Visibility", &Visibility);
17 TTree *
tt =
new TTree(
"PhotonLibraryData",
"PhotonLibraryData");
18 tt->Branch(
"Voxel", &Voxel,
"Voxel/I");
19 tt->Branch(
"OpChannel", &OpChannel,
"OpChannel/I");
20 tt->Branch(
"Visibility", &Visibility,
"Visibility/F");
22 for(
int i=0; i!=ch->GetEntries(); ++i)
TChain * CreateChainFromList_opt(std::string ListFileName, std::string ChainName, std::string BaseDirectory, bool DoCheck=false)
TChain * CreateChainFromList_opt |
( |
std::string |
ListFileName, |
|
|
std::string |
ChainName, |
|
|
std::string |
BaseDirectory, |
|
|
bool |
DoCheck = false |
|
) |
| |
Definition at line 35 of file AssembleSingleFile.C.
References f.
Referenced by AssembleSingleFile().
37 std::ifstream
InputFile(ListFileName.c_str());
40 TChain * TheChain =
new TChain(ChainName.c_str());
43 while(getline(InputFile, FileName))
45 FileName=BaseDirectory+FileName;
46 std::cout<<FileName.c_str()<<std::endl;
47 TheChain->Add(FileName.c_str());
52 while(getline(InputFile, FileName))
54 FileName=BaseDirectory+FileName;
55 TFile*
f=TFile::Open(FileName.c_str());
56 if(f->Get(ChainName.c_str()))
58 std::cout<<FileName.c_str()<<std::endl;
59 TheChain->Add(FileName.c_str());
61 else std::cout<<
"Chain " <<ChainName <<
" not found in file " << FileName<<std::endl;
void MakeCombinedFile |
( |
std::string |
FileList, |
|
|
std::string |
BaseDirectory, |
|
|
std::string |
OutputName |
|
) |
| |