EIC 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>*&, float);
30  virtual ~InternalSeed();
32 
36  const float& z() const { return m_z; }
37  const float& quality() const { return m_q; }
38 
40  SPForSeed<SpacePoint>*&, float);
41 
42  bool setQuality(float);
43 
45 
46  protected:
50  float m_z;
51  float m_q;
52 };
53 
55 // Inline methods
57 
58 template <typename SpacePoint>
60  m_s0 = 0;
61  m_s1 = 0;
62  m_s2 = 0;
63  m_z = 0.;
64  m_q = 0.;
65 }
66 
67 template <typename SpacePoint>
69  const InternalSeed& sp) {
70  if (&sp != this) {
71  m_z = sp.m_z;
72  m_q = sp.m_q;
73  m_s0 = sp.m_s0;
74  m_s1 = sp.m_s1;
75  m_s2 = sp.m_s2;
76  }
77  return (*this);
78 }
79 
80 template <typename SpacePoint>
84  float z) {
85  set(s0, s1, s2, z);
86  m_q = 0.;
87 }
88 
90 // Copy constructor
92 
93 template <typename SpacePoint>
95  : m_s0(sp.m_s0), m_s1(sp.m_s1), m_s2(sp.m_s2) {
96  *this = sp;
97 }
98 
100 // Destructor
102 
103 template <typename SpacePoint>
105 
107 // Set
109 
110 template <typename SpacePoint>
113  SPForSeed<SpacePoint>*& s2, float z) {
114  m_z = z;
115  m_s0 = s0;
116  m_s1 = s1;
117  m_s2 = s2;
118 }
119 
121 // Set three space points seed
123 
124 template <typename SpacePoint>
126  bool pixb = !m_s0->spacepoint->clusterList().second;
127  bool pixt = !m_s2->spacepoint->clusterList().second;
128 
129  if (pixb != pixt) {
130  if (m_q > m_s0->quality() && m_q > m_s1->quality() &&
131  m_q > m_s2->quality()) {
132  return false;
133  }
134  }
135 
136  m_s0->setQuality(m_q);
137  m_s1->setQuality(m_q);
138  m_s2->setQuality(m_q);
139 
140  s.erase();
141  s.add(m_s0->spacepoint);
142  s.add(m_s1->spacepoint);
143  s.add(m_s2->spacepoint);
144  s.setZVertex(double(m_z));
145  return true;
146 }
147 
149 // Set quality in pro seed
151 
152 template <typename SpacePoint>
154  m_q = q;
155  bool pixb = !m_s0->spacepoint->clusterList().second;
156  bool pixt = !m_s2->spacepoint->clusterList().second;
157  if (pixb == pixt) {
158  m_s0->setQuality(q);
159  m_s1->setQuality(q);
160  m_s2->setQuality(q);
161  return true;
162  }
163  if (q < m_s0->quality() || q < m_s1->quality() || q < m_s2->quality()) {
164  return true;
165  }
166  return false;
167 }
168 
169 } // namespace Legacy
170 } // namespace Acts