9 #include <arich/dbobjects/ARICHReconstructionPar.h>
18 void ARICHReconstructionPar::initializeDefault()
21 double parsBkg[10] = {0, 1, 8.764830e+00, -4.815370e+00, 3.268570e-06, 8.518560e+00, -9.609710e+00, 9.769060e-06, 1.095350e-02, -1.322410e-02};
22 m_bkgPDF =
new TF1(
"bkgPDF",
23 "0*[0] + (1-[1])*(exp([2]+[3]*x)*[4]) + [1]*(exp([5]+[6]*x)*[7]+x*[8]+x*x*[9])");
24 m_bkgPDF->SetParameters(parsBkg);
26 double parsRes[4] = {1.12147e-01, 3.81701e+00, 0.0093, -6.14984e-04};
27 m_thcResolution =
new TF1(
"thcResolution",
"([p0]*exp(-[p1]*x)+[p2]+[p3]*x-((x>3)?[p3]*(x-3):0))*1.35");
28 m_thcResolution->SetParameters(parsRes);
30 double parsBkgPhi[8] = {0, 0, 6.68258e-02, 6.50048e+00, -1.04876e-01, -7.06652e-03, 1.34111e-01, 1.83823e-01};
31 m_bkgPhiPDF =
new TF2(
"m_bkgPhiPDF",
32 "[0]*0 + [1]*0 + 1/( ([2]*exp(y*[3]) + [4])*cos(x/2)*cos(x/2)*cos(x/2)*cos(x/2) + sqrt([5] + [6]*y + [7]*y*y ) )");
33 m_bkgPhiPDF->SetParameters(parsBkgPhi);
35 m_pars = {0.098304138, 5.973590e-02, 21, 0.88, 3.7, 0.357, 0.46, 1, 0.12, 0.12, 0.02, 1.5, 0.0288};
36 m_flatBkgPerPad = 0.000892;
38 m_aerogelFOM = {13.200797, 15.186757};
41 double ARICHReconstructionPar::getBackgroundPerPad(
double th_cer,
const std::vector<double>& pars)
const
45 for (
auto par : pars) {
46 m_bkgPDF->SetParameter(ipar, par);
49 return m_bkgPDF->Eval(th_cer) + m_flatBkgPerPad;
52 double ARICHReconstructionPar::getPhiCorrectedBackgroundPerPad(
double fi_cer_trk,
double th_cer,
53 const std::vector<double>& pars)
const
57 for (
auto par : pars) {
58 m_bkgPhiPDF->SetParameter(ipar, par);
61 return m_flatBkgPerPad * m_bkgPhiPDF->Eval(fi_cer_trk, th_cer);
64 double ARICHReconstructionPar::getExpectedBackgroundHits(
const std::vector<double>& pars,
double minThc,
double maxThc)
const
68 for (
auto par : pars) {
69 m_bkgPDF->SetParameter(ipar, par);
74 const double surf[4] = { -2.19669e-02, 3.59010e+01, -2.77441e+01, 1.43564e+02};
76 double thc = minThc + step / 2.;
78 while (thc < maxThc) {
79 bkg += (surf[0] + surf[1] * thc + surf[2] * pow(thc, 2) + surf[3] * pow(thc, 3)) * getBackgroundPerPad(thc, pars);
86 double ARICHReconstructionPar::getNPadsInRing(
double maxThc,
double minThc,
double trackTh)
const
89 double s1 =
sqrt(
tan(maxThc)) * pow((
tan(maxThc + trackTh) +
tan(maxThc - trackTh)) / 2, 3. / 2.);
91 if (minThc > 0) s2 =
sqrt(
tan(minThc)) * pow((
tan(minThc + trackTh) +
tan(minThc - trackTh)) / 2, 3. / 2.);
92 return 3.1416 * 0.18 * 0.18 * (s1 - s2) * 0.6 / 0.005 / 0.005;
95 void ARICHReconstructionPar::print()
const
98 cout << endl <<
"-----bkg PDF-----" << endl;
100 int Npar = m_bkgPDF->GetNpar();
101 std::vector<double> bkgPars(Npar, 0);
102 m_bkgPDF->GetParameters(bkgPars.data());
103 for (
int i = 0; i < Npar; i++)cout << Form(
"bkg Pars %d = %e", i, bkgPars[i]) << endl;
105 cout << endl <<
"-----bkg phi corr PDF-----" << endl;
106 m_bkgPhiPDF->Print();
107 int Npar2 = m_bkgPhiPDF->GetNpar();
108 std::vector<double> bkgPhiCorPars(Npar2, 0);
109 m_bkgPhiPDF->GetParameters(bkgPhiCorPars.data());
110 for (
int i = 0; i < Npar2; i++)cout << Form(
"bkg Pars %d = %e", i, bkgPhiCorPars[i]) << endl;
112 cout << endl <<
"-----flat backgroud per pad-----" << endl;
113 cout <<
" flat background per pad is " << m_flatBkgPerPad << endl;
115 cout << endl <<
"----additional parameters (for wide gaus, quartz etc.)-----" << endl;
116 for (
int i = 0; i < (int)m_pars.size(); i++) {
117 printf(
"m_pars[%d] = %e\n", i, m_pars[i]);
120 cout << endl <<
"----Aerogel FOM-----" << endl;
121 for (
int i = 0; i < (int)m_aerogelFOM.size(); i++) {
122 printf(
"m_aerogelFOM[%d] = %f\n", i, m_aerogelFOM[i]);
125 cout << endl <<
"----- Resolution PDF-----" << endl;
126 m_thcResolution->Print();
128 m_thcResolution->GetParameters(resPars);
129 for (
int i = 0; i < 4; i++)cout << Form(
"resolution Pars %d = %e", i, resPars[i]) << endl;
double sqrt(double a)
sqrt for double
double tan(double a)
tan for double
Abstract base class for different kinds of events.