1#ifndef BMNCONVERTERTHREAD_H
2#define BMNCONVERTERTHREAD_H 1
7#include "TClonesArray.h"
13#include <ROOT/TBufferMerger.hxx>
15#include "FairLogger.h"
62 std::mutex* queue_access,
63 std::condition_variable* queue_wait,
65 Bool_t measure_time = kFALSE)
111 UInt_t* data =
nullptr,
113 UInt_t fRunId = 7444,
114 UInt_t fEventId = -1);
116 void SetInitData(vector<pair<
int, pair<int, int>>>* vec_tree, vector<pair<
int, pair<int, int>>>* vec_tree_spills)
118 this->vecTree = vec_tree;
119 this->vecTreeSpills = vec_tree_spills;
145 LOGF(info,
"Closing converter thread %d; Waiting time: %.3fs, Calculation time: %.3fs",
threadId,
155 Bool_t fExportExternalSpillStat;
158 void WriteSpill(Int_t spillId);
160 template<
typename BrType>
161 void BranchRegFun(TString name, BrType** ar)
174 TBranch* b =
fRawTree->Branch(name, ar);
175 LOGF(debug1,
"Register branch %p : %s", (
void*)b, name.Data());
181 BmnEventData fCurEvent;
184 vector<pair<int, pair<int, int>>>* vecTree;
185 vector<pair<int, pair<int, int>>>* vecTreeSpills;
190 map<TTimeStamp, Int_t> leaps;
191 TTimeStamp utc_valid;
195 Int_t GetUTCShift(TTimeStamp t);
196 BmnStatus ProcessEvent(UInt_t* data, UInt_t len);
197 BmnStatus ConvertStatEvent(UInt_t*
d, UInt_t& len);
200 BmnStatus Process_HRB(UInt_t* data, UInt_t len, UInt_t serial);
202 BmnStatus FillBlockTDC(UInt_t*
d, UInt_t serial, uint16_t& len, TClonesArray* ar, UInt_t modid);
203 BmnStatus FillBlockADC(UInt_t*
d, UInt_t serial, uint8_t channel, uint16_t& len, TClonesArray* ar);
204 BmnStatus FillTDC(UInt_t*
d, UInt_t serial, UInt_t slot, UInt_t modId, UInt_t& idx);
205 BmnStatus FillTQDC(UInt_t*
d, UInt_t serial, UInt_t slot, UInt_t modId, UInt_t& idx);
214 BmnStatus FillTQDC_E(UInt_t*
d, UInt_t serial, UInt_t& len);
223 BmnStatus FillMSC16VE_E(UInt_t*
d, DeviceHeader* dev_hdr);
227 BmnStatus FillTDC72VXS(UInt_t*
d, UInt_t serial, UInt_t& len, UInt_t modid);
231 BmnStatus FillTTVXS(UInt_t*
d, UInt_t serial, UInt_t& len);
232 BmnStatus ProcessGenericDevice(UInt_t*
d, DeviceHeader* dev_hdr);
236 BmnStatus FillTDC250HGND(UInt_t*
d, UInt_t serial, UInt_t len);
240 BmnStatus MapVSP(UInt_t*
d, DeviceHeader* dev_hdr);
251 BmnStatus FillUT24VE_TRC(UInt_t*
d, UInt_t& serial, UInt_t& len);
252 BmnStatus FillVirtualDevice(UInt_t*
d, DeviceHeader* dh);
253 BmnStatus FillFVME2TMWR(UInt_t*
d, UInt_t serial, UInt_t& idx, UInt_t& len);
254 BmnStatus FillMSC(UInt_t*
d, UInt_t serial, UInt_t slot, UInt_t& idx);
255 inline BmnSyncDigit* FillWR(UInt_t iSerial, ULong64_t iEvent, Long64_t t_sec, Long64_t t_ns);
const Float_t d
Z-ccordinate of the first GEM-station.
CDuration GetCalculationCTime()
CDuration GetWaitingCTime()
void SetMerger(TBufferMerger *m)
void SetInitData(vector< pair< int, pair< int, int > > > *vec_tree, vector< pair< int, pair< int, int > > > *vec_tree_spills)
BmnConverterThread(BmnConverterThread const &)=delete
void ClearRawSpillArrays()
BmnConverterThread(queue< Int_t > *thread_queue, std::mutex *queue_access, std::condition_variable *queue_wait, Int_t id, Bool_t measure_time=kFALSE)
void SetTrees(TTree *tree, TTree *treeSpills)
std::map< uint8_t, uint32_t * > time_slice_map
std::shared_ptr< TBufferMergerFile > mergerFile
void SetExportExternalSpillStat(bool v)
BmnEventHeader * eventHeaderDAQ
BmnConverterThread & operator=(BmnConverterThread const &)=delete
virtual ~BmnConverterThread()
void SetData(Int_t taskId, Int_t len=0, UInt_t *data=nullptr, BmnEventType fCurEvType=kBMNEMPTY, UInt_t fRunId=7444, UInt_t fEventId=-1)
void RegisterSpillBranches()
Define enumerations used in tracking.