Project
Loading...
Searching...
No Matches
FairRootManager Class Reference

#include <FairRootManager.h>

Inherits TObject.

Public Member Functions

virtual ~FairRootManager ()
 
Bool_t AllDataProcessed ()
 
Int_t AddBranchToList (const char *name)
 
Int_t CheckBranch (const char *BrName)
 
void CloseSink ()
 
void CreateGeometryFile (const char *geofile)
 
void Fill ()
 
void LastFill ()
 
TClonesArray * GetEmptyTClonesArray (TString branchName)
 
TClonesArray * GetTClonesArray (TString branchName)
 
void UpdateBranches ()
 
TString GetBranchName (Int_t id)
 
Int_t GetBranchId (TString const &BrName)
 
Int_t GetMCTrackBranchId () const
 
TList * GetBranchNameList ()
 
const std::vector< std::string > & GetReqBranchNames () const
 
TObject * GetObject (const char *BrName)
 
template<typename T >
T InitObjectAs (const char *BrName)
 
Double_t GetEventTime ()
 
TObject * GetCloneOfLinkData (const FairLink link)
 
TClonesArray * GetCloneOfTClonesArray (const FairLink link)
 
void InitTSBuffer (TString branchName, BinaryFunctor *function)
 
TClonesArray * GetData (TString branchName, BinaryFunctor *function, Double_t parameter)
 
TClonesArray * GetData (TString branchName, BinaryFunctor *startFunction, Double_t startParameter, BinaryFunctor *stopFunction, Double_t stopParameter)
 
void RegisterTSBuffer (TString branchName, FairTSBufferFunctional *functionalBuffer)
 
void TerminateTSBuffer (TString branchName)
 
void TerminateAllTSBuffer ()
 
FairTSBufferFunctional * GetTSBuffer (TString branchName)
 
Int_t ReadEvent (Int_t i=0)
 
Int_t ReadNonTimeBasedEventFromBranches (Int_t i=0)
 
void ReadBranchEvent (const char *BrName)
 
void ReadBranchEvent (const char *BrName, Int_t entry)
 
Int_t GetRunId ()
 
Bool_t ReadNextEvent (Double_t dt)
 
void Register (const char *name, const char *Foldername, TNamed *obj, Bool_t toFile)
 
void Register (const char *name, const char *Foldername, TCollection *obj, Bool_t toFile)
 
template<typename T >
void RegisterAny (const char *name, T *&obj, Bool_t toFile)
 
bool CreatePersistentBranchesAny ()
 
void RegisterInputObject (const char *name, TObject *obj)
 
TClonesArray * Register (TString branchName, TString className, TString folderName, Bool_t toFile)
 
FairWriteoutBuffer * RegisterWriteoutBuffer (TString branchName, FairWriteoutBuffer *buffer)
 
void UpdateListOfTimebasedBranches ()
 
void RunWithTimeStamps ()
 
void SetBranchNameList (TList *list)
 
void SetTimeBasedBranchNameList (TList *list)
 
void FillEventHeader (FairEventHeader *feh)
 
void SetLastFill (Bool_t val=kTRUE)
 
Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0)
 
void WriteGeometry ()
 
void WriteFileHeader (FairFileHeader *f)
 
void WriteFolder ()
 
Int_t CheckMaxEventNo (Int_t EvtEnd=0)
 
void StoreWriteoutBufferData (Double_t eventTime)
 
void StoreAllWriteoutBufferData ()
 
void DeleteOldWriteoutBufferData ()
 
Int_t GetEntryNr ()
 
void SetEntryNr (Int_t val)
 
void SetUseFairLinks (Bool_t val)
 
Bool_t GetUseFairLinks () const
 
void SetSource (FairSource *tempSource)
 
FairSource * GetSource ()
 
Bool_t InitSource ()
 
void SetSink (FairSink *tempSink)
 
FairSink * GetSink ()
 
Bool_t InitSink ()
 
void SetListOfFolders (TObjArray *ta)
 
TChain * GetInChain ()
 
TChain * GetSignalChainNo (UInt_t i)
 
TTree * GetInTree ()
 
const TFile * GetRootFile ()
 
TFile * GetInFile ()
 
void SetInChain (TChain *tempChain, Int_t ident=-1)
 
void SetFinishRun (Bool_t val=kTRUE)
 
Bool_t FinishRun ()
 
Int_t GetInstanceId () const
 
void UpdateFileName (TString &fileName)
 
TFile * GetOutFile ()
 
TTree * GetOutTree ()
 
Bool_t SpecifyRunId ()
 
