Skip to content
Snippets Groups Projects
Commit 073bd443 authored by Nikolay Karpushkin's avatar Nikolay Karpushkin Committed by Florian Uhlig
Browse files

clang

parent a7aa29b2
No related branches found
No related tags found
1 merge request!387Psd digi update & moni + unpack update
......@@ -27,7 +27,6 @@ CbmPsdDigi::CbmPsdDigi(const CbmPsdDigi& other) : fuAddress(other.fuAddress), fd
CbmPsdDigi::CbmPsdDigi(CbmPsdDigi&& other) : fuAddress(other.fuAddress), fdTime(other.fdTime), fdEdep(other.fdEdep) {}
// --- Set address from module and section number
void CbmPsdDigi::SetAddress(UInt_t moduleId, UInt_t sectionId)
{
......
......@@ -44,12 +44,7 @@ public:
** @param time Time [ns]
** @param edep Energy deposition
**/
CbmPsdDigi(UInt_t address, Double_t time, Double_t edep)
: fuAddress(address)
, fdTime(time)
, fdEdep(edep)
{
}
CbmPsdDigi(UInt_t address, Double_t time, Double_t edep) : fuAddress(address), fdTime(time), fdEdep(edep) {}
/** @brief Constructor with detailed assignment.
......@@ -58,10 +53,7 @@ public:
** @param time Time [ns]
** @param edep Energy deposition
**/
CbmPsdDigi(UInt_t moduleId, UInt_t sectionId, Double_t time, Double_t edep)
: fuAddress(0)
, fdTime(time)
, fdEdep(edep)
CbmPsdDigi(UInt_t moduleId, UInt_t sectionId, Double_t time, Double_t edep) : fuAddress(0), fdTime(time), fdEdep(edep)
{
fuAddress = CbmPsdAddress::GetAddress(moduleId, sectionId);
}
......
......@@ -137,7 +137,7 @@ CbmPsdDsp::CbmPsdDsp(CbmPsdDsp&& other)
// --- Destructor
CbmPsdDsp::~CbmPsdDsp()
CbmPsdDsp::~CbmPsdDsp()
{
std::vector<uint16_t>().swap(fuWfm);
std::vector<uint16_t>().swap(fuFitWfm);
......
......@@ -122,17 +122,17 @@ private:
Double_t fdAccum = 0; /// FPGA FEE Accumulator
Double_t fdAdcTime = -1.; /// Adc time of measurement
Double_t fdEdepWfm = 0.; /// Energy deposition from waveform [MeV]
Double_t fdAmpl = 0.; /// Amplitude from waveform [mV]
UInt_t fuMinimum = 0; /// Minimum of waveform [adc samples]
UInt_t fuTimeMax = 0; /// Time of maximum in waveform [adc samples]
Double_t fdEdepWfm = 0.; /// Energy deposition from waveform [MeV]
Double_t fdAmpl = 0.; /// Amplitude from waveform [mV]
UInt_t fuMinimum = 0; /// Minimum of waveform [adc samples]
UInt_t fuTimeMax = 0; /// Time of maximum in waveform [adc samples]
std::vector<uint16_t> fuWfm = std::vector<uint16_t>(32, 0);
Double_t fdFitAmpl = 0.; /// Amplitude from fit of waveform [mV]
Double_t fdFitZL = 0.; /// ZeroLevel from fit of waveform [adc counts]
Double_t fdFitEdep = 0.; /// Energy deposition from fit of waveform [MeV]
Double_t fdFitR2 = 999.; /// Quality of waveform fit [] -- good near 0
Double_t fdFitTimeMax = -1.; /// Time of maximum in fit of waveform [adc samples]
Double_t fdFitAmpl = 0.; /// Amplitude from fit of waveform [mV]
Double_t fdFitZL = 0.; /// ZeroLevel from fit of waveform [adc counts]
Double_t fdFitEdep = 0.; /// Energy deposition from fit of waveform [MeV]
Double_t fdFitR2 = 999.; /// Quality of waveform fit [] -- good near 0
Double_t fdFitTimeMax = -1.; /// Time of maximum in fit of waveform [adc samples]
std::vector<uint16_t> fuFitWfm = std::vector<uint16_t>(32, 0);
template<class Archive>
......
......@@ -81,24 +81,24 @@ public:
private:
/// Control flags
Bool_t fbMonitorMode = kTRUE; //! Switch ON the filling of a minimal set of histograms
Bool_t fbMonitorChanMode = kFALSE; //! Switch ON the filling channelwise histograms
Bool_t fbMonitorWfmMode = kFALSE; //! Switch ON the filling waveforms histograms
Bool_t fbMonitorFitMode= kFALSE; //! Switch ON the filling waveform fitting histograms
Bool_t fbDebugMonitorMode= kFALSE; //! Switch ON the filling of a additional set of histograms
Bool_t fbFirstPackageError = kTRUE;
Bool_t fbPsdMissedData = kFALSE;
Bool_t fbMonitorMode = kTRUE; //! Switch ON the filling of a minimal set of histograms
Bool_t fbMonitorChanMode = kFALSE; //! Switch ON the filling channelwise histograms
Bool_t fbMonitorWfmMode = kFALSE; //! Switch ON the filling waveforms histograms
Bool_t fbMonitorFitMode = kFALSE; //! Switch ON the filling waveform fitting histograms
Bool_t fbDebugMonitorMode = kFALSE; //! Switch ON the filling of a additional set of histograms
Bool_t fbFirstPackageError = kTRUE;
Bool_t fbPsdMissedData = kFALSE;
std::vector<Bool_t> fvbMaskedComponents = {};
/// Settings from parameter file
CbmMcbm2018PsdPar* fUnpackPar = nullptr; //!
UInt_t fuRawDataVersion = 0; //! Raw data versioning
/// Readout chain dimensions and mapping
UInt_t fuNrOfGdpbs = 0; //! Total number of GDPBs in the system
CbmMcbm2018PsdPar* fUnpackPar = nullptr; //!
UInt_t fuRawDataVersion = 0; //! Raw data versioning
/// Readout chain dimensions and mapping
UInt_t fuNrOfGdpbs = 0; //! Total number of GDPBs in the system
std::map<UInt_t, UInt_t> fGdpbIdIndexMap = {}; //! gDPB ID to index map
UInt_t fuNrOfFeePerGdpb = 0; //! Number of FEBs per GDPB
UInt_t fuNrOfChannelsPerFee = 0; //! Number of channels in each FEE
UInt_t fuNrOfChannelsPerGdpb = 0; //! Number of channels per GDPB
UInt_t fuNrOfFeePerGdpb = 0; //! Number of FEBs per GDPB
UInt_t fuNrOfChannelsPerFee = 0; //! Number of channels in each FEE
UInt_t fuNrOfChannelsPerGdpb = 0; //! Number of channels per GDPB
/// Constants
static const Int_t kiMaxNbFlibLinks = 32;
......@@ -111,92 +111,92 @@ private:
/// TS/MS info
ULong64_t fulCurrentTsIdx = 0;
ULong64_t fulCurrentMsIdx = 0;
Double_t fdTsStartTime = -1.0; //! Time in ns of current TS from the index of the first MS first component
Double_t fdMsTime = -1.0; //! Start Time in ns of current MS from its index field in header
Double_t fdPrevMsTime = -1.0; //! Start Time in ns of previous MS from its index field in header
UInt_t fuMsIndex = 0; //! Index of current MS within the TS
Double_t fdTsStartTime = -1.0; //! Time in ns of current TS from the index of the first MS first component
Double_t fdMsTime = -1.0; //! Start Time in ns of current MS from its index field in header
Double_t fdPrevMsTime = -1.0; //! Start Time in ns of previous MS from its index field in header
UInt_t fuMsIndex = 0; //! Index of current MS within the TS
/// Current data properties
UInt_t fuCurrentEquipmentId = 0; //! Current equipment ID, tells from which DPB the current MS is originating
UInt_t fuCurrDpbId = 0; //! Temp holder until Current equipment ID is properly filled in MS
UInt_t fuCurrDpbIdx = 0; //! Index of the DPB from which the MS currently unpacked is coming
UInt_t fuCurrDpbId = 0; //! Temp holder until Current equipment ID is properly filled in MS
UInt_t fuCurrDpbIdx = 0; //! Index of the DPB from which the MS currently unpacked is coming
/// Starting state book-keeping
Double_t fdStartTime = -1.0; /** Time of first valid hit (epoch available), used as reference for evolution plots**/
std::chrono::steady_clock::time_point
ftStartTimeUnix = std::chrono::steady_clock::now(); /** Time of run Start from UNIX system, used as reference for long evolution plots against reception time **/
std::chrono::steady_clock::time_point ftStartTimeUnix = std::chrono::steady_clock::
now(); /** Time of run Start from UNIX system, used as reference for long evolution plots against reception time **/
/// Histograms related variables
UInt_t fuHistoryHistoSize = 3600; /** Size in seconds of the evolution histograms **/
std::vector<Int_t> fviHistoChargeArgs= std::vector<Int_t>(3, 0); /** Charge histogram arguments in adc counts **/
std::vector<Int_t> fviHistoAmplArgs= std::vector<Int_t>(3, 0); /** Amplitude histogram arguments in adc counts **/
std::vector<Int_t> fviHistoZLArgs= std::vector<Int_t>(3, 0); /** ZeroLevel histogram arguments in adc counts **/
UInt_t fuHistoryHistoSize = 3600; /** Size in seconds of the evolution histograms **/
std::vector<Int_t> fviHistoChargeArgs = std::vector<Int_t>(3, 0); /** Charge histogram arguments in adc counts **/
std::vector<Int_t> fviHistoAmplArgs = std::vector<Int_t>(3, 0); /** Amplitude histogram arguments in adc counts **/
std::vector<Int_t> fviHistoZLArgs = std::vector<Int_t>(3, 0); /** ZeroLevel histogram arguments in adc counts **/
/// Histograms
UInt_t fuMsgsCntInMs = 0;
UInt_t fuMsgsCntInMs = 0;
UInt_t fuReadMsgsCntInMs = 0;
UInt_t fuLostMsgsCntInMs = 0;
UInt_t fuReadEvtCntInMs = 0;
UInt_t fuReadEvtCntInMs = 0;
/// Channel rate plots
std::vector<TH2*> fvhHitZLChanEvo = std::vector<TH2*>(kuNbChanPsd, nullptr);
std::vector<TH2*> fvhHitLPChanEvo= std::vector<TH2*>(kuNbChanPsd, nullptr);
std::vector<TH2*> fvhHitFAChanEvo= std::vector<TH2*>(kuNbChanPsd, nullptr);
std::vector<TH1*> fvhHitChargeChan= std::vector<TH1*>(kuNbChanPsd, nullptr);
std::vector<TH1*> fvhHitZeroLevelChan= std::vector<TH1*>(kuNbChanPsd, nullptr);
std::vector<TH1*> fvhHitAmplChan= std::vector<TH1*>(kuNbChanPsd, nullptr);
std::vector<TH1*> fvhHitChargeByWfmChan= std::vector<TH1*>(kuNbChanPsd, nullptr);
std::vector<TH1*> fvhHitWfmChan= std::vector<TH1*>(kuNbChanPsd, nullptr);
std::vector<TH2*> fvhHitZLChanEvo = std::vector<TH2*>(kuNbChanPsd, nullptr);
std::vector<TH2*> fvhHitLPChanEvo = std::vector<TH2*>(kuNbChanPsd, nullptr);
std::vector<TH2*> fvhHitFAChanEvo = std::vector<TH2*>(kuNbChanPsd, nullptr);
std::vector<TH1*> fvhHitChargeChan = std::vector<TH1*>(kuNbChanPsd, nullptr);
std::vector<TH1*> fvhHitZeroLevelChan = std::vector<TH1*>(kuNbChanPsd, nullptr);
std::vector<TH1*> fvhHitAmplChan = std::vector<TH1*>(kuNbChanPsd, nullptr);
std::vector<TH1*> fvhHitChargeByWfmChan = std::vector<TH1*>(kuNbChanPsd, nullptr);
std::vector<TH1*> fvhHitWfmChan = std::vector<TH1*>(kuNbChanPsd, nullptr);
static const UInt_t kuNbWfmRanges = 8;
static const UInt_t kuNbWfmExamples = 8;
std::vector<UInt_t> kvuWfmRanges = std::vector<UInt_t>(kuNbWfmRanges, 0);
std::vector<UInt_t> kvuWfmRanges = std::vector<UInt_t>(kuNbWfmRanges, 0);
std::vector<UInt_t> kvuWfmInRangeToChangeChan = std::vector<UInt_t>(kuNbChanPsd * kuNbWfmRanges, 0);
std::vector<TH1*> fv3hHitWfmFlattenedChan = std::vector<TH1*>(kuNbChanPsd * kuNbWfmRanges * kuNbWfmExamples, 0);
std::vector<TH1*> fv3hHitWfmFlattenedChan = std::vector<TH1*>(kuNbChanPsd * kuNbWfmRanges * kuNbWfmExamples, 0);
/// Channels map
Bool_t fbSpillOn = kTRUE;
UInt_t fuCurrentSpillIdx = 0;
UInt_t fuCurrentSpillPlot = 0;
Double_t fdStartTimeSpill = -1.0;
Double_t fdLastSecondTime = -1.0;
UInt_t fuCountsLastSecond = 0;
Bool_t fbSpillOn = kTRUE;
UInt_t fuCurrentSpillIdx = 0;
UInt_t fuCurrentSpillPlot = 0;
Double_t fdStartTimeSpill = -1.0;
Double_t fdLastSecondTime = -1.0;
UInt_t fuCountsLastSecond = 0;
static const UInt_t kuOffSpillCountLimit = 200;
const UInt_t kuPsdChanMap[kuNbChanPsd] = {
0}; // = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; //! Map from electronics channel to PSD physical channel
TH1* fhHitChargeMap= nullptr;
TH1* fhHitMapEvo= nullptr;
TH2* fhChanHitMapEvo= nullptr;
TH1* fhHitChargeMap = nullptr;
TH1* fhHitMapEvo = nullptr;
TH2* fhChanHitMapEvo = nullptr;
/// Global Rate
TH1* fhMissedData= nullptr;
TH1* fhAdcTime= nullptr;
TH2* fhMsLengthEvo= nullptr;
TH1* fhMissedData = nullptr;
TH1* fhAdcTime = nullptr;
TH2* fhMsLengthEvo = nullptr;
TH2* fhMsgsCntPerMsEvo = nullptr;
TH2* fhReadMsgsCntPerMsEvo= nullptr;
TH2* fhLostMsgsCntPerMsEvo= nullptr;
TH2* fhReadEvtsCntPerMsEvo= nullptr;
TH2* fhMsgsCntPerMsEvo = nullptr;
TH2* fhReadMsgsCntPerMsEvo = nullptr;
TH2* fhLostMsgsCntPerMsEvo = nullptr;
TH2* fhReadEvtsCntPerMsEvo = nullptr;
/// Waveform fitting
std::vector<TH1*> fvhHitFitWfmChan = std::vector<TH1*>(kuNbChanPsd, nullptr);
std::vector<TH1*> fvhHitFitWfmChan = std::vector<TH1*>(kuNbChanPsd, nullptr);
std::vector<TH2*> fvhFitHarmonic1Chan = std::vector<TH2*>(kuNbChanPsd, nullptr);
std::vector<TH2*> fvhFitHarmonic2Chan= std::vector<TH2*>(kuNbChanPsd, nullptr);
std::vector<TH2*> fvhFitQaChan= std::vector<TH2*>(kuNbChanPsd, nullptr);
std::vector<TH2*> fvhFitHarmonic2Chan = std::vector<TH2*>(kuNbChanPsd, nullptr);
std::vector<TH2*> fvhFitQaChan = std::vector<TH2*>(kuNbChanPsd, nullptr);
/// Canvases
TCanvas* fcSummary= nullptr;
TCanvas* fcHitMaps= nullptr;
TCanvas* fcZLevo= nullptr;
TCanvas* fcChargesFPGA= nullptr;
TCanvas* fcChargesWfm= nullptr;
TCanvas* fcAmplitudes= nullptr;
TCanvas* fcZeroLevels= nullptr;
TCanvas* fcGenCntsPerMs= nullptr;
TCanvas* fcWfmsAllChannels= nullptr;
TCanvas* fcSummary = nullptr;
TCanvas* fcHitMaps = nullptr;
TCanvas* fcZLevo = nullptr;
TCanvas* fcChargesFPGA = nullptr;
TCanvas* fcChargesWfm = nullptr;
TCanvas* fcAmplitudes = nullptr;
TCanvas* fcZeroLevels = nullptr;
TCanvas* fcGenCntsPerMs = nullptr;
TCanvas* fcWfmsAllChannels = nullptr;
std::vector<TCanvas*> fvcWfmsChan = std::vector<TCanvas*>(kuNbChanPsd, nullptr);
TCanvas* fcPronyFit= nullptr;
TCanvas* fcPronyFit = nullptr;
CbmMcbm2018MonitorAlgoPsd(const CbmMcbm2018MonitorAlgoPsd&);
CbmMcbm2018MonitorAlgoPsd operator=(const CbmMcbm2018MonitorAlgoPsd&);
......
......@@ -40,8 +40,14 @@ CbmMcbm2018UnpackerAlgoPsd::CbmMcbm2018UnpackerAlgoPsd()
CbmMcbm2018UnpackerAlgoPsd::~CbmMcbm2018UnpackerAlgoPsd()
{
if (nullptr != fPsdDigiVector) { fPsdDigiVector->clear(); delete fPsdDigiVector; }
if (nullptr != fPsdDspVector) { fPsdDspVector->clear(); delete fPsdDspVector; }
if (nullptr != fPsdDigiVector) {
fPsdDigiVector->clear();
delete fPsdDigiVector;
}
if (nullptr != fPsdDspVector) {
fPsdDspVector->clear();
delete fPsdDspVector;
}
}
// -------------------------------------------------------------------------
......@@ -195,8 +201,8 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessTs(const fles::Timeslice& ts)
[](const CbmPsdDigi& a, const CbmPsdDigi& b) -> bool { return a.GetTime() < b.GetTime(); });
if (fbDebugWriteOutput && (fPsdDspVector != nullptr)) {
std::sort(fPsdDspVector->begin(), fPsdDspVector->end(),
[](const CbmPsdDsp& a, const CbmPsdDsp& b) -> bool { return a.GetTime() < b.GetTime(); });
std::sort(fPsdDspVector->begin(), fPsdDspVector->end(),
[](const CbmPsdDsp& a, const CbmPsdDsp& b) -> bool { return a.GetTime() < b.GetTime(); });
}
return kTRUE;
......
......@@ -76,32 +76,32 @@ public:
private:
/// Control flags
Bool_t fbMonitorMode = kFALSE; //! Switch ON the filling of a minimal set of histograms
Bool_t fbMonitorMode = kFALSE; //! Switch ON the filling of a minimal set of histograms
Bool_t fbDebugMonitorMode = kFALSE; //! Switch ON the filling of a additional set of histograms
Bool_t fbDebugWriteOutput = kFALSE; //! If ON the output vector of dsp debug information is written to disk
/// Output vectors
std::vector<CbmPsdDigi>*
fPsdDigiVector = nullptr; //! Output Digi vector /* TODO CHECK The exclamation mark signals the transientness */
std::vector<CbmPsdDsp>*
fPsdDspVector = nullptr; //! Output Dsp vector /* TODO CHECK The exclamation mark signals the transientness */
std::vector<CbmPsdDigi>* fPsdDigiVector =
nullptr; //! Output Digi vector /* TODO CHECK The exclamation mark signals the transientness */
std::vector<CbmPsdDsp>* fPsdDspVector =
nullptr; //! Output Dsp vector /* TODO CHECK The exclamation mark signals the transientness */
std::vector<Bool_t> fvbMaskedComponents = {};
/// Settings from parameter file
CbmMcbm2018PsdPar* fUnpackPar = nullptr; //!
UInt_t fuRawDataVersion = 0; //! Raw data versioning
/// Readout chain dimensions and mapping
UInt_t fuNrOfGdpbs = 0; //! Total number of GDPBs in the system
CbmMcbm2018PsdPar* fUnpackPar = nullptr; //!
UInt_t fuRawDataVersion = 0; //! Raw data versioning
/// Readout chain dimensions and mapping
UInt_t fuNrOfGdpbs = 0; //! Total number of GDPBs in the system
std::map<UInt_t, UInt_t> fGdpbIdIndexMap = {}; //! gDPB ID to index map
UInt_t fuNrOfFeePerGdpb = 0; //! Number of FEBs per GDPB
UInt_t fuNrOfChannelsPerFee = 0; //! Number of channels in each FEE
UInt_t fuNrOfChannelsPerGdpb = 0; //! Number of channels per GDPB
UInt_t fuNrOfFeePerGdpb = 0; //! Number of FEBs per GDPB
UInt_t fuNrOfChannelsPerFee = 0; //! Number of channels in each FEE
UInt_t fuNrOfChannelsPerGdpb = 0; //! Number of channels per GDPB
/// Detector Mapping
UInt_t fuNrOfGbtx = 0;
UInt_t fuNrOfModules = 0;
std::vector<Int_t> fviPsdChUId= {};
UInt_t fuNrOfGbtx = 0;
UInt_t fuNrOfModules = 0;
std::vector<Int_t> fviPsdChUId = {};
/// User settings: Data correction parameters
Double_t fdTimeOffsetNs = 0.0;
......@@ -113,25 +113,26 @@ private:
/// Running indices
/// TS/MS info
ULong64_t fulCurrentTsIdx = 0; //! Idx of the current TS
ULong64_t fulCurrentMsIdx = 0; //! Idx of the current MS in TS (0 to fuTotalMsNb)
size_t fuCurrentMsSysId = 0; //! SysId of the current MS in TS (0 to fuTotalMsNb)
Double_t fdTsStartTime = -1.0; //! Time in ns of current TS from the index of the first MS first component
Double_t fdTsStopTimeCore = -1.0; //! End Time in ns of current TS Core from the index of the first MS first component
Double_t fdMsTime = -1.0; //! Start Time in ns of current MS from its index field in header
UInt_t fuMsIndex = 0; //! Index of current MS within the TS
ULong64_t fulCurrentTsIdx = 0; //! Idx of the current TS
ULong64_t fulCurrentMsIdx = 0; //! Idx of the current MS in TS (0 to fuTotalMsNb)
size_t fuCurrentMsSysId = 0; //! SysId of the current MS in TS (0 to fuTotalMsNb)
Double_t fdTsStartTime = -1.0; //! Time in ns of current TS from the index of the first MS first component
Double_t fdTsStopTimeCore =
-1.0; //! End Time in ns of current TS Core from the index of the first MS first component
Double_t fdMsTime = -1.0; //! Start Time in ns of current MS from its index field in header
UInt_t fuMsIndex = 0; //! Index of current MS within the TS
/// Current data properties
UInt_t fuCurrentEquipmentId = 0; //! Current equipment ID, tells from which DPB the current MS is originating
UInt_t fuCurrDpbId = 0; //! Temp holder until Current equipment ID is properly filled in MS
UInt_t fuCurrDpbIdx = 0; //! Index of the DPB from which the MS currently unpacked is coming
UInt_t fuCurrDpbId = 0; //! Temp holder until Current equipment ID is properly filled in MS
UInt_t fuCurrDpbIdx = 0; //! Index of the DPB from which the MS currently unpacked is coming
/// Starting state book-keeping
Double_t fdStartTime = -1.0; /** Time of first valid hit (TS_MSB available), used as reference for evolution plots**/
Double_t fdStartTime = -1.0; /** Time of first valid hit (TS_MSB available), used as reference for evolution plots**/
Double_t fdStartTimeMsSz = 0.0; /** Time of first microslice, used as reference for evolution plots**/
std::chrono::steady_clock::time_point
ftStartTimeUnix = std::chrono::steady_clock::now(); /** Time of run Start from UNIX system, used as reference for long evolution plots against reception time **/
std::chrono::steady_clock::time_point ftStartTimeUnix = std::chrono::steady_clock::
now(); /** Time of run Start from UNIX system, used as reference for long evolution plots against reception time **/
ClassDef(CbmMcbm2018UnpackerAlgoPsd, 2)
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment