Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ParticleSmearingOptions.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ParticleSmearingOptions.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2021 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
13  using Options::Reals;
14 
15  auto opt = desc.add_options();
16  opt("smear-sigma-D0", value<Reals<3>>()->default_value({{20, 30, 0.3}}),
17  "Smear the initial Pt-dependent d0 in perigee frame with a_0[um] + "
18  "a_1[um]*exp(-1.*abs(a_2[1/GeV])*pt)");
19  opt("smear-sigma-Z0", value<Reals<3>>()->default_value({{20, 30, 0.3}}),
20  "Smear the initial Pt-dependent z0 in perigee frame with a_0[um] + "
21  "a_1[um]*exp(-1.*abs(a_2[1/GeV])*pt)");
22  opt("smear-sigma-T0", value<double>()->default_value(1),
23  "Smear the initial time in ns");
24  opt("smear-sigma-momentum", value<Reals<3>>()->default_value({{1, 1, 0.05}}),
25  "Smear the initial phi (degree), theta (degree) and momentum (relative)");
26  opt("smear-initial-variance-inflation",
27  value<Reals<6>>()->default_value({{1., 1., 1., 1., 1., 1.}}),
28  "Inflate the initial covariance matrix");
29 }
30 
34  using namespace ActsExamples;
35  using namespace Acts::UnitConstants;
36  using Options::Reals;
37 
39 
40  auto sigmaD0Opts = vars["smear-sigma-D0"].template as<Reals<3>>();
41  auto sigmaZ0Opts = vars["smear-sigma-Z0"].template as<Reals<3>>();
42  auto sigmaMomOpts = vars["smear-sigma-momentum"].template as<Reals<3>>();
43  cfg.sigmaD0 = sigmaD0Opts[0] * Acts::UnitConstants::um;
44  cfg.sigmaD0PtA = sigmaD0Opts[1] * Acts::UnitConstants::um;
45  cfg.sigmaD0PtB = sigmaD0Opts[2] / Acts::UnitConstants::GeV;
46  cfg.sigmaZ0 = sigmaZ0Opts[0] * Acts::UnitConstants::um;
47  cfg.sigmaZ0PtA = sigmaZ0Opts[1] * Acts::UnitConstants::um;
48  cfg.sigmaZ0PtB = sigmaZ0Opts[2] / Acts::UnitConstants::GeV;
49  cfg.sigmaT0 = vars["smear-sigma-T0"].as<double>() * Acts::UnitConstants::ns;
50  cfg.sigmaPhi = sigmaMomOpts[0] * Acts::UnitConstants::degree;
51  cfg.sigmaTheta = sigmaMomOpts[1] * Acts::UnitConstants::degree;
52  cfg.sigmaPRel = sigmaMomOpts[2];
53  auto varInflation =
54  vars["smear-initial-variance-inflation"].template as<Reals<6>>();
55  cfg.initialVarInflation = {varInflation[0], varInflation[1], varInflation[2],
56  varInflation[3], varInflation[4], varInflation[5]};
57  return cfg;
58 }