CbmRoot
CbmMuchReadoutBuffer Class Reference

#include <CbmMuchReadoutBuffer.h>

Inheritance diagram for CbmMuchReadoutBuffer:
[legend]
Collaboration diagram for CbmMuchReadoutBuffer:
[legend]

Public Member Functions

 CbmMuchReadoutBuffer ()
 
 CbmMuchReadoutBuffer (TString branchName, TString folderName, Bool_t persistence=kTRUE)
 
 CbmMuchReadoutBuffer (const CbmMuchReadoutBuffer &)=delete
 
CbmMuchReadoutBufferoperator= (const CbmMuchReadoutBuffer &)=delete
 
virtual Int_t Merge (CbmMuchSignal *, CbmMuchSignal *, std::vector< CbmMuchSignal * > &)
 
 ~CbmMuchReadoutBuffer ()
 
virtual void AddNewDataToTClonesArray (FairTimeStamp *)
 
Bool_t CheckData (CbmMuchSignal *data)
 
Bool_t CheckInterference (CbmMuchSignal *data1, CbmMuchSignal *data2)
 
virtual void DeleteOldData ()
 
virtual void EraseDataFromDataMap (FairTimeStamp *)
 
void Fill (UInt_t address, CbmMuchSignal *data)
 
virtual void FillDataMap (FairTimeStamp *, double)
 
virtual double FindTimeForData (FairTimeStamp *)
 
virtual Int_t GetNData ()
 
virtual void WriteOutAllData ()
 
Int_t ReadOutData (Double_t time, std::vector< CbmMuchSignal * > &dataList)
 
virtual void WriteOutData (Double_t time)
 

Static Public Member Functions

static CbmMuchReadoutBufferInstance ()
 

Protected Attributes

std::multimap< UInt_t, CbmMuchSignal * > fBuffer
 
std::multimap< UInt_t, CbmMuchSignal * >::iterator fBufferIt
 
std::multimap< UInt_t, CbmMuchSignal * >::iterator fOldIt
 
TClonesArray * fArray
 
Bool_t fWriteToArray
 

Private Member Functions

 ClassDef (CbmMuchReadoutBuffer, 1)
 

Private Attributes

Int_t fCounter
 

Static Private Attributes

static CbmMuchReadoutBufferfgInstance = NULL
 

Detailed Description

Definition at line 23 of file CbmMuchReadoutBuffer.h.

Constructor & Destructor Documentation

◆ CbmMuchReadoutBuffer() [1/3]

CbmMuchReadoutBuffer::CbmMuchReadoutBuffer ( )
inline

Definition at line 27 of file CbmMuchReadoutBuffer.h.

Referenced by Instance().

◆ CbmMuchReadoutBuffer() [2/3]

CbmMuchReadoutBuffer::CbmMuchReadoutBuffer ( TString  branchName,
TString  folderName,
Bool_t  persistence = kTRUE 
)
inline

Constructor with branch and folder name

Parameters
branchNameName of branch in output tree
folderNameNo idea what this is good for
persistenceIf kTRUE (default), the branch will appear in the output file.

If this constructor is used, a branch with a TClonesArray will be created. Data from the buffer will be copied to this array. Note that in this case, ReadOutData will deliver no data (for the same readout time), since the buffered data are deleted after being copied to the array.

Definition at line 43 of file CbmMuchReadoutBuffer.h.

◆ CbmMuchReadoutBuffer() [3/3]

CbmMuchReadoutBuffer::CbmMuchReadoutBuffer ( const CbmMuchReadoutBuffer )
delete

◆ ~CbmMuchReadoutBuffer()

CbmMuchReadoutBuffer::~CbmMuchReadoutBuffer ( )
inline

Destructor

          Cleans up remaining data in the buffer, if present, which should not
          be the case if used properly.

Definition at line 71 of file CbmMuchReadoutBuffer.h.

Member Function Documentation

◆ AddNewDataToTClonesArray()

virtual void CbmReadoutBuffer< CbmMuchSignal >::AddNewDataToTClonesArray ( FairTimeStamp *  )
inlinevirtualinherited

Adding data to the TClonesArray Abstract method from FairWriteoutBuffer; not needed in this template implementation.

Definition at line 101 of file CbmReadoutBuffer.h.

◆ CheckData()

Bool_t CbmReadoutBuffer< CbmMuchSignal >::CheckData ( CbmMuchSignal data)
inlineinherited

Check data for consistency (stop time should be larger than start time)

Parameters
dataData object @value kTRUE is stop time is later than start time.

Definition at line 111 of file CbmReadoutBuffer.h.

◆ CheckInterference()

Bool_t CbmReadoutBuffer< CbmMuchSignal >::CheckInterference ( CbmMuchSignal data1,
CbmMuchSignal data2 
)
inlineinherited

Check interference of two data objects

Parameters
data1,data2Data objects @value kTRUE if objects interfere

Interference is present if the temporal extension of the objects overlap.

Definition at line 125 of file CbmReadoutBuffer.h.

◆ ClassDef()

CbmMuchReadoutBuffer::ClassDef ( CbmMuchReadoutBuffer  ,
 
)
private

◆ DeleteOldData()

virtual void CbmReadoutBuffer< CbmMuchSignal >::DeleteOldData
inlinevirtualinherited