template<typename T >
void RegisterAny (const char *brname, T *&obj, bool persistence)
 
template<typename TPtr >
TPtr InitObjectAs (const char *brname)
 

Static Public Member Functions

static FairRootManager * Instance ()
 
static void SetTreeName (const std::string &tname)
 
static void SetFolderName (const std::string &tname)
 
static const char * GetTreeName ()
 
static const char * GetFolderName ()
 

Detailed Description

I/O Manager class

Author
M. Al-Turany, Denis Bertini
Version
0.1
Since
12.01.04

Definition at line 52 of file FairRootManager.h.

Constructor & Destructor Documentation

◆ ~FairRootManager()

FairRootManager::~FairRootManager ( )
virtual

dtor

Definition at line 131 of file FairRootManager.cxx.

Member Function Documentation

◆ AddBranchToList()

Int_t FairRootManager::AddBranchToList ( const char *  name)

Add a branch name to the Branchlist and give it an id

Definition at line 229 of file FairRootManager.cxx.

◆ AllDataProcessed()

Bool_t FairRootManager::AllDataProcessed ( )

Definition at line 365 of file FairRootManager.cxx.

◆ CheckBranch()

Int_t FairRootManager::CheckBranch ( const char *  BrName)

Check if Branch persistence or not (Memory branch) return value: 1 : Branch is Persistance 2 : Memory Branch 0 : Branch does not exist

The first time this method is called the map is generated and then used

Definition at line 715 of file FairRootManager.cxx.

◆ CheckMaxEventNo()

Int_t FairRootManager::CheckMaxEventNo ( Int_t  EvtEnd = 0)

Check the maximum event number we can run to

Definition at line 902 of file FairRootManager.cxx.

◆ CloseSink()

void FairRootManager::CloseSink ( )
inline

Definition at line 68 of file FairRootManager.h.

◆ CreateGeometryFile()

void FairRootManager::CreateGeometryFile ( const char *  geofile)

Create a new file and save the current TGeoManager object to it

Writes the geometry in a separate file. This is only to have a file which can be read without the framework. The geomanager used by the framework is still stored in the parameter file or database

Definition at line 409 of file FairRootManager.cxx.

◆ CreatePersistentBranchesAny()

bool FairRootManager::CreatePersistentBranchesAny ( )

for branches which are not managed by folders, we need a special function to trigger persistent branch creation return true if successful; false if problem

◆ DeleteOldWriteoutBufferData()

void FairRootManager::DeleteOldWriteoutBufferData ( )

Definition at line 974 of file FairRootManager.cxx.

◆ Fill()

void FairRootManager::Fill ( )

Definition at line 375 of file FairRootManager.cxx.

◆ FillEventHeader()

void FairRootManager::FillEventHeader ( FairEventHeader *  feh)
inline

Definition at line 192 of file FairRootManager.h.

◆ FinishRun()

Bool_t FairRootManager::FinishRun ( )
inline

Definition at line 267 of file FairRootManager.h.

◆ GetBranchId()

Int_t FairRootManager::GetBranchId ( TString const &  BrName)

Return Id of a branch named

Return the branch id from the name

Definition at line 308 of file FairRootManager.cxx.

◆ GetBranchName()

TString FairRootManager::GetBranchName ( Int_t  id)

Return branch name by Id

Return the branch name from the id

Definition at line 296 of file FairRootManager.cxx.

◆ GetBranchNameList()

TList * FairRootManager::GetBranchNameList ( )
inline

Return a TList of TObjString of branch names available in this session

Definition at line 92 of file FairRootManager.h.

◆ GetCloneOfLinkData()

TObject * FairRootManager::GetCloneOfLinkData ( const FairLink  link)

Returns a clone of the data object the link is pointing to. The clone has to be deleted in the calling code!

Definition at line 560 of file FairRootManager.cxx.

◆ GetCloneOfTClonesArray()

TClonesArray * FairRootManager::GetCloneOfTClonesArray ( const FairLink  link)

Get the data of the given branch name, this method runs over multiple entries of the tree and selects the data according to the function and the parameter given.

Definition at line 642 of file FairRootManager.cxx.

◆ GetData() [1/2]

TClonesArray * FairRootManager::GetData ( TString  branchName,
BinaryFunctor *  function,
Double_t  parameter 
)

Definition at line 328 of file FairRootManager.cxx.

◆ GetData() [2/2]

TClonesArray * FairRootManager::GetData ( TString  branchName,
BinaryFunctor *  startFunction,
Double_t  startParameter,
BinaryFunctor *  stopFunction,
Double_t  stopParameter 
)

