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

A container class to store digi data during events. More...

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

+ Inheritance diagram for FairWriteoutBuffer:
+ Collaboration diagram for FairWriteoutBuffer:

Public Member Functions

 FairWriteoutBuffer ()
 
 FairWriteoutBuffer (TString branchName, TString className, TString folderName, Bool_t persistance)
 
virtual ~FairWriteoutBuffer ()
 
virtual void SaveDataToTree (Bool_t val=kTRUE)
 If SaveDataToTree is set the data is stored at the end of the buffering into the given TClonesArray.
 
virtual void ActivateBuffering (Bool_t val=kTRUE)
 fActivateBuffering has to be set to kTRUE to use the buffering. Otherwise the data is directly stored in the given TClonesArray.
 
virtual void FillNewData (FairTimeStamp *data, double startTime, double activeTime)
 
virtual Int_t GetNData ()
 
virtual std::vector
< FairTimeStamp * > 
GetRemoveOldData (double time)
 
virtual std::vector
< FairTimeStamp * > 
GetAllData ()
 
virtual void SetVerbose (Int_t val)
 
virtual void DeleteOldData ()
 
virtual void WriteOutData (double time)
 
virtual void WriteOutAllData ()
 

Protected Member Functions

virtual void AddNewDataToTClonesArray (FairTimeStamp *data)=0
 store the data from the FairTimeStamp pointer in a TClonesArray (you have to cast it to your type of data)
 
virtual double FindTimeForData (FairTimeStamp *data)=0
 if the same data object (like a pad or a pixel) is already present in the buffer, the time of this object has to be returned otherwise -1
 
virtual void FillDataMap (FairTimeStamp *data, double activeTime)=0
 add a new element in the search buffer
 
virtual void EraseDataFromDataMap (FairTimeStamp *data)=0
 delete the element from the search buffer (see PndSdsDigiPixelWriteoutBuffer)
 
virtual std::vector< std::pair
< double, FairTimeStamp * > > 
Modify (std::pair< double, FairTimeStamp * > oldData, std::pair< double, FairTimeStamp * > newData)
 
virtual void WriteOutDataDeadTimeMap (double time)
 
virtual void MoveDataFromStartTimeMapToDeadTimeMap (double time)
 
virtual void FillDataToDeadTimeMap (FairTimeStamp *data, double activeTime)
 
virtual void PrintData (FairTimeStamp *data)
 
virtual void PrintDeadTimeMap ()
 Method should be overwritten in derived classes to print the data of an object stored in the buffer.
 
virtual void PrintStartTimeMap ()
 
 ClassDef (FairWriteoutBuffer, 1)
 /// FairLogger
 

Protected Attributes

std::multimap< double,
std::pair< double,
FairTimeStamp * > > 
fStartTime_map
 
std::multimap< double,
FairTimeStamp * > 
fDeadTime_map
 
TString fBranchName
 
TString fClassName
 
Bool_t fTreeSave
 
Bool_t fActivateBuffering
 
Int_t fVerbose
 
FairLoggerfLogger
 

Detailed Description

A container class to store digi data during events.

Author
Tobias Stockmanns The FairWriteoutBuffer class provides a container which handles the storage of data between events. The data has to be given with an active time, the absolute time the data is active in the detector and can influence the output of the data. FillNewData is used to put new data into the container. WriteOutData with a given actual time stores the data which has an active time older than the given time in the corresponding TClonesArray of the FairRootManager. At the end of the task WriteOutAllData has to be called to store the data which is still in the buffer. If one adds data via FillNewData into the buffer which is already present in the buffer, Modify is called. The standard behavior of Modify is that the new data is ignored to simulate pile-up. If a different behavior is wanted one has to overwrite Modify in a derived class.

The data which should be stored in the buffer has to be derived from FairTimeStamp. It needs an operator< and a method equal if the same detector element is hit.

To use this buffer one has to derive his own buffer class from FairWriteoutBuffer and overwrite the pure virtual functions.

Definition at line 37 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 37 of file FairWriteoutBuffer.h

Constructor & Destructor Documentation

FairWriteoutBuffer::FairWriteoutBuffer ( )
inline

Definition at line 40 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 40 of file FairWriteoutBuffer.h

FairWriteoutBuffer::FairWriteoutBuffer ( TString  branchName,
TString  className,
TString  folderName,
Bool_t  persistance 
)

Definition at line 15 of file FairWriteoutBuffer.cxx.

View newest version in sPHENIX GitHub at line 15 of file FairWriteoutBuffer.cxx

References fBranchName, fClassName, fTreeSave, FairRootManager::Instance(), and FairRootManager::Register().

+ Here is the call graph for this function:

virtual FairWriteoutBuffer::~FairWriteoutBuffer ( )
inlinevirtual

Definition at line 43 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 43 of file FairWriteoutBuffer.h

Member Function Documentation

virtual void FairWriteoutBuffer::ActivateBuffering ( Bool_t  val = kTRUE)
inlinevirtual

fActivateBuffering has to be set to kTRUE to use the buffering. Otherwise the data is directly stored in the given TClonesArray.

