#include <Bmnt.h>
Public Member Functions | |
| Bmnt () | |
| Create a bmnt with no outfile yet specified. | |
| Bmnt (const char *outfile) | |
| Create a bmnt with a pre-specified outfile. | |
| ~Bmnt () | |
| Destructor. | |
| void | ProcessFiles (const char **filenames) |
| Process the list of files into one pre-specified output file. | |
| void | ProcessFile (const char *filename, int nentries=0) |
| void | ProcessDirectory (const char *in_directory, const char *out_directory, bool skip_last=false) |
| TTree * | GetTree () |
| void | Write () |
Private Attributes | |
| BmntImp * | fImp |
|
|
Create a bmnt with no outfile yet specified.
Definition at line 119 of file Bmnt.cxx.
|
|
|
Create a bmnt with a pre-specified outfile.
Definition at line 123 of file Bmnt.cxx. References fImp, outfile, and BmntImp::Start().
|
|
|
Destructor.
Definition at line 128 of file Bmnt.cxx. References fImp. 00129 {
00130 if (!fImp) return;
00131
00132 delete fImp; fImp = 0;
00133 }
|
|
|
Definition at line 242 of file Bmnt.cxx. References fImp, and BmntImp::fTree.
|
|
||||||||||||||||
|
Process all .mbeam.root files in given input directory and place output in given directory as .bmnt.root. Set skip_last to true to skip the most recent file (maybe because it is not yet written). Definition at line 147 of file Bmnt.cxx. References files, fImp, gSystem(), infile, len, outfile, BmntImp::ProcessFile(), BmntImp::Start(), BmntImp::Stop(), and Write(). 00149 {
00150 void *dir = gSystem->OpenDirectory(in_directory);
00151 if (!dir) {
00152 cerr << "No such directory: " << in_directory << endl;
00153 return;
00154 }
00155
00156 vector<string> files;
00157 while (const char* file = gSystem->GetDirEntry(dir)) {
00158 string filename = file;
00159 if ( filename.length() > 5
00160 && filename[0] == 'B'
00161 && filename.find(".mbeam.root") == filename.length()-11 ) {
00162 files.push_back(file);
00163 }
00164 }
00165 std::sort(files.begin(),files.end());
00166 if (skip_last) files.pop_back();
00167 for (size_t ind = 0; ind < files.size(); ++ind) {
00168
00169 string infile = in_directory;
00170 infile += "/";
00171 infile += files[ind];
00172
00173 string outfile = out_directory;
00174 size_t start = infile.rfind("/");
00175 size_t len = infile.find(".mbeam.root") - start;
00176 outfile += infile.substr(start,len);
00177 outfile += ".bmnt.root";
00178
00179 if (!fImp->Start(outfile.c_str())) continue;
00180
00181 cerr << infile << " --> " << outfile << endl;
00182
00183 fImp->ProcessFile(infile.c_str(),true);
00184 fImp->ProcessFile(infile.c_str(),false);
00185 this->Write();
00186 fImp->Stop();
00187 delete fImp;
00188 fImp = new BmntImp();
00189 }
00190 }
|
|
||||||||||||
|
Definition at line 135 of file Bmnt.cxx. References fImp, and BmntImp::ProcessFile(). 00136 {
00137 fImp->ProcessFile(filename, false, nentries);
00138 }
|
|
|
Process the list of files into one pre-specified output file.
Definition at line 141 of file Bmnt.cxx. References filenames, fImp, and BmntImp::ProcessFile(). Referenced by make_bmnt_one_per_dir(). 00142 {
00143 for (int ind=0; filenames[ind]; ++ind) fImp->ProcessFile(filenames[ind],true);
00144 for (int ind=0; filenames[ind]; ++ind) fImp->ProcessFile(filenames[ind],false);
00145 }
|
|
|
Definition at line 244 of file Bmnt.cxx. References BmntImp::fFile, fImp, and BmntImp::fTree. Referenced by make_bmnt_one_per_dir(), and ProcessDirectory().
|
|
|
Definition at line 12 of file Bmnt.h. Referenced by Bmnt(), GetTree(), ProcessDirectory(), ProcessFile(), ProcessFiles(), Write(), and ~Bmnt(). |
1.3.9.1