Skip to content
Snippets Groups Projects
Commit f6d62bef authored by Sergei Zharko's avatar Sergei Zharko
Browse files

online QA: CA updates

parent f5673e3f
No related branches found
No related tags found
1 merge request!1746hist-server: user interruption handling
Pipeline #28603 passed
......@@ -259,6 +259,8 @@ namespace cbm::algo::ca
using Tbase::begin;
using Tbase::capacity;
using Tbase::cbegin;
using Tbase::cend;
using Tbase::clear;
using Tbase::end;
using Tbase::insert; //TODO:: make it private
......
......@@ -138,6 +138,20 @@ void InputQa::Init()
}
}
// Hit time distributions
fvphHitTime.resize(nSt + 1); // [nSt] - total over stations
for (int iSt = 0; iSt < nSt + 1; ++iSt) {
auto staNm = iSt == nSt ? "" : format("_sta_{}", iSt);
auto staTl = iSt == nSt ? "" : format(" in station {}", iSt);
for (auto hitSet : kHitSets) {
auto setNm = EHitSet::Input == hitSet ? "input" : "used";
auto setTl = EHitSet::Input == hitSet ? "Input" : "Used";
auto name = format("hit_{}_rel_time{}", setNm, staNm);
auto titl = format("{} hit relative time{}; #delta t_{{hit}};Count", setTl, staTl);
fvphHitTime[iSt][hitSet] = fQaData.MakeObj<H1D>(name, titl, 10000, -0.1, 1.1);
}
}
// ----- Init canvases
// Hit occupancies
for (auto hitSet : kHitSets) {
......@@ -211,6 +225,13 @@ void InputQa::Exec()
vbHitUsed[iH] = true;
}
// Calculate max and min hit time
const auto& hits = fpInputData->GetHits();
auto [minTimeIt, maxTimeIt] =
std::minmax_element(hits.cbegin(), hits.cend(), [](const auto& h1, const auto& h2) { return h1.T() < h2.T(); });
fMinHitTime = minTimeIt->T();
fMaxHitTime = maxTimeIt->T();
// Fill input hit histograms
{
for (int iH = 0; iH < nHitsInput; ++iH) {
......@@ -233,6 +254,7 @@ void InputQa::Exec()
//
void InputQa::FillHitDistributionsForHitSet(InputQa::EHitSet hitSet, const Hit& hit)
{
int nSt = fpParameters->GetNstationsActive();
int iSt = hit.Station();
double x = hit.X();
double y = hit.Y();
......@@ -243,4 +265,7 @@ void InputQa::FillHitDistributionsForHitSet(InputQa::EHitSet hitSet, const Hit&
auto nKeys = static_cast<double>(fpInputData->GetNhitKeys());
fvphHitFrontKeyIndex[hitSet]->Fill(hit.FrontKey() / nKeys);
fvphHitBackKeyIndex[hitSet]->Fill(hit.BackKey() / nKeys);
double relTime = (hit.T() - fMinHitTime) / (fMaxHitTime - fMinHitTime);
fvphHitTime[iSt][hitSet]->Fill(relTime);
fvphHitTime[nSt][hitSet]->Fill(relTime);
}
......@@ -72,6 +72,9 @@ namespace cbm::algo::ca
static constexpr double kXYZMargin = 0.05; ///< Margin for occupancy distributions in XY plane
static constexpr int knHitSets = 2; ///< Number of hit sets: input/used
double fMinHitTime = std::numeric_limits<double>::max();
double fMaxHitTime = std::numeric_limits<double>::lowest();
// Hit distributions vs. station
using OccupHistContainer_t = std::vector<HitSetArray_t<qa::H2D*>>;
OccupHistContainer_t fvphHitOccupXY; ///< hist: Hit occupancy in different stations in XY plane
......@@ -82,5 +85,7 @@ namespace cbm::algo::ca
HitSetArray_t<qa::H1D*> fvphHitFrontKeyIndex = {nullptr, nullptr}; ///< Indices of front hit keys
HitSetArray_t<qa::H1D*> fvphHitBackKeyIndex = {nullptr, nullptr}; ///< Indices of back hit keys
std::vector<HitSetArray_t<qa::H1D*>> fvphHitTime; ///< Time distribution of hits
};
} // namespace cbm::algo::ca
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment