#include "LArCalibUtils/LArPhysWaveHECTool.h"
#include "LArIdentifier/LArOnline_SuperCellID.h"
#include <gsl/gsl_integration.h>
#include <gsl/gsl_errno.h>
#include <TGraphSmooth.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
Go to the source code of this file.
|
Double_t | normalize (TF1 *func, Double_t *rampl=NULL, Double_t from=0., Double_t to=0., Double_t step=1.) |
|
Double_t | normalize_prof (TProfile *histo, Double_t *rampl=NULL) |
|
void | Smooth_new (Double_t *x, Double_t *y, Double_t *yref, Int_t ymax) |
|
void | SmootKern (Double_t *x, Double_t *y, Int_t ymax, Double_t band=10.) |
|
◆ normalize()
Double_t normalize |
( |
TF1 * |
func, |
|
|
Double_t * |
rampl = NULL , |
|
|
Double_t |
from = 0. , |
|
|
Double_t |
to = 0. , |
|
|
Double_t |
step = 1. |
|
) |
| |
Definition at line 825 of file LArPhysWaveHECTool.cxx.
828 static Double_t amax, tmax,
t, ampl;
829 static Double_t
t1,
t2,tt1,tt2;
832 if((from ==
to) || (from >
to))
833 func->GetRange(
t1,
t2);
835 func->GetRange(tt1,tt2);
836 if(from>tt1)
t1 = from;
else t1 = tt1;
843 if(func->Eval(
t) > amax) {
844 amax = func->Eval(
t); tmax =
t;
847 Double_t
x[20],
y[20];
849 for(
t=tmax-5;
t<tmax+5; ++
t) {
851 y[
i] = func->Eval(
t);
854 TGraph *
g =
new TGraph(10,
x,
y);
855 g->Fit(
"pol2",
"QIE0");
856 tmax = -
g->GetFunction(
"pol2")->GetParameter(1) / (2 *
g->GetFunction(
"pol2")->GetParameter(2));
857 amax =
g->GetFunction(
"pol2")->Eval(tmax);
859 ampl = func->GetParameter(1);
860 if(amax != 0) func->SetParameter(1,ampl/amax);
862 cout <<
"Normalize: tmax="<<tmax <<
" ampl=" << ampl<<
" amax="<<amax << endl;
863 if(rampl != NULL) *rampl = amax;
◆ normalize_prof()
Double_t normalize_prof |
( |
TProfile * |
histo, |
|
|
Double_t * |
rampl = NULL |
|
) |
| |
Definition at line 868 of file LArPhysWaveHECTool.cxx.
870 Double_t amax, tmax,
x,
y,
err;
872 amax =
histo->GetBinContent(0);
873 tmax =
histo->GetBinCenter(0);
877 if(amax < histo->GetBinContent(
i))
879 amax =
histo->GetBinContent(
i);
880 tmax =
histo->GetBinCenter(
i);
884 histo->Fit(
"pol2",
"0QI",
"",tmax-10., tmax+10.);
885 tmax = -
histo->GetFunction(
"pol2")->GetParameter(1) / (2 *
histo->GetFunction(
"pol2")->GetParameter(2));
886 amax =
histo->GetFunction(
"pol2")->Eval(tmax);
891 if(htmp->GetBinEntries(
i) == 0)
continue;
892 x = htmp->GetBinCenter(
i);
893 y = htmp->GetBinContent(
i);
894 nent=
int(htmp->GetBinEntries(
i));
895 err = htmp->GetBinError(
i);
908 if(rampl != NULL) *rampl = amax;
◆ Smooth_new()
void Smooth_new |
( |
Double_t * |
x, |
|
|
Double_t * |
y, |
|
|
Double_t * |
yref, |
|
|
Int_t |
ymax |
|
) |
| |
◆ SmootKern()
void SmootKern |
( |
Double_t * |
x, |
|
|
Double_t * |
y, |
|
|
Int_t |
ymax, |
|
|
Double_t |
band = 10. |
|
) |
| |
Definition at line 912 of file LArPhysWaveHECTool.cxx.
915 TGraph *
g=
new TGraph(
ymax,
x,
y);
916 TGraphSmooth *gs =
new TGraphSmooth();
917 TGraph *
g1 = gs->SmoothKern(
g,
"normal",band);
918 xx =
g1->GetX();
yy =
g1->GetY();
919 for(Int_t
i=0;
i<
g->GetN(); ++
i) {
◆ ATLAS_NO_CHECK_FILE_THREAD_SAFETY
ATLAS_NO_CHECK_FILE_THREAD_SAFETY |
◆ LArWaveFlag
◆ NMAX
◆ Tp4_gsl_err_counter
int Tp4_gsl_err_counter =0 |
◆ Tp5_gsl_err_counter
int Tp5_gsl_err_counter =0 |