2#define BMNCONVERTER_H 1
12#include <boost/property_tree/json_parser.hpp>
13#include <boost/property_tree/ptree.hpp>
15#include <nlohmann/json.hpp>
17#include "TClonesArray.h"
22#include "TTimeStamp.h"
25#include <ROOT/TBufferMerger.hxx>
27#include "FairRootManager.h"
28#include "FairSource.h"
49#define WAIT_LIMIT 40000000
52typedef pair<TTree*, uint64_t>
TreePE;
57namespace pt = boost::property_tree;
64 vector<pair<int, pair<int, int>>>
vecTree;
68 map<int32_t, map<int32_t, TreePos>>
treeMap;
74 BmnConverter(uint32_t threadCount = 0, uint32_t period = 8, TString outDir =
".",
bool tempFileOnDisk =
false);
97 void SetSpillMap(map<SysPoint, BmnSpillInfo> spillMap) { fSpillMap = spillMap; }
99 map<SysPoint, BmnSpillInfo>
GetSpillMap() {
return fSpillMap; }
115 const TTimeStamp TimeZero = TTimeStamp(time_t(0), 0);
118 bool temp_file_on_disk;
129 string fDecoderConfigFileName;
130 TString fRawRunHdrName;
131 TString fMetadataName;
132 TString fRawTreeName;
133 TString fRawTreeSpillName;
134 TString fRootFileName;
135 TString fRootDirPath;
142 unique_ptr<DigiRunHeader> runHeader;
143 unique_ptr<BmnMetadataRaw> metadata;
144 unique_ptr<ROOT::TBufferMerger> fMerger;
146 vector<TObject*> fNamVec;
147 vector<TClonesArray*> fArrVec;
149 uint32_t data[10000000];
156 Bool_t fExportJsonBlocks;
158 map<TTimeStamp, Int_t> leaps;
159 TTimeStamp utc_valid;
162 map<SysPoint, BmnSpillInfo> fSpillMap;
166 Int_t GetSpillNumber(vector<SysPoint>* spillEnds, vector<SysPoint>* spillStarts,
SysPoint time);
167 Int_t GetSpillNumber(vector<SysPoint>* spillEnds, vector<SysPoint>* spillStarts, TTimeStamp time);
168 BmnStatus ConvertRawToRootIterateFileRead();
169 void QuickProcessEvent(UInt_t*
d, UInt_t& len);
170 void QuickConvertStatEvent(UInt_t* buf, UInt_t& len);
183 Int_t GetUTCShift(TTimeStamp t);
const Float_t d
Z-ccordinate of the first GEM-station.
std::chrono::time_point< SysClock > SysPoint
void SetDecoderConfigFileName(string FileName)
map< int32_t, MapTP2TreePE > treeTimeMapDiv
BmnStatus ParseJsonTLV(UInt_t *buf, UInt_t &len)
BmnStatus FeedEvent(UInt_t *buf, UInt_t len, Int_t type)
void SetSubName(TString v)
BmnStatus FeedFile(TString name, Bool_t getRunId=kTRUE, Bool_t getSubName=kTRUE)
multimap< SysPoint, TreePE > treeTimeMap
void ReproduceBranches(TTree *inTree, TTree *outTree)
BmnThreadManager< BmnConverterThread > * fThreads
map< int32_t, multimap< SysPoint, TreePos > > treeMapSpills
void SeparateEventsBySpills()
map< int32_t, map< int32_t, TreePos > > treeMap
void SetSpillMap(map< SysPoint, BmnSpillInfo > spillMap)
void SetPeriod(uint32_t v)
BmnConverter(uint32_t threadCount=0, uint32_t period=8, TString outDir=".", bool tempFileOnDisk=false)
static BmnStatus ParseComplexTLV(UInt_t *buf, UInt_t &len, UInt_t &runId)
void SeparateEventsBySpillsTM()
void SetRunId(uint32_t v)
map< SysPoint, BmnSpillInfo > GetSpillMap()
vector< pair< int, pair< int, int > > > vecTree
vector< pair< int, pair< int, int > > > vecTreeSpills
a class to store JSON values
multimap< SysPoint, TreePE > MapTP2TreePE
pair< uint32_t, uint64_t > TreePos
pair< TTree *, uint64_t > TreePE
Defines unique identifiers (enum) for all BM@N detector systems.
basic_json<> json
default specialization