26 throw std::invalid_argument(
"Missing folder name base");
28 throw std::invalid_argument(
"Missing file name");
30 throw std::invalid_argument(
"Missing logger");
32 throw std::invalid_argument(
"Missing service name");
39 TFile* outputFile = TFile::Open(m_cfg.fileName.c_str(),
"recreate");
41 throw std::ios_base::failure(
"Could not open '" + m_cfg.fileName);
47 auto& surfaceMaps = detMaterial.first;
48 for (
auto& [key,
value] : surfaceMaps) {
55 const auto gvolID = geoID.
volume();
56 const auto gbouID = geoID.
boundary();
57 const auto glayID = geoID.
layer();
58 const auto gappID = geoID.
approach();
61 std::string tdName = m_cfg.folderNameBase.c_str();
68 outputFile->mkdir(tdName.c_str());
69 outputFile->cd(tdName.c_str());
73 size_t bins0 = 1, bins1 = 1;
85 size_t binningBins = binningData.size();
88 TH1F*
n =
new TH1F(m_cfg.ntag.c_str(),
"bins; bin", binningBins, -0.5,
92 TH1F*
v =
new TH1F(m_cfg.vtag.c_str(),
"binning values; bin", binningBins,
93 -0.5, binningBins - 0.5);
96 TH1F* o =
new TH1F(m_cfg.otag.c_str(),
"binning options; bin",
97 binningBins, -0.5, binningBins - 0.5);
100 TH1F*
min =
new TH1F(m_cfg.mintag.c_str(),
"min; bin", binningBins, -0.5,
104 TH1F*
max =
new TH1F(m_cfg.maxtag.c_str(),
"max; bin", binningBins, -0.5,
109 for (
auto bData : binningData) {
111 n->SetBinContent(b,
int(binningData[b - 1].
bins()));
112 v->SetBinContent(b,
int(binningData[b - 1].binvalue));
113 o->SetBinContent(b,
int(binningData[b - 1].option));
114 min->SetBinContent(b, binningData[b - 1].min);
115 max->SetBinContent(b, binningData[b - 1].max);
125 TH2F*
t =
new TH2F(m_cfg.ttag.c_str(),
"thickness [mm] ;b0 ;b1", bins0,
126 -0.5, bins0 - 0.5, bins1, -0.5, bins1 - 0.5);
127 TH2F* x0 =
new TH2F(m_cfg.x0tag.c_str(),
"X_{0} [mm] ;b0 ;b1", bins0, -0.5,
128 bins0 - 0.5, bins1, -0.5, bins1 - 0.5);
129 TH2F* l0 =
new TH2F(m_cfg.l0tag.c_str(),
"#Lambda_{0} [mm] ;b0 ;b1", bins0,
130 -0.5, bins0 - 0.5, bins1, -0.5, bins1 - 0.5);
131 TH2F* A =
new TH2F(m_cfg.atag.c_str(),
"X_{0} [mm] ;b0 ;b1", bins0, -0.5,
132 bins0 - 0.5, bins1, -0.5, bins1 - 0.5);
133 TH2F* Z =
new TH2F(m_cfg.ztag.c_str(),
"#Lambda_{0} [mm] ;b0 ;b1", bins0,
134 -0.5, bins0 - 0.5, bins1, -0.5, bins1 - 0.5);
135 TH2F* rho =
new TH2F(m_cfg.rhotag.c_str(),
"#rho [g/mm^3] ;b0 ;b1", bins0,
136 -0.5, bins0 - 0.5, bins1, -0.5, bins1 - 0.5);
139 for (
size_t b0 = 0; b0 < bins0; ++b0) {
140 for (
size_t b1 = 0; b1 < bins1; ++b1) {
144 t->SetBinContent(b0 + 1, b1 + 1, mat.thickness());
145 x0->SetBinContent(b0 + 1, b1 + 1, mat.material().X0());
146 l0->SetBinContent(b0 + 1, b1 + 1, mat.material().L0());
147 A->SetBinContent(b0 + 1, b1 + 1, mat.material().Ar());
148 Z->SetBinContent(b0 + 1, b1 + 1, mat.material().Z());
149 rho->SetBinContent(b0 + 1, b1 + 1, mat.material().massDensity());
170 collectMaterial(*
hVolume, detMatMap);
187 collectMaterial(*lay, detMatMap);
192 if (m_cfg.processBoundaries) {
194 const auto& bSurface = bou->surfaceRepresentation();
195 if (bSurface.surfaceMaterialSharedPtr() !=
nullptr) {
196 detMatMap.first[bSurface.geometryId()] =
197 bSurface.surfaceMaterialSharedPtr();
205 collectMaterial(*tvol, detMatMap);
214 if (rSurface.surfaceMaterialSharedPtr() !=
nullptr and
215 m_cfg.processRepresenting) {
216 detMatMap.first[rSurface.geometryId()] =
223 if (aSurface->surfaceMaterialSharedPtr() !=
nullptr) {
224 detMatMap.first[aSurface->geometryId()] =
225 aSurface->surfaceMaterialSharedPtr();
231 if (tLayer.
surfaceArray() !=
nullptr and m_cfg.processSensitives) {
234 if (sSurface->surfaceMaterialSharedPtr() !=
nullptr) {
235 detMatMap.first[sSurface->geometryId()] =
236 sSurface->surfaceMaterialSharedPtr();