15#include "FairRootManager.h"
19 : FairTask(
"R3BNeulandProvideTStart", 0)
20 , fNeulandCalData(
"NeulandCalData")
21 , fEventHeader(nullptr)
27 fNeulandCalData.Init();
29 auto ioman = FairRootManager::Instance();
32 throw std::runtime_error(
"R3BNeulandProvideTStart: No FairRootManager");
35 fEventHeader =
dynamic_cast<R3BEventHeader*
>(ioman->GetObject(
"EventHeader."));
36 if (fEventHeader ==
nullptr)
38 throw std::runtime_error(
"R3BNeulandProvideTStart: No R3BEventHeader");
46Double_t R3BNeulandProvideTStart::GetTStart()
const
48 const auto calData = fNeulandCalData.
Retrieve();
50 double tref[2] = { NAN, NAN };
51 double eref[2] = { NAN, NAN };
54 for (
const auto& data : calData)
56 const auto side = data->GetSide() - 1;
57 const auto bar = data->GetBarId();
62 tref[side] = data->GetTime();
63 eref[side] = data->GetQdc();
71 if (tref[0] - tref[1] < -0.5 * 5. * 2048)
72 tref[1] = tref[1] - 5. * 2048;
73 if (tref[0] - tref[1] > 0.5 * 5. * 2048)
74 tref[0] = tref[0] - 5. * 2048;
76 pstart = 0.5 * (tref[0] + tref[1]);
82bool R3BNeulandProvideTStart::IsBeam()
const {
return !std::isnan(GetTStart()); }
ClassImp(R3B::Neuland::Cal2HitPar)
InitStatus Init() override
void Exec(Option_t *) override
R3BNeulandProvideTStart()