CbmRoot
Loading...
Searching...
No Matches
KfRootUtils.cxx
Go to the documentation of this file.
1
/* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2
SPDX-License-Identifier: GPL-3.0-only
3
Authors: Sergei Zharko [committer] */
4
9
10
#include "
KfRootUtils.h
"
11
12
#include "
KfMaterialMap.h
"
13
#include "TH2F.h"
14
#include "TString.h"
15
16
namespace
kf::tools
17
{
18
// -------------------------------------------------------------------------------------------------------------------
19
//
20
TH2F* RootUtils::ToHistogram(
const
cbm::algo::kf::MaterialMap
& material,
const
TString& name,
const
TString& title)
21
{
22
int
nBins = material.
GetNbins
();
23
int
xMin = -material.
GetXYmax
();
24
int
xMax = +material.
GetXYmax
();
25
auto
*
h
=
new
TH2F(name, title, nBins, xMin, xMax, nBins, xMin, xMax);
26
h
->GetXaxis()->SetTitle(
"X [cm]"
);
27
h
->GetYaxis()->SetTitle(
"Y [cm]"
);
28
h
->GetZaxis()->SetTitle(
"thickness [% of X0]"
);
29
for
(
int
iX = 0; iX < material.
GetNbins
(); iX++) {
30
for
(
int
iY = 0; iY < material.
GetNbins
(); iY++) {
31
h
->SetBinContent(iX + 1, iY + 1, 100. * material.
GetBinThicknessX0
<
float
>(iX, iY));
32
}
33
}
34
return
h
;
35
}
36
}
// namespace kf::tools
KfMaterialMap.h
KfRootUtils.h
Different ROOT utility functions for the KF-framework (header)
h
Data class with information on a STS local track.
cbm::algo::kf::MaterialMap
A map of station thickness in units of radiation length (X0) to the specific point in XY plane.
Definition
KfMaterialMap.h:27
cbm::algo::kf::MaterialMap::GetXYmax
float GetXYmax() const
Gets radius of the material table [cm].
Definition
KfMaterialMap.h:67
cbm::algo::kf::MaterialMap::GetNbins
int GetNbins() const
Gets number of bins (rows or columns) of the material table.
Definition
KfMaterialMap.h:64
cbm::algo::kf::MaterialMap::GetBinThicknessX0
I GetBinThicknessX0(int iGlob) const
Gets material thickness in units of radiational length X0.
Definition
KfMaterialMap.h:107
kf::tools
Definition
KfMaterialMapFactory.h:24
reco
kfnew
tools
KfRootUtils.cxx
Generated on Sun Dec 22 2024 23:04:16 for CbmRoot by
1.12.0