Belle II Software  release-08-01-10
OfflineFitFunction.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #include <ecl/digitization/algorithms.h>
9 
10 #pragma once
11 
12 namespace Belle2 {
17  namespace ECL {
18  double WaveFuncTwoComponent(double* x, double* par)
19  {
20  //Used for fitting with ROOT::FIT and drawing offline fit results
21  //p0 = trigger time
22  //p1 = baseline
23  //p2 = photon component amp
24  //p3 = hadron component amp
25  //p4-p13 =photon shape template parameters (fixed)
26  //p14-p23 = hadron or didoe shape template parameters (fixed)
27  //p24 = photon scale (fixed)
28  //p25 = hadron scale (fixed)
29 
30  const double time = x[0] - par[0];
31  const double PhotonScale = par[24];
32  const double HadronScale = par[25];
33 
34  double GammaComponent = 0;
35  double HadronComponent = 0;
36  double photonTemplate10[10];
37  double hadronTemplate10[10];
38  for (int k = 0; k < 10; k++) {
39  photonTemplate10[k] = par[4 + k];
40  hadronTemplate10[k] = par[10 + 4 + k];
41  }
42  GammaComponent = Belle2::ECL::ShaperDSPofflineFit(time, photonTemplate10, PhotonScale);
43  HadronComponent = Belle2::ECL::ShaperDSPofflineFit(time, hadronTemplate10, HadronScale);
44  return (par[2] * GammaComponent + par[3] * HadronComponent) + par[1];
45  }
46  }
48 }
Abstract base class for different kinds of events.