RunStore Class Reference
|
Ratpac-two
|
#include <RunStore.hh>
Detailed Description
Run-level data structure helper class
The RunStore coordinates the movement of run-level information throughout the program. Unless you have a really good reason, you should always access the RunStore through the static methods, and not create an instance of it yourself.
This code handles DS::Run objects, which should be used to store all run-level information that you wish to carry with the output file. In ROOT files, DS::Run objects are stored in a tree named "runT" which has a single branch called "run" of type DS::Run.
The current behavior of the RunStore is to cache all run records in memory on demand, with no bound on memory usage of the cache. Records are never flushed from the cache, and are written to the output tree at the last possible moment. This behavior may be fine-tuned in the future.
The rules for using the RunStore depend on who you are:
Generic Processor
Given an event, you can obtain the run information for that event by calling RunStore::GetRun() with a pointer to the event (DS::Root). If the information cannot be found in the cache, or in a TTree registered to handle this information, a null pointer is returned.
Output Processor
When opening an output ROOT file, the output processor must create a run tree. The tree is registered by calling SetWriteTree(). Before closing the file containing the TTree, the output processor needs to call FlushWriteTree() to ensure all cached runs are written to the tree.
Event Producer
A producer of events (Gsim/inroot/etc) needs to either register an input TTree of run information using SetReadTree(), or needs to populate the cache with run records using AddNewRun(). The former is used by inroot, and the latter is used by Gsim. In special circumstances, you might want to populate the cache from a tree (but not leave it permanently assocated), in which case you should use PreloadFromTree().
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/ds/include/RAT/DS/RunStore.hh
Generated by