Definition at line 46 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 46 of file FairWriteoutBuffer.h

References fActivateBuffering.

virtual void FairWriteoutBuffer::AddNewDataToTClonesArray ( FairTimeStamp data)
protectedpure virtual

store the data from the FairTimeStamp pointer in a TClonesArray (you have to cast it to your type of data)

Referenced by FillDataToDeadTimeMap(), FillNewData(), and WriteOutDataDeadTimeMap().

+ Here is the caller graph for this function:

FairWriteoutBuffer::ClassDef ( FairWriteoutBuffer  ,
 
)
protected
virtual void FairWriteoutBuffer::DeleteOldData ( )
inlinevirtual

Definition at line 59 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 59 of file FairWriteoutBuffer.h

References fBranchName, FairRootManager::GetTClonesArray(), and FairRootManager::Instance().

+ Here is the call graph for this function:

virtual void FairWriteoutBuffer::EraseDataFromDataMap ( FairTimeStamp data)
protectedpure virtual

delete the element from the search buffer (see PndSdsDigiPixelWriteoutBuffer)

Referenced by FillDataToDeadTimeMap(), and GetRemoveOldData().

+ Here is the caller graph for this function:

virtual void FairWriteoutBuffer::FillDataMap ( FairTimeStamp data,
double  activeTime 
)
protectedpure virtual

add a new element in the search buffer

Referenced by FillDataToDeadTimeMap().

+ Here is the caller graph for this function:

void FairWriteoutBuffer::FillDataToDeadTimeMap ( FairTimeStamp data,
double  activeTime 
)
protectedvirtual

Definition at line 159 of file FairWriteoutBuffer.cxx.

View newest version in sPHENIX GitHub at line 159 of file FairWriteoutBuffer.cxx

References AddNewDataToTClonesArray(), data, FairTimeStamp::equal(), EraseDataFromDataMap(), fActivateBuffering, fDeadTime_map, FillDataMap(), FindTimeForData(), fVerbose, it, Modify(), and FairTimeStamp::Print().

Referenced by MoveDataFromStartTimeMapToDeadTimeMap().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairWriteoutBuffer::FillNewData ( FairTimeStamp data,
double  startTime,
double  activeTime 
)
virtual

Fills a pointer to a data object into the buffer. StartTime gives the time when the data can influence later data, activeTime gives the time how long the data can influence later data. Both time data has to be given as an absolute time!

Definition at line 141 of file FairWriteoutBuffer.cxx.

View newest version in sPHENIX GitHub at line 141 of file FairWriteoutBuffer.cxx

References AddNewDataToTClonesArray(), fActivateBuffering, fStartTime_map, and fVerbose.

+ Here is the call graph for this function:

virtual double FairWriteoutBuffer::FindTimeForData ( FairTimeStamp data)
protectedpure virtual

if the same data object (like a pad or a pixel) is already present in the buffer, the time of this object has to be returned otherwise -1

Referenced by FillDataToDeadTimeMap().

+ Here is the caller graph for this function:

std::vector< FairTimeStamp * > FairWriteoutBuffer::GetAllData ( )
virtual

Definition at line 136 of file FairWriteoutBuffer.cxx.

View newest version in sPHENIX GitHub at line 136 of file FairWriteoutBuffer.cxx

References fDeadTime_map, and GetRemoveOldData().

+ Here is the call graph for this function:

virtual Int_t FairWriteoutBuffer::GetNData ( )
inlinevirtual

Definition at line 52 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 52 of file FairWriteoutBuffer.h

References fDeadTime_map.

std::vector< FairTimeStamp * > FairWriteoutBuffer::GetRemoveOldData ( double  time)
virtual

Definition at line 120 of file FairWriteoutBuffer.cxx.

View newest version in sPHENIX GitHub at line 120 of file FairWriteoutBuffer.cxx

References EraseDataFromDataMap(), fDeadTime_map, fVerbose, and it.

Referenced by GetAllData(), and WriteOutDataDeadTimeMap().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual std::vector<std::pair<double, FairTimeStamp*> > FairWriteoutBuffer::Modify ( std::pair< double, FairTimeStamp * >  oldData,
std::pair< double, FairTimeStamp * >  newData 
)
inlineprotectedvirtual

Modify defines the behavior of the buffer if data should be stored which is already in the buffer. Parameters are the old data with the active time, the new data with an active time. Modify returns than a vector with the new data which should be stored.

Definition at line 76 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 76 of file FairWriteoutBuffer.h

Referenced by FillDataToDeadTimeMap().

+ Here is the caller graph for this function:

void FairWriteoutBuffer::MoveDataFromStartTimeMapToDeadTimeMap ( double  time)
protectedvirtual

Definition at line 226 of file FairWriteoutBuffer.cxx.

View newest version in sPHENIX GitHub at line 226 of file FairWriteoutBuffer.cxx

References data, FillDataToDeadTimeMap(), and fStartTime_map.

Referenced by WriteOutAllData(), and WriteOutData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void FairWriteoutBuffer::PrintData ( FairTimeStamp data)
inlineprotectedvirtual

