CbmRoot
Loading...
Searching...
No Matches
KfMaterialMonitor.h
Go to the documentation of this file.
1/* Copyright (C) 2023-2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergey Gorbunov [committer], Sergei Zharko */
4
8
9#pragma once
10
11#include "KfDefs.h"
12#include "KfMaterialMap.h"
13
14#include <algorithm>
15#include <string>
16#include <vector>
17
18namespace cbm::algo::kf
19{
24 public:
27
31 MaterialMonitor(const MaterialMap* materialMap, const std::string& name = "") : fName(name)
32 {
33 SetMaterial(materialMap);
34 }
35
38 void SetMaterial(const MaterialMap* materialMap);
39
42 void SetName(const std::string& name) { fName = name; }
43
45 void ResetActiveBins() { std::fill(fActiveBinMap.begin(), fActiveBinMap.end(), 0); }
46
50 void MarkActiveBin(float x, float y);
51
53 void EvaluateStatistics();
54
56 std::string ToString();
57
59 int GetActiveNbins() const { return fActiveNbins; }
60
62 double GetActiveRadThickMin() const { return fPassiveRadThickMin; }
63
65 double GetActiveRadThickMax() const { return fPassiveRadThickMax; }
66
69
71 int GetPassiveNbins() const { return fPassiveNbins; }
72
74 double GetPassiveRadThickMin() const { return fPassiveRadThickMin; }
75
77 double GetPassiveRadThickMax() const { return fPassiveRadThickMax; }
78
81
83 double GetRatioOfOutsideHits() const { return fNhitsOutside / (fNhitsTotal + 1.e-8); }
84
86 double GetNhits() const { return fNhitsTotal; }
87
88 private:
89 std::string fName{};
90 std::vector<char> fActiveBinMap{};
91
92 const MaterialMap* fMaterial{nullptr};
93
97
101
102 unsigned long fNhitsTotal{0};
103 unsigned long fNhitsOutside{0};
104
107 };
108
109} // namespace cbm::algo::kf
Common constant definitions for the Kalman Filter library.
A map of station thickness in units of radiation length (X0) to the specific point in XY plane.
A class to collect statistics for a material budget map of the KF-framework.
double GetActiveRadThickMin() const
Get minimal radiation thickness among all active bins.
int GetPassiveNbins() const
Get number of passive bins in the map.
double GetPassiveRadThickMean() const
Get average radiation thickness among all passive bins.
double GetRatioOfOutsideHits() const
Get the ration of hits that show up outside the material map.
double GetActiveRadThickMean() const
Get average radiation thickness among all active bins.
const MaterialMap * fMaterial
Pointer to the material map.
double GetPassiveRadThickMax() const
Get maximal radiation thickness among all passive bins.
unsigned long fNhitsOutside
number of hits outside the material map
double fActiveRadThickMax
Active material: maximal thickness.
std::string fName
Name of the material map.
MaterialMonitor()
Default constructor.
std::vector< char > fActiveBinMap
Map of active bins in the material map (bins where hits appear)
double fPassiveRadThickMin
Passive material: minimal thickness.
double fPassiveRadThickMean
Passive material: average thickness.
double GetNhits() const
Get the number of processed hits.
unsigned long fNhitsTotal
number of hits in statistics
int GetActiveNbins() const
Get number of active bins in the map.
void EvaluateStatistics()
Update values of statistical variables with respect to the active map.
std::string ToString()
Print statistics to a string.
int fPassiveNbins
Passive material: number of bins.
int fActiveNbins
Active material: number of bins.
void MarkActiveBin(float x, float y)
Mark a bin as active.
MaterialMonitor(const MaterialMap *materialMap, const std::string &name="")
Constructor.
void SetMaterial(const MaterialMap *materialMap)
Set a material budget map.
double fActiveRadThickMin
Active material: minimal thickness.
double GetPassiveRadThickMin() const
Get minimal radiation thickness among all passive bins.
double fPassiveRadThickMax
Passive material: maximal thickness.
double fActiveRadThickMean
Active material: average thickness.
void ResetActiveBins()
Reset the map of active bins.
void SetName(const std::string &name)
Set a name of the material budget map.
double GetActiveRadThickMax() const
Get maximal radiation thickness among all active bins.
constexpr double Undef< double >
Definition KfDefs.h:127
constexpr int Undef< int >
Definition KfDefs.h:118