Belle II Software  release-05-01-25
ARICHReconstructionPar.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Luka Santelj *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <arich/dbobjects/ARICHReconstructionPar.h>
12 
13 #include <iostream>
14 #include <vector>
15 
16 using namespace std;
17 using namespace Belle2;
18 
19 
20 void ARICHReconstructionPar::initializeDefault()
21 {
22 
23  double parsBkg[8] = {1, 0, 0.0062, 5.0, 0.10364, 20.0596, 0.002103, -0.0031283};
24  m_bkgPDF = new TF1("bkgPDF",
25  "((1-[1])*[2]*exp(-[3]*x) + [1]*([4]*exp(-[5]*x)+[6]+[7]*x))*(1-1/1.5/1.5/[0]/[0])*TMath::Floor(1.5*[0])");
26  m_bkgPDF->SetParameters(parsBkg);
27 
28  double parsRes[4] = {1.12147e-01, 3.81701e+00, 0.0093, -6.14984e-04};
29  m_thcResolution = new TF1("thcResolution", "[0]*exp(-[1]*x)+[2]+[3]*x");
30  m_thcResolution->SetParameters(parsRes);
31 
32  m_pars = {0.18, 0.13};
33  m_flatBkgPerPad = 0.0014;
34 
35  m_aerogelFOM = {11.3, 13.0};
36 }
37 
38 double ARICHReconstructionPar::getBackgroundPerPad(double th_cer, const std::vector<double>& pars) const
39 {
40 
41  int ipar = 0;
42  for (auto par : pars) {
43  m_bkgPDF->SetParameter(ipar, par);
44  ipar++;
45  }
46  return m_bkgPDF->Eval(th_cer) + m_flatBkgPerPad;
47 }
48 
49 double ARICHReconstructionPar::getExpectedBackgroundHits(std::vector<double>& pars, double minThc, double maxThc) const
50 {
51 
52  int ipar = 0;
53  for (auto par : pars) {
54  m_bkgPDF->SetParameter(ipar, par);
55  ipar++;
56  }
57 
58  // parameters of fit of pol3 to the number of nPads per ring with given theta and width 5mrad
59  double surf[4] = { -2.19669e-02, 3.59010e+01, -2.77441e+01, 1.43564e+02};
60  double step = 0.005;
61  double thc = minThc + step / 2.;
62  double bkg = 0;
63  while (thc < maxThc) {
64  bkg += (surf[0] + surf[1] * thc + surf[2] * pow(thc, 2) + surf[3] * pow(thc, 3)) * getBackgroundPerPad(thc, pars);
65  thc += step;
66  }
67  return bkg;
68 
69 }
70 
71 double ARICHReconstructionPar::getNPadsInRing(double maxThc, double minThc, double trackTh) const
72 {
73 
74  double s1 = sqrt(tan(maxThc)) * pow((tan(maxThc + trackTh) + tan(maxThc - trackTh)) / 2, 3. / 2.);
75  double s2 = 0;
76  if (minThc > 0) s2 = sqrt(tan(minThc)) * pow((tan(minThc + trackTh) + tan(minThc - trackTh)) / 2, 3. / 2.);
77  return 3.1416 * 0.18 * 0.18 * (s1 - s2) * 0.6 / 0.005 / 0.005; // pi*dist^2*s*avg_geo_acc/pad_size
78 }
79 
80 void ARICHReconstructionPar::print() const
81 {
82 
83  cout << endl << "-----bkg PDF-----" << endl;
84  m_bkgPDF->Print();
85  int Npar = m_bkgPDF->GetNpar();
86  std::vector<double> bkgPars(Npar, 0);
87  m_bkgPDF->GetParameters(bkgPars.data());
88  for (int i = 0; i < Npar; i++)cout << Form("bkg Pars %d = %e", i, bkgPars[i]) << endl;
89 
90  cout << endl << "-----flat backgroud per pad-----" << endl;
91  cout << " flat background per pad is " << m_flatBkgPerPad << endl;
92 
93  cout << endl << "----additional parameters (for wide gaus)-----" << endl;
94  for (int i = 0; i < (int)m_pars.size(); i++) {
95  printf("m_pars[%d] = %e\n", i, m_pars[i]);
96  }
97 
98  cout << endl << "----Aerogel FOM-----" << endl;
99  for (int i = 0; i < (int)m_aerogelFOM.size(); i++) {
100  printf("m_aerogelFOM[%d] = %f\n", i, m_aerogelFOM[i]);
101  }
102 
103  cout << endl << "----- Resolution PDF-----" << endl;
104  m_thcResolution->Print();
105  double resPars[4];
106  m_thcResolution->GetParameters(resPars);
107  for (int i = 0; i < 4; i++)cout << Form("resolution Pars %d = %e", i, resPars[i]) << endl;
108 
109 }
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19