CbmRoot
CbmReadoutBuffer< Data > Class Template Reference

#include <CbmReadoutBuffer.h>

Inheritance diagram for CbmReadoutBuffer< Data >:
[legend]
Collaboration diagram for CbmReadoutBuffer< Data >:
[legend]

Public Member Functions

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

Protected Attributes

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

Detailed Description

template<class Data>
class CbmReadoutBuffer< Data >

Definition at line 27 of file CbmReadoutBuffer.h.

Constructor & Destructor Documentation

◆ CbmReadoutBuffer() [1/3]

template<class Data >
CbmReadoutBuffer< Data >::CbmReadoutBuffer ( )
inline

Default constructor

          No output TClonesArray will be present. The buffered data have to
          be fetched through ReadOutData.

Definition at line 36 of file CbmReadoutBuffer.h.

◆ CbmReadoutBuffer() [2/3]

template<class Data >
CbmReadoutBuffer< Data >::CbmReadoutBuffer ( 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 56 of file CbmReadoutBuffer.h.

◆ CbmReadoutBuffer() [3/3]

template<class Data >
CbmReadoutBuffer< Data >::CbmReadoutBuffer ( const CbmReadoutBuffer< Data > &  )
delete

◆ ~CbmReadoutBuffer()

template<class Data >
virtual CbmReadoutBuffer< Data >::~CbmReadoutBuffer ( )
inlinevirtual

Destructor

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

Definition at line 86 of file CbmReadoutBuffer.h.

Member Function Documentation

◆ AddNewDataToTClonesArray()

template<class Data >
virtual void CbmReadoutBuffer< Data >::AddNewDataToTClonesArray ( FairTimeStamp *  )
inlinevirtual

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

Definition at line 101 of file CbmReadoutBuffer.h.

◆ CheckData()

template<class Data >
Bool_t CbmReadoutBuffer< Data >::CheckData ( Data *  data)
inline

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.

Referenced by CbmReadoutBuffer< CbmMuchSignal >::Fill().

◆ CheckInterference()

template<class Data >
Bool_t CbmReadoutBuffer< Data >::CheckInterference ( Data *  data1,
Data *  data2 
)
inline

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.

Referenced by CbmReadoutBuffer< CbmMuchSignal >::Fill().

◆ DeleteOldData()

template<class Data >
virtual void CbmReadoutBuffer< Data >::DeleteOldData ( )
inlinevirtual

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

Definition at line 137 of file CbmReadoutBuffer.h.

◆ EraseDataFromDataMap()

template<class Data >
virtual void CbmReadoutBuffer< Data >::EraseDataFromDataMap ( FairTimeStamp *  )
inlinevirtual

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

Definition at line 148 of file CbmReadoutBuffer.h.

◆ Fill()

template<class Data >
void CbmReadoutBuffer< Data >::Fill ( UInt_t  address,
Data *  data 
)
inline

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.

Referenced by CbmMuchDigitizeGem::AddCharge(), CbmMuchDigitizeGem::AddNoiseSignal(), CbmMuchDigitizeGem::BufferSignals(), and CbmReadoutBuffer< CbmMuchSignal >::Fill().

◆ FillDataMap()

template<class Data >
virtual void CbmReadoutBuffer< Data >::FillDataMap ( FairTimeStamp *  ,
double   
)
inlinevirtual

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

Definition at line 249 of file CbmReadoutBuffer.h.

◆ FindTimeForData()

template<class Data >
virtual double CbmReadoutBuffer< Data >::FindTimeForData ( FairTimeStamp *  )
inlinevirtual

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()

template<class Data >
virtual Int_t CbmReadoutBuffer< Data >::GetNData ( )
inlinevirtual

Number of data in the buffer

Returns
Number of data objects in buffer

Definition at line 266 of file CbmReadoutBuffer.h.

Referenced by CbmMuchDigitizeGem::Finish().

◆ Merge()

template<class Data >
virtual Int_t CbmReadoutBuffer< Data >::Merge ( Data *  oldData1,
Data *  oldData2,
std::vector< Data * > &  newDataList 
)
inlinevirtual

Reimplemented in CbmMuchReadoutBuffer.

Definition at line 272 of file CbmReadoutBuffer.h.

Referenced by CbmReadoutBuffer< CbmMuchSignal >::Fill().

◆ operator=()

template<class Data >
CbmReadoutBuffer& CbmReadoutBuffer< Data >::operator= ( const CbmReadoutBuffer< Data > &  )
delete

◆ ReadOutData()

template<class Data >
Int_t CbmReadoutBuffer< Data >::ReadOutData ( Double_t  time,
std::vector< Data * > &  dataList 
)
inline

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.

Referenced by CbmMuchDigitizeGem::ReadAndRegister().

◆ WriteOutAllData()

template<class Data >
virtual void CbmReadoutBuffer< Data >::WriteOutAllData ( )
inlinevirtual

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()

template<class Data >
virtual void CbmReadoutBuffer< Data >::WriteOutData ( Double_t  time)
inlinevirtual

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.

Referenced by CbmReadoutBuffer< CbmMuchSignal >::WriteOutAllData().

Member Data Documentation

◆ fArray

◆ fBuffer

◆ fBufferIt

◆ fOldIt

template<class Data >
std::multimap<UInt_t, Data*>::iterator CbmReadoutBuffer< Data >::fOldIt
protected

◆ fWriteToArray

template<class Data >
Bool_t CbmReadoutBuffer< Data >::fWriteToArray
protected

Definition at line 421 of file CbmReadoutBuffer.h.

Referenced by CbmReadoutBuffer< CbmMuchSignal >::WriteOutData().


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