EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairTSBufferFunctional Class Reference

A class to access time ordered data in a root branch. More...

#include <EicRoot/blob/master/base/FairTSBufferFunctional.h>

+ Inheritance diagram for FairTSBufferFunctional:
+ Collaboration diagram for FairTSBufferFunctional:

Public Member Functions

 FairTSBufferFunctional (TString branchName, TTree *sourceTree, BinaryFunctor *stopFunction, BinaryFunctor *startFunction=0)
 
virtual ~FairTSBufferFunctional ()
 
TClonesArray * GetData (Double_t stopParameter)
 
TClonesArray * GetData (Double_t startParameter, Double_t stopParameter)
 
Int_t GetBranchIndex ()
 
void SetStartFunction (BinaryFunctor *function)
 
void SetStopFunction (BinaryFunctor *function)
 
Bool_t AllDataProcessed ()
 
Bool_t TimeOut ()
 
Int_t FindStartIndex (Double_t startParameter)
 

Private Member Functions

void ReadInNextFilledEntry ()
 
Int_t ReadInPreviousFilledEntry (Int_t startEntry)
 
void ReadInNextEntry ()
 
void ReadInEntry (Int_t number)
 
void AbsorbDataBufferArray ()
 
 FairTSBufferFunctional (const FairTSBufferFunctional &)
 
FairTSBufferFunctionaloperator= (const FairTSBufferFunctional &)
 
 ClassDef (FairTSBufferFunctional, 0)
 

Private Attributes

TClonesArray * fOutputArray
 
TClonesArray * fBufferArray
 
TClonesArray * fInputArray
 
BinaryFunctorfStartFunction
 
BinaryFunctorfStopFunction
 
TBranch * fBranch
 
Int_t fBranchIndex
 
Int_t fStartIndex
 
Int_t fVerbose
 

Detailed Description

A class to access time ordered data in a root branch.

In the constructor of the class one has to give the branch name of the data, the tree the data is stored in and a BinaryFunctor which contains the method how the data should be extracted. Several example functors already exists. To extract the data one has to call GetData with a parameter which fits to the selected functor. GetData returns a TClonesArray which contains the data.

Be careful! The buffer runs through the time ordered data in one time direction only. This means that you cannot request data which is older than the data you have requested before.

Addition: This is not true anymore. GetData(Double_t, Double_t) is able to get also data which is older but this only works if you request a fixed time via StopTime functor. For other functors the behavior is unpredictable.

Created on: Feb 18, 201 Author: stockman

Definition at line 140 of file FairTSBufferFunctional.h.

View newest version in sPHENIX GitHub at line 140 of file FairTSBufferFunctional.h

Constructor & Destructor Documentation

FairTSBufferFunctional::FairTSBufferFunctional ( TString  branchName,
TTree *  sourceTree,
BinaryFunctor stopFunction,
BinaryFunctor startFunction = 0 
)

Definition at line 9 of file FairTSBufferFunctional.cxx.

View newest version in sPHENIX GitHub at line 9 of file FairTSBufferFunctional.cxx

References fBranch, fBufferArray, fInputArray, fOutputArray, FairRootManager::GetObject(), and FairRootManager::Instance().

+ Here is the call graph for this function:

virtual FairTSBufferFunctional::~FairTSBufferFunctional ( )
inlinevirtual

Definition at line 146 of file FairTSBufferFunctional.h.

View newest version in sPHENIX GitHub at line 146 of file FairTSBufferFunctional.h

FairTSBufferFunctional::FairTSBufferFunctional ( const FairTSBufferFunctional )
private

Member Function Documentation

void FairTSBufferFunctional::AbsorbDataBufferArray ( )
private

Definition at line 218 of file FairTSBufferFunctional.cxx.

View newest version in sPHENIX GitHub at line 218 of file FairTSBufferFunctional.cxx

References fBufferArray, fInputArray, and fVerbose.

Referenced by GetData().

+ Here is the caller graph for this function:

Bool_t FairTSBufferFunctional::AllDataProcessed ( )

Definition at line 252 of file FairTSBufferFunctional.cxx.

View newest version in sPHENIX GitHub at line 252 of file FairTSBufferFunctional.cxx

References fBranch, fBranchIndex, fBufferArray, and fOutputArray.

FairTSBufferFunctional::ClassDef ( FairTSBufferFunctional  ,
 
)
private
Int_t FairTSBufferFunctional::FindStartIndex ( Double_t  startParameter)

Definition at line 130 of file FairTSBufferFunctional.cxx.

View newest version in sPHENIX GitHub at line 130 of file FairTSBufferFunctional.cxx

References fBranchIndex, fInputArray, fStartFunction, ReadInEntry(), ReadInNextFilledEntry(), and ReadInPreviousFilledEntry().

Referenced by GetData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Int_t FairTSBufferFunctional::GetBranchIndex ( )
inline

Definition at line 149 of file FairTSBufferFunctional.h.

View newest version in sPHENIX GitHub at line 149 of file FairTSBufferFunctional.h

References fBranchIndex.

Referenced by GetData().

+ Here is the caller graph for this function:

TClonesArray * FairTSBufferFunctional::GetData ( Double_t  stopParameter)

Definition at line 32 of file FairTSBufferFunctional.cxx.

View newest version in sPHENIX GitHub at line 32 of file FairTSBufferFunctional.cxx

References AbsorbDataBufferArray(), fBranch, fBranchIndex, fBufferArray, fInputArray, fOutputArray, fStopFunction, fVerbose, FairTimeStamp::GetTimeStamp(), ReadInNextEntry(), and ReadInNextFilledEntry().

