9 #include "Mat_map_surface_plot.cpp"
13 void plot_ratio(std::vector<TH2F*> Map_prop, std::vector<TH2F*> Map_geant,
const sinfo& surface_info,
const std::string&
name){
15 std::string out_name = name+
"/"+surface_info.
name+
"/"+surface_info.
name+
"_"+surface_info.
idname;
16 gSystem->Exec( Form(
"mkdir %s", (name+
"/"+surface_info.
name).c_str()) );
19 if(surface_info.
type == 2){
21 TText *vol =
new TText(.1,.95,surface_info.
name.c_str());
23 TText *
surface =
new TText(.1,.9,surface_info.
id.c_str());
25 TText *surface_z =
new TText(.1,.85,(
"Z = " +
to_string(surface_info.
pos)).c_str() );
28 TCanvas *
c1 =
new TCanvas(
"c1",
"mat_X0",1200,1200);
29 c1->SetRightMargin(0.14);
30 c1->SetTopMargin(0.14);
31 c1->SetLeftMargin(0.14);
32 c1->SetBottomMargin(0.14);
33 Map_prop[0]->Divide(Map_geant[0]);
34 Map_prop[0]->GetZaxis()->SetTitle(
"X0 ratio");
35 Map_prop[0]->Draw(
"COLZ");
39 c1->Print( (out_name+
"_X0.pdf").c_str());
50 if(surface_info.
type == 1){
52 TText *vol =
new TText(.1,.95,surface_info.
name.c_str());
54 TText *
surface =
new TText(.1,.9,surface_info.
id.c_str());
56 TText *surface_r =
new TText(.1,.85,(
"R = " +
to_string(surface_info.
pos)).c_str() );
59 TCanvas *
c1 =
new TCanvas(
"c1",
"mat_X0",1200,1200);
60 c1->SetRightMargin(0.14);
61 c1->SetTopMargin(0.14);
62 c1->SetLeftMargin(0.14);
63 c1->SetBottomMargin(0.14);
64 Map_prop[0]->Divide(Map_geant[0]);
65 Map_prop[0]->GetZaxis()->SetTitle(
"X0 ratio");
66 Map_prop[0]->Draw(
"COLZ");
70 c1->Print( (out_name+
"_X0.pdf").c_str());
94 void Mat_map_surface_plot_ratio(std::string input_file_prop =
"", std::string input_file_geant =
"", std::string json_surface_file =
"",
int nbprocess = -1, std::string
name =
"", std::string name_prop =
"", std::string name_geant =
""){
96 gStyle->SetOptStat(0);
97 gStyle->SetOptTitle(0);
99 std::map<uint64_t,std::vector<TH2F*>> surface_hist_prop;
100 std::map<uint64_t,sinfo> surface_info_prop;
102 std::map<uint64_t,std::vector<TH2F*>> surface_hist_geant;
103 std::map<uint64_t,sinfo> surface_info_geant;
105 Fill(surface_hist_prop, surface_info_prop, input_file_prop, json_surface_file, nbprocess);
106 Fill(surface_hist_geant, surface_info_geant, input_file_geant, json_surface_file, nbprocess);
108 for (
auto hist_it = surface_hist_prop.begin(); hist_it != surface_hist_prop.end(); hist_it++){
109 if(name_prop !=
"")
plot(hist_it->second, surface_info_prop[hist_it->first], name_prop);
110 if(name_geant !=
"")
plot(surface_hist_geant[hist_it->first], surface_info_geant[hist_it->first], name_geant);
111 plot_ratio(hist_it->second,surface_hist_geant[hist_it->first], surface_info_prop[hist_it->first],
name);
113 for (
auto hist : hist_it->second){
116 hist_it->second.clear();
117 for (
auto hist : surface_hist_geant[hist_it->first]){
120 surface_hist_geant[hist_it->first].clear();