![]() |
Diana Software
|
Class to handle ROOT files. More...
Public Member Functions | |
| QGFileHandler () | |
| Constructor. More... | |
| virtual | ~QGFileHandler () |
| Destructor. More... | |
| bool | CheckForModifiedFiles () |
| Check whether any open file has been modified. More... | |
| void | CloseFiles () |
| Close all open files, empty the chain. More... | |
| void | GetEvent (const Long64_t eventNumber, const std::string &samplesName="") |
| Get an event. More... | |
| TEventList | GetEventList (TCut cuts) |
| Get an event list containing the events passing a cut. More... | |
| std::vector< std::string > | GetFilenames () |
| Get a vector containing the names of the open files. More... | |
| const QSampleInfo & | GetMasterSample (const Long64_t eventNumber) |
| Get master sample of an event. More... | |
| const Diana::QVector & | GetPulse (const Long64_t eventNumber, const std::string &samplesName) |
| Get the pulse of an event. More... | |
| TObject * | GetGenericObject (const Long64_t eventNumber, const std::string &samplesName) |
| const QChannelRunData * | GetChannelRunData (const Long64_t eventNumber) |
| Get the run data for an event. More... | |
| const QRunData * | GetRunData (const Long64_t eventNumber) |
| Get the run data for an event. More... | |
| QChain * | GetQChain () |
| Get a pointer to the chian. More... | |
| std::set< std::string > | GetSetOfAliases () |
| Get the aliases defined in the tree. More... | |
| std::set< std::string > | GetSetOfQVectorAliases () |
| Get the aliases defined in the tree. More... | |
| std::set< std::string > | GetSetOfLeaves () |
| Get the names of the leaves of the tree. More... | |
| std::set< std::string > | GetSetOfQVectorLeaves () |
| Get the names of the leaves of the tree. More... | |
| std::string | GetDefaultPulseLabel () const |
| Get the names of the leaves of the tree. More... | |
| const std::vector< QSampleInfo > & | GetSignificantSamples (const Long64_t eventNumber) |
| Get significant samples of an event. More... | |
| std::string | GetTreeClass () |
| Get the class name of the tree. More... | |
| bool | IsFileOpen () |
| Check whether a file is open. More... | |
| void | ListOpenFiles () |
| Print a list of open files to the console. More... | |
| void | OpenFile () |
| Pop up a file open dialog. More... | |
| void | OpenFile (std::string filename) |
| Open a new file, add it to the chain. More... | |
| void | OpenFiles (const std::vector< std::string > &files) |
| Open files, add them to the chain. More... | |
| void | ParseFileList (const std::string &filename) |
| Parse file list. More... | |
Protected Member Functions | |
| time_t | ModificationTime (const std::string &filename) |
| Return modification time of file. More... | |
| void | ReopenFiles () |
| Reopen files. More... | |
| void | SetLowestStartTimeUnix (const std::string &treeName) |
| Set LowestStartTimeUnix alias. More... | |
| void | SetUpChain () |
| Set up the chain. More... | |
| void | SetUpNumericTypes () |
| Specify the numeric data types. More... | |
Protected Attributes | |
| std::string | fDataDirectory |
| Directory containing data files. More... | |
| TEventList | fEventList |
| Event list. More... | |
| TFile * | fFile |
| ROOT file. More... | |
| std::vector< std::string > | fFilenames |
| Filenames. More... | |
| bool | fFileOpen |
| File open flag. More... | |
| double | fLowestStartTimeUnix |
| Lowest StartTimeUnix of open files. More... | |
| std::map< std::string, time_t > | fModificationTime |
| Modification times of every open file. More... | |
| std::set< std::string > | fNumericTypes |
| Collection of numeric data types. More... | |
| Diana::QVector | fDefaultPulse |
| Default (empty) pulse, for use when opening a non-Diana file. More... | |
| QHeader * | fHeader |
| QBaseEvent. More... | |
| QPulseInfo * | fPulseInfo |
| QChain * | fQChain |
| QChain. More... | |
| std::string | fTreeClass |
| Name of tree's class. More... | |
| Diana::QVector | fSamples |
| samples (QVector or QVectorI or QPulse) to load More... | |
| TObject * | fGenericObject |
| Diana::QGlobalDataManager * | fDataManager |
| std::string | fDefaultPulseLabel |
| defalt label of samples to load More... | |
Class to handle ROOT files.
Definition at line 34 of file QGFileHandler.hh.
| QGFileHandler::QGFileHandler | ( | ) |
Constructor.
Definition at line 50 of file QGFileHandler.cc.
References fDataManager, fDefaultPulseLabel, fGenericObject, SetUpChain(), and SetUpNumericTypes().
|
virtual |
| bool QGFileHandler::CheckForModifiedFiles | ( | ) |
Check whether any open file has been modified.
Definition at line 66 of file QGFileHandler.cc.
References fModificationTime, ModificationTime(), and ReopenFiles().
Referenced by QGPlot::Plot().
| void QGFileHandler::CloseFiles | ( | ) |
Close all open files, empty the chain.
Definition at line 88 of file QGFileHandler.cc.
References fFilenames, fFileOpen, fHeader, fLowestStartTimeUnix, fModificationTime, fPulseInfo, fQChain, fTreeClass, and SetUpChain().
Referenced by QGCanvasSetupFrame::HandleCloseFilesButton(), and ReopenFiles().
| const QChannelRunData * QGFileHandler::GetChannelRunData | ( | const Long64_t | eventNumber | ) |
Get the run data for an event.
Definition at line 232 of file QGFileHandler.cc.
References chanRunData, fPulseInfo, QPulseInfo::GetChannelId(), QRunData::GetChannelRunData(), and GetRunData().
Referenced by QGPulse::GetPulseFromChain().
|
inline |
Get the names of the leaves of the tree.
Definition at line 87 of file QGFileHandler.hh.
References fDefaultPulseLabel.
Referenced by QGPulseEditWindow::FillVariablesDropDownBoxes().
| void QGFileHandler::GetEvent | ( | const Long64_t | eventNumber, |
| const std::string & | samplesName = "" |
||
| ) |
Get an event.
Definition at line 103 of file QGFileHandler.cc.
References fGenericObject, fQChain, fSamples, and QPulse::GetSamples().
Referenced by GetGenericObject(), GetMasterSample(), GetPulse(), GetRunData(), and GetSignificantSamples().
| TEventList QGFileHandler::GetEventList | ( | TCut | cuts | ) |
Get an event list containing the events passing a cut.
Definition at line 143 of file QGFileHandler.cc.
References fQChain.
|
inline |
Get a vector containing the names of the open files.
Definition at line 55 of file QGFileHandler.hh.
References fFilenames.
Referenced by QGPlotIconsFrame::HandlePulsesButton(), and QGCanvasWindow::UpdateFileLabel().
| TObject * QGFileHandler::GetGenericObject | ( | const Long64_t | eventNumber, |
| const std::string & | samplesName | ||
| ) |
Definition at line 173 of file QGFileHandler.cc.
References fGenericObject, and GetEvent().
Referenced by QGPulse::GetPulseFromChain().
| const QSampleInfo & QGFileHandler::GetMasterSample | ( | const Long64_t | eventNumber | ) |
Get master sample of an event.
Definition at line 154 of file QGFileHandler.cc.
References QPulseInfo::Clear(), fPulseInfo, GetEvent(), and QPulseInfo::GetMasterSample().
Referenced by QGPulse::GetPulseFromChain().
| const QVector & QGFileHandler::GetPulse | ( | const Long64_t | eventNumber, |
| const std::string & | samplesName | ||
| ) |
Get the pulse of an event.
Definition at line 166 of file QGFileHandler.cc.
References fSamples, and GetEvent().
Referenced by QGPulse::GetPulseFromChain().
|
inline |
Get a pointer to the chian.
Definition at line 72 of file QGFileHandler.hh.
References fQChain.
Referenced by QGPulse::FillEventData(), QGHistogram::Generate(), QGPulse::Generate(), QGScatterPlot::Generate(), and QGPulse::Order().
| const QRunData * QGFileHandler::GetRunData | ( | const Long64_t | eventNumber | ) |
Get the run data for an event.
Definition at line 196 of file QGFileHandler.cc.
References fDataManager, fHeader, fPulseInfo, fQChain, GetEvent(), and QHeader::GetRun().
Referenced by GetChannelRunData().
| set< string > QGFileHandler::GetSetOfAliases | ( | ) |
Get the aliases defined in the tree.
Definition at line 248 of file QGFileHandler.cc.
References fFileOpen, fQChain, QChain::GetListOfAllAliases(), and N.
Referenced by QGHistogramEditWindow::FillVariablesDropDownBoxes(), QGPulseEditWindow::FillVariablesDropDownBoxes(), and QGScatterPlotEditWindow::FillVariablesDropDownBoxes().
| set< string > QGFileHandler::GetSetOfLeaves | ( | ) |
Get the names of the leaves of the tree.
Definition at line 279 of file QGFileHandler.cc.
References fFileOpen, fNumericTypes, fQChain, QChain::GetListOfAllLeaves(), and N.
Referenced by QGHistogramEditWindow::FillVariablesDropDownBoxes(), QGPulseEditWindow::FillVariablesDropDownBoxes(), and QGScatterPlotEditWindow::FillVariablesDropDownBoxes().
| std::set< std::string > QGFileHandler::GetSetOfQVectorAliases | ( | ) |
Get the aliases defined in the tree.
Definition at line 273 of file QGFileHandler.cc.
Referenced by QGPulseEditWindow::FillVariablesDropDownBoxes().
| set< string > QGFileHandler::GetSetOfQVectorLeaves | ( | ) |
Get the names of the leaves of the tree.
Definition at line 301 of file QGFileHandler.cc.
References fDefaultPulseLabel, fFileOpen, fQChain, and QChain::GetListOfAllLeaves().
Referenced by QGPulseEditWindow::FillVariablesDropDownBoxes().
| const vector< QSampleInfo > & QGFileHandler::GetSignificantSamples | ( | const Long64_t | eventNumber | ) |
Get significant samples of an event.
Definition at line 181 of file QGFileHandler.cc.
References QPulseInfo::Clear(), fPulseInfo, GetEvent(), and QPulseInfo::GetSamplesInfo().
Referenced by QGPulse::GetPulseFromChain().
|
inline |
Get the class name of the tree.
Definition at line 93 of file QGFileHandler.hh.
References fTreeClass.
|
inline |
Check whether a file is open.
Definition at line 96 of file QGFileHandler.hh.
References fFileOpen.
Referenced by QGCanvasWindow::DisplayPlotFrame(), QGCanvasWindow::DisplaySetupFrame(), QGPulse::FillEventData(), QGHistogram::Generate(), QGPulse::Generate(), QGScatterPlot::Generate(), QGPulse::GetPulseFromChain(), QGCanvasSetupFrame::OpenFile(), QGCanvasSetupFrame::OpenSession(), QGPulse::Order(), and QGCanvasSetupFrame::SetDisplay().
| void QGFileHandler::ListOpenFiles | ( | ) |
Print a list of open files to the console.
Definition at line 327 of file QGFileHandler.cc.
References fFilenames, and fFileOpen.
Referenced by QGCanvasSetupFrame::HandleListOpenFilesButton().
|
protected |
Return modification time of file.
Definition at line 345 of file QGFileHandler.cc.
Referenced by CheckForModifiedFiles().
| void QGFileHandler::OpenFile | ( | ) |
Pop up a file open dialog.
Definition at line 361 of file QGFileHandler.cc.
References fDataDirectory, QGDefaultsHandler::GetDataDirectory(), QGDefaultsHandler::Instance(), N, and QGDefaultsHandler::SetDataDirectory().
Referenced by QGCanvasSetupFrame::OpenFile(), OpenFiles(), ParseFileList(), and QGCanvasWindow::SetProperty().
| void QGFileHandler::OpenFile | ( | std::string | filename | ) |
Open a new file, add it to the chain.
| void QGFileHandler::OpenFiles | ( | const std::vector< std::string > & | files | ) |
Open files, add them to the chain.
Definition at line 531 of file QGFileHandler.cc.
References OpenFile().
Referenced by QGPlotIconsFrame::HandlePulsesButton(), ReopenFiles(), and QGGraphicalCut::ViewPulses().
| void QGFileHandler::ParseFileList | ( | const std::string & | filename | ) |
Parse file list.
Definition at line 539 of file QGFileHandler.cc.
References QGTextFileHandler::DoesKeyExist(), QGTextFileHandler::GetLines(), QGTextFileHandler::GetValue(), OpenFile(), and QGTextFileHandler::ReadFile().
|
protected |
Reopen files.
Definition at line 576 of file QGFileHandler.cc.
References QGlobalReaderDispatcher::Clear(), CloseFiles(), fDataManager, fFilenames, QGlobalReaderDispatcher::GetInstance(), and OpenFiles().
Referenced by CheckForModifiedFiles().
|
protected |
Set LowestStartTimeUnix alias.
Definition at line 585 of file QGFileHandler.cc.
References fFile, fFilenames, fLowestStartTimeUnix, fQChain, and QChain::GetListOfAllAliases().
|
protected |
Set up the chain.
Definition at line 608 of file QGFileHandler.cc.
References fQChain.
Referenced by CloseFiles(), and QGFileHandler().
|
protected |
Specify the numeric data types.
Definition at line 614 of file QGFileHandler.cc.
References fNumericTypes.
Referenced by QGFileHandler().
|
protected |
Directory containing data files.
Definition at line 136 of file QGFileHandler.hh.
Referenced by OpenFile().
|
protected |
Definition at line 180 of file QGFileHandler.hh.
Referenced by GetRunData(), QGFileHandler(), and ReopenFiles().
|
protected |
Default (empty) pulse, for use when opening a non-Diana file.
Definition at line 164 of file QGFileHandler.hh.
|
protected |
defalt label of samples to load
Definition at line 183 of file QGFileHandler.hh.
Referenced by GetDefaultPulseLabel(), GetSetOfQVectorLeaves(), and QGFileHandler().
|
protected |
Event list.
Definition at line 139 of file QGFileHandler.hh.
|
protected |
|
protected |
Filenames.
Definition at line 145 of file QGFileHandler.hh.
Referenced by CloseFiles(), GetFilenames(), ListOpenFiles(), ReopenFiles(), and SetLowestStartTimeUnix().
|
protected |
File open flag.
Definition at line 148 of file QGFileHandler.hh.
Referenced by CloseFiles(), GetSetOfAliases(), GetSetOfLeaves(), GetSetOfQVectorLeaves(), IsFileOpen(), and ListOpenFiles().
|
protected |
Definition at line 178 of file QGFileHandler.hh.
Referenced by GetEvent(), GetGenericObject(), and QGFileHandler().
|
protected |
QBaseEvent.
Definition at line 167 of file QGFileHandler.hh.
Referenced by CloseFiles(), and GetRunData().
|
protected |
Lowest StartTimeUnix of open files.
Definition at line 151 of file QGFileHandler.hh.
Referenced by CloseFiles(), and SetLowestStartTimeUnix().
|
protected |
Modification times of every open file.
Definition at line 155 of file QGFileHandler.hh.
Referenced by CheckForModifiedFiles(), and CloseFiles().
|
protected |
Collection of numeric data types.
Definition at line 161 of file QGFileHandler.hh.
Referenced by GetSetOfLeaves(), and SetUpNumericTypes().
|
protected |
Definition at line 168 of file QGFileHandler.hh.
Referenced by CloseFiles(), GetChannelRunData(), GetMasterSample(), GetRunData(), and GetSignificantSamples().
|
protected |
Definition at line 171 of file QGFileHandler.hh.
Referenced by CloseFiles(), GetEvent(), GetEventList(), GetQChain(), GetRunData(), GetSetOfAliases(), GetSetOfLeaves(), GetSetOfQVectorLeaves(), SetLowestStartTimeUnix(), SetUpChain(), and ~QGFileHandler().
|
protected |
samples (QVector or QVectorI or QPulse) to load
Definition at line 177 of file QGFileHandler.hh.
Referenced by GetEvent(), and GetPulse().
|
protected |
Name of tree's class.
Definition at line 174 of file QGFileHandler.hh.
Referenced by CloseFiles(), and GetTreeClass().