Skip to content
Snippets Groups Projects
Commit 64638b88 authored by Nikolay Karpushkin's avatar Nikolay Karpushkin
Browse files

time_fix

parent 80d9345c
No related branches found
No related tags found
1 merge request!409Add mpsd macros
......@@ -21,6 +21,7 @@
CbmPsdDsp::CbmPsdDsp()
: fuAddress()
, fdTime()
, fdTsTime()
, fdEdep()
, fuZL()
, fdAccum()
......@@ -45,6 +46,7 @@ CbmPsdDsp::CbmPsdDsp()
// --- Constructor with assignment
CbmPsdDsp::CbmPsdDsp(UInt_t address,
Double_t time,
Double_t ts_time,
Double_t edep,
UInt_t zl,
Double_t accum,
......@@ -65,6 +67,7 @@ CbmPsdDsp::CbmPsdDsp(UInt_t address,
: fuAddress(address)
, fdTime(time)
, fdTsTime(ts_time)
, fdEdep(edep)
, fuZL(zl)
, fdAccum(accum)
......@@ -90,6 +93,7 @@ CbmPsdDsp::CbmPsdDsp(UInt_t address,
CbmPsdDsp::CbmPsdDsp(const CbmPsdDsp& other)
: fuAddress(other.fuAddress)
, fdTime(other.fdTime)
, fdTsTime(other.fdTsTime)
, fdEdep(other.fdEdep)
, fuZL(other.fuZL)
, fdAccum(other.fdAccum)
......@@ -115,6 +119,7 @@ CbmPsdDsp::CbmPsdDsp(const CbmPsdDsp& other)
CbmPsdDsp::CbmPsdDsp(CbmPsdDsp&& other)
: fuAddress(other.fuAddress)
, fdTime(other.fdTime)
, fdTsTime(other.fdTsTime)
, fdEdep(other.fdEdep)
, fuZL(other.fuZL)
, fdAccum(other.fdAccum)
......@@ -150,6 +155,7 @@ CbmPsdDsp& CbmPsdDsp::operator=(const CbmPsdDsp& other)
if (this != &other) {
fuAddress = other.fuAddress;
fdTime = other.fdTime;
fdTsTime = other.fdTsTime;
fdEdep = other.fdEdep;
fuZL = other.fuZL;
fdAccum = other.fdAccum;
......@@ -178,6 +184,7 @@ CbmPsdDsp& CbmPsdDsp::operator=(CbmPsdDsp&& other)
if (this != &other) {
fuAddress = other.fuAddress;
fdTime = other.fdTime;
fdTsTime = other.fdTsTime;
fdEdep = other.fdEdep;
fuZL = other.fuZL;
fdAccum = other.fdAccum;
......
......@@ -37,7 +37,7 @@ public:
/** @brief Constructor with detailed assignment.
**/
CbmPsdDsp(UInt_t address, Double_t time, Double_t edep, UInt_t zl, Double_t accum, Double_t adc_time,
CbmPsdDsp(UInt_t address, Double_t time, Double_t ts_time, Double_t edep, UInt_t zl, Double_t accum, Double_t adc_time,
Double_t edep_wfm, Double_t ampl, UInt_t minimum, UInt_t time_max, std::vector<std::uint16_t> wfm,
Double_t fit_ampl, Double_t fit_zl, Double_t fit_edep, Double_t fit_r2, Double_t fit_time_max,
std::vector<std::uint16_t> fit_wfm);
......@@ -81,6 +81,12 @@ public:
Double_t GetTime() const { return fdTime; };
/** @brief TsTime
** @return TsTime [ns]
**/
Double_t GetTsTime() const { return fdTsTime; };
/** @brief Energy deposit
** @return Energy deposit
**/
......@@ -112,7 +118,8 @@ public:
void SetEdep(Double_t edep) { fdEdep = edep; }
UInt_t fuAddress = 0; /// Unique channel address
Double_t fdTime = -1.; /// Time of measurement [ns]
Double_t fdTime = -1.; /// Time of measurement relative to TS [ns]
Double_t fdTsTime = -1.; /// Time of TimeSlice of measurement. Relative to first TS [ns]
Double_t fdEdep = 0.; /// Energy deposition from FPGA [MeV]
UInt_t fuZL = 0; /// ZeroLevel from waveform [adc counts]
Double_t fdAccum = 0; /// FPGA FEE Accumulator
......@@ -136,6 +143,7 @@ public:
{
ar& fuAddress;
ar& fdTime;
ar& fdTsTime;
ar& fdEdep;
ar& fuZL;
ar& fdAccum;
......
......@@ -255,11 +255,6 @@ void CbmMcbmCheckTimingAlgo::CheckInterSystemOffset()
dRefTime = fpT0DigiVec->at(uDigi).GetTime();
dRefCharge = fpT0DigiVec->at(uDigi).GetCharge();
} // if( ECbmModuleId::kT0 == fRefDet.detId )
if (ECbmModuleId::kPsd == fRefDet.detId) {
dRefTime = fDigiMan->Get<DigiRef>(uDigi)->GetTime();
dRefCharge = fDigiMan->Get<DigiRef>(uDigi)->GetCharge();
uRefAddress = fDigiMan->Get<DigiRef>(uDigi)->GetAddress();
} // if( ECbmModuleId::kT0 == fRefDet.detId )
else {
dRefTime = fDigiMan->Get<DigiRef>(uDigi)->GetTime();
dRefCharge = fDigiMan->Get<DigiRef>(uDigi)->GetCharge();
......
......@@ -218,7 +218,7 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u
uint32_t uSize = msDescriptor.size;
fulCurrentMsIdx = msDescriptor.idx;
fdMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx);
fdMsTime = static_cast<double>(fulCurrentMsIdx);
LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex << fuCurrentEquipmentId << std::dec
<< " has size: " << uSize;
......@@ -263,7 +263,7 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u
/// Save start time of first valid MS )
if (fdStartTime < 0) fdStartTime = fdMsTime;
Double_t dMsRelativeTime = fdMsTime - fdStartTime;
Double_t dMsRelativeTime = fdMsTime - fdTsStartTime;
// If MS time is less than start time print error and return
if (fdMsTime - fdStartTime < 0) {
......@@ -316,7 +316,7 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u
}
if (ReadResult == 0) {
double prev_hit_time =
double prev_hit_time =
dMsRelativeTime + (double) PsdReader.VectPackHdr.at(0).uAdcTime * 12.5 - fdTimeOffsetNs; //in ns
//hit loop
......@@ -338,8 +338,8 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u
UInt_t uChanUId = fviPsdChUId[uHitChannel]; //unique ID
UInt_t fuAddress = uChanUId; /// Unique channel address
Double_t fdTime = dMsRelativeTime + (double) PsdReader.VectPackHdr.at(hit_iter).uAdcTime * 12.5
- fdTimeOffsetNs; /// Time of measurement [ns]
Double_t fdTime = dMsRelativeTime + (double) PsdReader.VectPackHdr.at(hit_iter).uAdcTime * 12.5 - fdTimeOffsetNs; /// Time of measurement relative to TS [ns]
Double_t fdTsTime = fdTsStartTime - fdStartTime; /// Time of TimeSlice of measurement. Relative to first TS [ns]
Double_t fdEdep = (double) PsdReader.VectHitHdr.at(hit_iter).uSignalCharge
/ fUnpackPar->GetMipCalibration(uHitChannel); /// Energy deposition from FPGA [MeV]
UInt_t fuZL = PsdReader.VectHitHdr.at(hit_iter).uZeroLevel; /// ZeroLevel from waveform [adc counts]
......@@ -399,7 +399,7 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u
fuFitWfm = Pfitter.GetFitWfm();
}
CbmPsdDsp dsp = CbmPsdDsp(fuAddress, fdTime, fdEdep, fuZL, fdAccum, fdAdcTime,
CbmPsdDsp dsp = CbmPsdDsp(fuAddress, fdTime, fdTsTime, fdEdep, fuZL, fdAccum, fdAdcTime,
fdEdepWfm, fdAmpl, fuMinimum, fuTimeMax, fuWfm,
......@@ -560,7 +560,7 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::SetDspOutputPointer(std::vector<CbmPsdDsp>* c
std::unique_ptr<CbmPsdDigi> CbmMcbm2018UnpackerAlgoPsd::MakeDigi(CbmPsdDsp dsp)
{
std::unique_ptr<CbmPsdDigi> digi(new CbmPsdDigi(dsp.GetAddress(), dsp.GetTime(), dsp.GetEdep()));
std::unique_ptr<CbmPsdDigi> digi(new CbmPsdDigi( dsp.GetAddress(), dsp.GetTime(), dsp.fdFitEdep ));
return digi;
}
......
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