Referenced by GetData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TClonesArray * FairTSBufferFunctional::GetData ( Double_t  startParameter,
Double_t  stopParameter 
)

Definition at line 116 of file FairTSBufferFunctional.cxx.

View newest version in sPHENIX GitHub at line 116 of file FairTSBufferFunctional.cxx

References fBranchIndex, fBufferArray, FindStartIndex(), fInputArray, fStartFunction, GetBranchIndex(), GetData(), and ReadInEntry().

+ Here is the call graph for this function:

FairTSBufferFunctional& FairTSBufferFunctional::operator= ( const FairTSBufferFunctional )
private
void FairTSBufferFunctional::ReadInEntry ( Int_t  number)
private

Definition at line 236 of file FairTSBufferFunctional.cxx.

View newest version in sPHENIX GitHub at line 236 of file FairTSBufferFunctional.cxx

References fBranch, fInputArray, fVerbose, and FairRootManager::Instance().

Referenced by FindStartIndex(), GetData(), ReadInNextEntry(), ReadInNextFilledEntry(), and ReadInPreviousFilledEntry().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairTSBufferFunctional::ReadInNextEntry ( )
private

Definition at line 228 of file FairTSBufferFunctional.cxx.

View newest version in sPHENIX GitHub at line 228 of file FairTSBufferFunctional.cxx

References fBranch, fBranchIndex, and ReadInEntry().

Referenced by GetData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairTSBufferFunctional::ReadInNextFilledEntry ( )
private

Definition at line 193 of file FairTSBufferFunctional.cxx.

View newest version in sPHENIX GitHub at line 193 of file FairTSBufferFunctional.cxx

References fBranch, fBranchIndex, fInputArray, fVerbose, and ReadInEntry().

Referenced by FindStartIndex(), and GetData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Int_t FairTSBufferFunctional::ReadInPreviousFilledEntry ( Int_t  startEntry)
private

Definition at line 206 of file FairTSBufferFunctional.cxx.

View newest version in sPHENIX GitHub at line 206 of file FairTSBufferFunctional.cxx

References fInputArray, and ReadInEntry().

Referenced by FindStartIndex().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairTSBufferFunctional::SetStartFunction ( BinaryFunctor function)
inline

Definition at line 150 of file FairTSBufferFunctional.h.

View newest version in sPHENIX GitHub at line 150 of file FairTSBufferFunctional.h

References fStartFunction.

void FairTSBufferFunctional::SetStopFunction ( BinaryFunctor function)
inline

Definition at line 151 of file FairTSBufferFunctional.h.

View newest version in sPHENIX GitHub at line 151 of file FairTSBufferFunctional.h

References fStopFunction.

Bool_t FairTSBufferFunctional::TimeOut ( )
inline

Definition at line 154 of file FairTSBufferFunctional.h.

View newest version in sPHENIX GitHub at line 154 of file FairTSBufferFunctional.h

References fStartFunction, fStopFunction, and BinaryFunctor::TimeOut().

+ Here is the call graph for this function:

Member Data Documentation

TBranch* FairTSBufferFunctional::fBranch
private

Definition at line 186 of file FairTSBufferFunctional.h.

View newest version in sPHENIX GitHub at line 186 of file FairTSBufferFunctional.h

Referenced by AllDataProcessed(), FairTSBufferFunctional(), GetData(), ReadInEntry(), ReadInNextEntry(), and ReadInNextFilledEntry().

Int_t FairTSBufferFunctional::fBranchIndex
private

Definition at line 187 of file FairTSBufferFunctional.h.

View newest version in sPHENIX GitHub at line 187 of file FairTSBufferFunctional.h

Referenced by AllDataProcessed(), FindStartIndex(), GetBranchIndex(), GetData(), ReadInNextEntry(), and ReadInNextFilledEntry().

TClonesArray* FairTSBufferFunctional::fBufferArray
private

Definition at line 180 of file FairTSBufferFunctional.h.

View newest version in sPHENIX GitHub at line 180 of file FairTSBufferFunctional.h

Referenced by AbsorbDataBufferArray(), AllDataProcessed(), FairTSBufferFunctional(), and GetData().

TClonesArray* FairTSBufferFunctional::fInputArray
private
TClonesArray* FairTSBufferFunctional::fOutputArray
private

Definition at line 179 of file FairTSBufferFunctional.h.

View newest version in sPHENIX GitHub at line 179 of file FairTSBufferFunctional.h

Referenced by AllDataProcessed(), FairTSBufferFunctional(), and GetData().

BinaryFunctor* FairTSBufferFunctional::fStartFunction
private

Definition at line 183 of file FairTSBufferFunctional.h.

View newest version in sPHENIX GitHub at line 183 of file FairTSBufferFunctional.h

Referenced by FindStartIndex(), GetData(), SetStartFunction(), and TimeOut().

Int_t FairTSBufferFunctional::fStartIndex
private

Definition at line 188 of file FairTSBufferFunctional.h.

View newest version in sPHENIX GitHub at line 188 of file FairTSBufferFunctional.h

BinaryFunctor* FairTSBufferFunctional::fStopFunction
private

Definition at line 184 of file FairTSBufferFunctional.h.

View newest version in sPHENIX GitHub at line 184 of file FairTSBufferFunctional.h

Referenced by GetData(), SetStopFunction(), and TimeOut().

Int_t FairTSBufferFunctional::fVerbose
private

Definition at line 190 of file FairTSBufferFunctional.h.

View newest version in sPHENIX GitHub at line 190 of file FairTSBufferFunctional.h

Referenced by AbsorbDataBufferArray(), GetData(), ReadInEntry(), and ReadInNextFilledEntry().


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