00001 {gROOT->Reset();
00002
00003
00004 bool distrib = 1;
00005 bool mean_value = 0;
00006
00007
00008 TString file2 = "Root_histo_files/adc_electron_2gev_2absorber.root";
00009 TString file4 = "Root_histo_files/adc_electron_2gev_4absorber.root";
00010 TString file6 = "Root_histo_files/adc_electron_2gev_6absorber.root";
00011 TString file8 = "Root_histo_files/adc_electron_2gev_8absorber.root";
00012 TString file10 = "Root_histo_files/adc_electron_2gev_10absorber.root";
00013 TString file12 = "Root_histo_files/adc_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 * hadc2 = (TH1F*)tf2.Get("hadc4_no_sat");
00023 TH1F * hadc4 = (TH1F*)tf4.Get("hadc4_no_sat");
00024 TH1F * hadc6 = (TH1F*)tf6.Get("hadc4_no_sat");
00025 TH1F * hadc8 = (TH1F*)tf8.Get("hadc4_no_sat");
00026 TH1F * hadc10 = (TH1F*)tf10.Get("hadc4_no_sat");
00027 TH1F * hadc12 = (TH1F*)tf12.Get("hadc4_no_sat");
00028
00029 hadc2->SetLineStyle(1);
00030 hadc4->SetLineStyle(1);
00031 hadc6->SetLineStyle(1);
00032 hadc8->SetLineStyle(1);
00033 hadc10->SetLineStyle(1);
00034 hadc12->SetLineStyle(1);
00035
00036 hadc2->SetLineColor(1);
00037 hadc4->SetLineColor(2);
00038 hadc6->SetLineColor(4);
00039 hadc8->SetLineColor(7);
00040 hadc10->SetLineColor(8);
00041 hadc12->SetLineColor(6);
00042
00043 hadc2->Rebin(2);
00044 hadc4->Rebin(2);
00045 hadc6->Rebin(2);
00046 hadc8->Rebin(2);
00047 hadc10->Rebin(2);
00048 hadc12->Rebin(2);
00049
00050
00051 if (distrib){
00052
00053 TH2F * frame = new TH2F("frame","",100,0,10000,100,0,0.2);
00054 frame->SetTitle("ADC count distribution from 2 GeV electrons for various number of absorbers");
00055 frame->SetXTitle("ADC counts");
00056
00057 TLegend * tleg = new TLegend(0.18,0.73,0.52,0.93);
00058 tleg->AddEntry(hadc2,"2 absorbers","l");
00059 tleg->AddEntry(hadc4,"4 absorbers","l");
00060 tleg->AddEntry(hadc6,"6 absorbers","l");
00061 tleg->AddEntry(hadc8,"8 absorbers","l");
00062 tleg->AddEntry(hadc10,"10 absorbers","l");
00063 tleg->AddEntry(hadc12,"12 absorbers","l");
00064
00065 frame->Draw();
00066 hadc2->DrawNormalized("same");
00067 hadc4->DrawNormalized("same");
00068 hadc6->DrawNormalized("same");
00069 hadc8->DrawNormalized("same");
00070 hadc10->DrawNormalized("same");
00071 hadc12->DrawNormalized("same");
00072 tleg->Draw("same");}
00073
00074
00075
00076
00077 if (mean_value){
00078
00079 int N = 6;
00080
00081 float nabs[N] = {2,4,6,8,10,12};
00082 float mean[N];
00083 float max[N];
00084 float rms[N];
00085
00086 mean[0] = hadc2->GetMean();
00087 mean[1] = hadc4->GetMean();
00088 mean[2] = hadc6->GetMean();
00089 mean[3] = hadc8->GetMean();
00090 mean[4] = hadc10->GetMean();
00091 mean[5] = hadc12->GetMean();
00092
00093 max[0] = hadc2->GetMaximumBin();
00094 max[1] = hadc4->GetMaximumBin();
00095 max[2] = hadc6->GetMaximumBin();
00096 max[3] = hadc8->GetMaximumBin();
00097 max[4] = hadc10->GetMaximumBin();
00098 max[5] = hadc12->GetMaximumBin();
00099
00100 rms[0] = hadc2->GetRMS();
00101 rms[1] = hadc4->GetRMS();
00102 rms[2] = hadc6->GetRMS();
00103 rms[3] = hadc8->GetRMS();
00104 rms[4] = hadc10->GetRMS();
00105 rms[5] = hadc12->GetRMS();
00106
00107 TGraph * tg_mean = new TGraph(N,nabs,mean);
00108 TGraph * tg_max = new TGraph(N,nabs,max);
00109 TGraph * tg_rms = new TGraph(N,nabs,rms);
00110
00111 tg_mean->SetTitle("Mean number of adc counts from 2 GeV electrons for various number of absorbers");
00112 tg_mean->GetXaxis()->SetTitle("number of absorbers");
00113 tg_mean->GetYaxis()->SetTitle("mean number of adc counts");
00114
00115 tg_max->SetTitle("Hit distribution MPV from 2 GeV electrons for various number of absorbers");
00116 tg_max->GetXaxis()->SetTitle("number of absorbers");
00117 tg_max->GetYaxis()->SetTitle("most probable number of adc counts");
00118
00119 tg_rms->SetTitle("RMS of the number of adc counts from 2 GeV electrons for various number of absorbers");
00120 tg_rms->GetXaxis()->SetTitle("number of absorbers");
00121 tg_rms->GetYaxis()->SetTitle("rms of the number of adc counts");
00122
00123 tg_mean->SetMarkerStyle(20);
00124 tg_max->SetMarkerStyle(20);
00125 tg_rms->SetMarkerStyle(20);
00126
00127 tg_mean->SetMarkerSize(1.3);
00128 tg_max->SetMarkerSize(1.3);
00129 tg_rms->SetMarkerSize(1.3);
00130
00131 tg_mean->SetMarkerColor(2);
00132 tg_max->SetMarkerColor(2);
00133 tg_rms->SetMarkerColor(2);
00134
00135 tg_mean->Draw("ap");
00136
00137
00138
00139 }
00140
00141
00142 }