CbmRoot
|
#include <CbmReadoutBuffer.h>
Public Member Functions | |
CbmReadoutBuffer () | |
CbmReadoutBuffer (TString branchName, TString folderName, Bool_t persistence=kTRUE) | |
CbmReadoutBuffer (const CbmReadoutBuffer &)=delete | |
CbmReadoutBuffer & | operator= (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 |
Definition at line 33 of file CbmReadoutBuffer.h.
|
inline |
Default constructor
No output TClonesArray will be present. The buffered data have to be fetched through ReadOutData.
Definition at line 42 of file CbmReadoutBuffer.h.
|
inline |
Constructor with branch and folder name
branchName | Name of branch in output tree |
folderName | No idea what this is good for |
persistence | If 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.
References CbmReadoutBuffer< Data >::fArray.
|
delete |
|
inlinevirtual |
Destructor
Cleans up remaining data in the buffer, if present, which should not be the case if used properly.
Definition at line 84 of file CbmReadoutBuffer.h.
References CbmReadoutBuffer< Data >::fBuffer, and CbmReadoutBuffer< Data >::fBufferIt.
|
inlinevirtual |
Adding data to the TClonesArray Abstract method from FairWriteoutBuffer; not needed in this template implementation.
Definition at line 98 of file CbmReadoutBuffer.h.
|
inline |
Check data for consistency (stop time should be larger than start time)
data | Data object @value kTRUE is stop time is later than start time. |
Definition at line 108 of file CbmReadoutBuffer.h.
Referenced by CbmReadoutBuffer< Data >::Fill().
|
inline |
Check interference of two data objects
data1,data2 | Data objects @value kTRUE if objects interfere |
Interference is present if the temporal extension of the objects overlap.
Definition at line 120 of file CbmReadoutBuffer.h.
Referenced by CbmReadoutBuffer< Data >::Fill().
|
inlinevirtual |
Clear the output TClonesArray Called at the end of the event from FairRootManager
Definition at line 133 of file CbmReadoutBuffer.h.
References CbmReadoutBuffer< Data >::fArray.
|
inlinevirtual |
Erase data from data map Abstract method from FairWriteoutBuffer; not needed in this template implementation.
Definition at line 145 of file CbmReadoutBuffer.h.
|
inline |
Fill data into the buffer
address | Unique address |
data | Pointer 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 160 of file CbmReadoutBuffer.h.
References CbmReadoutBuffer< Data >::CheckData(), CbmReadoutBuffer< Data >::CheckInterference(), CbmReadoutBuffer< Data >::fBuffer, CbmReadoutBuffer< Data >::fBufferIt, CbmReadoutBuffer< Data >::Fill(), and CbmReadoutBuffer< Data >::Merge().
Referenced by CbmMuchDigitizeGem::AddCharge(), CbmMuchDigitizeGem::AddNoiseSignal(), CbmMuchDigitizeGem::BufferSignals(), and CbmReadoutBuffer< Data >::Fill().
|
inlinevirtual |
Fill data map Abstract method from FairWriteoutBuffer; not needed in this template implementation.
Definition at line 240 of file CbmReadoutBuffer.h.
|
inlinevirtual |
Active time for a given data object Abstract method from FairWriteoutBuffer; not needed in this template implementation.
Definition at line 249 of file CbmReadoutBuffer.h.
|
inlinevirtual |
Number of data in the buffer
Definition at line 257 of file CbmReadoutBuffer.h.
References CbmReadoutBuffer< Data >::fBuffer.
Referenced by CbmMuchDigitizeGem::Finish().
|
inlinevirtual |
Reimplemented in CbmMuchReadoutBuffer.
Definition at line 262 of file CbmReadoutBuffer.h.
Referenced by CbmReadoutBuffer< Data >::Fill().
|
delete |
|
inline |
Read out data from the buffer
[in] | time | Readout time. If < 0, all data will be read out. |
[out] | dataList | Vector 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 306 of file CbmReadoutBuffer.h.
References CbmReadoutBuffer< Data >::fBuffer, CbmReadoutBuffer< Data >::fBufferIt, and CbmReadoutBuffer< Data >::fOldIt.
Referenced by CbmMuchDigitizeGem::ReadAndRegister().
|
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 290 of file CbmReadoutBuffer.h.
References CbmReadoutBuffer< Data >::WriteOutData().
|
inlinevirtual |
Write out data to the TClonesArray
time | Readout 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 357 of file CbmReadoutBuffer.h.
References CbmReadoutBuffer< Data >::fArray, CbmReadoutBuffer< Data >::fBuffer, CbmReadoutBuffer< Data >::fBufferIt, CbmReadoutBuffer< Data >::fOldIt, and CbmReadoutBuffer< Data >::fWriteToArray.
Referenced by CbmReadoutBuffer< Data >::WriteOutAllData().
|
protected |
Definition at line 409 of file CbmReadoutBuffer.h.
Referenced by CbmReadoutBuffer< Data >::CbmReadoutBuffer(), CbmReadoutBuffer< Data >::DeleteOldData(), and CbmReadoutBuffer< Data >::WriteOutData().
|
protected |
Definition at line 406 of file CbmReadoutBuffer.h.
Referenced by CbmReadoutBuffer< Data >::Fill(), CbmReadoutBuffer< Data >::GetNData(), CbmReadoutBuffer< Data >::ReadOutData(), CbmReadoutBuffer< Data >::WriteOutData(), and CbmReadoutBuffer< Data >::~CbmReadoutBuffer().
|
protected |
Definition at line 407 of file CbmReadoutBuffer.h.
Referenced by CbmReadoutBuffer< Data >::Fill(), CbmReadoutBuffer< Data >::ReadOutData(), CbmReadoutBuffer< Data >::WriteOutData(), and CbmReadoutBuffer< Data >::~CbmReadoutBuffer().
|
protected |
Definition at line 408 of file CbmReadoutBuffer.h.
Referenced by CbmReadoutBuffer< Data >::ReadOutData(), and CbmReadoutBuffer< Data >::WriteOutData().
|
protected |
Definition at line 410 of file CbmReadoutBuffer.h.
Referenced by CbmReadoutBuffer< Data >::WriteOutData().