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
16namespace 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
Different ROOT utility functions for the KF-framework (header)
Data class with information on a STS local track.
A map of station thickness in units of radiation length (X0) to the specific point in XY plane.
float GetXYmax() const
Gets radius of the material table [cm].
int GetNbins() const
Gets number of bins (rows or columns) of the material table.
I GetBinThicknessX0(int iGlob) const
Gets material thickness in units of radiational length X0.