Clear the output TClonesArray Called at the end of the event from FairRootManager

Definition at line 137 of file CbmReadoutBuffer.h.

◆ EraseDataFromDataMap()

virtual void CbmReadoutBuffer< CbmMuchSignal >::EraseDataFromDataMap ( FairTimeStamp *  )
inlinevirtualinherited

Erase data from data map Abstract method from FairWriteoutBuffer; not needed in this template implementation.

Definition at line 148 of file CbmReadoutBuffer.h.

◆ Fill()

void CbmReadoutBuffer< CbmMuchSignal >::Fill ( UInt_t  address,
CbmMuchSignal data 
)
inlineinherited

Fill data into the buffer

Parameters
addressUnique address
dataPointer to data object

If, for the same address, other data are present in the buffer, the time intervals of old and new data will be compared. If there is no time overlap with already present data, the new data will be inserted into the buffer. Otherwise, the method Modify is called and the resulting, modified data are inserted into the buffer.

Definition at line 163 of file CbmReadoutBuffer.h.

◆ FillDataMap()

virtual void CbmReadoutBuffer< CbmMuchSignal >::FillDataMap ( FairTimeStamp *  ,
double   
)
inlinevirtualinherited

Fill data map Abstract method from FairWriteoutBuffer; not needed in this template implementation.

Definition at line 249 of file CbmReadoutBuffer.h.

◆ FindTimeForData()

virtual double CbmReadoutBuffer< CbmMuchSignal >::FindTimeForData ( FairTimeStamp *  )
inlinevirtualinherited

Active time for a given data object Abstract method from FairWriteoutBuffer; not needed in this template implementation.

Definition at line 258 of file CbmReadoutBuffer.h.

◆ GetNData()

virtual Int_t CbmReadoutBuffer< CbmMuchSignal >::GetNData
inlinevirtualinherited

Number of data in the buffer

Returns
Number of data objects in buffer

Definition at line 266 of file CbmReadoutBuffer.h.

◆ Instance()

CbmMuchReadoutBuffer * CbmMuchReadoutBuffer::Instance ( )
static

◆ Merge()

◆ operator=()

CbmMuchReadoutBuffer& CbmMuchReadoutBuffer::operator= ( const CbmMuchReadoutBuffer )
delete

◆ ReadOutData()

Int_t CbmReadoutBuffer< CbmMuchSignal >::ReadOutData ( Double_t  time,
std::vector< CbmMuchSignal * > &  dataList 
)
inlineinherited

Read out data from the buffer

Parameters
[in]timeReadout time. If < 0, all data will be read out.
[out]dataListVector with pointers to data objects @value Number of data objects read out

Data interface alternative to the TClonesArray. Data from the buffer with stop time before the specified readout time will be delivered and removed from the buffer. The object ownership is passed to the consumer, who is responsible for destroying the data objects in the data vector.

Definition at line 318 of file CbmReadoutBuffer.h.

◆ WriteOutAllData()

virtual void CbmReadoutBuffer< CbmMuchSignal >::WriteOutAllData
inlinevirtualinherited

Write out all data in the buffer to the TClonesArray

          All buffer data, irrespective of time, will be copied
          to the output array and deleted from the buffer.
          Called from Framework (FairRootManager)

Definition at line 302 of file CbmReadoutBuffer.h.

◆ WriteOutData()

virtual void CbmReadoutBuffer< CbmMuchSignal >::WriteOutData ( Double_t  time)
inlinevirtualinherited

Write out data to the TClonesArray

Parameters
timeReadout time. If < 0, all data will be written out.

All data with stop time before the readout time will be copied to the output array and deleted from the buffer. Called from Framework (FairRootManager). Note that this method has no effect if fWriteToArray is kFALSE, which is the default.

Definition at line 369 of file CbmReadoutBuffer.h.

Member Data Documentation

◆ fArray

TClonesArray* CbmReadoutBuffer< CbmMuchSignal >::fArray
protectedinherited

Definition at line 420 of file CbmReadoutBuffer.h.

◆ fBuffer

std::multimap<UInt_t, CbmMuchSignal *> CbmReadoutBuffer< CbmMuchSignal >::fBuffer
protectedinherited

Definition at line 417 of file CbmReadoutBuffer.h.

◆ fBufferIt

std::multimap<UInt_t, CbmMuchSignal *>::iterator CbmReadoutBuffer< CbmMuchSignal >::fBufferIt
protectedinherited

Definition at line 418 of file CbmReadoutBuffer.h.

◆ fCounter

Int_t CbmMuchReadoutBuffer::fCounter
private

Definition at line 78 of file CbmMuchReadoutBuffer.h.

◆ fgInstance

CbmMuchReadoutBuffer * CbmMuchReadoutBuffer::fgInstance = NULL
staticprivate

Pointer to singleton instance

Definition at line 76 of file CbmMuchReadoutBuffer.h.

Referenced by Instance().

◆ fOldIt

std::multimap<UInt_t, CbmMuchSignal *>::iterator CbmReadoutBuffer< CbmMuchSignal >::fOldIt
protectedinherited

Definition at line 419 of file CbmReadoutBuffer.h.

◆ fWriteToArray

Bool_t CbmReadoutBuffer< CbmMuchSignal >::fWriteToArray
protectedinherited

Definition at line 421 of file CbmReadoutBuffer.h.


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