FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairWriteoutBuffer Class Referenceabstract

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

#include <FairWriteoutBuffer.h>

Inheritance diagram for FairWriteoutBuffer:
FairEventBuilder FairTestDetectorDigiWriteoutBuffer MyWriteoutBuffer

Public Member Functions

 FairWriteoutBuffer ()
 
 FairWriteoutBuffer (TString branchName, TString className, TString folderName, Bool_t persistance)
 
virtual ~FairWriteoutBuffer ()
 
virtual void SaveDataToTree (Bool_t val=kTRUE)
 
virtual void ActivateBuffering (Bool_t val=kTRUE)
 
Bool_t IsBufferingActivated ()
 
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
 
virtual double FindTimeForData (FairTimeStamp *data)=0
 
virtual void FillDataMap (FairTimeStamp *data, double activeTime)=0
 add a new element in the search buffer More...
 
virtual void EraseDataFromDataMap (FairTimeStamp *data)=0
 delete the element from the search buffer (see PndSdsDigiPixelWriteoutBuffer) More...
 
virtual std::vector< std::pair
< double, FairTimeStamp * > > 
Modify (std::pair< double, FairTimeStamp * > oldData, std::pair< double, FairTimeStamp * >)
 
virtual void WriteOutDataDeadTimeMap (double time)
 
virtual void MoveDataFromStartTimeMapToDeadTimeMap (double time)
 
virtual void FillDataToDeadTimeMap (FairTimeStamp *data, double activeTime, double startTime)
 
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. More...
 
virtual void PrintStartTimeMap ()
 

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 48 of file FairWriteoutBuffer.h.

Constructor & Destructor Documentation

FairWriteoutBuffer::FairWriteoutBuffer ( )
inline

Definition at line 51 of file FairWriteoutBuffer.h.

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

Definition at line 23 of file FairWriteoutBuffer.cxx.

virtual FairWriteoutBuffer::~FairWriteoutBuffer ( )
inlinevirtual

Definition at line 62 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 69 of file FairWriteoutBuffer.h.

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)

Implemented in FairTestDetectorDigiWriteoutBuffer, and MyWriteoutBuffer.

virtual void FairWriteoutBuffer::DeleteOldData ( )
inlinevirtual

Definition at line 88 of file FairWriteoutBuffer.h.

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

delete the element from the search buffer (see PndSdsDigiPixelWriteoutBuffer)

Implemented in FairTestDetectorDigiWriteoutBuffer, and MyWriteoutBuffer.

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

add a new element in the search buffer

Implemented in FairTestDetectorDigiWriteoutBuffer, and MyWriteoutBuffer.

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

Definition at line 160 of file FairWriteoutBuffer.cxx.

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 144 of file FairWriteoutBuffer.cxx.

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

Implemented in FairTestDetectorDigiWriteoutBuffer, and MyWriteoutBuffer.

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

Definition at line 139 of file FairWriteoutBuffer.cxx.

virtual Int_t FairWriteoutBuffer::GetNData ( )
inlinevirtual

Definition at line 82 of file FairWriteoutBuffer.h.

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

Definition at line 124 of file FairWriteoutBuffer.cxx.

Bool_t FairWriteoutBuffer::IsBufferingActivated ( )
inline

Definition at line 75 of file FairWriteoutBuffer.h.

virtual std::vector<std::pair<double, FairTimeStamp*> > FairWriteoutBuffer::Modify ( std::pair< double, FairTimeStamp * >  oldData,
std::pair< double, FairTimeStamp * >   
)
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 113 of file FairWriteoutBuffer.h.

void FairWriteoutBuffer::MoveDataFromStartTimeMapToDeadTimeMap ( double  time)
protectedvirtual

Definition at line 246 of file FairWriteoutBuffer.cxx.

virtual void FairWriteoutBuffer::PrintData ( FairTimeStamp data)
inlineprotectedvirtual

Definition at line 125 of file FairWriteoutBuffer.h.

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 270 of file FairWriteoutBuffer.cxx.

void FairWriteoutBuffer::PrintStartTimeMap ( )
protectedvirtual

Definition at line 259 of file FairWriteoutBuffer.cxx.

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 64 of file FairWriteoutBuffer.h.

virtual void FairWriteoutBuffer::SetVerbose ( Int_t  val)
inlinevirtual

Definition at line 86 of file FairWriteoutBuffer.h.

void FairWriteoutBuffer::WriteOutAllData ( )
virtual

Definition at line 104 of file FairWriteoutBuffer.cxx.

void FairWriteoutBuffer::WriteOutData ( double  time)
virtual

Definition at line 42 of file FairWriteoutBuffer.cxx.

void FairWriteoutBuffer::WriteOutDataDeadTimeMap ( double  time)
protectedvirtual

Definition at line 71 of file FairWriteoutBuffer.cxx.

Member Data Documentation

Bool_t FairWriteoutBuffer::fActivateBuffering
protected

Definition at line 138 of file FairWriteoutBuffer.h.

TString FairWriteoutBuffer::fBranchName
protected

Definition at line 135 of file FairWriteoutBuffer.h.

TString FairWriteoutBuffer::fClassName
protected

Definition at line 136 of file FairWriteoutBuffer.h.

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

Definition at line 133 of file FairWriteoutBuffer.h.

FairLogger* FairWriteoutBuffer::fLogger
protected

Definition at line 140 of file FairWriteoutBuffer.h.

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

Definition at line 132 of file FairWriteoutBuffer.h.

Bool_t FairWriteoutBuffer::fTreeSave
protected

Definition at line 137 of file FairWriteoutBuffer.h.

Int_t FairWriteoutBuffer::fVerbose
protected

Definition at line 139 of file FairWriteoutBuffer.h.


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