Project
Loading...
Searching...
No Matches
FragmentParam.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13
14using namespace o2::zdc;
15
16//______________________________________________________________________________
18{
19 // default constructor
20 initFunctions();
21}
22
23//______________________________________________________________________________
24FragmentParam::FragmentParam(std::array<double, NCOEFFS> const& fn, std::array<double, NCOEFFS> const& fp,
25 std::array<double, NCOEFFS> const& sigman, std::array<double, NCOEFFS> const& sigmap)
26{
27 setParamsfn(fn);
28 setParamsfp(fp);
29 setParamssigman(sigman);
30 setParamssigmap(sigmap);
31 initFunctions();
32}
33
34void FragmentParam::initFunctions()
35{
36 // lambda helper
37 auto makeFct = [](auto name, auto params, double limit) {
38 const char* polynomstr = "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x";
39 auto f = new TF1(name, polynomstr, 0., limit);
40 for (int j = 0; j < NCOEFFS; ++j) {
41 f->SetParameter(j, params[j]);
42 }
43 return f;
44 };
45
46 // the proton function
47 mFNeutrons.reset(makeFct("fneutrons", mParamfn, 126));
48
49 // the proton function
50 mFProtons.reset(makeFct("fprotons", mParamfp, 82));
51
52 // the neutron sigma function
53 mFSigmaNeutrons.reset(makeFct("fsigman", mParamsigman, 126));
54
55 // the proton sigma function
56 mFSigmaProtons.reset(makeFct("fsigmap", mParamsigmap, 82));
57}
58
59//______________________________________________________________________________
61{
62 printf(" Parameters fn: %1.6f %1.6f %1.6f %1.6f %1.6f \n", mParamfn[0], mParamfn[1], mParamfn[2], mParamfn[3], mParamfn[4]);
63 printf(" Parameters fp: %1.6f %1.6f %1.6f %1.6f %1.6f \n", mParamfp[0], mParamfp[1], mParamfp[2], mParamfp[3], mParamfp[4]);
64 printf(" Parameters sigman: %1.6f %1.6f %1.6f %1.6f %1.6f \n", mParamsigman[0], mParamsigman[1], mParamsigman[2], mParamsigman[3], mParamsigman[4]);
65 printf(" Parameters sigmap: %1.6f %1.6f %1.6f %1.6f %1.6f \n", mParamsigmap[0], mParamsigmap[1], mParamsigmap[2], mParamsigmap[3], mParamsigmap[4]);
66}
67
68//______________________________________________________________________________
69void FragmentParam::setParamsfn(std::array<double, NCOEFFS> const& arrvalues)
70{
71 mParamfn = arrvalues;
72}
73
74//______________________________________________________________________________
75void FragmentParam::setParamsfp(std::array<double, NCOEFFS> const& arrvalues)
76{
77 mParamfp = arrvalues;
78}
79
80//______________________________________________________________________________
81void FragmentParam::setParamssigman(std::array<double, NCOEFFS> const& arrvalues)
82{
83 mParamsigman = arrvalues;
84}
85
86//______________________________________________________________________________
87void FragmentParam::setParamssigmap(std::array<double, NCOEFFS> const& arrvalues)
88{
89 mParamsigmap = arrvalues;
90}
uint32_t j
Definition RawData.h:0
void setParamsfn(std::array< double, NCOEFFS > const &arrvalues)
void setParamsfp(std::array< double, NCOEFFS > const &arrvalues)
void setParamssigman(std::array< double, NCOEFFS > const &arrvalues)
void setParamssigmap(std::array< double, NCOEFFS > const &arrvalues)
static constexpr int NCOEFFS
GLuint const GLchar * name
Definition glcorearb.h:781
GLdouble f
Definition glcorearb.h:310
GLenum const GLfloat * params
Definition glcorearb.h:272