Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LegacyInternalSeed.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file LegacyInternalSeed.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018 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 // InternalSeed.hpp Acts project
12 
13 #pragma once
16 
17 namespace Acts {
18 namespace Legacy {
19 template <typename SpacePoint>
20 class InternalSeed {
22  // Public methods:
24 
25  public:
26  InternalSeed();
28  SPForSeed<SpacePoint>*& /*s2*/, float /*z*/);
30  virtual ~InternalSeed();
32 
36  const float& z() const { return m_z; }
37  const float& quality() const { return m_q; }
38 
39  void set(SPForSeed<SpacePoint>*& /*s0*/, SPForSeed<SpacePoint>*& /*s1*/,
40  SPForSeed<SpacePoint>*& /*s2*/, float /*z*/);
41 
42  bool setQuality(float /*q*/);
43 
45 
46  protected:
50  float m_z = 0;
51  float m_q = 0;
52 };
53 
55 
57 // Inline methods
59 
60 template <typename SpacePoint>
62  m_s0 = nullptr;
63  m_s1 = nullptr;
64  m_s2 = nullptr;
65  m_z = 0.;
66  m_q = 0.;
67 }
68 
69 template <typename SpacePoint>
71  const InternalSeed& sp) {
72  if (&sp != this) {
73  m_z = sp.m_z;
74  m_q = sp.m_q;
75  m_s0 = sp.m_s0;
76  m_s1 = sp.m_s1;
77  m_s2 = sp.m_s2;
78  }
79  return (*this);
80 }
81 
82 template <typename SpacePoint>
83 inline InternalSeed<SpacePoint>::InternalSeed(SPForSeed<SpacePoint>*& s0,
84  SPForSeed<SpacePoint>*& s1,
85  SPForSeed<SpacePoint>*& s2,
86  float z) {
87  set(s0, s1, s2, z);
88  m_q = 0.;
89 }
90 
92 // Copy constructor
94 
95 template <typename SpacePoint>
96 inline InternalSeed<SpacePoint>::InternalSeed(const InternalSeed& sp)
97  : m_s0(sp.m_s0), m_s1(sp.m_s1), m_s2(sp.m_s2) {
98  *this = sp;
99 }
100 
102 // Destructor
104 
105 template <typename SpacePoint>
106 inline InternalSeed<SpacePoint>::~InternalSeed() = default;
107 
109 // Set
111 
112 template <typename SpacePoint>
113 inline void InternalSeed<SpacePoint>::set(SPForSeed<SpacePoint>*& s0,
114  SPForSeed<SpacePoint>*& s1,
115  SPForSeed<SpacePoint>*& s2, float z) {
116  m_z = z;
117  m_s0 = s0;
118  m_s1 = s1;
119  m_s2 = s2;
120 }
121 
123 // Set three space points seed
125 
126 template <typename SpacePoint>
128  bool pixb = !m_s0->spacepoint->clusterList().second;
129  bool pixt = !m_s2->spacepoint->clusterList().second;
130 
131  if (pixb != pixt) {
132  if (m_q > m_s0->quality() && m_q > m_s1->quality() &&
133  m_q > m_s2->quality()) {
134  return false;
135  }
136  }
137 
138  m_s0->setQuality(m_q);
139  m_s1->setQuality(m_q);
140  m_s2->setQuality(m_q);
141 
142  s.erase();
143  s.add(m_s0->spacepoint);
144  s.add(m_s1->spacepoint);
145  s.add(m_s2->spacepoint);
146  s.setZVertex(double(m_z));
147  return true;
148 }
149 
151 // Set quality in pro seed
153 
154 template <typename SpacePoint>
155 inline bool InternalSeed<SpacePoint>::setQuality(float q) {
156  m_q = q;
157  bool pixb = !m_s0->spacepoint->clusterList().second;
158  bool pixt = !m_s2->spacepoint->clusterList().second;
159  if (pixb == pixt) {
160  m_s0->setQuality(q);
161  m_s1->setQuality(q);
162  m_s2->setQuality(q);
163  return true;
164  }
165  if (q < m_s0->quality() || q < m_s1->quality() || q < m_s2->quality()) {
166  return true;
167  }
168  return false;
169 }
170 
172 
173 } // namespace Legacy
174 } // namespace Acts