1#ifndef BMNRAWDATADECODER_H
2#define BMNRAWDATADECODER_H 1
10#pragma GCC system_header
11#include <boost/property_tree/json_parser.hpp>
12#include <boost/property_tree/ptree.hpp>
14#include "TClonesArray.h"
17#include "TTimeStamp.h"
26#include "BmnEventHeader.h"
42#include "DigiArrays.h"
47#define WAIT_LIMIT 40000000
53namespace pt = boost::property_tree;
64 BmnRawDataDecoder(TString file =
"", TString outfile =
"", ULong_t nEvents = 0, ULong_t period = 8);
142 fDetectorSetup =
setup;
149 fDecoderConfigFileName = FileName;
180 fRootFileName = Form(
"%sbmn_run%d%s_raw.root", fRootDirPath.Data(), fRunId, fSubName.Data());
225 Bool_t isForwardMode;
227 const TTimeStamp TimeZero = TTimeStamp(time_t(0), 0);
228 Double_t workTime_cpu = 0.0;
229 Double_t workTime_real = 0.0;
231 std::map<DetectorId, bool> fDetectorSetup;
232 bool isRawRootInputFile;
233 bool fApplyThreshold;
238 UInt_t fNTotalEvents;
239 UInt_t fNSignalEvents;
240 UInt_t fStartEventId;
242 string fDecoderConfigFileName;
243 TString fRootFileName;
244 TString fRootDirPath;
245 TString fDigiDirPath;
246 TString fRawFileName;
247 TString fDigiFileName;
248 TString fCalibFileName;
256 UInt_t fPedEvCntrBySpill;
259 Int_t fEvForPedestals;
262 Bool_t fUseCalibFile;
void SetForwardMode(bool v=true)
void SetDetectorSetup(std::map< DetectorId, bool > setup)
TTimeStamp GetRunEndTime() const
void SetDecoderConfigFileName(string FileName)
void SetPeriodId(UInt_t v)
void SetEvForPedestals(UInt_t v)
UInt_t GetEventId() const
TTimeStamp GetRunStartTime() const
void SetTaskMode(bool v=true)
void SetDetectorSetup(std::map< DetectorId, bool > setup)
BmnSetup GetBmnSetup() const
TString GetRootFileName()
void SetPeriodId(UInt_t v)
static double correctionSil
void SetTaskMode(bool v=true)
BmnDecoder * GetDecoder() const
UInt_t GetEventId() const
static Bool_t IsRawFile(TString name)
static double correctionGem
BmnStatus ConvertRawToRoot()
static double correctionCsc
UInt_t GetEvForPedestals()
BmnStatus DecodeDataToDigiIterate()
void SetDigiRootFile(TString filename)
void SetEvForPedestals(UInt_t v)
void SetBmnSetup(BmnSetup v)
UInt_t GetNevents() const
virtual ~BmnRawDataDecoder()
BmnStatus InitConverter()
BmnStatus ConvertRawToRootIterate(UInt_t *buf, UInt_t len)
BmnRawSource * GetRawConverter() const
UInt_t GetPeriodId() const
void SetApplyThreshold(bool b)
TTimeStamp GetRunStartTime() const
void SetRawRootDirPath(TString path)
void SetForwardMode(bool v=true)
bool GetUseCalibFile() const
BmnStatus DecodeDataToDigi()
TTimeStamp GetRunEndTime() const
static Bool_t IsRootFile(TString name)
void SetDecoderConfigFileName(string FileName)
void SetUseCalibFile(bool v)
void SetRawRootFile(TString filename)
bool GetForwardMode() const
static Int_t GetRunIdFromFile(TString name)
void SetPeriodId(UInt_t v)
void SetDecoderConfigFileName(string FileName)
void SetTaskMode(bool v=true)
void SetForwardMode(bool v=true)
TTimeStamp GetRunEndTime() const
TTimeStamp GetRunStartTime() const
UInt_t GetEventId() const
a class to store JSON values
basic_json<> json
default specialization