14 #include <TDirectory.h>
17 #include <TPaveLabel.h>
18 #include <TPaletteAxis.h>
49 Double_t fitval_pp = par[0] + par[1]*(TMath::Power(x[0]/
adc_thresh_calc, par[2]));
56 TFile *
df =
new TFile(input_filename);
57 std::ofstream Time_resol;
58 Time_resol.open (
"SC_time_resol.txt", std::ofstream::out);
63 for (
unsigned int j = 0; j < 30; j++)
65 t_fit_chan[j] =
new TF1(Form(
"t_fit_chan_%i", j+1),
"gaus", -2.0,2.0);
71 TW_can[j] =
new TCanvas( Form(
"TW_can_%i",j+1),
"TW_can", 800, 600);
75 char* stt = Form(
"h_stt_chan_%i",j+1);
76 TH1I* h_st = (TH1I*) df->Get(stt);
77 char* stt_corr = Form(
"h1_st_corr_time_%i",j+1);
78 TH1I* h_st_cr = (TH1I*) df->Get(stt_corr);
79 char* h2_st_corr_vs_pp = Form(
"h2_st_corr_vs_pp_%i",j+1);
80 TH2I* h2_st_cr_pp = (TH2I*) df->Get(h2_st_corr_vs_pp);
86 gStyle->SetOptStat(10);
91 h_st->GetXaxis()->SetRangeUser(-2.,2.);
96 gStyle->SetOptStat(10);
101 h_st_cr->GetXaxis()->SetRangeUser(-2.,2.);
105 Time_resol <<
x[j] <<
"\t" <<
sigma[j]*1000 <<
"\t" <<
ex[j] <<
"\t" <<
Err[j]*1000 << endl;
111 gStyle->SetOptStat(10);
112 gStyle->SetErrorX(0);
115 h2_st_cr_pp->Draw(
"colz");
116 h2_st_cr_pp->GetXaxis()->SetRangeUser(120.,3500.);
117 h2_st_cr_pp->GetYaxis()->SetRangeUser(-2.0,2.0);
124 in.open(Form(
"SC_time_resol.txt"));
125 float sector, t, es ,
e;
126 TNtuple *ntuple =
new TNtuple(
"ntuple",
"data from text file",
"sector:t:es:e");
127 ntuple->ReadFile(
"SC_time_resol.txt");
131 Time_can =
new TCanvas(
"Time_can",
"Time_can", 800, 600);
133 gStyle->SetOptFit(0111);
134 ntuple->Draw(
"sector:t:es:e");
135 TGraphErrors *
gr=
new TGraphErrors(ntuple->GetSelectedRows(),ntuple->GetV1(),ntuple->GetV2(),ntuple->GetV3(),ntuple->GetV4());
137 gr->SetTitle(
"ST Self Time Resolution Vs Sector Number");
138 gr->GetXaxis()->SetTitle(
"Sector Number");
139 gr->GetYaxis()->SetTitle(
"ST Self Time Resolution (ps)");
140 gr->SetMarkerStyle(21);
141 gr->SetMarkerSize(3);
142 gr->SetMarkerColor(4);
Double_t stt_fit_params[NCHANNELS][3]
Double_t stt_fit_params_err[NCHANNELS][3]
const Double_t adc_max_mV
TF1 * t_fit_chan[NCHANNELS]
const Double_t adc_max_chan
Double_t sudo_mpv_chan[NCHANNELS]
void st_tw_resols(char const *input_filename)
Double_t sigma[NCHANNELS]
const Double_t adc_thresh_calc
Double_t t_pp_fit_params[NCHANNELS][3]
const Double_t tdc_thresh_mV
Double_t t_pp_fit_params_err[NCHANNELS][3]
Double_t fitf_pp(Double_t *x, Double_t *par)
const Double_t tdc_gain_factor