Definition at line 337 of file FairRootManager.cxx.

◆ GetEmptyTClonesArray()

TClonesArray * FairRootManager::GetEmptyTClonesArray ( TString  branchName)

Definition at line 267 of file FairRootManager.cxx.

◆ GetEntryNr()

Int_t FairRootManager::GetEntryNr ( )
inline

Definition at line 219 of file FairRootManager.h.

◆ GetEventTime()

Double_t FairRootManager::GetEventTime ( )

Return a pointer to the object (collection) saved in the fInTree branch named BrName

Definition at line 751 of file FairRootManager.cxx.

◆ GetFolderName()

const char * FairRootManager::GetFolderName ( )
static

Definition at line 1029 of file FairRootManager.cxx.

◆ GetInChain()

TChain * FairRootManager::GetInChain ( )
inline

Definition at line 243 of file FairRootManager.h.

◆ GetInFile()

TFile * FairRootManager::GetInFile ( )
inline

Definition at line 257 of file FairRootManager.h.

◆ GetInstanceId()

Int_t FairRootManager::GetInstanceId ( ) const
inline

public Members for multi-threading

Definition at line 276 of file FairRootManager.h.

◆ GetInTree()

TTree * FairRootManager::GetInTree ( )
inline

Definition at line 245 of file FairRootManager.h.

◆ GetMCTrackBranchId()

Int_t FairRootManager::GetMCTrackBranchId ( ) const
inline

The MCTrack branch stands out since it is required by the framework algorithms

Definition at line 89 of file FairRootManager.h.

◆ GetObject()

TObject * FairRootManager::GetObject ( const char *  BrName)

Get the Object (container) for the given branch name, this method can be used to access the data of a branch that was created from a different analysis task, and not written in the tree yet. the user have to cast this pointer to the right type. Return a pointer to the object (collection) saved in the fInChain branch named BrName

Get Data object by name

Try to find the object in the folder structure, object already activated by other task or call

if the object does not exist then it could be a memory branch

if the object does not exist then look in the input tree

there is an input tree and the object was not in memory

Definition at line 523 of file FairRootManager.cxx.

◆ GetOutFile()

TFile * FairRootManager::GetOutFile ( )

Return a pointer to the output File of type TFile

Definition at line 1059 of file FairRootManager.cxx.

◆ GetOutTree()

TTree * FairRootManager::GetOutTree ( )

Return a pointer to the output tree of type TTree

Definition at line 1068 of file FairRootManager.cxx.

◆ GetReqBranchNames()

const std::vector< std::string > & FairRootManager::GetReqBranchNames ( ) const
inline

Return the vector of branch names that were requested by tasks as input

Definition at line 94 of file FairRootManager.h.

◆ GetRootFile()

const TFile * FairRootManager::GetRootFile ( )
inline

Definition at line 251 of file FairRootManager.h.

◆ GetRunId()

Int_t FairRootManager::GetRunId ( )

Read all entries from input tree(s) with time stamp from current time to dt (time in ns)

Definition at line 482 of file FairRootManager.cxx.

◆ GetSignalChainNo()

TChain * FairRootManager::GetSignalChainNo ( UInt_t  i)
inline

Definition at line 244 of file FairRootManager.h.

◆ GetSink()

FairSink * FairRootManager::GetSink ( )
inline

Definition at line 239 of file FairRootManager.h.

◆ GetSource()

FairSource * FairRootManager::GetSource ( )
inline

Definition at line 235 of file FairRootManager.h.

◆ GetTClonesArray()

TClonesArray * FairRootManager::GetTClonesArray ( TString  branchName)

Definition at line 285 of file FairRootManager.cxx.

◆ GetTreeName()

const char * FairRootManager::GetTreeName ( )
static

Definition at line 1015 of file FairRootManager.cxx.

◆ GetTSBuffer()

FairTSBufferFunctional * FairRootManager::GetTSBuffer ( TString  branchName)
inline

Definition at line 136 of file FairRootManager.h.

◆ GetUseFairLinks()

Bool_t FairRootManager::GetUseFairLinks ( ) const
inline

Definition at line 223 of file FairRootManager.h.

◆ InitObjectAs() [1/2]

template<typename T >
T FairRootManager::InitObjectAs ( const char *  BrName)

Initializes and returns a default object for a branch or looks it up when it exists already. Returns nullptr when the branch does not exist or looking up with wrong type. The name Init indicates that this functions should be called only in Init sections of FairTasks. The returned default object will be filled with data by the framework.

