15 #include <TDirectory.h>
17 #include <TPaveLabel.h>
18 #include <TPaletteAxis.h>
23 #include <TGraphErrors.h>
79 Double_t fitval_pp = par[0] + par[1]*x[0];
86 TFile *
df =
new TFile(input_filename);
87 std::ofstream st_time_res;
88 st_time_res.open (
"st_time_res.txt", std::ofstream::out);
94 for (
unsigned int j = 0; j < 30; j++)
97 PT_can[j] =
new TCanvas( Form(
"PT_can_%i",j+1), Form(
"PT_can_%i",j+1), 800, 450);
100 TopDirectory = (TDirectory*) df->FindObjectAny(
"ST_Tresolution");
104 char*
total = Form(
"h2_CorrectedTime_z_%i",j+1);
106 char* pj = Form(
"py_%i",j+1);
107 TH1D* pytotal = (TH1D*)pj;
109 cout <<
"==================================================" << endl;
110 cout <<
"Processing Channel " << j+1 << endl;
111 cout <<
"==================================================" << endl;
119 gStyle->SetOptStat(0);
120 gStyle->SetErrorX(0);
124 h2_total->GetZaxis()->SetRangeUser(0,10000);
125 h2_total->GetYaxis()->SetTitle(
"ST Corrected Time (ns)");
126 h2_total->GetYaxis()->SetRangeUser(-5.0,5.0);
129 gStyle->SetOptFit(11);
130 gStyle->SetErrorX(0);
135 t_max[j]= pytotal->GetMaximum();
136 t_min[j]= pytotal->GetMinimum();
147 pytotal->GetXaxis()->SetRangeUser(-5.0,5.0);
148 pytotal->Fit(
"gaus",
"",
"",-0.6,0.6);
149 TF1 *gaus = pytotal->GetFunction(
"gaus");
151 PT_can[j]->Print(Form(
"ST_Sector_%i.png",j+1));
160 in.open(Form(
"st_time_res.txt"));
161 float sector,ser,tall,taller;
162 TNtuple *ntuple =
new TNtuple(
"ntuple",
"data from text file",
"sector:ser:tall:taller");
163 ntuple->ReadFile(
"st_time_res.txt");
167 TCanvas *
Time_can =
new TCanvas(
"Time_can",
"Time_can", 800, 600);
168 Time_can->SetFillColor(41);
169 gStyle->SetOptFit(011);
170 ntuple->Draw(
"sector:tall:taller:ser");
171 TGraphErrors *
gr=
new TGraphErrors(ntuple->GetSelectedRows(),ntuple->GetV1(),ntuple->GetV2(),ntuple->GetV4(),ntuple->GetV3());
173 gr->SetTitle(
"Time Resolution After Applying Propagation Time Corrections");
174 gr->GetXaxis()->SetTitle(
"Sector Number");
175 gr->GetYaxis()->SetTitle(
"Time Resolution (ps)");
176 gr->SetMarkerStyle(21);
177 gr->SetMarkerSize(3);
178 gr->SetMarkerColor(4);
182 TLine *line =
new TLine(0,350,33,350);
183 line->SetLineWidth(4);
184 line->SetLineColor(28);
185 line->SetLineStyle(9);
188 Time_can->Print(Form(
"ST_Tresolution.png"));
Double_t tns_min[NCHANNELS]
Double_t t_bs_fit_err[NCHANNELS][3]
Double_t t_bs_fit[NCHANNELS][3]
TF1 * t_vs_z_fit_chan[NCHANNELS]
void Resolution(char const *input_filename)
Double_t tbs_min[NCHANNELS]
Double_t t_total_fit[NCHANNELS][3]
Double_t t_bn_fit[NCHANNELS][3]
Double_t t_min[NCHANNELS]
Double_t tbs_max[NCHANNELS]
TDirectory * TopDirectory
Double_t t_ns_fit_err[NCHANNELS][3]
Double_t tall_max[NCHANNELS]
Double_t tss_min[NCHANNELS]
Double_t t_bn_fit_err[NCHANNELS][3]
Double_t t_total_fit_err[NCHANNELS][3]
Double_t t_all_fit[NCHANNELS][3]
Double_t t_ns_fit[NCHANNELS][3]
Double_t t_ss_fit_err[NCHANNELS][3]
Double_t tns_max[NCHANNELS]
Double_t tbn_max[NCHANNELS]
Double_t t_ss_fit[NCHANNELS][3]
Double_t t_all_fit_err[NCHANNELS][3]
Double_t tall_min[NCHANNELS]
Double_t t_max[NCHANNELS]
Double_t tss_max[NCHANNELS]
Double_t fitf_pp(Double_t *x, Double_t *par)
Double_t tbn_min[NCHANNELS]