13 void plot_ratio(std::vector<TH2F*> Map_prop, std::vector<TH2F*> Map_geant, std::vector<int> detectors,
const std::string&
name){
16 TH2F *Unit_Map_prop = (TH2F*) Map_prop[2]->Clone();
17 Unit_Map_prop->Divide(Map_prop[2]);
18 TH2F *Unit_Map_geant = (TH2F*) Map_geant[2]->Clone();
19 Unit_Map_geant->Divide(Map_geant[2]);
21 TH1D *Proj_eta_prop = (TH1D*) Map_prop[0]->ProjectionX()->Clone();
22 Proj_eta_prop->Divide(Unit_Map_prop->ProjectionX());
23 TH1D *Proj_eta_geant = (TH1D*) Map_geant[0]->ProjectionX()->Clone();
24 Proj_eta_geant->Divide(Unit_Map_geant->ProjectionX());
26 TH1D *Proj_phi_prop = (TH1D*) Map_prop[0]->ProjectionY()->Clone();
27 Proj_phi_prop->Divide(Unit_Map_prop->ProjectionY());
28 TH1D *Proj_phi_geant = (TH1D*) Map_geant[0]->ProjectionY()->Clone();
29 Proj_phi_geant->Divide(Unit_Map_geant->ProjectionY());
31 std::string sVol =
"Detector volumes :";
32 for(
auto const& det: detectors) {
36 TText *vol =
new TText(.1, .95, sVol.c_str());
39 TCanvas *
c1 =
new TCanvas(
"c1",
"mat_X0",1200,1200);
40 c1->SetRightMargin(0.14);
41 c1->SetTopMargin(0.14);
42 c1->SetLeftMargin(0.14);
43 c1->SetBottomMargin(0.14);
44 Map_prop[0]->Divide(Map_geant[0]);
45 Map_prop[0]->GetZaxis()->SetTitle(
"X0 Val/Geant");
46 Map_prop[0]->SetMaximum(2.);
47 Map_prop[0]->Draw(
"COLZ");
49 c1->Print( (name+
"ratio_X0.pdf").c_str());
51 TCanvas *
c2 =
new TCanvas(
"c2",
"mat_X0/eta", 1200, 1200);
52 c2->SetRightMargin(0.14);
53 c2->SetTopMargin(0.14);
54 c2->SetLeftMargin(0.14);
55 c2->SetBottomMargin(0.14);
57 Proj_eta_prop->Divide(Proj_eta_geant);
58 Proj_eta_prop->GetYaxis()->SetTitle(
"X0 Val/Geant");
59 Proj_eta_prop->SetMarkerStyle(7);
60 Proj_eta_prop->Draw(
"HIST PC");
61 c2->Print((name +
"ratio_X0_eta.pdf").c_str());
63 TCanvas *
c3 =
new TCanvas(
"c3",
"mat_X0/phi", 1200, 1200);
64 c3->SetRightMargin(0.14);
65 c3->SetTopMargin(0.14);
66 c3->SetLeftMargin(0.14);
67 c3->SetBottomMargin(0.14);
68 Proj_phi_prop->Divide(Proj_phi_geant);
69 Proj_phi_prop->GetYaxis()->SetTitle(
"X0 Val/Geant");
70 Proj_phi_prop->SetMarkerStyle(7);
71 Proj_phi_prop->Draw(
"HIST PC");
72 c3->Print((name +
"ratio_X0_phi.pdf").c_str());
79 delete Unit_Map_geant;
91 void Mat_map_detector_plot_ratio(std::string input_file_prop =
"", std::string input_file_geant =
"", std::vector<int> detectors = vector<int>(),
int nbprocess = -1, std::string
name =
"", std::string name_prop =
"", std::string name_geant =
""){
93 gStyle->SetOptStat(0);
94 gStyle->SetOptTitle(0);
96 std::vector<TH2F*> detector_hist_prop;
97 std::vector<TH2F*> detector_hist_geant;
99 Fill(detector_hist_prop, input_file_prop, detectors, nbprocess);
100 Fill(detector_hist_geant, input_file_geant, detectors, nbprocess);
102 plot(detector_hist_prop, detectors, name_prop);
103 plot(detector_hist_geant, detectors, name_geant);
104 plot_ratio(detector_hist_prop, detector_hist_geant, detectors,
name);