62 BmnDecoder(TString file =
"", TString outfile =
"", ULong_t nEvents = 0, ULong_t period = 8);
67 void Exec(Option_t* opt);
70 void InitMappers(std::function<
void(TString, TObject*)> branch_reg_fun);
108 d.header = eventHeader;
180 fTof400PlaceMapFileName = PlaceMap;
186 fTof701PlaceMapFileName = PlaceMap;
267 return (nSmpl == 128) ? 1542 : 1992;
283 const TTimeStamp TimeZero = TTimeStamp(time_t(0), 0);
284 Double_t workTime_cpu = 0.0;
285 Double_t workTime_real = 0.0;
289 std::map<DetectorId, bool> fDetectorSetup;
293 bool fApplyThreshold;
297 Int_t fTOF700ReferenceRun;
298 Int_t fTOF700ReferenceChamber;
303 ULong_t fNTotalEvents;
304 ULong_t fNSignalEvents;
305 UInt_t fStartEventId;
310 TTimeStamp fRunStartTime;
311 TTimeStamp fRunEndTime;
314 TTree* fRawTreeSpills;
317 TTree* fDigiTreeSpills;
318 string fDecoderConfigFileName;
319 TString fRootFileName;
320 TString fDigiFileName;
321 TString fCalibFileName;
322 TString fDigiRunHdrName;
323 TString fDchMapFileName;
324 TString fMwpcMapFileName;
325 TString fGemMapFileName;
326 TString fVspMapFileName;
327 TString fTof400PlaceMapFileName;
328 TString fTof400StripMapFileName;
329 TString fTof701PlaceMapFileName;
330 TString fTof701StripMapFileName;
331 TString fTof700MapFileName;
332 TString fTof700GeomFileName;
333 TString fZDCMapFileName;
334 TString fZDCCalibrationFileName;
335 TString fScWallMapFileName;
336 TString fScWallCalibrationFileName;
337 TString fFHCalMapFileName;
338 TString fFHCalCalibrationFileName;
339 TString fHodoMapFileName;
340 TString fHodoCalibrationFileName;
341 TString fNdetMapFileName;
342 TString fNdetCalibrationFileName;
343 TString fHgndMapFileName;
344 TString fHgndCalibrationFileName;
345 TString fECALMapFileName;
346 TString fECALCalibrationFileName;
347 TString fMSCMapFileName;
348 TString fSiliconMapFileName;
349 TString fSiBTMapFileName;
350 TString fCscMapFileName;
351 TString fTrigPlaceMapFileName;
352 TString fTrigChannelMapFileName;
354 TString fRawRunHdrName;
355 TString fMetadataName;
366 TClonesArray* adc128;
368 TClonesArray* vsp_raw;
371 TClonesArray* tqdc_tdc;
372 TClonesArray* tqdc_adc;
373 TClonesArray* tdc_hgnd;
382 TClonesArray* silicon;
387 TClonesArray* tof400;
388 TClonesArray* tof700;
389 TClonesArray* tof701;
391 TClonesArray* scwall;
399 TClonesArray* msc_copy;
400 TClonesArray* t0_copy;
406 Long64_t NRawTreeEvents;
407 Long64_t NRawTreeSpills;
438 UInt_t fPedEvCntrBySpill;
441 UInt_t fEvForPedestals;
442 UInt_t fEvForNoiseCorr;
447 bool fExportJsonBocks;
452 unordered_map<UInt_t, Long64_t> fTimeShifts;
453 Long64_t fT0SyncTime;
456 map<TTimeStamp, Int_t> leaps;
457 TTimeStamp utc_valid;
460 map<TTimeStamp, BmnSpillInfo> fSpillMap;
461 map<uint32_t, uint32_t> _dfl_run_id;
467 template<
typename BrType>
468 void Assignment_Fun(
const TString name, BrType** ob, TTree* tree =
nullptr)
471 FairRootManager* frm = FairRootManager::Instance();
472 *ob =
static_cast<BrType*
>(frm->GetObject(name));
473 LOG(debug) <<
"Getting: " << name <<
" p: " << ob;
475 TBranch* b = tree->GetBranch(name);
478 auto brAddr = b->GetAddress();
480 LOG(debug) <<
"Assigning branch " << b <<
" name " <<
name <<
" addr " << (
void*)brAddr;
481 *ob =
reinterpret_cast<BrType*
>(*(
reinterpret_cast<void**
>(brAddr)));
483 tree->SetBranchAddress(name, ob);
484 LOG(debug) <<
" Set branch " << b <<
" name " <<
name <<
" addr " << (
void*)*ob;
489 template<
typename BrType>
490 void Register_Fun(
const TString name, BrType** ob)
493 FairRootManager* frm = FairRootManager::Instance();
494 frm->Register(name, name +
"_dir", *ob, fSaveOutput);
496 TBranch* b = fDigiTree->Branch(name, ob);
497 LOGF(debug1,
"Register branch %p : %s", (
void*)b,
name.Data());
502 Int_t GetUTCShift(TTimeStamp t);
503 BmnStatus GetT0Info(Double_t& t0time, Double_t& t0width);
504 inline void FillWR(UInt_t iSerial, ULong64_t iEvent, Long64_t t_sec, Long64_t t_ns);
506 BmnStatus LoadCalibFile(TString& FileName);
507 BmnStatus SaveCalibFile(TString& FileName);
509 void CopyDataToPedMap(UInt_t ev);