Definition at line 87 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 87 of file FairWriteoutBuffer.h

References FairTimeStamp::GetTimeStamp().

Referenced by PrintDeadTimeMap().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairWriteoutBuffer::PrintDeadTimeMap ( )
protectedvirtual

Method should be overwritten in derived classes to print the data of an object stored in the buffer.

Definition at line 250 of file FairWriteoutBuffer.cxx.

View newest version in sPHENIX GitHub at line 250 of file FairWriteoutBuffer.cxx

References fDeadTime_map, it, and PrintData().

Referenced by WriteOutData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairWriteoutBuffer::PrintStartTimeMap ( )
protectedvirtual

Definition at line 239 of file FairWriteoutBuffer.cxx.

View newest version in sPHENIX GitHub at line 239 of file FairWriteoutBuffer.cxx

References data, fStartTime_map, and FairTimeStamp::GetTimeStamp().

Referenced by WriteOutData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void FairWriteoutBuffer::SaveDataToTree ( Bool_t  val = kTRUE)
inlinevirtual

If SaveDataToTree is set the data is stored at the end of the buffering into the given TClonesArray.

Definition at line 45 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 45 of file FairWriteoutBuffer.h

References fTreeSave.

virtual void FairWriteoutBuffer::SetVerbose ( Int_t  val)
inlinevirtual

Definition at line 57 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 57 of file FairWriteoutBuffer.h

References fVerbose.

void FairWriteoutBuffer::WriteOutAllData ( )
virtual

Definition at line 99 of file FairWriteoutBuffer.cxx.

View newest version in sPHENIX GitHub at line 99 of file FairWriteoutBuffer.cxx

References fDeadTime_map, fStartTime_map, MoveDataFromStartTimeMapToDeadTimeMap(), and WriteOutData().

+ Here is the call graph for this function:

void FairWriteoutBuffer::WriteOutData ( double  time)
virtual

Definition at line 35 of file FairWriteoutBuffer.cxx.

View newest version in sPHENIX GitHub at line 35 of file FairWriteoutBuffer.cxx

References fActivateBuffering, fBranchName, fVerbose, FairRootManager::GetTClonesArray(), FairRootManager::Instance(), MoveDataFromStartTimeMapToDeadTimeMap(), PrintDeadTimeMap(), PrintStartTimeMap(), and WriteOutDataDeadTimeMap().

Referenced by WriteOutAllData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairWriteoutBuffer::WriteOutDataDeadTimeMap ( double  time)
protectedvirtual

Definition at line 66 of file FairWriteoutBuffer.cxx.

View newest version in sPHENIX GitHub at line 66 of file FairWriteoutBuffer.cxx

References AddNewDataToTClonesArray(), data, fActivateBuffering, fBranchName, fTreeSave, fVerbose, GetRemoveOldData(), FairRootManager::GetTClonesArray(), and FairRootManager::Instance().

Referenced by WriteOutData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

Bool_t FairWriteoutBuffer::fActivateBuffering
protected

Definition at line 97 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 97 of file FairWriteoutBuffer.h

Referenced by ActivateBuffering(), FillDataToDeadTimeMap(), FillNewData(), WriteOutData(), and WriteOutDataDeadTimeMap().

TString FairWriteoutBuffer::fBranchName
protected

Definition at line 94 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 94 of file FairWriteoutBuffer.h

Referenced by DeleteOldData(), FairWriteoutBuffer(), WriteOutData(), and WriteOutDataDeadTimeMap().

TString FairWriteoutBuffer::fClassName
protected

Definition at line 95 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 95 of file FairWriteoutBuffer.h

Referenced by FairWriteoutBuffer().

std::multimap<double, FairTimeStamp*> FairWriteoutBuffer::fDeadTime_map
protected

Definition at line 92 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 92 of file FairWriteoutBuffer.h

Referenced by FillDataToDeadTimeMap(), GetAllData(), GetNData(), GetRemoveOldData(), PrintDeadTimeMap(), and WriteOutAllData().

FairLogger* FairWriteoutBuffer::fLogger
protected

Definition at line 99 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 99 of file FairWriteoutBuffer.h

std::multimap<double, std::pair<double, FairTimeStamp*> > FairWriteoutBuffer::fStartTime_map
protected

Definition at line 91 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 91 of file FairWriteoutBuffer.h

Referenced by FillNewData(), MoveDataFromStartTimeMapToDeadTimeMap(), PrintStartTimeMap(), and WriteOutAllData().

Bool_t FairWriteoutBuffer::fTreeSave
protected

Definition at line 96 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 96 of file FairWriteoutBuffer.h

Referenced by FairWriteoutBuffer(), SaveDataToTree(), and WriteOutDataDeadTimeMap().

Int_t FairWriteoutBuffer::fVerbose
protected

Definition at line 98 of file FairWriteoutBuffer.h.

View newest version in sPHENIX GitHub at line 98 of file FairWriteoutBuffer.h

Referenced by FillDataToDeadTimeMap(), FillNewData(), GetRemoveOldData(), SetVerbose(), WriteOutData(), and WriteOutDataDeadTimeMap().


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