◆ InitObjectAs() [2/2]

template<typename TPtr >
TPtr FairRootManager::InitObjectAs ( const char *  brname)

Definition at line 484 of file FairRootManager.h.

◆ InitSink()

Bool_t FairRootManager::InitSink ( )

Definition at line 184 of file FairRootManager.cxx.

◆ InitSource()

Bool_t FairRootManager::InitSource ( )

Definition at line 160 of file FairRootManager.cxx.

◆ InitTSBuffer()

void FairRootManager::InitTSBuffer ( TString  branchName,
BinaryFunctor *  function 
)

Definition at line 323 of file FairRootManager.cxx.

◆ Instance()

FairRootManager * FairRootManager::Instance ( )
static

static access method

Definition at line 70 of file FairRootManager.cxx.

◆ LastFill()

void FairRootManager::LastFill ( )

Definition at line 381 of file FairRootManager.cxx.

◆ ReadBranchEvent() [1/2]

void FairRootManager::ReadBranchEvent ( const char *  BrName)

Read the tree entry on one branch

Definition at line 491 of file FairRootManager.cxx.

◆ ReadBranchEvent() [2/2]

void FairRootManager::ReadBranchEvent ( const char *  BrName,
Int_t  entry 
)

Read the tree entry on one branch for a specific entry

Definition at line 470 of file FairRootManager.cxx.

◆ ReadEvent()

Int_t FairRootManager::ReadEvent ( Int_t  i = 0)

Read a single entry from background chain

Definition at line 444 of file FairRootManager.cxx.

◆ ReadNextEvent()

Bool_t FairRootManager::ReadNextEvent ( Double_t  dt)

TODO

Definition at line 516 of file FairRootManager.cxx.

◆ ReadNonTimeBasedEventFromBranches()

Int_t FairRootManager::ReadNonTimeBasedEventFromBranches ( Int_t  i = 0)

Read a single entry from each branch that is not read via TSBuffers

Definition at line 500 of file FairRootManager.cxx.

◆ Register() [1/3]

void FairRootManager::Register ( const char *  name,
const char *  Foldername,
TCollection *  obj,
Bool_t  toFile 
)

create a new branch in the output tree

Parameters
nameName of the branch to create
FoldernameFolder name containing this branch (e.g Detector name)
objPointer of type TCollection (e.g. TClonesArray of hits, points)
toFileif kTRUE, branch will be saved to the tree

Definition at line 242 of file FairRootManager.cxx.

◆ Register() [2/3]

void FairRootManager::Register ( const char *  name,
const char *  Foldername,
TNamed *  obj,
Bool_t  toFile 
)

create a new branch in the output tree

Parameters
nameName of the branch to create
FoldernameFolder name containing this branch (e.g Detector name)
objPointer of type TNamed (e.g. MCStack object)
toFileif kTRUE, branch will be saved to the tree

Definition at line 224 of file FairRootManager.cxx.

◆ Register() [3/3]

TClonesArray * FairRootManager::Register ( TString  branchName,
TString  className,
TString  folderName,
Bool_t  toFile 
)

Definition at line 253 of file FairRootManager.cxx.

◆ RegisterAny() [1/2]

template<typename T >
void FairRootManager::RegisterAny ( const char *  brname,
T *&  obj,
bool  persistence 
)

Definition at line 465 of file FairRootManager.h.

◆ RegisterAny() [2/2]

template<typename T >
void FairRootManager::RegisterAny ( const char *  name,
T *&  obj,
Bool_t  toFile 
)

create a new branch based on an arbitrary type T (for which a dictionary must exist)

◆ RegisterInputObject()

void FairRootManager::RegisterInputObject ( const char *  name,
TObject *  obj 
)

Definition at line 247 of file FairRootManager.cxx.

◆ RegisterTSBuffer()

void FairRootManager::RegisterTSBuffer ( TString  branchName,
FairTSBufferFunctional *  functionalBuffer 
)
inline

Definition at line 130 of file FairRootManager.h.

◆ RegisterWriteoutBuffer()

FairWriteoutBuffer * FairRootManager::RegisterWriteoutBuffer ( TString  branchName,
FairWriteoutBuffer *  buffer 
)

Register a new FairWriteoutBuffer to the map. If a Buffer with the same map key already exists the given buffer will be deleted and the old will be returned!

Definition at line 909 of file FairRootManager.cxx.

◆ RunWithTimeStamps()

void FairRootManager::RunWithTimeStamps ( )
inline

Use time stamps to read data and not tree entries

Definition at line 185 of file FairRootManager.h.

