24 throw std::invalid_argument(
"Missing folder name base");
26 throw std::invalid_argument(
"Missing file name");
28 throw std::invalid_argument(
"Missing logger");
30 throw std::invalid_argument(
"Missing service name");
37 TFile* outputFile = TFile::Open(m_cfg.fileName.c_str(),
"recreate");
39 throw std::ios_base::failure(
"Could not open '" + m_cfg.fileName);
45 auto& surfaceMaps = detMaterial.first;
46 for (
auto& [key,
value] : surfaceMaps) {
53 const auto gvolID = geoID.
volume();
54 const auto gbouID = geoID.
boundary();
55 const auto glayID = geoID.
layer();
56 const auto gappID = geoID.
approach();
59 std::string tdName = m_cfg.folderNameBase.c_str();
66 outputFile->mkdir(tdName.c_str());
67 outputFile->cd(tdName.c_str());
71 size_t bins0 = 1, bins1 = 1;
83 size_t binningBins = binningData.size();
86 TH1F*
n =
new TH1F(m_cfg.ntag.c_str(),
"bins; bin", binningBins, -0.5,
90 TH1F*
v =
new TH1F(m_cfg.vtag.c_str(),
"binning values; bin", binningBins,
91 -0.5, binningBins - 0.5);
94 TH1F* o =
new TH1F(m_cfg.otag.c_str(),
"binning options; bin",
95 binningBins, -0.5, binningBins - 0.5);
98 TH1F*
min =
new TH1F(m_cfg.mintag.c_str(),
"min; bin", binningBins, -0.5,
102 TH1F*
max =
new TH1F(m_cfg.maxtag.c_str(),
"max; bin", binningBins, -0.5,
107 for (
auto bData : binningData) {
109 n->SetBinContent(b,
int(binningData[b - 1].bins()));
110 v->SetBinContent(b,
int(binningData[b - 1].binvalue));
111 o->SetBinContent(b,
int(binningData[b - 1].option));
112 min->SetBinContent(b, binningData[b - 1].min);
113 max->SetBinContent(b, binningData[b - 1].max);
123 TH2F*
t =
new TH2F(m_cfg.ttag.c_str(),
"thickness [mm] ;b0 ;b1", bins0,
124 -0.5, bins0 - 0.5, bins1, -0.5, bins1 - 0.5);
125 TH2F* x0 =
new TH2F(m_cfg.x0tag.c_str(),
"X_{0} [mm] ;b0 ;b1", bins0, -0.5,
126 bins0 - 0.5, bins1, -0.5, bins1 - 0.5);
127 TH2F* l0 =
new TH2F(m_cfg.l0tag.c_str(),
"#Lambda_{0} [mm] ;b0 ;b1", bins0,
128 -0.5, bins0 - 0.5, bins1, -0.5, bins1 - 0.5);
129 TH2F*
A =
new TH2F(m_cfg.atag.c_str(),
"X_{0} [mm] ;b0 ;b1", bins0, -0.5,
130 bins0 - 0.5, bins1, -0.5, bins1 - 0.5);
131 TH2F*
Z =
new TH2F(m_cfg.ztag.c_str(),
"#Lambda_{0} [mm] ;b0 ;b1", bins0,
132 -0.5, bins0 - 0.5, bins1, -0.5, bins1 - 0.5);
133 TH2F* rho =
new TH2F(m_cfg.rhotag.c_str(),
"#rho [g/mm^3] ;b0 ;b1", bins0,
134 -0.5, bins0 - 0.5, bins1, -0.5, bins1 - 0.5);
137 for (
size_t b0 = 0; b0 < bins0; ++b0) {
138 for (
size_t b1 = 0; b1 < bins1; ++b1) {
142 t->SetBinContent(b0 + 1, b1 + 1,
mat.thickness());
143 x0->SetBinContent(b0 + 1, b1 + 1,
mat.material().X0());
144 l0->SetBinContent(b0 + 1, b1 + 1,
mat.material().L0());
145 A->SetBinContent(b0 + 1, b1 + 1,
mat.material().Ar());
146 Z->SetBinContent(b0 + 1, b1 + 1,
mat.material().Z());
147 rho->SetBinContent(b0 + 1, b1 + 1,
mat.material().massDensity());
167 collectMaterial(*
hVolume, detMatMap);
184 collectMaterial(*lay, detMatMap);
189 if (m_cfg.processBoundaries) {
191 const auto& bSurface = bou->surfaceRepresentation();
192 if (bSurface.surfaceMaterialSharedPtr() !=
nullptr) {
193 detMatMap.first[bSurface.geoID()] = bSurface.surfaceMaterialSharedPtr();
201 collectMaterial(*tvol, detMatMap);
210 if (rSurface.surfaceMaterialSharedPtr() !=
nullptr and
211 m_cfg.processRepresenting) {
218 if (aSurface->surfaceMaterialSharedPtr() !=
nullptr) {
219 detMatMap.first[aSurface->geoID()] =
220 aSurface->surfaceMaterialSharedPtr();
226 if (tLayer.
surfaceArray() !=
nullptr and m_cfg.processSensitives) {
229 if (sSurface->surfaceMaterialSharedPtr() !=
nullptr) {
230 detMatMap.first[sSurface->geoID()] =
231 sSurface->surfaceMaterialSharedPtr();