|
REST-for-Physics
v2.3
Rare Event Searches ToolKit for Physics
|
Data provider and manager in REST.
REST data, including metadata and event data, are all handled by this class A series of metadata objects is saved here after being loaded from rml/root file with sequential startup. Input file is also opened here, either being raw data file(opened with external process) or root file(opened with built- in reader). TRestRun extracts event data in the input file and wraps it into TRestEvent class, which is queried by other classes.
RESTsoft - Software for Rare Event Searches with TPCs
History of developments:
2014-june: First concept. As part of conceptualization of previous REST code (REST v2) Igor G. Irastorza
2017-Aug: Major change: added for multi-thread capability Kaixiang Ni
Definition at line 18 of file TRestRun.h.
#include <TRestRun.h>
Public Member Functions | |
| void | AddEventBranch (TRestEvent *event) |
| Add an event branch in output EventTree. | |
| void | AddInputFileExternal (const std::string &file) |
| void | AddMetadata (TRestMetadata *meta) |
| add metadata object to the metadata list | |
| void | cd () |
| ClassDefOverride (TRestRun, 6) | |
| void | CloseFile () |
| Close both input file and output file, setting trees to nullptr also. | |
| Bool_t | EvaluateMetadataMember (const std::string &instr) |
| It will evaluate the expression given including the data member from the corresponding metadata class type or name defined in the input string. | |
| TString | FormFormat (const TString &filenameFormat) |
| Form output file name according to file info list, proc info list and run data. | |
| TFile * | FormOutputFile () |
| Create a new TFile as REST output file. Writing metadata objects into it. | |
| TRestAnalysisTree * | GetAnalysisTree () const |
| Long64_t | GetBytesRead () const |
| int | GetCurrentEntry () const |
| Double_t | GetElapsedTimeSeconds () const |
| Double_t | GetEndTimestamp () const |
| Long64_t | GetEntries () const |
| void | GetEntry (Long64_t entry) |
| Calls GetEntry() for both AnalysisTree and EventTree. | |
| std::vector< int > | GetEventEntriesWithConditions (const std::string &, int startingIndex=0, int maxNumber=-1) |
| std::vector< int > | GetEventIdsWithConditions (const std::string &, int startingIndex=0, int maxNumber=-1) |
| TTree * | GetEventTree () const |
| std::vector< std::string > | GetEventTypesList () |
| It returns a list of available event types inside the file. | |
| TRestEvent * | GetEventWithID (Int_t eventID, Int_t subEventID=-1, const TString &tag="") |
| TString | GetExperimentName () const |
| Long64_t | GetFeminosDaqTotalEvents () const |
| TRestEventProcess * | GetFileProcess () const |
| template<class T> | |
| T * | GetInputEvent () |
| Calling GetInputEvent<TRestGeant4Event>() will return a TRestGeant4Event*. | |
| TRestEvent * | GetInputEvent () const |
| Calling GetInputEvent() will return a basic TRestEvent*. | |
| TString | GetInputEventName () const |
| TFile * | GetInputFile () const |
| std::string | GetInputFileName (unsigned int i) const |
| std::string | GetInputFileNamePattern () const |
| std::vector< TString > | GetInputFileNames () const |
| Int_t | GetInputFileNumber () const |
| TRestMetadata * | GetMetadata (const TString &name, TFile *file=nullptr) |
| TRestMetadata * | GetMetadataClass (const TString &type, TFile *file=nullptr) |
| std::string | GetMetadataMember (const std::string &instr) |
| std::vector< std::string > | GetMetadataNames () |
| std::vector< std::string > | GetMetadataTitles () |
| void | GetNextEntry () |
| Int_t | GetNextEvent (TRestEvent *targetEvent, TRestAnalysisTree *targetTree) |
| Get next event by writing event data into target event and target tree. | |
| TRestEvent * | GetNextEventWithConditions (const std::string &) |
| Load the next event that satisfies the conditions specified by a string. | |
| int | GetNumberOfMetadata () const |
| Int_t | GetObservableID (const std::string &name) |
| TFile * | GetOutputFile () const |
| TString | GetOutputFileName () const |
| Int_t | GetParentRunNumber () const |
| TString | GetRunDescription () const |
| std::string | GetRunInformation (const std::string &info) |
| Double_t | GetRunLength () const |
| Int_t | GetRunNumber () const |
| TString | GetRunTag () const |
| TString | GetRunType () const |
| TString | GetRunUser () const |
| Double_t | GetStartTimestamp () const |
| Int_t | GetSubRunNumber () const |
| Long64_t | GetTotalBytes () |
| void | HangUpEndFile () |
| void | ImportMetadata (const TString &rootFile, const TString &name, const TString &type, Bool_t store) |
| Open the root file and import the metadata of the given name. | |
| void | Initialize () override |
| REST run class. | |
| TFile * | MergeToOutputFile (std::vector< std::string > fileFullNames, std::string outputFileName="") |
| Form REST output file by merging a list of files together. | |
| Bool_t | ObservableExists (const std::string &name) |
| void | OpenInputFile (const TString &filename, const std::string &mode="") |
| Open the input file, read file info and the trees if it is root file. | |
| void | OpenInputFile (int i) |
| Open the i th file in the file list. | |
| TRestRun & | operator= (const TRestRun &)=delete |
| void | PassOutputFile () |
| void | PrintAllMetadata () |
| void | PrintEndDate () |
| void | PrintErrors () |
| Prints out all the warnings registered by metadata classes accessible to TRestRun, thats metadata and processes previously used in a data chain. | |
| void | PrintEvent () const |
| void | PrintMetadata () override |
| Prints the basic run information. | |
| void | PrintObservables () |
| void | PrintStartDate () |
| Prints the run start date and time in human format. | |
| void | PrintTrees () const |
| void | PrintWarnings () |
| Prints out all the warnings registered by metadata classes accessible to TRestRun, thats metadata and processes previously used in a data chain. | |
| void | ReadFileInfo (const std::string &filename) |
| Extract file info from a file, and save it in the file info list. | |
| void | ReadInputFileMetadata () |
| void | ReadInputFileTrees () |
| void | ReleaseEndFile () |
| std::string | ReplaceMetadataMembers (const std::string &instr, Int_t precision=8) |
| It will replace the data members contained inside the string given as input. The data members in the input string should be written using the following format [MetadataClass::fDataMember]. | |
| void | ResetEntry () |
| Reset file reading progress. | |
| void | SetCurrentEntry (int i) |
| void | SetEndTimeStamp (Double_t timestamp) |
| void | SetExtProcess (TRestEventProcess *p) |
| Set external file process. | |
| void | SetFeminosDaqTotalEvents (Long64_t n) |
| void | SetHistoricMetadataSaving (bool save) |
| void | SetInputEvent (TRestEvent *event) |
| Retarget input event in the tree. | |
| void | SetInputFileName (const std::string &s) |
| void | SetNFilesSplit (int n) |
| void | SetOutputFileName (const std::string &s) |
| void | SetParentRunNumber (Int_t number) |
| void | SetRunDescription (const TString &description) |
| void | SetRunNumber (Int_t number) |
| void | SetRunTag (const TString &tag) |
| void | SetRunType (const TString &type) |
| void | SetRunUser (const TString &user) |
| void | SetStartTimeStamp (Double_t timestamp) |
| void | SetTotalBytes (Long64_t totalBytes) |
| void | SkipEventTree () |
| TRestRun (const std::string &filename) | |
| TRestRun (const TRestRun &)=delete | |
| TFile * | UpdateOutputFile () |
| Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override |
| overwriting the write() method with fStore considered | |
| void | WriteWithDataBase () |
| Write this object into TFile and add a new entry in database. | |
| Public Member Functions inherited from TRestMetadata | |
| void | AddLog (std::string log="", bool print=true) |
| Add logs to messageBuffer. | |
| void | DoNotStore () |
| If this method is called the metadata information will not be stored in disk. | |
| TVector2 | Get2DVectorParameterWithUnits (std::string parName, TVector2 defaultValue=TVector2(-1, -1)) |
| TVector3 | Get3DVectorParameterWithUnits (std::string parName, TVector3 defaultValue=TVector3(-1, -1, -1)) |
| TString | GetCommit () |
| Returns the REST commit value stored in fCommit. | |
| std::string | GetConfigBuffer () |
| Returns the config section of this class. | |
| std::string | GetDataMemberValue (std::string memberName) |
| Get the value of data member as string. | |
| std::vector< std::string > | GetDataMemberValues (std::string memberName, Int_t precision=0) |
| Get the value of datamember as a vector of strings. | |
| TString | GetDataPath () |
| Returns a std::string with the path used for data storage. | |
| Double_t | GetDblParameterWithUnits (std::string parName, Double_t defaultValue=PARAMETER_NOT_FOUND_DBL) |
| Gets the value of the parameter name parName, after applying unit conversion. | |
| Bool_t | GetError () const |
| It returns true if an error was identified by a derived metadata class. | |
| TString | GetErrorMessage () |
| Returns a std::string containing the error message. | |
| TString | GetLibraryVersion () |
| Returns the REST libraty version stored in fLibraryVersion. | |
| TString | GetMainDataPath () |
| Gets a std::string with the path used for data storage. | |
| Int_t | GetNumberOfErrors () const |
| Int_t | GetNumberOfWarnings () const |
| std::string | GetParameter (std::string parName, TString defaultValue=PARAMETER_NOT_FOUND_STR) |
| Returns corresponding REST Metadata parameter from multiple sources. | |
| std::string | GetSectionName () |
| Returns the section name of this class, defined at the beginning of fSectionName. | |
| TRestStringOutput::REST_Verbose_Level | GetVerboseLevel () |
| returns the verboselevel in type of REST_Verbose_Level enumerator | |
| TString | GetVerboseLevelString () |
| returns the verbose level in type of TString | |
| TString | GetVersion () |
| Returns the REST version stored in fVersion. | |
| Int_t | GetVersionCode () |
| UInt_t | GetVersionMajor () const |
| UInt_t | GetVersionMinor () const |
| UInt_t | GetVersionPatch () const |
| Bool_t | GetWarning () const |
| It returns true if an error was identified by a derived metadata class. | |
| TString | GetWarningMessage () |
| Returns a std::string containing the warning message. | |
| TRestMetadata * | InstantiateChildMetadata (int index, std::string pattern="") |
| This method will retrieve a new TRestMetadata instance of a child element of the present TRestMetadata instance based on the index given by argument, which defines the element order to be retrieved, 0 for first element found, 1 for the second element found, etc. | |
| TRestMetadata * | InstantiateChildMetadata (std::string pattern="", std::string name="") |
| This method will retrieve a new TRestMetadata instance of a child element of the present TRestMetadata instance based on the name given by argument. | |
| Bool_t | isCleanState () const |
| Bool_t | isOfficialRelease () const |
| Int_t | LoadConfigFromBuffer () |
| Initialize data from a string element buffer. | |
| Int_t | LoadConfigFromElement (TiXmlElement *eSectional, TiXmlElement *eGlobal, std::map< std::string, std::string > envs={}) |
| Main starter method. | |
| Int_t | LoadConfigFromFile (const std::string &configFilename, const std::string §ionName="") |
| Give the file name, find out the corresponding section. Then call the main starter. | |
| virtual void | Merge (const TRestMetadata &) |
| TRestMetadata & | operator= (const TRestMetadata &) |
| void | Print () |
| Implementing TObject::Print() method. | |
| void | PrintConfigBuffer () |
| Print the config xml section stored in the class. | |
| void | PrintMessageBuffer () |
| Print the buffered message. | |
| void | PrintTimeStamp (Double_t timeStamp) |
| Print the current time on local machine. | |
| void | SetConfigFile (std::string configFilename) |
| set config file path from external | |
| void | SetError (std::string message="", bool print=true, int maxPrint=5) |
| A metadata class may use this method to signal that something went wrong. | |
| void | SetHostmgr (TRestManager *m) |
| Set the host manager for this class. | |
| void | SetSectionName (std::string sName) |
| set the section name, clear the section content | |
| void | SetVerboseLevel (TRestStringOutput::REST_Verbose_Level v) |
| sets the verbose level | |
| void | SetWarning (std::string message="", bool print=true, int maxPrint=5) |
| A metadata class may use this method to signal that something went wrong. | |
| void | Store () |
| If this method is called the metadata information will be stored in disk. | |
| TRestMetadata (const TRestMetadata &) | |
| virtual void | UpdateMetadataMembers () |
| Method to allow implementation of specific metadata members updates at inherited classes. | |
| void | WriteConfigBuffer (std::string fName) |
| Writes the config buffer to a file in append mode. | |
| ~TRestMetadata () | |
| TRestMetadata default destructor. | |
Protected Member Functions | |
| void | InitFromConfigFile () override |
| Initialize logic of TRestRun. | |
| Protected Member Functions inherited from TRestMetadata | |
| std::string | ElementToString (TiXmlElement *ele) |
| Convert an TiXmlElement object to string. | |
| TVector2 | Get2DVectorParameterWithUnits (std::string parName, TiXmlElement *e, TVector2 defaultValue=TVector2(-1, -1)) |
| TVector3 | Get3DVectorParameterWithUnits (std::string parName, TiXmlElement *e, TVector3 defaultValue=TVector3(-1, -1, -1)) |
| Double_t | GetDblParameterWithUnits (std::string parName, TiXmlElement *e, Double_t defaultVal=PARAMETER_NOT_FOUND_DBL) |
| TiXmlElement * | GetElement (std::string eleDeclare, TiXmlElement *e=nullptr) |
| Get an xml element from a given parent element, according to its declaration. | |
| TiXmlElement * | GetElementFromFile (std::string configFilename, std::string NameOrDecalre="") |
| Open an xml encoded file and find its element. | |
| TiXmlElement * | GetElementWithName (std::string eleDeclare, std::string eleName) |
| Get an xml element from the default location, according to its declaration and its field "name". | |
| TiXmlElement * | GetElementWithName (std::string eleDeclare, std::string eleName, TiXmlElement *e) |
| Get an xml element from a given parent element, according to its declaration and its field "name". | |
| std::string | GetFieldValue (std::string fieldName, std::string definition, size_t fromPosition=0) |
| Gets field value in an xml element string by parsing it as TiXmlElement. | |
| std::string | GetFieldValue (std::string parName, TiXmlElement *e) |
| Returns the field value of an xml element which has the specified name. | |
| std::string | GetKEYDefinition (std::string keyName) |
| Gets the first key definition for keyName found inside buffer starting at fromPosition. | |
| std::string | GetKEYDefinition (std::string keyName, size_t &Position) |
| std::string | GetKEYDefinition (std::string keyName, size_t &Position, std::string buffer) |
| std::string | GetKEYDefinition (std::string keyName, std::string buffer) |
| std::string | GetKEYStructure (std::string keyName) |
| Gets the first key structure for keyName found inside buffer after fromPosition. | |
| std::string | GetKEYStructure (std::string keyName, size_t &Position) |
| std::string | GetKEYStructure (std::string keyName, size_t &Position, std::string buffer) |
| std::string | GetKEYStructure (std::string keyName, size_t &Position, TiXmlElement *ele) |
| std::string | GetKEYStructure (std::string keyName, std::string buffer) |
| TiXmlElement * | GetNextElement (TiXmlElement *e) |
| Get the next sibling xml element of this element, with same eleDeclare. | |
| std::string | GetParameter (std::string parName, size_t &pos, std::string inputString) |
| Returns the value for the parameter name parName found in inputString. | |
| std::string | GetParameter (std::string parName, TiXmlElement *e, TString defaultValue=PARAMETER_NOT_FOUND_STR) |
| Returns the value for the parameter named parName in the given section. | |
| std::pair< std::string, std::string > | GetParameterAndUnits (std::string parname, TiXmlElement *e=nullptr) |
| Returns the unit string of the given parameter of the given xml section. | |
| std::map< std::string, std::string > | GetParametersList () |
| It retrieves a map of all parameter:value found in the metadata class. | |
| TString | GetSearchPath () |
| virtual void | InitFromRootFile () |
| Method called after the object is retrieved from root file. | |
| virtual Int_t | LoadSectionMetadata () |
| This method does some preparation of xml section. | |
| void | ReadAllParameters () |
| Reflection methods, Set value of a datamember in class according to TRestMetadata::fElement. | |
| void | ReadParametersList (std::map< std::string, std::string > &list) |
| It reads a parameter list and associates it to its corresponding metadata member. par0 --> fPar0. | |
| std::string | ReplaceConstants (const std::string buffer) |
| Identifies "constants" in the input buffer, and replace them with corresponding value. | |
| std::string | ReplaceVariables (const std::string buffer) |
| Identifies environmental variable replacing marks in the input buffer, and replace them with corresponding value. | |
| void | ReSetVersion () |
| Resets the version of TRestRun to REST_RELEASE. Only TRestRun is allowed to update version. | |
| std::string | SearchFile (std::string filename) |
| Search files in current directory and directories specified in "searchPath" section. | |
| void | SetLibraryVersion (TString version) |
| Set the library version of this metadata class. | |
| TiXmlElement * | StringToElement (std::string definition) |
| Parsing a string into TiXmlElement object. | |
| TRestMetadata () | |
| TRestMetadata default constructor. | |
| TRestMetadata (const char *configFilename) | |
| constructor | |
| void | UnSetVersion () |
| Resets the version of TRestRun to -1, in case the file is old REST file. Only TRestRun is allowed to update version. | |
Protected Attributes | |
| TRestAnalysisTree * | fAnalysisTree |
| Long64_t | fBytesRead |
| int | fCurrentEvent |
| Double_t | fEndTime |
| Event absolute ending time/date (unix timestamp). | |
| Int_t | fEntriesSaved |
| int | fEventBranchLoc |
| int | fEventIndexCounter = 0 |
| TTree * | fEventTree |
| TString | fExperimentName |
| Long64_t | fFeminosDaqTotalEvents = 0 |
| TRestEventProcess * | fFileProcess |
| bool | fFromRML = false |
| bool | fHangUpEndFile = false |
| TRestEvent * | fInputEvent |
| TFile * | fInputFile |
| TString | fInputFileName |
| std::vector< TString > | fInputFileNames |
| TRestRootFileHandle | fInputFileOwner |
| std::vector< TRestMetadata * > | fInputMetadata |
| std::vector< TRestMetadata * > | fMetadata |
| Int_t | fNFilesSplit |
| TFile * | fOutputFile |
| TString | fOutputFileName |
| TRestRootFileHandle | fOutputFileOwner |
| bool | fOverwrite |
| Int_t | fParentRunNumber |
| It can be used as parent number of subrun number. | |
| TString | fRunClassName |
| TString | fRunDescription |
| Int_t | fRunNumber |
| TString | fRunTag |
| TString | fRunType |
| TString | fRunUser |
| bool | fSaveHistoricData |
| Double_t | fStartTime |
| Event absolute starting time/date (unix timestamp). | |
| Long64_t | fTotalBytes |
| Protected Attributes inherited from TRestMetadata | |
| std::string | configBuffer |
| The buffer where the corresponding metadata section is stored. Filled only during Write(). | |
| std::string | fConfigFileName |
| Full name of the rml file. | |
| std::map< std::string, std::string > | fConstants |
| Saving a list of rml constants. name-value std::pair. Constants are temporary for this class only. | |
| TiXmlElement * | fElement |
| Saving the sectional element together with global element. | |
| TiXmlElement * | fElementGlobal |
| Saving the global element, to be passed to the resident class, if necessary. | |
| Bool_t | fError = false |
| It can be used as a way to identify that something went wrong using SetError method. | |
| TString | fErrorMessage = "" |
| A std::string to store an optional error message through method SetError. | |
| TRestManager * | fHostmgr |
| All metadata classes can be initialized and managed by TRestManager. | |
| Int_t | fNErrors = 0 |
| It counts the number of errors notified. | |
| Int_t | fNWarnings = 0 |
| It counts the number of warnings notified. | |
| std::string | fSectionName |
| Section name given in the constructor of the derived metadata class. | |
| Bool_t | fStore |
| This variable is used to determine if the metadata structure should be stored in the ROOT file. | |
| std::map< std::string, std::string > | fVariables |
| Saving a list of rml variables. name-value std::pair. | |
| TRestStringOutput::REST_Verbose_Level | fVerboseLevel |
| Verbose level used to print debug info. | |
| Bool_t | fWarning = false |
| It can be used as a way to identify that something went wrong using SetWarning method. | |
| TString | fWarningMessage = "" |
| It can be used as a way to identify that something went wrong using SetWarning method. | |
| std::string | messageBuffer |
| The buffer to store the output message through TRestStringOutput in this class. | |
| endl_t | RESTendl |
| Termination flag object for TRestStringOutput. | |
Private Member Functions | |
| std::string | ReplaceMetadataMember (const std::string &instr, Int_t precision=0) |
| It will replace the data member from the corresponding metadata class type or name defined in the input string. | |
| TRestRun::TRestRun | ( | ) |
Definition at line 96 of file TRestRun.cxx.
|
explicit |
Definition at line 98 of file TRestRun.cxx.
| TRestRun::~TRestRun | ( | ) |
Definition at line 110 of file TRestRun.cxx.
| void TRestRun::AddEventBranch | ( | TRestEvent * | event | ) |
Add an event branch in output EventTree.
Definition at line 1390 of file TRestRun.cxx.
| void TRestRun::AddInputFileExternal | ( | const std::string & | file | ) |
Definition at line 506 of file TRestRun.cxx.
|
inline |
add metadata object to the metadata list
Definition at line 117 of file TRestRun.h.
|
inline |
Definition at line 127 of file TRestRun.h.
| void TRestRun::CloseFile | ( | ) |
Close both input file and output file, setting trees to nullptr also.
Definition at line 1251 of file TRestRun.cxx.
| Bool_t TRestRun::EvaluateMetadataMember | ( | const std::string & | instr | ) |
It will evaluate the expression given including the data member from the corresponding metadata class type or name defined in the input string.
The input expression should contain the metadata class type or name using the format metadata->member or metadata::fMember, where metadata might be the class name or the intrinsic name assigned to the metadata object.
Examples:
Both, :: and -> are allowed to separate class and the data member.
Definition at line 1876 of file TRestRun.cxx.
| TString TRestRun::FormFormat | ( | const TString & | FilenameFormat | ) |
Form output file name according to file info list, proc info list and run data.
It will replace the fields in output file name surrounded by "[]". The file info list is created by TRestRun::ReadFileInfo(), the proc info list is created by TRestProcessRunner::ReadProcInfo(), the run data is from TRestRun's datamember(fRunNumber,fRunType, etc) e.g. we can set output file name like:
and generates:
Definition at line 1012 of file TRestRun.cxx.
| TFile * TRestRun::FormOutputFile | ( | ) |
Create a new TFile as REST output file. Writing metadata objects into it.
Definition at line 1118 of file TRestRun.cxx.
|
inline |
Definition at line 175 of file TRestRun.h.
|
inline |
Definition at line 153 of file TRestRun.h.
|
inline |
Definition at line 152 of file TRestRun.h.
|
inline |
Definition at line 186 of file TRestRun.h.
|
inline |
Definition at line 141 of file TRestRun.h.
| Long64_t TRestRun::GetEntries | ( | ) | const |
Definition at line 1474 of file TRestRun.cxx.
| void TRestRun::GetEntry | ( | Long64_t | entry | ) |
Calls GetEntry() for both AnalysisTree and EventTree.
Definition at line 980 of file TRestRun.cxx.
| std::vector< int > TRestRun::GetEventEntriesWithConditions | ( | const std::string & | cuts, |
| int | startingIndex = 0, | ||
| int | maxNumber = -1 ) |
Definition at line 1513 of file TRestRun.cxx.
| std::vector< int > TRestRun::GetEventIdsWithConditions | ( | const std::string & | cuts, |
| int | startingIndex = 0, | ||
| int | maxNumber = -1 ) |
Definition at line 1614 of file TRestRun.cxx.
|
inline |
Definition at line 176 of file TRestRun.h.
| std::vector< std::string > TRestRun::GetEventTypesList | ( | ) |
It returns a list of available event types inside the file.
Definition at line 964 of file TRestRun.cxx.
| TRestEvent * TRestRun::GetEventWithID | ( | Int_t | eventID, |
| Int_t | subEventID = -1, | ||
| const TString & | tag = "" ) |
Definition at line 1483 of file TRestRun.cxx.
|
inline |
Definition at line 142 of file TRestRun.h.
|
inline |
Definition at line 227 of file TRestRun.h.
|
inline |
Definition at line 170 of file TRestRun.h.
|
inline |
Calling GetInputEvent<TRestGeant4Event>() will return a TRestGeant4Event*.
Definition at line 161 of file TRestRun.h.
|
inline |
Calling GetInputEvent() will return a basic TRestEvent*.
Definition at line 158 of file TRestRun.h.
|
inline |
Definition at line 174 of file TRestRun.h.
|
inline |
Definition at line 150 of file TRestRun.h.
|
inline |
Definition at line 145 of file TRestRun.h.
|
inline |
Definition at line 148 of file TRestRun.h.
|
inline |
Definition at line 144 of file TRestRun.h.
|
inline |
Definition at line 177 of file TRestRun.h.
| TRestMetadata * TRestRun::GetMetadata | ( | const TString & | name, |
| TFile * | file = nullptr ) |
Definition at line 1708 of file TRestRun.cxx.
| TRestMetadata * TRestRun::GetMetadataClass | ( | const TString & | type, |
| TFile * | file = nullptr ) |
Definition at line 1676 of file TRestRun.cxx.
|
inline |
Definition at line 188 of file TRestRun.h.
| std::vector< std::string > TRestRun::GetMetadataNames | ( | ) |
Definition at line 1738 of file TRestRun.cxx.
| std::vector< std::string > TRestRun::GetMetadataTitles | ( | ) |
Definition at line 1746 of file TRestRun.cxx.
|
inline |
Definition at line 90 of file TRestRun.h.
| Int_t TRestRun::GetNextEvent | ( | TRestEvent * | targetEvent, |
| TRestAnalysisTree * | targetTree ) |
Get next event by writing event data into target event and target tree.
returns 0 if success, returns -1 if failed, e.g. end of file writing event data into target event calls the method TRestEvent::CloneTo() writing observable data into target analysistree calls memcpy It requires same branch structure, but we didn't verify it here.
Definition at line 868 of file TRestRun.cxx.
| TRestEvent * TRestRun::GetNextEventWithConditions | ( | const std::string & | cuts | ) |
Load the next event that satisfies the conditions specified by a string.
| conditions | string specifying conditions, supporting multiple conditions separated by ":", allowed symbols include "<", "<=", ">", ">=", "=", "==". For example "A>=2.2:B==4". |
Definition at line 1633 of file TRestRun.cxx.
|
inline |
Definition at line 185 of file TRestRun.h.
|
inline |
Definition at line 172 of file TRestRun.h.
|
inline |
Definition at line 151 of file TRestRun.h.
|
inline |
Definition at line 149 of file TRestRun.h.
|
inline |
Definition at line 132 of file TRestRun.h.
|
inline |
Definition at line 138 of file TRestRun.h.
| string TRestRun::GetRunInformation | ( | const std::string & | info | ) |
Definition at line 1650 of file TRestRun.cxx.
| Double_t TRestRun::GetRunLength | ( | ) | const |
Definition at line 1460 of file TRestRun.cxx.
|
inline |
Definition at line 134 of file TRestRun.h.
|
inline |
Definition at line 137 of file TRestRun.h.
|
inline |
Definition at line 135 of file TRestRun.h.
|
inline |
Definition at line 136 of file TRestRun.h.
|
inline |
Definition at line 140 of file TRestRun.h.
|
inline |
Definition at line 133 of file TRestRun.h.
| Long64_t TRestRun::GetTotalBytes | ( | ) |
Definition at line 1467 of file TRestRun.cxx.
|
inline |
Definition at line 223 of file TRestRun.h.
| void TRestRun::ImportMetadata | ( | const TString & | File, |
| const TString & | name, | ||
| const TString & | type, | ||
| Bool_t | store ) |
Open the root file and import the metadata of the given name.
The metadata class can be recovered to the same condition as when it is saved.
Definition at line 1406 of file TRestRun.cxx.
|
overrideprotectedvirtual |
Initialize logic of TRestRun.
Things doing in this method:
Reimplemented from TRestMetadata.
Definition at line 166 of file TRestRun.cxx.
|
overridevirtual |
REST run class.
Set variables by default during initialization.
Reimplemented from TRestMetadata.
Definition at line 115 of file TRestRun.cxx.
| TFile * TRestRun::MergeToOutputFile | ( | std::vector< std::string > | fileFullNames, |
| std::string | outputFileName = "" ) |
Form REST output file by merging a list of files together.
If output file name is not given(=""), then it will recreate the output file according to fOutputFileName. Otherwise it will update the given file. File The merge is built and validated in a same-directory temporary file before replacing the formatted destination. This method is used to create the output file after TRestProcessRunner is finished. The metadata objects will also be written into the file.
Definition at line 1058 of file TRestRun.cxx.
|
inline |
Definition at line 173 of file TRestRun.h.
| void TRestRun::OpenInputFile | ( | const TString & | filename, |
| const std::string & | mode = "" ) |
Open the input file, read file info and the trees if it is root file.
TRestRun will:
Definition at line 375 of file TRestRun.cxx.
| void TRestRun::OpenInputFile | ( | int | i | ) |
Open the i th file in the file list.
Definition at line 358 of file TRestRun.cxx.
|
inline |
Definition at line 102 of file TRestRun.h.
|
inline |
Definition at line 234 of file TRestRun.h.
| void TRestRun::PrintEndDate | ( | ) |
Definition at line 1988 of file TRestRun.cxx.
| void TRestRun::PrintErrors | ( | ) |
Prints out all the warnings registered by metadata classes accessible to TRestRun, thats metadata and processes previously used in a data chain.
Definition at line 2010 of file TRestRun.cxx.
|
inline |
Definition at line 258 of file TRestRun.h.
|
overridevirtual |
Prints the basic run information.
Reimplemented from TRestMetadata.
Definition at line 1929 of file TRestRun.cxx.
|
inline |
Definition at line 252 of file TRestRun.h.
| void TRestRun::PrintStartDate | ( | ) |
Prints the run start date and time in human format.
Definition at line 1968 of file TRestRun.cxx.
|
inline |
Definition at line 240 of file TRestRun.h.
| void TRestRun::PrintWarnings | ( | ) |
Prints out all the warnings registered by metadata classes accessible to TRestRun, thats metadata and processes previously used in a data chain.
Definition at line 2036 of file TRestRun.cxx.
| void TRestRun::ReadFileInfo | ( | const std::string & | filename | ) |
Extract file info from a file, and save it in the file info list.
Items:
Definition at line 724 of file TRestRun.cxx.
| void TRestRun::ReadInputFileMetadata | ( | ) |
Definition at line 518 of file TRestRun.cxx.
| void TRestRun::ReadInputFileTrees | ( | ) |
Definition at line 579 of file TRestRun.cxx.
|
inline |
Definition at line 224 of file TRestRun.h.
|
private |
It will replace the data member from the corresponding metadata class type or name defined in the input string.
The input string should contain the metadata class type or name following the format string instr = "mdName::fDataMember"; or string instr = "TRestMetadataClass::fDataMember";. or the format string instr = "mdName->fDataMember";. Both, :: and -> are allowed to separate class and member of the class.
The method will work with both, metadata class or metadata name. First it will be evaluated if the metadata name is found, using the method TRestRun::GetMetadata. If not, it will try to check if the corresponding input string is giving a metadata class type, using the method TRestRun::GetMetadataClass.
Definition at line 1811 of file TRestRun.cxx.
| string TRestRun::ReplaceMetadataMembers | ( | const std::string & | instr, |
| Int_t | precision = 8 ) |
It will replace the data members contained inside the string given as input. The data members in the input string should be written using the following format [MetadataClass::fDataMember].
Definition at line 1760 of file TRestRun.cxx.
| void TRestRun::ResetEntry | ( | ) |
Reset file reading progress.
if input file is root file, just set current entry to be 0 if input file is external file, handled by external process, It will force the process to reload the file.
Definition at line 853 of file TRestRun.cxx.
|
inline |
Definition at line 201 of file TRestRun.h.
|
inline |
Definition at line 219 of file TRestRun.h.
| void TRestRun::SetExtProcess | ( | TRestEventProcess * | p | ) |
Set external file process.
Definition at line 1310 of file TRestRun.cxx.
|
inline |
Definition at line 226 of file TRestRun.h.
|
inline |
Definition at line 221 of file TRestRun.h.
| void TRestRun::SetInputEvent | ( | TRestEvent * | event | ) |
Retarget input event in the tree.
The input event is by default the last branch in EventTree, by calling this method, it can be retargeted to other branches corresponding to the given event.
Definition at line 1353 of file TRestRun.cxx.
|
inline |
Definition at line 194 of file TRestRun.h.
|
inline |
Definition at line 222 of file TRestRun.h.
|
inline |
Definition at line 199 of file TRestRun.h.
|
inline |
Definition at line 204 of file TRestRun.h.
|
inline |
Definition at line 217 of file TRestRun.h.
|
inline |
Definition at line 203 of file TRestRun.h.
|
inline |
Definition at line 209 of file TRestRun.h.
|
inline |
Definition at line 205 of file TRestRun.h.
|
inline |
Definition at line 213 of file TRestRun.h.
|
inline |
Definition at line 218 of file TRestRun.h.
|
inline |
Definition at line 220 of file TRestRun.h.
|
inline |
Definition at line 125 of file TRestRun.h.
| TFile * TRestRun::UpdateOutputFile | ( | ) |
Definition at line 1146 of file TRestRun.cxx.
|
overridevirtual |
overwriting the write() method with fStore considered
Reimplemented from TRestMetadata.
Definition at line 1455 of file TRestRun.cxx.
| void TRestRun::WriteWithDataBase | ( | ) |
Write this object into TFile and add a new entry in database.
level=0 : add a new run in database. run number is the next number, subrun number is 0. level=1 (default) : add a new subrun in database. run number is determined in BeginOfInit(). subrun number is the next number. if run does not exist, it will create new if "force" is true. level>=2 : add a new file in database. run number is determined in BeginOfInit(). subrun number is 0. if not exist, it will create new if "force" is true.
Definition at line 1188 of file TRestRun.cxx.
|
protected |
Definition at line 53 of file TRestRun.h.
|
protected |
Definition at line 58 of file TRestRun.h.
|
protected |
Definition at line 57 of file TRestRun.h.
|
protected |
Event absolute ending time/date (unix timestamp).
Definition at line 37 of file TRestRun.h.
|
protected |
Definition at line 38 of file TRestRun.h.
|
protected |
Definition at line 60 of file TRestRun.h.
|
protected |
Definition at line 61 of file TRestRun.h.
|
protected |
Definition at line 52 of file TRestRun.h.
|
protected |
Definition at line 31 of file TRestRun.h.
|
protected |
Definition at line 65 of file TRestRun.h.
|
protected |
Definition at line 56 of file TRestRun.h.
|
protected |
Definition at line 63 of file TRestRun.h.
|
protected |
Definition at line 62 of file TRestRun.h.
|
protected |
Definition at line 51 of file TRestRun.h.
|
protected |
Definition at line 49 of file TRestRun.h.
|
protected |
Definition at line 34 of file TRestRun.h.
|
protected |
Definition at line 46 of file TRestRun.h.
|
protected |
Definition at line 47 of file TRestRun.h.
|
protected |
Definition at line 43 of file TRestRun.h.
|
protected |
Definition at line 42 of file TRestRun.h.
|
protected |
Definition at line 39 of file TRestRun.h.
|
protected |
Definition at line 50 of file TRestRun.h.
|
protected |
Definition at line 35 of file TRestRun.h.
|
protected |
Definition at line 48 of file TRestRun.h.
|
protected |
Definition at line 54 of file TRestRun.h.
|
protected |
It can be used as parent number of subrun number.
Definition at line 23 of file TRestRun.h.
|
protected |
Definition at line 24 of file TRestRun.h.
|
protected |
Definition at line 30 of file TRestRun.h.
|
protected |
Definition at line 21 of file TRestRun.h.
|
protected |
Definition at line 29 of file TRestRun.h.
|
protected |
Definition at line 25 of file TRestRun.h.
|
protected |
Definition at line 27 of file TRestRun.h.
|
protected |
Definition at line 55 of file TRestRun.h.
|
protected |
Event absolute starting time/date (unix timestamp).
Definition at line 36 of file TRestRun.h.
|
protected |
Definition at line 59 of file TRestRun.h.