◆ SetBranchNameList()

void FairRootManager::SetBranchNameList ( TList *  list)

Set the branch name list

Definition at line 731 of file FairRootManager.cxx.

◆ SetEntryNr()

void FairRootManager::SetEntryNr ( Int_t  val)
inline

Definition at line 220 of file FairRootManager.h.

◆ SetFinishRun()

void FairRootManager::SetFinishRun ( Bool_t  val = kTRUE)
inline

Definition at line 266 of file FairRootManager.h.

◆ SetFolderName()

static void FairRootManager::SetFolderName ( const std::string &  tname)
inlinestatic

Definition at line 270 of file FairRootManager.h.

◆ SetInChain()

void FairRootManager::SetInChain ( TChain *  tempChain,
Int_t  ident = -1 
)

Definition at line 743 of file FairRootManager.cxx.

◆ SetLastFill()

void FairRootManager::SetLastFill ( Bool_t  val = kTRUE)
inline

Enables a last Fill command after all events are processed to store any data which is still in Buffers

Definition at line 199 of file FairRootManager.h.

◆ SetListOfFolders()

void FairRootManager::SetListOfFolders ( TObjArray *  ta)
inline

Definition at line 242 of file FairRootManager.h.

◆ SetSink()

void FairRootManager::SetSink ( FairSink *  tempSink)
inline

Definition at line 238 of file FairRootManager.h.

◆ SetSource()

void FairRootManager::SetSource ( FairSource *  tempSource)
inline
Parameters
Status: if true all inputs are mixed, i.e: each read event will take one entry from each input and put them in one big event and send it to the next step These methods have been moved to the FairFileSource

Definition at line 234 of file FairRootManager.h.

◆ SetTimeBasedBranchNameList()

void FairRootManager::SetTimeBasedBranchNameList ( TList *  list)

Replace the time based branch name list

Replace the list

Definition at line 933 of file FairRootManager.cxx.

◆ SetTreeName()

static void FairRootManager::SetTreeName ( const std::string &  tname)
inlinestatic

Definition at line 269 of file FairRootManager.h.

◆ SetUseFairLinks()

void FairRootManager::SetUseFairLinks ( Bool_t  val)
inline

Definition at line 222 of file FairRootManager.h.

◆ SpecifyRunId()

Bool_t FairRootManager::SpecifyRunId ( )

Read one event from source to find out which RunId to use

Definition at line 433 of file FairRootManager.cxx.

◆ StoreAllWriteoutBufferData()

void FairRootManager::StoreAllWriteoutBufferData ( )

Definition at line 962 of file FairRootManager.cxx.

◆ StoreWriteoutBufferData()

void FairRootManager::StoreWriteoutBufferData ( Double_t  eventTime)

Definition at line 955 of file FairRootManager.cxx.

◆ TerminateAllTSBuffer()

void FairRootManager::TerminateAllTSBuffer ( )

Definition at line 358 of file FairRootManager.cxx.

◆ TerminateTSBuffer()

void FairRootManager::TerminateTSBuffer ( TString  branchName)

Definition at line 351 of file FairRootManager.cxx.

◆ UpdateBranches()

void FairRootManager::UpdateBranches ( )

Update the list of Memory branches from the source used

Definition at line 753 of file FairRootManager.cxx.

◆ UpdateFileName()

void FairRootManager::UpdateFileName ( TString &  fileName)

Definition at line 1052 of file FairRootManager.cxx.

◆ UpdateListOfTimebasedBranches()

void FairRootManager::UpdateListOfTimebasedBranches ( )

Update the list of time based branches in the output file

Add branches that are time based to the proper list

Definition at line 921 of file FairRootManager.cxx.

◆ Write()

Int_t FairRootManager::Write ( const char *  name = 0,
Int_t  option = 0,
Int_t  bufsize = 0 
)

When creating TTree from TFolder the fullpath of the objects is used as branch names this method truncate the full path from the branch names

Writes the tree in the file.

Definition at line 390 of file FairRootManager.cxx.

◆ WriteFileHeader()

void FairRootManager::WriteFileHeader ( FairFileHeader *  f)

Write the file header object to the output file

Definition at line 896 of file FairRootManager.cxx.

◆ WriteFolder()

void FairRootManager::WriteFolder ( )

Write the folder structure used to create the tree to the output file

Definition at line 425 of file FairRootManager.cxx.

◆ WriteGeometry()

void FairRootManager::WriteGeometry ( )

Write the current TGeoManager to file

Writes the geometry in the current output file.

Definition at line 402 of file FairRootManager.cxx.


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