2022-02-05 13:20:45 -05:00
|
|
|
#include "SPSAnalysisStage.h"
|
|
|
|
|
|
|
|
namespace Navigator {
|
|
|
|
|
|
|
|
SPSAnalysisStage::SPSAnalysisStage() :
|
|
|
|
AnalysisStage("SPSAnalysis"), delayFLTime("delayFLTime"), delayFRTime("delayFRTime"), delayBLTime("delayBLTime"), delayBRTime("delayBRTime"), x1("x1"), x2("x2"), xavg("xavg")
|
|
|
|
{
|
2022-02-20 22:19:33 -05:00
|
|
|
SpectrumManager& manager = SpectrumManager::GetInstance();
|
|
|
|
manager.BindParameter(delayFLTime);
|
|
|
|
manager.BindParameter(delayFRTime);
|
|
|
|
manager.BindParameter(delayBLTime);
|
|
|
|
manager.BindParameter(delayBRTime);
|
|
|
|
manager.BindParameter(x1);
|
|
|
|
manager.BindParameter(x2);
|
|
|
|
manager.BindParameter(xavg);
|
2022-02-05 13:20:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
SPSAnalysisStage::~SPSAnalysisStage() {}
|
|
|
|
|
2022-02-19 11:33:21 -05:00
|
|
|
void SPSAnalysisStage::AnalyzePhysicsEvent(const NavEvent& event)
|
2022-02-05 13:20:45 -05:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
for(auto& hit : event)
|
|
|
|
{
|
2022-02-19 11:33:21 -05:00
|
|
|
if(hit.id == 136)
|
2022-02-05 13:20:45 -05:00
|
|
|
delayFLTime.SetValue(hit.timestamp/1.0e3);
|
2022-02-19 11:33:21 -05:00
|
|
|
else if(hit.id == 137)
|
2022-02-05 13:20:45 -05:00
|
|
|
delayFRTime.SetValue(hit.timestamp/1.0e3);
|
2022-02-19 11:33:21 -05:00
|
|
|
else if(hit.id == 138)
|
2022-02-05 13:20:45 -05:00
|
|
|
delayBLTime.SetValue(hit.timestamp/1.0e3);
|
2022-02-19 11:33:21 -05:00
|
|
|
else if(hit.id == 139)
|
2022-02-05 13:20:45 -05:00
|
|
|
delayBRTime.SetValue(hit.timestamp/1.0e3);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(delayFLTime.IsValid() && delayFRTime.IsValid())
|
|
|
|
x1.SetValue((delayFLTime.GetValue() - delayFRTime.GetValue())*0.5);
|
|
|
|
|
|
|
|
if(delayBLTime.IsValid() && delayBRTime.IsValid())
|
|
|
|
x1.SetValue((delayBLTime.GetValue() - delayBRTime.GetValue())*0.5);
|
|
|
|
}
|
|
|
|
}
|