REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
TRestRun Class Reference

Detailed Description

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>

Inheritance diagram for TRestRun:
TRestMetadata

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...
 
TRestAnalysisTreeGetAnalysisTree () 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. 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...
 
TRestEventGetEventWithID (Int_t eventID, Int_t subEventID=-1, const TString &tag="")
 
TString GetExperimentName () const
 
Long64_t GetFeminosDaqTotalEvents () const
 
TRestEventProcessGetFileProcess () const
 
template<class T >
T * GetInputEvent ()
 Calling GetInputEvent<TRestGeant4Event>() will return a TRestGeant4Event* More...
 
TRestEventGetInputEvent () 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
 
TRestMetadataGetMetadata (const TString &name, TFile *file=nullptr)
 
TRestMetadataGetMetadataClass (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...
 
TRestEventGetNextEventWithConditions (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 SetFeminosDaqTotalEvents (Long64_t n)
 
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...
 

Protected Member Functions

void InitFromConfigFile () override
 Initialize logic of TRestRun. More...
 

Protected Attributes

TRestAnalysisTreefAnalysisTree
 
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
 
Long64_t fFeminosDaqTotalEvents = 0
 
TRestEventProcessfFileProcess
 
bool fFromRML = false
 
bool fHangUpEndFile = false
 
TRestEventfInputEvent
 
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
 

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...
 

Constructor & Destructor Documentation

◆ TRestRun() [1/2]

TRestRun::TRestRun ( )

Definition at line 52 of file TRestRun.cxx.

◆ TRestRun() [2/2]

TRestRun::TRestRun ( const std::string &  filename)
explicit

Definition at line 54 of file TRestRun.cxx.

◆ ~TRestRun()

TRestRun::~TRestRun ( )

Definition at line 66 of file TRestRun.cxx.

Member Function Documentation

◆ AddEventBranch()

void TRestRun::AddEventBranch ( TRestEvent event)

Add an event branch in output EventTree.

Definition at line 1282 of file TRestRun.cxx.

◆ AddInputFileExternal()

void TRestRun::AddInputFileExternal ( const std::string &  file)

Definition at line 434 of file TRestRun.cxx.

◆ AddMetadata()

void TRestRun::AddMetadata ( TRestMetadata meta)
inline

add metadata object to the metadata list

Definition at line 112 of file TRestRun.h.

◆ cd()

void TRestRun::cd ( )
inline

Definition at line 122 of file TRestRun.h.

◆ CloseFile()

void TRestRun::CloseFile ( )

Close both input file and output file, setting trees to nullptr also.

Definition at line 1155 of file TRestRun.cxx.

◆ EvaluateMetadataMember()

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:

run->EvaluateMetadataMember("TRestDetectorSetup->fDetectorPressure == 4");
run->EvaluateMetadataMember("sc->fMinValues[1] == 3" );

Both, :: and -> are allowed to separate class and the data member.

Returns
The result of the evaluated expression. If the input string is empty it will return true.

Definition at line 1768 of file TRestRun.cxx.

◆ FormFormat()

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:

Run[fRunNumber]_Proc_[LastProcess].root

and generates:

Run00000_T2018-01-01_08:00:00_Proc_sAna.root

Definition at line 940 of file TRestRun.cxx.

◆ FormOutputFile()

TFile * TRestRun::FormOutputFile ( )

Create a new TFile as REST output file. Writing metadata objects into it.

Definition at line 1036 of file TRestRun.cxx.

◆ GetAnalysisTree()

TRestAnalysisTree * TRestRun::GetAnalysisTree ( ) const
inline

Definition at line 170 of file TRestRun.h.

◆ GetBytesRead()

Long64_t TRestRun::GetBytesRead ( ) const
inline

Definition at line 148 of file TRestRun.h.

◆ GetCurrentEntry()

int TRestRun::GetCurrentEntry ( ) const
inline

Definition at line 147 of file TRestRun.h.

◆ GetElapsedTimeSeconds()

Double_t TRestRun::GetElapsedTimeSeconds ( ) const
inline

Definition at line 181 of file TRestRun.h.

◆ GetEndTimestamp()

Double_t TRestRun::GetEndTimestamp ( ) const
inline

Definition at line 136 of file TRestRun.h.

◆ GetEntries()

Long64_t TRestRun::GetEntries ( ) const

Definition at line 1366 of file TRestRun.cxx.

◆ GetEntry()

void TRestRun::GetEntry ( Long64_t  entry)

Calls GetEntry() for both AnalysisTree and EventTree.

Definition at line 908 of file TRestRun.cxx.

◆ GetEventEntriesWithConditions()

std::vector< int > TRestRun::GetEventEntriesWithConditions ( const std::string &  cuts,
int  startingIndex = 0,
int  maxNumber = -1 
)

Definition at line 1405 of file TRestRun.cxx.

◆ GetEventIdsWithConditions()

std::vector< int > TRestRun::GetEventIdsWithConditions ( const std::string &  cuts,
int  startingIndex = 0,
int  maxNumber = -1 
)

Definition at line 1506 of file TRestRun.cxx.

◆ GetEventTree()

TTree * TRestRun::GetEventTree ( ) const
inline

Definition at line 171 of file TRestRun.h.

◆ GetEventTypesList()

std::vector< std::string > TRestRun::GetEventTypesList ( )

It returns a list of available event types inside the file.

Definition at line 892 of file TRestRun.cxx.

◆ GetEventWithID()

TRestEvent * TRestRun::GetEventWithID ( Int_t  eventID,
Int_t  subEventID = -1,
const TString &  tag = "" 
)

Definition at line 1375 of file TRestRun.cxx.

◆ GetExperimentName()

TString TRestRun::GetExperimentName ( ) const
inline

Definition at line 137 of file TRestRun.h.

◆ GetFeminosDaqTotalEvents()

Long64_t TRestRun::GetFeminosDaqTotalEvents ( ) const
inline

Definition at line 222 of file TRestRun.h.

◆ GetFileProcess()

TRestEventProcess * TRestRun::GetFileProcess ( ) const
inline

Definition at line 165 of file TRestRun.h.

◆ GetInputEvent() [1/2]

template<class T >
T * TRestRun::GetInputEvent ( )
inline

Calling GetInputEvent<TRestGeant4Event>() will return a TRestGeant4Event*

Definition at line 156 of file TRestRun.h.

◆ GetInputEvent() [2/2]

TRestEvent * TRestRun::GetInputEvent ( ) const
inline

Calling GetInputEvent() will return a basic TRestEvent*

Definition at line 153 of file TRestRun.h.

◆ GetInputEventName()

TString TRestRun::GetInputEventName ( ) const
inline

Definition at line 169 of file TRestRun.h.

◆ GetInputFile()

TFile * TRestRun::GetInputFile ( ) const
inline

Definition at line 145 of file TRestRun.h.

◆ GetInputFileName()

std::string TRestRun::GetInputFileName ( unsigned int  i) const
inline

Definition at line 140 of file TRestRun.h.

◆ GetInputFileNamePattern()

std::string TRestRun::GetInputFileNamePattern ( ) const
inline

Definition at line 143 of file TRestRun.h.

◆ GetInputFileNames()

std::vector< TString > TRestRun::GetInputFileNames ( ) const
inline

Definition at line 139 of file TRestRun.h.

◆ GetInputFileNumber()

Int_t TRestRun::GetInputFileNumber ( ) const
inline

Definition at line 172 of file TRestRun.h.

◆ GetMetadata()

TRestMetadata * TRestRun::GetMetadata ( const TString &  name,
TFile *  file = nullptr 
)

Definition at line 1600 of file TRestRun.cxx.

◆ GetMetadataClass()

TRestMetadata * TRestRun::GetMetadataClass ( const TString &  type,
TFile *  file = nullptr 
)

Definition at line 1568 of file TRestRun.cxx.

◆ GetMetadataMember()

std::string TRestRun::GetMetadataMember ( const std::string &  instr)
inline

Definition at line 183 of file TRestRun.h.

◆ GetMetadataNames()

std::vector< std::string > TRestRun::GetMetadataNames ( )

Definition at line 1630 of file TRestRun.cxx.

◆ GetMetadataTitles()

std::vector< std::string > TRestRun::GetMetadataTitles ( )

Definition at line 1638 of file TRestRun.cxx.

◆ GetNextEntry()

void TRestRun::GetNextEntry ( )
inline

Definition at line 88 of file TRestRun.h.

◆ GetNextEvent()

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 796 of file TRestRun.cxx.

◆ GetNextEventWithConditions()

TRestEvent * TRestRun::GetNextEventWithConditions ( const std::string &  cuts)

Load the next event that satisfies the conditions specified by a string.

Parameters
conditionsstring specifying conditions, supporting multiple conditions separated by ":", allowed symbols include "<", "<=", ">", ">=", "=", "==". For example "A>=2.2:B==4".
Returns
TRestEvent

Definition at line 1525 of file TRestRun.cxx.

◆ GetNumberOfMetadata()

int TRestRun::GetNumberOfMetadata ( ) const
inline

Definition at line 180 of file TRestRun.h.

◆ GetObservableID()

Int_t TRestRun::GetObservableID ( const std::string &  name)
inline

Definition at line 167 of file TRestRun.h.

◆ GetOutputFile()

TFile * TRestRun::GetOutputFile ( ) const
inline

Definition at line 146 of file TRestRun.h.

◆ GetOutputFileName()

TString TRestRun::GetOutputFileName ( ) const
inline

Definition at line 144 of file TRestRun.h.

◆ GetParentRunNumber()

Int_t TRestRun::GetParentRunNumber ( ) const
inline

Definition at line 127 of file TRestRun.h.

◆ GetRunDescription()

TString TRestRun::GetRunDescription ( ) const
inline

Definition at line 133 of file TRestRun.h.

◆ GetRunInformation()

string TRestRun::GetRunInformation ( const std::string &  info)

Definition at line 1542 of file TRestRun.cxx.

◆ GetRunLength()

Double_t TRestRun::GetRunLength ( ) const

Definition at line 1352 of file TRestRun.cxx.

◆ GetRunNumber()

Int_t TRestRun::GetRunNumber ( ) const
inline

Definition at line 129 of file TRestRun.h.

◆ GetRunTag()

TString TRestRun::GetRunTag ( ) const
inline

Definition at line 132 of file TRestRun.h.

◆ GetRunType()

TString TRestRun::GetRunType ( ) const
inline

Definition at line 130 of file TRestRun.h.

◆ GetRunUser()

TString TRestRun::GetRunUser ( ) const
inline

Definition at line 131 of file TRestRun.h.

◆ GetStartTimestamp()

Double_t TRestRun::GetStartTimestamp ( ) const
inline

Definition at line 135 of file TRestRun.h.

◆ GetSubRunNumber()

Int_t TRestRun::GetSubRunNumber ( ) const
inline

Definition at line 128 of file TRestRun.h.

◆ GetTotalBytes()

Long64_t TRestRun::GetTotalBytes ( )

Definition at line 1359 of file TRestRun.cxx.

◆ HangUpEndFile()

void TRestRun::HangUpEndFile ( )
inline

Definition at line 218 of file TRestRun.h.

◆ ImportMetadata()

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 1298 of file TRestRun.cxx.

◆ InitFromConfigFile()

void TRestRun::InitFromConfigFile ( )
overrideprotectedvirtual

Initialize logic of TRestRun.

Things doing in this method:

  1. Read basic parameter. This is done by calling ReadAllParameters()
  2. Initialize runnumber and input file name. They follow non-trivial logic.
  3. Construct default output file name with runNumber, runTag, etc.
  4. Loop over sections to initialize metadata
  5. Open input file(s), read the stored metadata and trees, read file name pattern to TRestDetector metadata.

Reimplemented from TRestMetadata.

Definition at line 122 of file TRestRun.cxx.

◆ Initialize()

void TRestRun::Initialize ( )
overridevirtual

REST run class.

Set variables by default during initialization.

Reimplemented from TRestMetadata.

Definition at line 71 of file TRestRun.cxx.

◆ MergeToOutputFile()

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 985 of file TRestRun.cxx.

◆ ObservableExists()

Bool_t TRestRun::ObservableExists ( const std::string &  name)
inline

Definition at line 168 of file TRestRun.h.

◆ OpenInputFile() [1/2]

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:

  1. read the file info (size, date, etc.) if it's root file from REST output, then
  2. update its class's data(version, tag, user, etc.) to the same as the one stored in the input file.
  3. link the input event and observables to the corresponding tree

Definition at line 331 of file TRestRun.cxx.

◆ OpenInputFile() [2/2]

void TRestRun::OpenInputFile ( int  i)

Open the i th file in the file list.

Definition at line 314 of file TRestRun.cxx.

◆ PassOutputFile()

void TRestRun::PassOutputFile ( )
inline

Definition at line 100 of file TRestRun.h.

◆ PrintAllMetadata()

void TRestRun::PrintAllMetadata ( )
inline

Definition at line 229 of file TRestRun.h.

◆ PrintEndDate()

void TRestRun::PrintEndDate ( )

Definition at line 1880 of file TRestRun.cxx.

◆ PrintErrors()

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.

◆ PrintEvent()

void TRestRun::PrintEvent ( ) const
inline

Definition at line 253 of file TRestRun.h.

◆ PrintMetadata()

void TRestRun::PrintMetadata ( )
overridevirtual

Prints the basic run information.

Reimplemented from TRestMetadata.

Definition at line 1821 of file TRestRun.cxx.

◆ PrintObservables()

void TRestRun::PrintObservables ( )
inline

Definition at line 247 of file TRestRun.h.

◆ PrintStartDate()

void TRestRun::PrintStartDate ( )

Prints the run start date and time in human format.

Definition at line 1860 of file TRestRun.cxx.

◆ PrintTrees()

void TRestRun::PrintTrees ( ) const
inline

Definition at line 235 of file TRestRun.h.

◆ PrintWarnings()

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.

◆ ReadFileInfo()

void TRestRun::ReadFileInfo ( const std::string &  filename)

Extract file info from a file, and save it in the file info list.

Items:

  1. matched file name formats
  2. Created time and date
  3. File size and entries

Definition at line 652 of file TRestRun.cxx.

◆ ReadInputFileMetadata()

void TRestRun::ReadInputFileMetadata ( )

Definition at line 446 of file TRestRun.cxx.

◆ ReadInputFileTrees()

void TRestRun::ReadInputFileTrees ( )

Definition at line 507 of file TRestRun.cxx.

◆ ReleaseEndFile()

void TRestRun::ReleaseEndFile ( )
inline

Definition at line 219 of file TRestRun.h.

◆ ReplaceMetadataMember()

string TRestRun::ReplaceMetadataMember ( const std::string &  instr,
Int_t  precision = 0 
)
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.

Returns
The corresponding class data member value in string format.

Definition at line 1703 of file TRestRun.cxx.

◆ ReplaceMetadataMembers()

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].

Returns
The string with data members replaced

Definition at line 1652 of file TRestRun.cxx.

◆ ResetEntry()

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 781 of file TRestRun.cxx.

◆ SetCurrentEntry()

void TRestRun::SetCurrentEntry ( int  i)
inline

Definition at line 196 of file TRestRun.h.

◆ SetEndTimeStamp()

void TRestRun::SetEndTimeStamp ( Double_t  timestamp)
inline

Definition at line 214 of file TRestRun.h.

◆ SetExtProcess()

void TRestRun::SetExtProcess ( TRestEventProcess p)

Set external file process.

Definition at line 1203 of file TRestRun.cxx.

◆ SetFeminosDaqTotalEvents()

void TRestRun::SetFeminosDaqTotalEvents ( Long64_t  n)
inline

Definition at line 221 of file TRestRun.h.

◆ SetHistoricMetadataSaving()

void TRestRun::SetHistoricMetadataSaving ( bool  save)
inline

Definition at line 216 of file TRestRun.h.

◆ SetInputEvent()

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 1245 of file TRestRun.cxx.

◆ SetInputFileName()

void TRestRun::SetInputFileName ( const std::string &  s)
inline

Definition at line 189 of file TRestRun.h.

◆ SetNFilesSplit()

void TRestRun::SetNFilesSplit ( int  n)
inline

Definition at line 217 of file TRestRun.h.

◆ SetOutputFileName()

void TRestRun::SetOutputFileName ( const std::string &  s)
inline

Definition at line 194 of file TRestRun.h.

◆ SetParentRunNumber()

void TRestRun::SetParentRunNumber ( Int_t  number)
inline

Definition at line 199 of file TRestRun.h.

◆ SetRunDescription()

void TRestRun::SetRunDescription ( const TString &  description)
inline

Definition at line 212 of file TRestRun.h.

◆ SetRunNumber()

void TRestRun::SetRunNumber ( Int_t  number)
inline

Definition at line 198 of file TRestRun.h.

◆ SetRunTag()

void TRestRun::SetRunTag ( const TString &  tag)
inline

Definition at line 204 of file TRestRun.h.

◆ SetRunType()

void TRestRun::SetRunType ( const TString &  type)
inline

Definition at line 200 of file TRestRun.h.

◆ SetRunUser()

void TRestRun::SetRunUser ( const TString &  user)
inline

Definition at line 208 of file TRestRun.h.

◆ SetStartTimeStamp()

void TRestRun::SetStartTimeStamp ( Double_t  timestamp)
inline

Definition at line 213 of file TRestRun.h.

◆ SetTotalBytes()

void TRestRun::SetTotalBytes ( Long64_t  totalBytes)
inline

Definition at line 215 of file TRestRun.h.

◆ SkipEventTree()

void TRestRun::SkipEventTree ( )
inline

Definition at line 120 of file TRestRun.h.

◆ UpdateOutputFile()

TFile * TRestRun::UpdateOutputFile ( )

Definition at line 1058 of file TRestRun.cxx.

◆ Write()

Int_t TRestRun::Write ( const char *  name = nullptr,
Int_t  option = 0,
Int_t  bufsize = 0 
)
overridevirtual

overwriting the write() method with fStore considered

Reimplemented from TRestMetadata.

Definition at line 1347 of file TRestRun.cxx.

◆ WriteWithDataBase()

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 1092 of file TRestRun.cxx.

Field Documentation

◆ fAnalysisTree

TRestAnalysisTree* TRestRun::fAnalysisTree
protected

Definition at line 51 of file TRestRun.h.

◆ fBytesRead

Long64_t TRestRun::fBytesRead
protected

Definition at line 56 of file TRestRun.h.

◆ fCurrentEvent

int TRestRun::fCurrentEvent
protected

Definition at line 55 of file TRestRun.h.

◆ fEndTime

Double_t TRestRun::fEndTime
protected

Event absolute ending time/date (unix timestamp)

Definition at line 37 of file TRestRun.h.

◆ fEntriesSaved

Int_t TRestRun::fEntriesSaved
protected

Definition at line 38 of file TRestRun.h.

◆ fEventBranchLoc

int TRestRun::fEventBranchLoc
protected

Definition at line 58 of file TRestRun.h.

◆ fEventIndexCounter

int TRestRun::fEventIndexCounter = 0
protected

Definition at line 59 of file TRestRun.h.

◆ fEventTree

TTree* TRestRun::fEventTree
protected

Definition at line 50 of file TRestRun.h.

◆ fExperimentName

TString TRestRun::fExperimentName
protected

Definition at line 31 of file TRestRun.h.

◆ fFeminosDaqTotalEvents

Long64_t TRestRun::fFeminosDaqTotalEvents = 0
protected

Definition at line 63 of file TRestRun.h.

◆ fFileProcess

TRestEventProcess* TRestRun::fFileProcess
protected

Definition at line 54 of file TRestRun.h.

◆ fFromRML

bool TRestRun::fFromRML = false
protected

Definition at line 61 of file TRestRun.h.

◆ fHangUpEndFile

bool TRestRun::fHangUpEndFile = false
protected

Definition at line 60 of file TRestRun.h.

◆ fInputEvent

TRestEvent* TRestRun::fInputEvent
protected

Definition at line 49 of file TRestRun.h.

◆ fInputFile

TFile* TRestRun::fInputFile
protected

Definition at line 47 of file TRestRun.h.

◆ fInputFileName

TString TRestRun::fInputFileName
protected

Definition at line 34 of file TRestRun.h.

◆ fInputFileNames

std::vector<TString> TRestRun::fInputFileNames
protected

Definition at line 46 of file TRestRun.h.

◆ fInputMetadata

std::vector<TRestMetadata*> TRestRun::fInputMetadata
protected

Definition at line 43 of file TRestRun.h.

◆ fMetadata

std::vector<TRestMetadata*> TRestRun::fMetadata
protected

Definition at line 42 of file TRestRun.h.

◆ fNFilesSplit

Int_t TRestRun::fNFilesSplit
protected

Definition at line 39 of file TRestRun.h.

◆ fOutputFile

TFile* TRestRun::fOutputFile
protected

Definition at line 48 of file TRestRun.h.

◆ fOutputFileName

TString TRestRun::fOutputFileName
protected

Definition at line 35 of file TRestRun.h.

◆ fOverwrite

bool TRestRun::fOverwrite
protected

Definition at line 52 of file TRestRun.h.

◆ fParentRunNumber

Int_t TRestRun::fParentRunNumber
protected

It can be used as parent number of subrun number.

Definition at line 23 of file TRestRun.h.

◆ fRunClassName

TString TRestRun::fRunClassName
protected

Definition at line 24 of file TRestRun.h.

◆ fRunDescription

TString TRestRun::fRunDescription
protected

Definition at line 30 of file TRestRun.h.

◆ fRunNumber

Int_t TRestRun::fRunNumber
protected

Definition at line 21 of file TRestRun.h.

◆ fRunTag

TString TRestRun::fRunTag
protected

Definition at line 29 of file TRestRun.h.

◆ fRunType

TString TRestRun::fRunType
protected

Definition at line 25 of file TRestRun.h.

◆ fRunUser

TString TRestRun::fRunUser
protected

Definition at line 27 of file TRestRun.h.

◆ fSaveHistoricData

bool TRestRun::fSaveHistoricData
protected

Definition at line 53 of file TRestRun.h.

◆ fStartTime

Double_t TRestRun::fStartTime
protected

Event absolute starting time/date (unix timestamp)

Definition at line 36 of file TRestRun.h.

◆ fTotalBytes

Long64_t TRestRun::fTotalBytes
protected

Definition at line 57 of file TRestRun.h.


The documentation for this class was generated from the following files: