14 #include <TDirectory.h>
16 #include <TPaveLabel.h>
17 #include <TPaletteAxis.h>
40 Double_t fitval_pp = par[0] + par[1]*(TMath::Power(x[0]/
adc_thresh_calc, par[2]));
49 TFile *
df =
new TFile(input_filename);
50 std::ofstream results;
51 results.open (
"st_timewalks.txt", std::ofstream::out);
55 for (
unsigned int j = 0; j < 30; j++)
58 TW_can[j] =
new TCanvas( Form(
"TW_can_%i",j+1),
"TW_can", 800, 450);
62 char* sttpp = Form(
"stt_vs_pp_chan_%i",j+1);
63 TH2I* h2_tpp = (TH2I*) df->Get(sttpp);
64 char* pp = Form(
"pp_chan_%i",j+1);
65 TH1I* h_pp = (TH1I*) df->Get(pp);
70 gStyle->SetOptStat(10);
75 h2_tpp->GetZaxis()->SetRangeUser(0,300);
76 h2_tpp->GetXaxis()->SetRangeUser(120.,3500.);
77 h2_tpp->GetYaxis()->SetRangeUser(-2.0,2.0);
78 TPaletteAxis *palette =
new TPaletteAxis(3501.0,-2.0,3599.0,2.0,h2_tpp);
79 palette->SetLabelOffset(0.002);
80 palette->SetLabelSize(0.05);
81 h2_tpp->GetListOfFunctions()->Add(palette,
"br");
85 cout <<
"==================================================" << endl;
86 cout <<
"Processing Channel " << j+1 << endl;
87 cout <<
"==================================================" << endl;
91 h2_tpp->Fit(Form(
"t_vs_pp_fit_chan_%i", j+1));
104 gStyle->SetOptStat(10);
105 gStyle->SetErrorX(0);
109 h_pp->GetXaxis()->SetRangeUser(120.0,3500.);
115 TW_can[j]->Print(Form(
"stt_tw_plot_%i.png",j+1));
const Double_t adc_max_mV
const Double_t adc_max_chan
Double_t sudo_mpv_chan[NCHANNELS]
void st_tw_fits(char const *input_filename)
const Double_t adc_thresh_calc
TF1 * t_vs_pp_fit_chan[NCHANNELS]
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