EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
#include <eic-smear/blob/master/include/eicsmear/erhic/Forester.h>
Classes | |
class | Status |
Public Member Functions | |
Forester () | |
virtual | ~Forester () |
Long64_t | Plant () |
void | SetInputFileName (const std::string &) |
void | SetOutputFileName (const std::string &) |
void | SetTreeName (const std::string &="EICTree") |
void | SetBranchName (const std::string &="event") |
std::string | GetInputFileName () const |
std::string | GetOutputFileName () const |
std::string | GetTreeName () const |
std::string | GetBranchName () const |
void | SetMaxNEvents (Long64_t=0) |
Long64_t | GetMaxNEvents () const |
void | SetMessageInterval (Long64_t=10000) |
void | Print (std::ostream &stream) const |
void | Print (Option_t *="not used") const |
void | SetBeVerbose (bool=false) |
bool | BeVerbose () const |
const erhic::FileType * | GetFileType () const |
Protected Member Functions | |
const Status & | GetGetStatus () const |
bool | OpenInput () |
bool | SetupOutput () |
void | Finish () |
bool | AllocateEvent () |
bool | FindFirstEvent () |
void | PrintStatus () const |
bool | MustQuit () const |
void | SetMustQuit (bool quit) |
Protected Attributes | |
Bool_t | mQuit |
Quit status. Set to true once EoF or max events reached. | |
Bool_t | mVerbose |
Verbosity flag. | |
TTree * | mTree |
VirtualEvent * | mEvent |
< Output TTree, owned by mRootFile | |
const erhic::FileType * | mFile |
< Stores event branch address | |
TFile * | mRootFile |
< File type information | |
Long64_t | mMaxNEvents |
< Pointer to output ROOT file | |
Long64_t | mInterval |
Event interval between printing status messages. | |
std::shared_ptr< std::istream > | mTextFile |
std::string | mInputName |
< Input text file | |
std::string | mOutputName |
Name of the output ROOT file. | |
std::string | mTreeName |
Name of the output TTree. | |
std::string | mBranchName |
Name of the event TBranch. | |
std::string | mLine |
Stores the latest text line read from the input file. | |
Status | mStatus |
Forester status information. | |
VirtualEventFactory * | mFactory |
Manages the creation of trees from plain-text Monte Carlo files. Bad pun, I know, but the ROOT guys started it.
Definition at line 40 of file Forester.h.
View newest version in sPHENIX GitHub at line 40 of file Forester.h
erhic::Forester::Forester | ( | ) |
Default constructor.
Definition at line 28 of file Forester.cxx.
View newest version in sPHENIX GitHub at line 28 of file Forester.cxx
|
virtual |
Destructor.
Definition at line 45 of file Forester.cxx.
View newest version in sPHENIX GitHub at line 45 of file Forester.cxx
|
protected |
Allocate an event buffer for the TTree based on the generator type. Returns false if the generator has not yet been successfully determined.
Definition at line 232 of file Forester.cxx.
View newest version in sPHENIX GitHub at line 232 of file Forester.cxx
References erhic::FileType::AllocateEvent(), mEvent, and mFile.
Referenced by SetupOutput().
|
inline |
Returns the verbosity i.e. whether to print status messages.
Definition at line 317 of file Forester.h.
View newest version in sPHENIX GitHub at line 317 of file Forester.h
References mVerbose.
Referenced by Finish(), and Plant().
|
protected |
Aligns the input text file on the first line of the first event. After a successful call, mLine stores the first line of the event and true is returned. If unsuccessful, mLine is blank and false is returned.
Definition at line 247 of file Forester.cxx.
View newest version in sPHENIX GitHub at line 247 of file Forester.cxx
References getline, mLine, and mTextFile.
Referenced by Poacher::Poacher().
|
protected |
Writes output and takes end-of-file actions.
Definition at line 207 of file Forester.cxx.
View newest version in sPHENIX GitHub at line 207 of file Forester.cxx
References BeVerbose(), GetGetStatus(), GetInputFileName(), mFactory, erhic::VirtualEventFactory::mObjectsToWriteAtTheEnd, mRootFile, mStatus, mTree, erhic::Forester::Status::Print(), SetMustQuit(), and erhic::Forester::Status::StopTimer().
Referenced by Plant().
|
inline |
Returns the name of the TBranch containing event objects.
Definition at line 289 of file Forester.h.
View newest version in sPHENIX GitHub at line 289 of file Forester.h
References mBranchName.
Referenced by SetupOutput().
|
inline |
Returns the file type information for the last processed file. Returns NULL if no input has been processed. Do not delete the returned object.
Definition at line 321 of file Forester.h.
View newest version in sPHENIX GitHub at line 321 of file Forester.h
References mFile.
Referenced by BuildTree().
|
inlineprotected |
Prints a summary of the last call to Plant() to the requested output stream.
Definition at line 184 of file Forester.h.
View newest version in sPHENIX GitHub at line 184 of file Forester.h
References mStatus.
Referenced by Finish().
|
inline |
Returns the name of the input text file containing Monte Carlo data.
Definition at line 277 of file Forester.h.
View newest version in sPHENIX GitHub at line 277 of file Forester.h
References mInputName.
Referenced by Finish(), OpenInput(), and Plant().
|
inline |
Returns the maximum number of events to process.
Definition at line 297 of file Forester.h.
View newest version in sPHENIX GitHub at line 297 of file Forester.h
References mMaxNEvents.
Referenced by Plant().
|
inline |
Returns the name of the ROOT tree file to create.
Definition at line 281 of file Forester.h.
View newest version in sPHENIX GitHub at line 281 of file Forester.h
References mOutputName.
Referenced by SetupOutput().
|
inline |
Returns the name of the TTree to write to the file named by SetOutputFileName().
Definition at line 285 of file Forester.h.
View newest version in sPHENIX GitHub at line 285 of file Forester.h
References mTreeName.
Referenced by SetupOutput().
|
inlineprotected |
Prints the quit flag status. A return value of true indicates that the input file has ended or the mMaxNEvents has been reached. Processing the file will quit after the end of the next call to FinishEvent().
Definition at line 305 of file Forester.h.
View newest version in sPHENIX GitHub at line 305 of file Forester.h
References mQuit.
Referenced by Plant().
|
protected |
Opens the input file and checks that it was produced by a supported Monte Carlo generator. Returns true upon success or false upon and I/O error or if the Monte Carlo generator is unsupported or cannot be determined.
Definition at line 133 of file Forester.cxx.
View newest version in sPHENIX GitHub at line 133 of file Forester.cxx
References erhic::FileType::CreateEventFactory(), erhic::FileFactory::GetFile(), erhic::FileType::GetGeneratorName(), GetInputFileName(), erhic::FileFactory::GetInstance(), erhic::VirtualEventFactory::mAdditionalInformation, mFactory, mFile, and mTextFile.
Referenced by Plant(), and Poacher::Poacher().
Long64_t erhic::Forester::Plant | ( | ) |
Processes a text file into a ROOT file. Returns the number of events processed.
Definition at line 70 of file Forester.cxx.
View newest version in sPHENIX GitHub at line 70 of file Forester.cxx
References BeVerbose(), erhic::VirtualEventFactory::Create(), Acts::UnitConstants::e, Finish(), GetInputFileName(), GetMaxNEvents(), erhic::VirtualEvent::GetNTracks(), mEvent, mFactory, mInterval, erhic::Forester::Status::ModifyEventCount(), erhic::Forester::Status::ModifyParticleCount(), mStatus, mTree, MustQuit(), OpenInput(), SetMustQuit(), SetupOutput(), and width().
Referenced by BuildTree().
void erhic::Forester::Print | ( | std::ostream & | stream | ) | const |
Prints the current configuration to the requested output stream.
Definition at line 260 of file Forester.cxx.
View newest version in sPHENIX GitHub at line 260 of file Forester.cxx
References mBranchName, mEvent, mInputName, mMaxNEvents, mOutputName, and mTreeName.
Referenced by Print().
void erhic::Forester::Print | ( | Option_t * | = "not used" | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. To avoid hiding TObject::Print()
Definition at line 271 of file Forester.cxx.
View newest version in sPHENIX GitHub at line 271 of file Forester.cxx
References Print().
|
protected |
Prints the status of the current Plant() call to the standard output.
|
inline |
If set to true, prints messages during running. If set to false, runs silently except in the case of critical errors.
Definition at line 313 of file Forester.h.
View newest version in sPHENIX GitHub at line 313 of file Forester.h
References mVerbose.
Referenced by BuildTree().
|
inline |
Sets the name of the TBranch containing event objects. This is the only branch written to the TTree named by SetTreeName().
Definition at line 273 of file Forester.h.
View newest version in sPHENIX GitHub at line 273 of file Forester.h
References mBranchName, and name.
Referenced by BuildTree().
|
inline |
Sets the name of the input text file containing Monte Carlo data.
Definition at line 261 of file Forester.h.
View newest version in sPHENIX GitHub at line 261 of file Forester.h
References mInputName, and name.
Referenced by BuildTree(), and Poacher::Poacher().
|
inline |
Sets the maximum number of events to process. Processing will terminate when this number of events or the end of the input file is reached, whichever occurs first. A value <= 0 indicates to process all events in the input file (this is the default).
Definition at line 293 of file Forester.h.
View newest version in sPHENIX GitHub at line 293 of file Forester.h
References mMaxNEvents.
Referenced by BuildTree().
|
inline |
Sets the event count interval at which to print a status message. A value <= 0 suppresses messages.
Definition at line 301 of file Forester.h.
View newest version in sPHENIX GitHub at line 301 of file Forester.h
References mInterval.
Referenced by BuildTree().
|
inlineprotected |
Set the quit flag.
Definition at line 309 of file Forester.h.
View newest version in sPHENIX GitHub at line 309 of file Forester.h
References mQuit.
Referenced by Finish(), and Plant().
|
inline |
Sets the name of the ROOT tree file to create.
Definition at line 265 of file Forester.h.
View newest version in sPHENIX GitHub at line 265 of file Forester.h
References mOutputName, and name.
Referenced by BuildTree().
|
inline |
Sets the name of the TTree to write to the file named by SetOutputFileName().
Definition at line 269 of file Forester.h.
View newest version in sPHENIX GitHub at line 269 of file Forester.h
|
protected |
Opens the output ROOT file and creates the TTree ready for filling.
Definition at line 174 of file Forester.cxx.
View newest version in sPHENIX GitHub at line 174 of file Forester.cxx
References AllocateEvent(), erhic::VirtualEventFactory::FindFirstEvent(), GetBranchName(), GetOutputFileName(), GetTreeName(), mEvent, mFactory, mRootFile, mStatus, mTree, and erhic::Forester::Status::StartTimer().
Referenced by Plant().
|
protected |
Name of the event TBranch.
Definition at line 253 of file Forester.h.
View newest version in sPHENIX GitHub at line 253 of file Forester.h
Referenced by GetBranchName(), Print(), and SetBranchName().
|
protected |
< Output TTree, owned by mRootFile
Definition at line 243 of file Forester.h.
View newest version in sPHENIX GitHub at line 243 of file Forester.h
Referenced by AllocateEvent(), Plant(), Print(), SetupOutput(), and ~Forester().
|
protected |
Definition at line 256 of file Forester.h.
View newest version in sPHENIX GitHub at line 256 of file Forester.h
Referenced by Poacher::EventName(), Finish(), Poacher::GetNextEvent(), OpenInput(), Plant(), SetupOutput(), and ~Forester().
|
protected |
< Stores event branch address
Definition at line 244 of file Forester.h.
View newest version in sPHENIX GitHub at line 244 of file Forester.h
Referenced by AllocateEvent(), GetFileType(), OpenInput(), and ~Forester().
|
protected |
< Input text file
Name of the input text file
Definition at line 250 of file Forester.h.
View newest version in sPHENIX GitHub at line 250 of file Forester.h
Referenced by GetInputFileName(), Print(), and SetInputFileName().
|
protected |
Event interval between printing status messages.
Definition at line 247 of file Forester.h.
View newest version in sPHENIX GitHub at line 247 of file Forester.h
Referenced by Plant(), and SetMessageInterval().
|
protected |
Stores the latest text line read from the input file.
Definition at line 254 of file Forester.h.
View newest version in sPHENIX GitHub at line 254 of file Forester.h
Referenced by FindFirstEvent().
|
protected |
< Pointer to output ROOT file
Maximum number of events to process
Definition at line 246 of file Forester.h.
View newest version in sPHENIX GitHub at line 246 of file Forester.h
Referenced by GetMaxNEvents(), Print(), and SetMaxNEvents().
|
protected |
Name of the output ROOT file.
Definition at line 251 of file Forester.h.
View newest version in sPHENIX GitHub at line 251 of file Forester.h
Referenced by GetOutputFileName(), Print(), and SetOutputFileName().
|
protected |
Quit status. Set to true once EoF or max events reached.
Definition at line 240 of file Forester.h.
View newest version in sPHENIX GitHub at line 240 of file Forester.h
Referenced by MustQuit(), and SetMustQuit().
|
protected |
< File type information
Definition at line 245 of file Forester.h.
View newest version in sPHENIX GitHub at line 245 of file Forester.h
Referenced by Finish(), SetupOutput(), and ~Forester().
|
protected |
Forester status information.
Definition at line 255 of file Forester.h.
View newest version in sPHENIX GitHub at line 255 of file Forester.h
Referenced by Finish(), GetGetStatus(), Plant(), and SetupOutput().
|
protected |
Definition at line 249 of file Forester.h.
View newest version in sPHENIX GitHub at line 249 of file Forester.h
Referenced by FindFirstEvent(), and OpenInput().
|
protected |
Definition at line 242 of file Forester.h.
View newest version in sPHENIX GitHub at line 242 of file Forester.h
Referenced by Finish(), Plant(), and SetupOutput().
|
protected |
Name of the output TTree.
Definition at line 252 of file Forester.h.
View newest version in sPHENIX GitHub at line 252 of file Forester.h
Referenced by GetTreeName(), Print(), and SetTreeName().
|
protected |
Verbosity flag.
Definition at line 241 of file Forester.h.
View newest version in sPHENIX GitHub at line 241 of file Forester.h
Referenced by BeVerbose(), and SetBeVerbose().