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. More... | |
void | AddInputFileExternal (const std::string &file) |
void | AddMetadata (TRestMetadata *meta) |
add metadata object to the metadata list More... | |
void | cd () |
ClassDefOverride (TRestRun, 6) | |
void | CloseFile () |
Close both input file and output file, setting trees to nullptr also. More... | |
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. More... | |
TString | FormFormat (const TString &FilenameFormat) |
Form output file name according to file info list, proc info list and run data. More... | |
TFile * | FormOutputFile () |
Create a new TFile as REST output file. Writing metadata objects into it. More... | |
TRestAnalysisTree * | GetAnalysisTree () const |
Long64_t | GetBytesReaded () const |
int | GetCurrentEntry () const |
Double_t | GetEndTimestamp () const |
Long64_t | GetEntries () const |
void | GetEntry (Long64_t entry) |
Calls GetEntry() for both AnalysisTree and EventTree. More... | |
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. More... | |
TRestEvent * | GetEventWithID (Int_t eventID, Int_t subEventID=-1, const TString &tag="") |
TString | GetExperimentName () const |
TRestEventProcess * | GetFileProcess () const |
template<class T > | |
T * | GetInputEvent () |
Calling GetInputEvent<TRestGeant4Event>() will return a TRestGeant4Event* More... | |
TRestEvent * | GetInputEvent () const |
Calling GetInputEvent() will return a basic TRestEvent* More... | |
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. More... | |
TRestEvent * | GetNextEventWithConditions (const std::string &) |
Load the next event that satisfies the conditions specified by a string. More... | |
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. More... | |
void | Initialize () override |
REST run class. More... | |
TFile * | MergeToOutputFile (std::vector< std::string > filefullnames, std::string outputfilename="") |
Form REST output file by merging a list of files together. More... | |
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. More... | |
void | OpenInputFile (int i) |
Open the i th file in the file list. More... | |
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. More... | |
void | PrintEvent () const |
void | PrintMetadata () override |
Prints the basic run information. More... | |
void | PrintObservables () |
void | PrintStartDate () |
Prints the run start date and time in human format. More... | |
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. More... | |
void | ReadFileInfo (const std::string &filename) |
Extract file info from a file, and save it in the file info list. More... | |
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]. More... | |
void | ResetEntry () |
Reset file reading progress. More... | |
void | SetCurrentEntry (int i) |
void | SetEndTimeStamp (Double_t timestamp) |
void | SetExtProcess (TRestEventProcess *p) |
Set external file process. More... | |
void | SetHistoricMetadataSaving (bool save) |
void | SetInputEvent (TRestEvent *event) |
Retarget input event in the tree. More... | |
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) | |
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 More... | |
void | WriteWithDataBase () |
Write this object into TFile and add a new entry in database. More... | |
Public Member Functions inherited from TRestMetadata | |
void | AddLog (std::string log="", bool print=true) |
Add logs to messageBuffer. More... | |
void | DoNotStore () |
If this method is called the metadata information will not be stored in disk. More... | |
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. More... | |
std::string | GetConfigBuffer () |
Returns the config section of this class. More... | |
std::string | GetDataMemberValue (std::string memberName) |
Get the value of data member as string. More... | |
std::vector< std::string > | GetDataMemberValues (std::string memberName, Int_t precision=0) |
Get the value of datamember as a vector of strings. More... | |
TString | GetDataPath () |
Returns a std::string with the path used for data storage. More... | |
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. More... | |
Bool_t | GetError () const |
It returns true if an error was identified by a derived metadata class. More... | |
TString | GetErrorMessage () |
Returns a std::string containing the error message. More... | |
TString | GetLibraryVersion () |
Returns the REST libraty version stored in fLibraryVersion. More... | |
TString | GetMainDataPath () |
Gets a std::string with the path used for data storage. More... | |
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. More... | |
std::string | GetSectionName () |
Returns the section name of this class, defined at the beginning of fSectionName. More... | |
TRestStringOutput::REST_Verbose_Level | GetVerboseLevel () |
returns the verboselevel in type of REST_Verbose_Level enumerator More... | |
TString | GetVerboseLevelString () |
returns the verbose level in type of TString More... | |
TString | GetVersion () |
Returns the REST version stored in fVersion. More... | |
Int_t | GetVersionCode () |
Bool_t | GetWarning () const |
It returns true if an error was identified by a derived metadata class. More... | |
TString | GetWarningMessage () |
Returns a std::string containing the warning message. More... | |
virtual void | Initialize () |
Making default settings. More... | |
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. More... | |
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. More... | |
Bool_t | isCleanState () const |
Bool_t | isOfficialRelease () const |
Int_t | LoadConfigFromBuffer () |
Initialize data from a string element buffer. More... | |
Int_t | LoadConfigFromElement (TiXmlElement *eSectional, TiXmlElement *eGlobal, std::map< std::string, std::string > envs={}) |
Main starter method. More... | |
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. More... | |
virtual void | Merge (const TRestMetadata &) |
TRestMetadata & | operator= (const TRestMetadata &)=delete |
void | Print () |
Implementing TObject::Print() method. More... | |
void | PrintConfigBuffer () |
Print the config xml section stored in the class. More... | |
void | PrintMessageBuffer () |
Print the buffered message. More... | |
virtual void | PrintMetadata () |
Implemented it in the derived metadata class to print out specific metadata information. More... | |
void | PrintTimeStamp (Double_t timeStamp) |
Print the current time on local machine. More... | |
void | SetConfigFile (std::string configFilename) |
set config file path from external More... | |
void | SetError (std::string message="", bool print=true) |
A metadata class may use this method to signal that something went wrong. More... | |
void | SetHostmgr (TRestManager *m) |
Set the host manager for this class. More... | |
void | SetSectionName (std::string sName) |
set the section name, clear the section content More... | |
void | SetVerboseLevel (TRestStringOutput::REST_Verbose_Level v) |
sets the verbose level More... | |
void | SetWarning (std::string message="", bool print=true) |
A metadata class may use this method to signal that something went wrong. More... | |
void | Store () |
If this method is called the metadata information will be stored in disk. More... | |
TRestMetadata (const TRestMetadata &)=delete | |
virtual void | UpdateMetadataMembers () |
Method to allow implementation of specific metadata members updates at inherited classes. More... | |
virtual Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) |
overwriting the write() method with fStore considered More... | |
void | WriteConfigBuffer (std::string fName) |
Writes the config buffer to a file in append mode. More... | |
~TRestMetadata () | |
TRestMetadata default destructor. More... | |
Protected Member Functions | |
void | InitFromConfigFile () override |
Initialize logic of TRestRun. More... | |
Protected Member Functions inherited from TRestMetadata | |
std::string | ElementToString (TiXmlElement *ele) |
Convert an TiXmlElement object to string. More... | |
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. More... | |
TiXmlElement * | GetElementFromFile (std::string configFilename, std::string NameOrDecalre="") |
Open an xml encoded file and find its element. More... | |
TiXmlElement * | GetElementWithName (std::string eleDeclare, std::string eleName) |
Get an xml element from the default location, according to its declaration and its field "name". More... | |
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". More... | |
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. More... | |
std::string | GetFieldValue (std::string parName, TiXmlElement *e) |
Returns the field value of an xml element which has the specified name. More... | |
std::string | GetKEYDefinition (std::string keyName) |
Gets the first key definition for keyName found inside buffer starting at fromPosition. More... | |
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. More... | |
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. More... | |
std::string | GetParameter (std::string parName, size_t &pos, std::string inputString) |
Returns the value for the parameter name parName found in inputString. More... | |
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. More... | |
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. More... | |
std::map< std::string, std::string > | GetParametersList () |
It retrieves a map of all parameter:value found in the metadata class. More... | |
TString | GetSearchPath () |
virtual void | InitFromConfigFile () |
To make settings from rml file. This method must be implemented in the derived class. More... | |
virtual void | InitFromRootFile () |
Method called after the object is retrieved from root file. More... | |
virtual Int_t | LoadSectionMetadata () |
This method does some preparation of xml section. More... | |
void | ReadAllParameters () |
Reflection methods, Set value of a datamember in class according to TRestMetadata::fElement. More... | |
void | ReadParametersList (std::map< std::string, std::string > &list) |
It reads a parameter list and associates it to its corresponding metadata member. par0 --> fPar0. More... | |
std::string | ReplaceConstants (const std::string buffer) |
Identifies "constants" in the input buffer, and replace them with corresponding value. More... | |
std::string | ReplaceVariables (const std::string buffer) |
Identifies environmental variable replacing marks in the input buffer, and replace them with corresponding value. More... | |
void | ReSetVersion () |
Resets the version of TRestRun to REST_RELEASE. Only TRestRun is allowed to update version. More... | |
std::string | SearchFile (std::string filename) |
Search files in current directory and directories specified in "searchPath" section. More... | |
void | SetLibraryVersion (TString version) |
Set the library version of this metadata class. More... | |
TiXmlElement * | StringToElement (std::string definition) |
Parsing a string into TiXmlElement object. More... | |
TRestMetadata () | |
TRestMetadata default constructor. More... | |
TRestMetadata (const char *configFilename) | |
constructor More... | |
void | UnSetVersion () |
Resets the version of TRestRun to -1, in case the file is old REST file. Only TRestRun is allowed to update version. More... | |
Protected Attributes | |
TRestAnalysisTree * | fAnalysisTree |
Long64_t | fBytesRead |
int | fCurrentEvent |
Double_t | fEndTime |
Event absolute ending time/date (unix timestamp) More... | |
Int_t | fEntriesSaved |
int | fEventBranchLoc |
int | fEventIndexCounter = 0 |
TTree * | fEventTree |
TString | fExperimentName |
TRestEventProcess * | fFileProcess |
bool | fFromRML = false |
bool | fHangUpEndFile = false |
TRestEvent * | fInputEvent |
TFile * | fInputFile |
TString | fInputFileName |
std::vector< TString > | fInputFileNames |
std::vector< TRestMetadata * > | fInputMetadata |
std::vector< TRestMetadata * > | fMetadata |
Int_t | fNFilesSplit |
TFile * | fOutputFile |
TString | fOutputFileName |
bool | fOverwrite |
Int_t | fParentRunNumber |
It can be used as parent number of subrun number. More... | |
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) More... | |
Long64_t | fTotalBytes |
Protected Attributes inherited from TRestMetadata | |
std::string | configBuffer |
The buffer where the corresponding metadata section is stored. Filled only during Write() More... | |
std::string | fConfigFileName |
Full name of the rml file. More... | |
std::map< std::string, std::string > | fConstants |
Saving a list of rml constants. name-value std::pair. Constants are temporary for this class only. More... | |
TiXmlElement * | fElement |
Saving the sectional element together with global element. More... | |
TiXmlElement * | fElementGlobal |
Saving the global element, to be passed to the resident class, if necessary. More... | |
Bool_t | fError = false |
It can be used as a way to identify that something went wrong using SetError method. More... | |
TString | fErrorMessage = "" |
A std::string to store an optional error message through method SetError. More... | |
TRestManager * | fHostmgr |
All metadata classes can be initialized and managed by TRestManager. More... | |
Int_t | fNErrors = 0 |
It counts the number of errors notified. More... | |
Int_t | fNWarnings = 0 |
It counts the number of warnings notified. More... | |
std::string | fSectionName |
Section name given in the constructor of the derived metadata class. More... | |
Bool_t | fStore |
This variable is used to determine if the metadata structure should be stored in the ROOT file. More... | |
std::map< std::string, std::string > | fVariables |
Saving a list of rml variables. name-value std::pair. More... | |
TRestStringOutput::REST_Verbose_Level | fVerboseLevel |
Verbose level used to print debug info. More... | |
Bool_t | fWarning = false |
It can be used as a way to identify that something went wrong using SetWarning method. More... | |
TString | fWarningMessage = "" |
It can be used as a way to identify that something went wrong using SetWarning method. More... | |
std::string | messageBuffer |
The buffer to store the output message through TRestStringOutput in this class. More... | |
endl_t | RESTendl |
Termination flag object for TRestStringOutput. More... | |
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. More... | |
TRestRun::TRestRun | ( | ) |
Definition at line 52 of file TRestRun.cxx.
|
explicit |
Definition at line 54 of file TRestRun.cxx.
TRestRun::~TRestRun | ( | ) |
Definition at line 66 of file TRestRun.cxx.
void TRestRun::AddEventBranch | ( | TRestEvent * | event | ) |
Add an event branch in output EventTree.
Definition at line 1283 of file TRestRun.cxx.
void TRestRun::AddInputFileExternal | ( | const std::string & | file | ) |
Definition at line 434 of file TRestRun.cxx.
|
inline |
add metadata object to the metadata list
Definition at line 110 of file TRestRun.h.
|
inline |
Definition at line 120 of file TRestRun.h.
void TRestRun::CloseFile | ( | ) |
Close both input file and output file, setting trees to nullptr also.
Definition at line 1156 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 1768 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 941 of file TRestRun.cxx.
TFile * TRestRun::FormOutputFile | ( | ) |
Create a new TFile as REST output file. Writing metadata objects into it.
Definition at line 1037 of file TRestRun.cxx.
|
inline |
Definition at line 168 of file TRestRun.h.
|
inline |
Definition at line 146 of file TRestRun.h.
|
inline |
Definition at line 145 of file TRestRun.h.
|
inline |
Definition at line 134 of file TRestRun.h.
Long64_t TRestRun::GetEntries | ( | ) | const |
Definition at line 1367 of file TRestRun.cxx.
void TRestRun::GetEntry | ( | Long64_t | entry | ) |
Calls GetEntry() for both AnalysisTree and EventTree.
Definition at line 909 of file TRestRun.cxx.
std::vector< int > TRestRun::GetEventEntriesWithConditions | ( | const std::string & | cuts, |
int | startingIndex = 0 , |
||
int | maxNumber = -1 |
||
) |
Definition at line 1405 of file TRestRun.cxx.
std::vector< int > TRestRun::GetEventIdsWithConditions | ( | const std::string & | cuts, |
int | startingIndex = 0 , |
||
int | maxNumber = -1 |
||
) |
Definition at line 1506 of file TRestRun.cxx.
|
inline |
Definition at line 169 of file TRestRun.h.
std::vector< std::string > TRestRun::GetEventTypesList | ( | ) |
It returns a list of available event types inside the file.
Definition at line 893 of file TRestRun.cxx.
TRestEvent * TRestRun::GetEventWithID | ( | Int_t | eventID, |
Int_t | subEventID = -1 , |
||
const TString & | tag = "" |
||
) |
Definition at line 1375 of file TRestRun.cxx.
|
inline |
Definition at line 135 of file TRestRun.h.
|
inline |
Definition at line 163 of file TRestRun.h.
|
inline |
Calling GetInputEvent<TRestGeant4Event>()
will return a TRestGeant4Event*
Definition at line 154 of file TRestRun.h.
|
inline |
Calling GetInputEvent()
will return a basic TRestEvent*
Definition at line 151 of file TRestRun.h.
|
inline |
Definition at line 167 of file TRestRun.h.
|
inline |
Definition at line 143 of file TRestRun.h.
|
inline |
Definition at line 138 of file TRestRun.h.
|
inline |
Definition at line 141 of file TRestRun.h.
|
inline |
Definition at line 137 of file TRestRun.h.
|
inline |
Definition at line 170 of file TRestRun.h.
TRestMetadata * TRestRun::GetMetadata | ( | const TString & | name, |
TFile * | file = nullptr |
||
) |
Definition at line 1600 of file TRestRun.cxx.
TRestMetadata * TRestRun::GetMetadataClass | ( | const TString & | type, |
TFile * | file = nullptr |
||
) |
Definition at line 1568 of file TRestRun.cxx.
|
inline |
Definition at line 180 of file TRestRun.h.
std::vector< std::string > TRestRun::GetMetadataNames | ( | ) |
Definition at line 1630 of file TRestRun.cxx.
std::vector< std::string > TRestRun::GetMetadataTitles | ( | ) |
Definition at line 1638 of file TRestRun.cxx.
|
inline |
Definition at line 86 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 797 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 1525 of file TRestRun.cxx.
|
inline |
Definition at line 178 of file TRestRun.h.
|
inline |
Definition at line 165 of file TRestRun.h.
|
inline |
Definition at line 144 of file TRestRun.h.
|
inline |
Definition at line 142 of file TRestRun.h.
|
inline |
Definition at line 125 of file TRestRun.h.
|
inline |
Definition at line 131 of file TRestRun.h.
string TRestRun::GetRunInformation | ( | const std::string & | info | ) |
Definition at line 1542 of file TRestRun.cxx.
Double_t TRestRun::GetRunLength | ( | ) | const |
Definition at line 1353 of file TRestRun.cxx.
|
inline |
Definition at line 127 of file TRestRun.h.
|
inline |
Definition at line 130 of file TRestRun.h.
|
inline |
Definition at line 128 of file TRestRun.h.
|
inline |
Definition at line 129 of file TRestRun.h.
|
inline |
Definition at line 133 of file TRestRun.h.
|
inline |
Definition at line 126 of file TRestRun.h.
Long64_t TRestRun::GetTotalBytes | ( | ) |
Definition at line 1360 of file TRestRun.cxx.
|
inline |
Definition at line 216 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 1299 of file TRestRun.cxx.
|
overrideprotectedvirtual |
Initialize logic of TRestRun.
Things doing in this method:
Reimplemented from TRestMetadata.
Definition at line 122 of file TRestRun.cxx.
|
overridevirtual |
REST run class.
Set variables by default during initialization.
Reimplemented from TRestMetadata.
Definition at line 71 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 Merging is by calling TFileMerger. After this, it will format the merged file name. This method is used to create output file after TRestProcessRunner is finished. The metadata objects will also be written into the file.
Definition at line 986 of file TRestRun.cxx.
|
inline |
Definition at line 166 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 331 of file TRestRun.cxx.
void TRestRun::OpenInputFile | ( | int | i | ) |
Open the i th file in the file list.
Definition at line 314 of file TRestRun.cxx.
|
inline |
Definition at line 98 of file TRestRun.h.
|
inline |
Definition at line 223 of file TRestRun.h.
void TRestRun::PrintEndDate | ( | ) |
Definition at line 1880 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 1902 of file TRestRun.cxx.
|
inline |
Definition at line 243 of file TRestRun.h.
|
overridevirtual |
Prints the basic run information.
Reimplemented from TRestMetadata.
Definition at line 1821 of file TRestRun.cxx.
|
inline |
Definition at line 239 of file TRestRun.h.
void TRestRun::PrintStartDate | ( | ) |
Prints the run start date and time in human format.
Definition at line 1860 of file TRestRun.cxx.
|
inline |
Definition at line 227 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 1928 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 653 of file TRestRun.cxx.
void TRestRun::ReadInputFileMetadata | ( | ) |
Definition at line 446 of file TRestRun.cxx.
void TRestRun::ReadInputFileTrees | ( | ) |
Definition at line 507 of file TRestRun.cxx.
|
inline |
Definition at line 217 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 1703 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 1652 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 782 of file TRestRun.cxx.
|
inline |
Definition at line 193 of file TRestRun.h.
|
inline |
Definition at line 212 of file TRestRun.h.
void TRestRun::SetExtProcess | ( | TRestEventProcess * | p | ) |
Set external file process.
Definition at line 1204 of file TRestRun.cxx.
|
inline |
Definition at line 214 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 1246 of file TRestRun.cxx.
|
inline |
Definition at line 186 of file TRestRun.h.
|
inline |
Definition at line 215 of file TRestRun.h.
|
inline |
Definition at line 191 of file TRestRun.h.
|
inline |
Definition at line 197 of file TRestRun.h.
|
inline |
Definition at line 210 of file TRestRun.h.
|
inline |
Definition at line 196 of file TRestRun.h.
|
inline |
Definition at line 202 of file TRestRun.h.
|
inline |
Definition at line 198 of file TRestRun.h.
|
inline |
Definition at line 206 of file TRestRun.h.
|
inline |
Definition at line 211 of file TRestRun.h.
|
inline |
Definition at line 213 of file TRestRun.h.
|
inline |
Definition at line 118 of file TRestRun.h.
TFile * TRestRun::UpdateOutputFile | ( | ) |
Definition at line 1059 of file TRestRun.cxx.
|
overridevirtual |
overwriting the write() method with fStore considered
Reimplemented from TRestMetadata.
Definition at line 1348 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 1093 of file TRestRun.cxx.
|
protected |
Definition at line 51 of file TRestRun.h.
|
protected |
Definition at line 56 of file TRestRun.h.
|
protected |
Definition at line 55 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 58 of file TRestRun.h.
|
protected |
Definition at line 59 of file TRestRun.h.
|
protected |
Definition at line 50 of file TRestRun.h.
|
protected |
Definition at line 31 of file TRestRun.h.
|
protected |
Definition at line 54 of file TRestRun.h.
|
protected |
Definition at line 61 of file TRestRun.h.
|
protected |
Definition at line 60 of file TRestRun.h.
|
protected |
Definition at line 49 of file TRestRun.h.
|
protected |
Definition at line 47 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 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 48 of file TRestRun.h.
|
protected |
Definition at line 35 of file TRestRun.h.
|
protected |
Definition at line 52 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 53 of file TRestRun.h.
|
protected |
Event absolute starting time/date (unix timestamp)
Definition at line 36 of file TRestRun.h.
|
protected |
Definition at line 57 of file TRestRun.h.