39 cout <<
"\nEnter The Mode of The F250's: ";
42 cerr <<
"...Invalid entry\n" << endl;
50 cout <<
"\nEnter The Number of Channels Above Baseline the Threshold Should Be (40 recommended): ";
53 cerr <<
"...Invalid entry\n" << endl;
60 rof =
new TFile(
"fadc_ped_data.root",
"RECREATE",
"FADC Pedestal Data");
68 rof->
cd(
Form(
"/mode_%d_data", fadc_mode));
70 else rof->
cd(
Form(
"/mode_%d_data", fadc_mode));
73 if (islot == 11 || islot == 12)
continue;
78 rof->
cd(
Form(
"/mode_%d_data/slot_%u", fadc_mode, islot));
80 else rof->
cd(
Form(
"/mode_%d_data/slot_%u", fadc_mode, islot));
89 rof->
cd(
Form(
"/mode_%d_data/slot_%u/chan_%u", fadc_mode, islot, ichan));
91 if( !
h_pped[islot][ichan] )
92 h_pped[islot][ichan] = (
TH1I*)(
rif->
Get(
Form(
"mode_%d_data/slot_%u/chan_%u/h_pped", fadc_mode, islot, ichan)));
102 init_gfit[islot][ichan] =
new TF1(
Form(
"init_fit_slot_%u_chan_%u", islot, ichan),
"gaus(0)");
110 Int_t curr_bin = init_max_bin+1;
113 if (curr_val < init_max_val/2.)
break;
119 init_max[islot][ichan] = init_max_val;
120 init_mean[islot][ichan] = init_max_bin_center;
130 h_pped[islot][ichan]->
Fit(
Form(
"init_fit_slot_%u_chan_%u", islot, ichan),
"QR");
134 gfit[islot][ichan] =
new TF1(
Form(
"iter_fit_slot_%u_chan_%u", islot, ichan),
"gaus(0)");
152 h_pped[islot][ichan]->
Fit(
Form(
"iter_fit_slot_%u_chan_%u", islot, ichan),
"QR");
162 if( istddev < 0 ) istddev = 0;
163 if( imean < 0 ) imean = 0;
184 outputfile.open(
"thresholds.dat");
186 if (islot == 11 || islot == 12)
continue;
187 outputfile <<
"slot=" << islot << endl;
190 outputfile << 4095 << endl;
192 outputfile <<
threshold[islot][ichan] << endl;
char * Form(const char *fmt,...)
TF1 * gfit[NUMSLOTS][NADCCHAN]
Double_t init_fr_low[NUMSLOTS][NADCCHAN]
Double_t finl_mean_err[NUMSLOTS][NADCCHAN]
Double_t finl_stddev_err[NUMSLOTS][NADCCHAN]
Double_t finl_max[NUMSLOTS][NADCCHAN]
TH1I * h_pped[NUMSLOTS][NADCCHAN]
TF1 * init_gfit[NUMSLOTS][NADCCHAN]
Double_t finl_stddev[NUMSLOTS][NADCCHAN]
Double_t init_mean[NUMSLOTS][NADCCHAN]
TDirectory * chan_dir[NADCCHAN]
Double_t finl_max_err[NUMSLOTS][NADCCHAN]
Double_t iter_max[NUMSLOTS][NADCCHAN]
Double_t init_stddev[NUMSLOTS][NADCCHAN]
TDirectory * slot_dir[NUMSLOTS]
UInt_t nentries[NUMSLOTS][NADCCHAN]
UInt_t threshold[NUMSLOTS][NADCCHAN]
Double_t fr_low[NUMSLOTS][NADCCHAN]
Double_t iter_mean[NUMSLOTS][NADCCHAN]
Double_t finl_mean[NUMSLOTS][NADCCHAN]
Double_t init_max[NUMSLOTS][NADCCHAN]
Double_t fr_high[NUMSLOTS][NADCCHAN]
Double_t iter_stddev[NUMSLOTS][NADCCHAN]
Double_t init_fr_high[NUMSLOTS][NADCCHAN]
virtual void SetLineColor(Color_t lcolor)
T * Get(const char *namecycle)
TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE) override
virtual TObject * Get(const char *namecycle)
virtual Double_t GetParameter(const TString &name) const
virtual Double_t GetParError(Int_t ipar) const
virtual void SetRange(Double_t xmin, Double_t xmax)
void Draw(Option_t *option="") override
virtual void SetParameters(const Double_t *params)
virtual void SetParNames(const char *name0="p0", const char *name1="p1", const char *name2="p2", const char *name3="p3", const char *name4="p4", const char *name5="p5", const char *name6="p6", const char *name7="p7", const char *name8="p8", const char *name9="p9", const char *name10="p10")
virtual Double_t GetBinCenter(Int_t bin) const
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
virtual Double_t GetEntries() const
virtual Int_t GetMaximumBin() const
virtual Double_t GetBinContent(Int_t bin) const
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
RVec< PromoteType< T > > lround(const RVec< T > &v)