Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DigitizationCell.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DigitizationCell.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2020 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 
9 #pragma once
10 
12 namespace Acts {
13 
15 struct DigitizationCell final {
16  // identification and data
17  size_t channel0 = 0;
18  size_t channel1 = 1;
19  float data = 0.;
20 
21  // construct them
22  DigitizationCell(size_t ch0, size_t ch1, float d = 0.)
23  : channel0(ch0), channel1(ch1), data(d) {}
24 
32  void addCell(const DigitizationCell& dc, bool analogueReadout) {
33  if (analogueReadout) {
34  data += dc.data;
35  }
36  }
37 
43  double depositedEnergy() const { return data; }
44 };
45 
47 struct DigitizationStep final {
48  double stepLength{0.};
49  double driftLength{0.};
50 
55 
57 
60  : stepCell(0, 0),
61  stepEntry(0., 0., 0.),
62  stepExit(0., 0., 0.),
63  stepReadoutProjected(0., 0.),
64  stepCellCenter(0., 0.) {}
65 
75  DigitizationStep(double sl, double dl, const DigitizationCell& dc,
76  const Vector3& entryP, const Vector3& exitP,
77  const Vector2& projectedPosition,
78  const Vector2& cellPosition)
79  : stepLength(sl),
80  driftLength(dl),
81  stepCell(dc),
82  stepEntry(entryP),
83  stepExit(exitP),
84  stepReadoutProjected(projectedPosition),
85  stepCellCenter(cellPosition) {}
86 };
87 
88 } // namespace Acts