17 #include <TRefArray.h>
38 , mInputName(
"default.txt")
39 , mOutputName(
"default.root")
40 , mTreeName(
"EICTree")
41 , mBranchName(
"event")
89 std::cout <<
"Processing event "<< std::setw(width) << i;
93 std::cout << std::endl;
117 catch(std::exception&
e) {
118 std::cerr <<
"Caught exception in Forester::Plant(): "
119 << e.what() << std::endl;
120 std::cerr <<
"Event will be skipped..." << std::endl;
126 catch(std::exception&
e) {
127 std::cerr <<
"Caught exception in Forester::Plant(): "
128 << e.what() << std::endl;
138 auto tmp = std::make_shared<igzstream>();
142 std::string message(
"Unable to open file ");
147 auto tmp = std::make_shared<std::ifstream>();
151 std::string message(
"Unable to open file ");
163 " is not from a supported generator");
169 catch(std::exception&) {
179 std::string message(
"Unable to open file ");
185 std::string message(
"Error allocating TTree ");
186 throw std::runtime_error(message.append(
GetTreeName()));
194 mTree->SetAutoSave(500LL * 1024LL * 1024LL);
202 catch(std::exception&) {
216 namedobject.second->Write(namedobject.first);
242 catch(std::exception&) {
261 os <<
"Input file: " <<
mInputName << std::endl;
263 os <<
"Output tree: " <<
mTreeName << std::endl;
264 os <<
"Output branch: " <<
mBranchName << std::endl;
265 os <<
"Maximum number of events: " <<
mMaxNEvents << std::endl;
267 os <<
"Event type: " <<
mEvent->ClassName() << std::endl;
290 os <<
"Began on " << std::ctime(&mStartTime);
291 os <<
"Ended on " << std::ctime(&mEndTime);
292 os <<
"Processed " << mNEvents <<
" events containing "
293 << mNParticles <<
" particles in "
294 << mTimer.RealTime() <<
" seconds "
295 <<
'(' << mTimer.RealTime()/mNEvents <<
" sec/event)" << std::endl;
314 mNParticles += count;