Finalize and merge results from all threads.
138 RadiationMapsMaker::Report maps;
141 std::vector<std::vector<double> *> pVal = {
142 &(maps.m_rz_tid),&(maps.m_rz_eion),&(maps.m_rz_niel),&(maps.m_rz_h20),&(maps.m_rz_neut),&(maps.m_rz_chad),
143 &(maps.m_full_rz_tid),&(maps.m_full_rz_eion),&(maps.m_full_rz_niel),&(maps.m_full_rz_h20),&(maps.m_full_rz_neut),&(maps.m_full_rz_chad)
146 std::vector<std::vector<double> *> pVal3d = {
147 &(maps.m_3d_tid),&(maps.m_3d_eion),&(maps.m_3d_niel),&(maps.m_3d_h20),&(maps.m_3d_neut),&(maps.m_3d_chad)
150 std::vector<std::vector<double> *> pValSpec = {
151 &(maps.m_rz_neut_spec),&(maps.m_rz_gamm_spec),&(maps.m_rz_elec_spec),&(maps.m_rz_muon_spec),&(maps.m_rz_pion_spec),&(maps.m_rz_prot_spec),&(maps.m_rz_rest_spec),
152 &(maps.m_full_rz_neut_spec),&(maps.m_full_rz_gamm_spec),&(maps.m_full_rz_elec_spec),&(maps.m_full_rz_muon_spec),&(maps.m_full_rz_pion_spec),&(maps.m_full_rz_prot_spec),&(maps.m_full_rz_rest_spec)
155 std::vector<int> nBinslogE = {
160 std::vector<std::vector<double> *> pValThetaSpec = {
161 &(maps.m_theta_full_rz_neut_spec),&(maps.m_theta_full_rz_gamm_spec),&(maps.m_theta_full_rz_elec_spec),&(maps.m_theta_full_rz_muon_spec),&(maps.m_theta_full_rz_pion_spec),&(maps.m_theta_full_rz_prot_spec),&(maps.m_theta_full_rz_rchgd_spec),&(maps.m_theta_full_rz_rneut_spec)
164 std::vector<int> nBinsThetalogE = {
168 for(
unsigned int hi=0;hi<pVal.size();hi++) {
172 (pVal[hi])->resize(0);
183 for(
unsigned int hi=0;hi<pVal3d.size();hi++) {
184 (pVal3d[hi])->resize(0);
190 for(
unsigned int hi=0;hi<pValSpec.size();hi++) {
191 (pValSpec[hi])->resize(0);
197 for(
unsigned int hi=0;hi<pValThetaSpec.size();hi++) {
198 (pValThetaSpec[hi])->resize(0);
204 maps.m_rz_tid_time .resize(0);
205 maps.m_rz_ht_time .resize(0);
206 maps.m_full_rz_tid_time .resize(0);
207 maps.m_full_rz_ht_time .resize(0);
209 maps.m_rz_element .resize(0);
210 maps.m_full_rz_element .resize(0);
215 maps.m_rz_vol .resize(0);
216 maps.m_rz_norm.resize(0);
218 maps.m_full_rz_vol.resize(0);
219 maps.m_full_rz_norm.resize(0);
221 maps.m_3d_vol .resize(0);
222 maps.m_3d_norm.resize(0);
260 std::vector<const char *> h2dNames = {
261 "rz_tid",
"rz_eion",
"rz_niel",
"rz_h20",
"rz_neut",
"rz_chad",
262 "full_rz_tid",
"full_rz_eion",
"full_rz_niel",
"full_rz_h20",
"full_rz_neut",
"full_rz_chad"
265 std::vector<const char *> h2dZTitles = {
266 "TID [Gy]",
"E_{ion}/V [MeV/cm^{3}]",
"NIEL [n_{eq}/cm^{2}]",
"SEE [h_{>20 MeV}/cm^{2}]",
"FLUX [n_{>100 keV}/cm^{2}]",
"FLUX [h_{charged}/cm^{2}]",
267 "TID [Gy]",
"E_{ion}/V [MeV/cm^{3}]",
"NIEL [n_{eq}/cm^{2}]",
"SEE [h_{>20 MeV}/cm^{2}]",
"FLUX [n_{>100 keV}/cm^{2}]",
"FLUX [h_{charged}/cm^{2}]"
270 std::vector<double> zMin = {
275 std::vector<double> zMax = {
280 std::vector<double> rMin = {
285 std::vector<double> rMax = {
293 TH2D * h_rz_norm = 0;
294 TH2D * h_full_rz_vol = 0;
295 TH2D * h_full_rz_norm = 0;
297 for(
unsigned int hi=0;hi<h2dNames.size();hi++) {
300 h2d->SetYTitle(
"r [cm]");
301 h2d->SetZTitle(h2dZTitles[hi]);
315 h_rz_vol ->SetXTitle(
xtitle);
316 h_rz_norm ->SetXTitle(
xtitle);
317 h_rz_vol ->SetYTitle(
"r [cm]");
318 h_rz_norm ->SetYTitle(
"r [cm]");
319 std::string
hname(
"Volume fraction of");
326 h_rz_vol ->SetZTitle(
hname.data());
327 h_rz_norm ->SetZTitle(
"Volume norm");
329 h_full_rz_vol ->SetXTitle(
xtitle);
330 h_full_rz_norm ->SetXTitle(
xtitle);
331 h_full_rz_vol ->SetYTitle(
"r [cm]");
332 h_full_rz_norm ->SetYTitle(
"r [cm]");
333 h_full_rz_vol ->SetZTitle(
hname.data());
334 h_full_rz_norm ->SetZTitle(
"Volume norm");
338 for(
int i=0;
i<h2d->GetNbinsX();
i++) {
339 for(
int j=0;j<h2d->GetNbinsY();j++) {
340 int iBin = h2d->GetBin(
i+1,j+1);
342 double r0=h2d->GetYaxis()->GetBinLowEdge(j+1);
343 double r1=h2d->GetYaxis()->GetBinUpEdge(j+1);
344 double z0=h2d->GetXaxis()->GetBinLowEdge(
i+1);
345 double z1=h2d->GetXaxis()->GetBinUpEdge(
i+1);
351 double val = (*(pVal[hi]))[vBin];
352 h2d->SetBinContent(iBin,
val/vol);
356 val =maps.m_rz_vol[vBin];
357 h_rz_vol->SetBinContent(iBin,
val/vol);
359 val =maps.m_rz_norm[vBin];
360 h_rz_norm->SetBinContent(iBin,
val/vol);
365 val =maps.m_full_rz_vol[vBin];
366 h_full_rz_vol->SetBinContent(iBin,
val/vol);
368 val =maps.m_full_rz_norm[vBin];
369 h_full_rz_norm->SetBinContent(iBin,
val/vol);
380 h_full_rz_vol->Write();
381 h_full_rz_vol->Delete();
382 h_full_rz_norm->Write();
383 h_full_rz_norm->Delete();
387 std::vector<const char *> h3dNames = {
388 "h3d_tid",
"h3d_eion",
"h3d_niel",
"h3d_h20",
"h3d_neut",
"h3d_chad"
391 std::vector<const char *> h3dTitles = {
392 "TID [Gy]",
"E_{ion}/V [MeV/cm^{3}]",
"NIEL [n_{eq}/cm^{2}]",
"SEE [h_{>20 MeV}/cm^{2}]",
"FLUX [n_{>100 keV}/cm^{2}]",
"FLUX [h_{charged}/cm^{2}]"
396 TH3D * h_3d_norm = 0;
398 for(
unsigned int hi=0;hi<h3dNames.size();hi++) {
399 TH3D *h3d =
new TH3D(h3dNames[hi],h3dNames[hi],
m_config.
nBinsz3d,
m_config.
zMinZoom,
m_config.
zMaxZoom,
m_config.
nBinsr3d,
m_config.
rMinZoom,
m_config.
rMaxZoom,
m_config.
nBinsphi3d,
m_config.
phiMinZoom,
m_config.
phiMaxZoom);
401 h3d->SetYTitle(
"r [cm]");
402 h3d->SetZTitle(
"#phi [#circ]");
403 h3d->SetTitle(h3dTitles[hi]);
405 h_3d_vol =
new TH3D(
"h3d_vol" ,
"h3d_vol" ,
m_config.
nBinsz3d,
m_config.
zMinZoom,
m_config.
zMaxZoom,
m_config.
nBinsr3d,
m_config.
rMinZoom,
m_config.
rMaxZoom,
m_config.
nBinsphi3d,
m_config.
phiMinZoom,
m_config.
phiMaxZoom);
406 h_3d_norm =
new TH3D(
"h3d_norm",
"h3d_norm",
m_config.
nBinsz3d,
m_config.
zMinZoom,
m_config.
zMaxZoom,
m_config.
nBinsr3d,
m_config.
rMinZoom,
m_config.
rMaxZoom,
m_config.
nBinsphi3d,
m_config.
phiMinZoom,
m_config.
phiMaxZoom);
407 h_3d_vol ->SetXTitle(
xtitle);
408 h_3d_norm ->SetXTitle(
xtitle);
409 h_3d_vol ->SetYTitle(
"r [cm]");
410 h_3d_norm ->SetYTitle(
"r [cm]");
411 h_3d_vol ->SetZTitle(
"#phi [#circ]");
412 h_3d_norm ->SetZTitle(
"#phi [#circ]");
413 std::string
hname(
"Volume fraction of");
420 h_3d_vol ->SetTitle(
hname.data());
421 h_3d_norm ->SetTitle(
"Volume norm");
424 for(
int i=0;
i<h3d->GetNbinsX();
i++) {
425 for(
int j=0;j<h3d->GetNbinsY();j++) {
426 for(
int k=0;
k<h3d->GetNbinsZ();
k++) {
428 int iBin = h3d->GetBin(
i+1,j+1,
k+1);
429 double phi0=h3d->GetZaxis()->GetBinLowEdge(
k+1);
430 double phi1=h3d->GetZaxis()->GetBinUpEdge(
k+1);
431 double r0=h3d->GetYaxis()->GetBinLowEdge(j+1);
432 double r1=h3d->GetYaxis()->GetBinUpEdge(j+1);
433 double z0=h3d->GetXaxis()->GetBinLowEdge(
i+1);
434 double z1=h3d->GetXaxis()->GetBinUpEdge(
i+1);
446 double val = (*(pVal3d[hi]))[vBin];
447 h3d->SetBinContent(iBin,
val/vol);
450 val =maps.m_3d_vol[vBin];
451 h_3d_vol->SetBinContent(iBin,
val/vol);
453 val =maps.m_3d_norm[vBin];
454 h_3d_norm->SetBinContent(iBin,
val/vol);
471 std::vector<const char *> hSpecNames = {
472 "rz_neut_spec",
"rz_gamm_spec",
"rz_elec_spec",
"rz_muon_spec",
"rz_pion_spec",
"rz_prot_spec",
"rz_rest_spec",
473 "full_rz_neut_spec",
"full_rz_gamm_spec",
"full_rz_elec_spec",
"full_rz_muon_spec",
"full_rz_pion_spec",
"full_rz_prot_spec",
"full_rz_rest_spec"
476 std::vector<const char *> hSpecTitles = {
477 "FLUX [n(log_{10}(E/MeV))/cm^{2}]",
"FLUX [#gamma(log_{10}(E/MeV))/cm^{2}]",
"FLUX [e^{#pm}(log_{10}(E/MeV))/cm^{2}]",
"FLUX [#mu^{#pm}(log_{10}(E/MeV))/cm^{2}]",
"FLUX [#pi^{#pm}(log_{10}(E/MeV))/cm^{2}]",
"FLUX [p(log_{10}(E/MeV))/cm^{2}]",
"FLUX [rest(log_{10}(E/MeV))/cm^{2}]",
478 "FLUX [n(log_{10}(E/MeV))/cm^{2}]",
"FLUX [#gamma(log_{10}(E/MeV))/cm^{2}]",
"FLUX [e^{#pm}(log_{10}(E/MeV))/cm^{2}]",
"FLUX [#mu^{#pm}(log_{10}(E/MeV))/cm^{2}]",
"FLUX [#pi^{#pm}(log_{10}(E/MeV))/cm^{2}]",
"FLUX [p(log_{10}(E/MeV))/cm^{2}]",
"FLUX [rest(log_{10}(E/MeV))/cm^{2}]"
481 std::vector<double> zMinSpec = {
486 std::vector<double> zMaxSpec = {
491 std::vector<double> rMinSpec = {
496 std::vector<double> rMaxSpec = {
501 std::vector<double> logEMin = {
506 std::vector<double> logEMax = {
511 for(
unsigned int hi=0;hi<hSpecNames.size();hi++) {
512 TH3D *hSpec =
new TH3D(hSpecNames[hi],hSpecNames[hi],
m_config.
nBinsz,zMinSpec[hi],zMaxSpec[hi],
m_config.
nBinsr,rMinSpec[hi],rMaxSpec[hi],nBinslogE[hi],logEMin[hi],logEMax[hi]);
514 hSpec->SetYTitle(
"r [cm]");
515 hSpec->SetZTitle(
"log_{10}(E/MeV)");
516 hSpec->SetTitle(hSpecTitles[hi]);
518 for(
int i=0;
i<hSpec->GetNbinsX();
i++) {
519 for(
int j=0;j<hSpec->GetNbinsY();j++) {
520 double r0=hSpec->GetYaxis()->GetBinLowEdge(j+1);
521 double r1=hSpec->GetYaxis()->GetBinUpEdge(j+1);
522 double z0=hSpec->GetXaxis()->GetBinLowEdge(
i+1);
523 double z1=hSpec->GetXaxis()->GetBinUpEdge(
i+1);
531 for(
int k=0;
k<hSpec->GetNbinsZ();
k++) {
532 int kBin = hSpec->GetBin(
i+1,j+1,
k+1);
534 val = (*(pValSpec[hi]))[vBinE];
535 hSpec->SetBinContent(kBin,
val/vol);
543 std::vector<const char *> hThetaSpecNames = {
544 "theta_dphi_full_rz_neut_spec",
"theta_dphi_full_rz_gamm_spec",
"theta_dphi_full_rz_elec_spec",
"theta_dphi_full_rz_muon_spec",
"theta_dphi_full_rz_pion_spec",
"theta_dphi_full_rz_prot_spec",
"theta_dphi_full_rz_rchgd_spec",
"theta_dphi_full_rz_rneut_spec"
547 std::vector<const char *> hThetaSpecTitles = {
548 "FLUX [n(log_{10}(E/MeV))/cm^{2}]",
"FLUX [#gamma(log_{10}(E/MeV))/cm^{2}]",
"FLUX [e^{#pm}(log_{10}(E/MeV))/cm^{2}]",
"FLUX [#mu^{#pm}(log_{10}(E/MeV))/cm^{2}]",
"FLUX [#pi^{#pm}(log_{10}(E/MeV))/cm^{2}]",
"FLUX [p(log_{10}(E/MeV))/cm^{2}]",
"FLUX [rest^{chgd}(log_{10}(E/MeV))/cm^{2}]",
"FLUX [rest^{neut}(log_{10}(E/MeV))/cm^{2}]"
551 std::vector<double> thetalogEMin = {
555 std::vector<double> thetalogEMax = {
559 for(
unsigned int hi=0;hi<hThetaSpecNames.size();hi++) {
562 TString
hname(hThetaSpecNames[hi]);
571 TH3D * hThetaSpec =
new TH3D(
hname.Data(),
hname.Data(),
m_config.
nBinsz,
m_config.
zMinFull,
m_config.
zMaxFull,
m_config.
nBinsr,
m_config.
rMinFull,
m_config.
rMaxFull,nBinsThetalogE[hi],thetalogEMin[hi],thetalogEMax[hi]);
573 hThetaSpec->SetXTitle(
xtitle);
574 hThetaSpec->SetYTitle(
"r [cm]");
575 hThetaSpec->SetZTitle(
"log_{10}(E/MeV)");
576 hname = TString(hThetaSpecTitles[hi]);
585 hThetaSpec->SetTitle(
hname.Data());
587 for(
int k=0;
k<hThetaSpec->GetNbinsX();
k++) {
588 for(
int l=0;
l<hThetaSpec->GetNbinsY();
l++) {
589 double r0=hThetaSpec->GetYaxis()->GetBinLowEdge(
l+1);
590 double r1=hThetaSpec->GetYaxis()->GetBinUpEdge(
l+1);
591 double z0=hThetaSpec->GetXaxis()->GetBinLowEdge(
k+1);
592 double z1=hThetaSpec->GetXaxis()->GetBinUpEdge(
k+1);
600 for(
int m=0;
m<hThetaSpec->GetNbinsZ();
m++) {
601 int mBin = hThetaSpec->GetBin(
k+1,
l+1,
m+1);
603 val = (*(pValThetaSpec[hi]))[vBinETh];
604 hThetaSpec->SetBinContent(mBin,
val/vol);
609 hThetaSpec->Delete();
615 TH3D * h_rz_tid_time =
new TH3D(
"rz_tid_time" ,
"rz_tid_time" ,
m_config.
nBinsz,
m_config.
zMinZoom,
m_config.
zMaxZoom,
m_config.
nBinsr,
m_config.
rMinZoom,
m_config.
rMaxZoom,
m_config.
nBinslogT,
m_config.
logTMin,
m_config.
logTMax);
616 h_rz_tid_time ->SetXTitle(
xtitle);
617 h_rz_tid_time ->SetYTitle(
"r [cm]");
618 h_rz_tid_time ->SetZTitle(
"log_{10}(t_{cut}/s)");
620 TH3D * h_rz_ht_time =
new TH3D(
"rz_ht_time" ,
"rz_ht_time" ,
m_config.
nBinsz,
m_config.
zMinZoom,
m_config.
zMaxZoom,
m_config.
nBinsr,
m_config.
rMinZoom,
m_config.
rMaxZoom,
m_config.
nBinslogT,
m_config.
logTMin,
m_config.
logTMax);
621 h_rz_ht_time ->SetXTitle(
xtitle);
622 h_rz_ht_time ->SetYTitle(
"r [cm]");
623 h_rz_ht_time ->SetZTitle(
"log_{10}(t_{cut}/s)");
626 TH3D * h_rz_element =
new TH3D(
"rz_element" ,
"rz_element" ,
m_config.
nBinsz,
m_config.
zMinZoom,
m_config.
zMaxZoom,
m_config.
nBinsr,
m_config.
rMinZoom,
m_config.
rMaxZoom,
m_config.
elemZMax-
m_config.
elemZMin+1,
m_config.
elemZMin-0.5,
m_config.
elemZMax+0.5);
627 h_rz_element ->SetXTitle(
xtitle);
628 h_rz_element ->SetYTitle(
"r [cm]");
629 h_rz_element ->SetZTitle(
"Z");
632 for(
int i=0;
i<h_rz_tid_time->GetNbinsX();
i++) {
633 for(
int j=0;j<h_rz_tid_time->GetNbinsY();j++) {
634 double r0=h_rz_tid_time->GetYaxis()->GetBinLowEdge(j+1);
635 double r1=h_rz_tid_time->GetYaxis()->GetBinUpEdge(j+1);
636 double z0=h_rz_tid_time->GetXaxis()->GetBinLowEdge(
i+1);
637 double z1=h_rz_tid_time->GetXaxis()->GetBinUpEdge(
i+1);
645 for(
int k=0;
k<h_rz_tid_time->GetNbinsZ();
k++) {
646 int kBin = h_rz_tid_time->GetBin(
i+1,j+1,
k+1);
649 val =maps.m_rz_tid_time[vBinT];
650 h_rz_tid_time->SetBinContent(kBin,
val/vol);
652 val =maps.m_rz_ht_time[vBinT];
653 h_rz_ht_time->SetBinContent(kBin,
val/vol);
656 for(
int k=0;
k<h_rz_element->GetNbinsZ();
k++) {
657 int kBin = h_rz_element->GetBin(
i+1,j+1,
k+1);
659 val =maps.m_rz_element[vBinElem];
660 h_rz_element->SetBinContent(kBin,
val/vol);
665 h_rz_tid_time->Write();
666 h_rz_tid_time->Delete();
667 h_rz_ht_time->Write();
668 h_rz_ht_time->Delete();
669 h_rz_element->Write();
670 h_rz_element->Delete();
673 TH3D * h_full_rz_tid_time =
new TH3D(
"full_rz_tid_time" ,
"full_rz_tid_time" ,
m_config.
nBinsz,
m_config.
zMinFull,
m_config.
zMaxFull,
m_config.
nBinsr,
m_config.
rMinFull,
m_config.
rMaxFull,
m_config.
nBinslogT,
m_config.
logTMin,
m_config.
logTMax);
674 h_full_rz_tid_time->SetXTitle(
xtitle);
675 h_full_rz_tid_time->SetYTitle(
"r [cm]");
676 h_full_rz_tid_time->SetZTitle(
"log_{10}(t_{cut}/s)");
678 TH3D * h_full_rz_ht_time =
new TH3D(
"full_rz_ht_time" ,
"full_rz_ht_time" ,
m_config.
nBinsz,
m_config.
zMinFull,
m_config.
zMaxFull,
m_config.
nBinsr,
m_config.
rMinFull,
m_config.
rMaxFull,
m_config.
nBinslogT,
m_config.
logTMin,
m_config.
logTMax);
679 h_full_rz_ht_time->SetXTitle(
xtitle);
680 h_full_rz_ht_time->SetYTitle(
"r [cm]");
681 h_full_rz_ht_time->SetZTitle(
"log_{10}(t_{cut}/s)");
684 TH3D * h_full_rz_element =
new TH3D(
"full_rz_element" ,
"full_rz_element" ,
m_config.
nBinsz,
m_config.
zMinFull,
m_config.
zMaxFull,
m_config.
nBinsr,
m_config.
rMinFull,
m_config.
rMaxFull,
m_config.
elemZMax-
m_config.
elemZMin+1,
m_config.
elemZMin-0.5,
m_config.
elemZMax+0.5);
685 h_full_rz_element->SetXTitle(
xtitle);
686 h_full_rz_element->SetYTitle(
"r [cm]");
687 h_full_rz_element->SetZTitle(
"Z");
690 for(
int i=0;
i<h_full_rz_tid_time->GetNbinsX();
i++) {
691 for(
int j=0;j<h_full_rz_tid_time->GetNbinsY();j++) {
692 double r0=h_full_rz_tid_time->GetYaxis()->GetBinLowEdge(j+1);
693 double r1=h_full_rz_tid_time->GetYaxis()->GetBinUpEdge(j+1);
694 double z0=h_full_rz_tid_time->GetXaxis()->GetBinLowEdge(
i+1);
695 double z1=h_full_rz_tid_time->GetXaxis()->GetBinUpEdge(
i+1);
703 for(
int k=0;
k<h_full_rz_tid_time->GetNbinsZ();
k++) {
704 int kBin = h_full_rz_tid_time->GetBin(
i+1,j+1,
k+1);
707 val =maps.m_full_rz_tid_time[vBinT];
708 h_full_rz_tid_time->SetBinContent(kBin,
val/vol);
710 val =maps.m_full_rz_ht_time[vBinT];
711 h_full_rz_ht_time->SetBinContent(kBin,
val/vol);
714 for(
int k=0;
k<h_full_rz_element->GetNbinsZ();
k++) {
715 int kBin = h_full_rz_element->GetBin(
i+1,j+1,
k+1);
717 val =maps.m_full_rz_element[vBinElem];
718 h_full_rz_element->SetBinContent(kBin,
val/vol);
722 h_full_rz_tid_time->Write();
723 h_full_rz_tid_time->Delete();
724 h_full_rz_ht_time->Write();
725 h_full_rz_ht_time->Delete();
726 h_full_rz_element->Write();
727 h_full_rz_element->Delete();
731 return StatusCode::SUCCESS;