00001 {gROOT->Reset();
00002
00003
00004 bool distrib = 0;
00005 bool mean_value = 1;
00006
00007
00008 TString file2 = "histo_electron_2gev_2absorber.root";
00009 TString file4 = "histo_electron_2gev_4absorber.root";
00010 TString file6 = "histo_electron_2gev_6absorber.root";
00011 TString file8 = "histo_electron_2gev_8absorber.root";
00012 TString file10 = "histo_electron_2gev_10absorber.root";
00013 TString file12 = "histo_electron_2gev_12absorber.root";
00014
00015 TFile * tf2 = new TFile(file2.Data());
00016 TFile * tf4 = new TFile(file4.Data());
00017 TFile * tf6 = new TFile(file6.Data());
00018 TFile * tf8 = new TFile(file8.Data());
00019 TFile * tf10 = new TFile(file10.Data());
00020 TFile * tf12 = new TFile(file12.Data());
00021
00022 TH1F * hnhit2 = (TH1F*)tf2.Get("hnhit4_clean");
00023 TH1F * hnhit4 = (TH1F*)tf4.Get("hnhit4_clean");
00024 TH1F * hnhit6 = (TH1F*)tf6.Get("hnhit4_clean");
00025 TH1F * hnhit8 = (TH1F*)tf8.Get("hnhit4_clean");
00026 TH1F * hnhit10 = (TH1F*)tf10.Get("hnhit4_clean");
00027 TH1F * hnhit12 = (TH1F*)tf12.Get("hnhit4_clean");
00028
00029 hnhit2->SetLineStyle(1);
00030 hnhit4->SetLineStyle(1);
00031 hnhit6->SetLineStyle(1);
00032 hnhit8->SetLineStyle(1);
00033 hnhit10->SetLineStyle(1);
00034 hnhit12->SetLineStyle(1);
00035
00036 hnhit2->SetLineColor(1);
00037 hnhit4->SetLineColor(2);
00038 hnhit6->SetLineColor(4);
00039 hnhit8->SetLineColor(7);
00040 hnhit10->SetLineColor(8);
00041 hnhit12->SetLineColor(6);
00042
00043
00044
00045 if (distrib){
00046
00047 TH2F * frame = new TH2F("frame","",100,0,25,100,0,1.1);
00048 frame->SetTitle("Hit distribution from 2 GeV electrons for various number of absorbers");
00049 frame->SetXTitle("number of hits");
00050
00051 TLegend * tleg = new TLegend(0.18,0.73,0.52,0.93);
00052 tleg->AddEntry(hnhit2,"2 absorbers","l");
00053 tleg->AddEntry(hnhit4,"4 absorbers","l");
00054 tleg->AddEntry(hnhit6,"6 absorbers","l");
00055 tleg->AddEntry(hnhit8,"8 absorbers","l");
00056 tleg->AddEntry(hnhit10,"10 absorbers","l");
00057 tleg->AddEntry(hnhit12,"12 absorbers","l");
00058
00059 frame->Draw();
00060 hnhit2->DrawNormalized("same");
00061 hnhit4->DrawNormalized("same");
00062 hnhit6->DrawNormalized("same");
00063 hnhit8->DrawNormalized("same");
00064 hnhit10->DrawNormalized("same");
00065 hnhit12->DrawNormalized("same");
00066 tleg->Draw("same");}
00067
00068
00069
00070
00071 if (mean_value){
00072
00073 float nabs[6] = {2,4,6,8,10,12};
00074 float mean[6];
00075 float max[6];
00076 float rms[6];
00077
00078 mean[0] = hnhit2->GetMean();
00079 mean[1] = hnhit4->GetMean();
00080 mean[2] = hnhit6->GetMean();
00081 mean[3] = hnhit8->GetMean();
00082 mean[4] = hnhit10->GetMean();
00083 mean[5] = hnhit12->GetMean();
00084
00085 max[0] = hnhit2->GetMaximumBin();
00086 max[1] = hnhit4->GetMaximumBin();
00087 max[2] = hnhit6->GetMaximumBin();
00088 max[3] = hnhit8->GetMaximumBin();
00089 max[4] = hnhit10->GetMaximumBin();
00090 max[5] = hnhit12->GetMaximumBin();
00091
00092 rms[0] = hnhit2->GetRMS();
00093 rms[1] = hnhit4->GetRMS();
00094 rms[2] = hnhit6->GetRMS();
00095 rms[3] = hnhit8->GetRMS();
00096 rms[4] = hnhit10->GetRMS();
00097 rms[5] = hnhit12->GetRMS();
00098
00099 TGraph * tg_mean = new TGraph(6,nabs,mean);
00100 TGraph * tg_max = new TGraph(6,nabs,max);
00101 TGraph * tg_rms = new TGraph(6,nabs,rms);
00102
00103 tg_mean->SetTitle("Mean number of hits from 2 GeV electrons for various number of absorbers");
00104 tg_mean->GetXaxis()->SetTitle("number of absorbers");
00105 tg_mean->GetYaxis()->SetTitle("mean number of hits");
00106
00107 tg_max->SetTitle("Hit distribution MPV from 2 GeV electrons for various number of absorbers");
00108 tg_max->GetXaxis()->SetTitle("number of absorbers");
00109 tg_max->GetYaxis()->SetTitle("most probable number of hits");
00110
00111 tg_rms->SetTitle("RMS of the number of hits from 2 GeV electrons for various number of absorbers");
00112 tg_rms->GetXaxis()->SetTitle("number of absorbers");
00113 tg_rms->GetYaxis()->SetTitle("rms of the number of hits");
00114
00115 tg_mean->SetMarkerStyle(20);
00116 tg_max->SetMarkerStyle(20);
00117 tg_rms->SetMarkerStyle(20);
00118
00119 tg_mean->SetMarkerSize(1.3);
00120 tg_max->SetMarkerSize(1.3);
00121 tg_rms->SetMarkerSize(1.3);
00122
00123 tg_mean->SetMarkerColor(2);
00124 tg_max->SetMarkerColor(2);
00125 tg_rms->SetMarkerColor(2);
00126
00127
00128
00129 tg_rms->Draw("ap");
00130
00131 }
00132
00133
00134 }