GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
|
TGRSIint is a class that acts as an interpreter for GRSISort. The idea is that TGRSIint will read in cal, info, mid and root files and open them appropriately (order) and do the correct thing with them. It also applies the command line options. Finally, TGRSIint allows us to take over the interpreter to do some GRSI things.
Definition at line 43 of file TGRSIint.h.
Public Member Functions | |
TGRSIint (const TGRSIint &)=delete | |
TGRSIint (TGRSIint &&) noexcept=delete | |
~TGRSIint ()=default | |
void | DelayedProcessLine_Action () |
bool | HandleTermInput () override |
TRawFile * | OpenRawFile (const std::string &filename) |
TFile * | OpenRootFile (const std::string &filename, Option_t *opt="read") |
TGRSIint & | operator= (const TGRSIint &)=delete |
TGRSIint & | operator= (TGRSIint &&) noexcept=delete |
void | PrintLogo (bool) override |
Long_t | ProcessLine (const char *line, Bool_t sync=kFALSE, Int_t *error=nullptr) override |
void | RunMacroFile (const std::string &filename) |
int | TabCompletionHook (char *, int *, std::ostream &) override |
void | Terminate (Int_t status=0) override |
Static Public Member Functions | |
static TEnv * | GetEnv () |
static TGRSIint * | instance (int argc=0, char **argv=nullptr, void *options=nullptr, int numOptions=-1, bool noLogo=false, const char *appClassName="grsisort") |
static void | PrintHelp (bool) |
Static Public Attributes | |
static TGRSIint * | fTGRSIint = nullptr |
Private Member Functions | |
TGRSIint (int argc, char **argv, void *options=nullptr, int numOptions=0, bool noLogo=false, const char *appClassName="grsisort") | |
void | ApplyOptions () |
Long_t | DelayedProcessLine (std::string command) |
void | LoadExtraClasses () |
void | LoopUntilDone () |
void | SetupPipeline () |
Static Private Member Functions | |
static void | DrawLogo () |
static void | LoadGROOTGraphics () |
Private Attributes | |
bool | fAllowedToTerminate |
bool | fIsTabComplete |
TTimer * | fKeepAliveTimer |
std::string | fNewFragmentFile |
std::vector< TRawFile * > | fRawFiles |
int | fRawFilesOpened |
int | fRootFilesOpened |
std::thread::id | main_thread_id |
Static Private Attributes | |
static TEnv * | fGRSIEnv = nullptr |
|
private |
Singleton constructor
Definition at line 63 of file TGRSIint.cxx.
References fGRSIEnv, TGRSIOptions::Get(), PrintLogo(), and TGRSIOptions::ShouldExit().
Referenced by instance().
|
delete |
|
deletenoexcept |
|
default |
|
private |
Applies options from TGRSIOptions. This include things such as batch sorting, reading material, and logo. Also includes the setup of what to do with mid and root files that are input.
Definition at line 90 of file TGRSIint.cxx.
References AllFilesExist(), StoppableThread::AllThreadHeader(), TGRSIOptions::Batch(), TRunInfo::ClearDate(), TRunInfo::ClearFullVersion(), TRunInfo::ClearVersion(), TGRSIOptions::CloseAfterSort(), DRED, TGRSIOptions::Get(), TSingleton< TParserLibrary >::Get(), TGRSIOptions::InputFiles(), TParserLibrary::Load(), LoadGROOTGraphics(), LoopUntilDone(), TGRSIOptions::MacroInputFiles(), OpenRawFile(), OpenRootFile(), TGRSIOptions::ParserLibrary(), TGRSIOptions::ReadingMaterial(), ReadTheNews(), RESET_COLOR, TGRSIOptions::RootInputFiles(), RunMacroFile(), TRunInfo::SetDate(), TRunInfo::SetFullVersion(), SetupPipeline(), TRunInfo::SetVersion(), StartGUI(), TGRSIOptions::StartGui(), and Terminate().
Referenced by instance().
|
private |
Definition at line 773 of file TGRSIint.cxx.
Referenced by ProcessLine().
void TGRSIint::DelayedProcessLine_Action | ( | ) |
Definition at line 790 of file TGRSIint.cxx.
References ProcessLine().
|
staticprivate |
Draws the logo. Can be suppressed with -l
Definition at line 697 of file TGRSIint.cxx.
References PopupLogo(), and WaitLogo().
Referenced by PrintLogo().
|
inlinestatic |
Definition at line 72 of file TGRSIint.h.
References fGRSIEnv.
|
override |
Handles terminal input via TRint
Definition at line 187 of file TGRSIint.cxx.
|
static |
Singleton constructor instance
Definition at line 53 of file TGRSIint.cxx.
References TGRSIint(), ApplyOptions(), and fTGRSIint.
Referenced by main(), TGRSIInterruptHandler::Notify(), TAnalysisHistLoop::OpenFile(), and TFragHistLoop::OpenFile().
|
private |
|
staticprivate |
Loads root graphics in unless -b is used for batch mode.
Definition at line 704 of file TGRSIint.cxx.
Referenced by ApplyOptions().
|
private |
Outputs the thread status until all of the threads are complete.
Definition at line 164 of file TGRSIint.cxx.
References StoppableThread::AllThreadProgress(), StoppableThread::AllThreadStatus(), StoppableThread::AnyThreadRunning(), fAllowedToTerminate, and TGRSIOptions::Get().
Referenced by ApplyOptions(), and Terminate().
TRawFile * TGRSIint::OpenRawFile | ( | const std::string & | filename | ) |
Opens Raw input file and stores them in _raw if successfuly opened.
Definition at line 371 of file TGRSIint.cxx.
References BLUE, TParserLibrary::CreateRawFile(), FileExists(), fRawFiles, fRawFilesOpened, TSingleton< TParserLibrary >::Get(), ProcessLine(), and RESET_COLOR.
Referenced by ApplyOptions().
TFile * TGRSIint::OpenRootFile | ( | const std::string & | filename, |
Option_t * | opt = "read" ) |
Opens root files provided on the command line. Also tells you where these files are stored (ie _file0). If these files are analysis or fragment trees, they are automatically chained into chains called gFragment and gAnalysis. Once this is complete, the TChannels, GValues and RunInfo are also read in.
Definition at line 299 of file TGRSIint.cxx.
References AddFileToGUI(), BLUE, fRootFilesOpened, gAnalysis, gFragment, TRunInfo::ReadInfoFromFile(), and RESET_COLOR.
Referenced by ApplyOptions(), TAnalysisHistLoop::OpenFile(), and TFragHistLoop::OpenFile().
|
static |
Prints the help. Not sure this is used anymore.
Definition at line 715 of file TGRSIint.cxx.
References BG_WHITE, DRED, and RESET_COLOR.
|
override |
Prints the GRSISort logo to terminal
Definition at line 271 of file TGRSIint.cxx.
References DrawLogo(), and ProgramName().
Referenced by TGRSIint().
|
override |
This takes over the native root command line. There are two main reasons for this
Definition at line 234 of file TGRSIint.cxx.
References DelayedProcessLine(), fIsTabComplete, and main_thread_id.
Referenced by DelayedProcessLine_Action(), OpenRawFile(), and RunMacroFile().
void TGRSIint::RunMacroFile | ( | const std::string & | filename | ) |
Runs a macro file. This happens when a .C file is provided on the command line
Definition at line 671 of file TGRSIint.cxx.
References FileExists(), and ProcessLine().
Referenced by ApplyOptions().
|
private |
Finds all of the files input as well as flags provided and makes all of the decisions about what to sort and what order to open everything up in. This also creates the output files. Starts the threads and gets the sorting going. This is really the brains of the command line sorting routine.
Definition at line 399 of file TGRSIint.cxx.
References TUnpackingLoop::AddGoodOutputQueue(), TDetBuildingLoop::AddOutputQueue(), TFragmentChainLoop::AddOutputQueue(), TGRSIOptions::AnalysisHistogramLib(), TGRSIOptions::AnalysisOptions(), TFragWriteLoop::BadInputQueue(), TUnpackingLoop::BadOutputQueue(), TDetectorInformation::BuildMode(), TGRSIOptions::CalInputFiles(), TGRSIOptions::CloseAfterSort(), StoppableThread::ColumnWidth(), DRED, TGRSIOptions::ExternalRunInfo(), FileExists(), fNewFragmentFile, TGRSIOptions::FragmentHistogramLib(), fRawFiles, gAnalysis, TAnalysisHistLoop::Get(), TAnalysisWriteLoop::Get(), TDataLoop::Get(), TDetBuildingLoop::Get(), TEventBuildingLoop::Get(), TFragHistLoop::Get(), TFragmentChainLoop::Get(), TFragWriteLoop::Get(), TGRSIOptions::Get(), TUnpackingLoop::Get(), TRunInfo::GetDetectorInformation(), GetRunNumber(), GetSubRunNumber(), gFragment, TGRSIOptions::InputFiles(), TAnalysisHistLoop::InputQueue(), TDetBuildingLoop::InputQueue(), TEventBuildingLoop::InputQueue(), TFragHistLoop::InputQueue(), TFragWriteLoop::InputQueue(), TUnpackingLoop::InputQueue(), TEventBuildingLoop::kDefault, TGRSIOptions::MakeAnalysisTree(), TGRSIOptions::MakeHistos(), TEventBuildingLoop::OutOfOrderQueue(), TGRSIOptions::OutputAnalysisFile(), TGRSIOptions::OutputAnalysisHistogramFile(), TGRSIOptions::OutputFragmentFile(), TGRSIOptions::OutputFragmentHistogramFile(), TDataLoop::OutputQueue(), TEventBuildingLoop::OutputQueue(), TAnalysisOptions::Print(), TChannel::ReadCalFile(), TRunInfo::ReadInfoFile(), GValue::ReadValFile(), RESET_COLOR, StoppableThread::ResumeAll(), TFragWriteLoop::ScalerInputQueue(), TUnpackingLoop::ScalerOutputQueue(), TDetectorInformation::Set(), TAnalysisHistLoop::SetOutputFilename(), TFragHistLoop::SetOutputFilename(), TRunInfo::SetRunInfo(), TDataLoop::SetSelfStopping(), TFragmentChainLoop::SetSelfStopping(), TEventBuildingLoop::SetSortDepth(), TGRSIOptions::SortDepth(), TGRSIOptions::SortRaw(), StoppableThread::StatusWidth(), TGRSIOptions::UseRnTuple(), TGRSIOptions::ValInputFiles(), and TGRSIOptions::WriteFragmentTree().
Referenced by ApplyOptions().
|
override |
Tries to do a tab completion. Returns false if unsuccsessful
Definition at line 225 of file TGRSIint.cxx.
References fIsTabComplete.
|
override |
Kills all of the threads if the process is allowed to terminate. This sends an error to TSortingDiagnostics if an analysis tree is being created
Definition at line 193 of file TGRSIint.cxx.
References fAllowedToTerminate, TGRSIOptions::Get(), TSingleton< TSortingDiagnostics >::Get(), LoopUntilDone(), TSortingDiagnostics::Print(), StoppableThread::SendStop(), and StoppableThread::StopAll().
Referenced by ApplyOptions(), and TGRSIInterruptHandler::Notify().
|
private |
Flag for shutting down GRSISort.
Definition at line 94 of file TGRSIint.h.
Referenced by LoopUntilDone(), and Terminate().
|
staticprivate |
|
private |
Flag for tab completion hook.
Definition at line 93 of file TGRSIint.h.
Referenced by ProcessLine(), and TabCompletionHook().
|
private |
Time of process.
Definition at line 88 of file TGRSIint.h.
|
private |
|
private |
List of Raw files opened.
Definition at line 99 of file TGRSIint.h.
Referenced by OpenRawFile(), and SetupPipeline().
|
private |
|
private |
Number of ROOT files opened.
Definition at line 95 of file TGRSIint.h.
Referenced by OpenRootFile().
|
static |
|
private |