Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-07 08:11:11

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2018 CERN for the benefit of the Acts project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
0008 
0009 ///////////////////////////////////////////////////////////////////
0010 // Seed.hpp Acts project
0011 ///////////////////////////////////////////////////////////////////
0012 
0013 #pragma once
0014 #include <list>
0015 
0016 namespace Acts::Legacy {
0017 
0018 template <typename SpacePoint>
0019 class Seed {
0020   /////////////////////////////////////////////////////////////////////////////////
0021   // Public methods:
0022   /////////////////////////////////////////////////////////////////////////////////
0023 
0024  public:
0025   Seed();
0026   Seed(const SpacePoint* /*b*/, const SpacePoint* /*m*/,
0027        const SpacePoint* /*u*/, const double /*vertex*/);
0028   Seed(const Seed& /*s*/);
0029   Seed& operator=(const Seed& /*s*/);
0030   virtual ~Seed();
0031   void erase();
0032   void add(const SpacePoint*& /*sp*/);
0033   void setZVertex(const double& /*z*/);
0034   const std::list<const SpacePoint*>& spacePoints() const;
0035   const double& zVertex() const;
0036 
0037   /////////////////////////////////////////////////////////////////////////////////
0038   // Protected data members
0039   /////////////////////////////////////////////////////////////////////////////////
0040 
0041  protected:
0042   std::list<const SpacePoint*> m_spacepoints;
0043   double m_zvertex = 0;
0044 };
0045 
0046 /// @cond
0047 
0048 /////////////////////////////////////////////////////////////////////////////////
0049 // Inline methods
0050 /////////////////////////////////////////////////////////////////////////////////
0051 
0052 template <typename SpacePoint>
0053 inline const std::list<const SpacePoint*>& Seed<SpacePoint>::spacePoints()
0054     const {
0055   return this->m_spacepoints;
0056 }
0057 
0058 template <typename SpacePoint>
0059 inline void Seed<SpacePoint>::erase() {
0060   m_spacepoints.erase(m_spacepoints.begin(), m_spacepoints.end());
0061 }
0062 
0063 template <typename SpacePoint>
0064 inline void Seed<SpacePoint>::add(const SpacePoint*& p) {
0065   m_spacepoints.push_back(p);
0066 }
0067 
0068 template <typename SpacePoint>
0069 inline void Seed<SpacePoint>::setZVertex(const double& z) {
0070   m_zvertex = z;
0071 }
0072 
0073 template <typename SpacePoint>
0074 inline const double& Seed<SpacePoint>::zVertex() const {
0075   return m_zvertex;
0076 }
0077 
0078 ///////////////////////////////////////////////////////////////////////////////
0079 // Constructors
0080 ///////////////////////////////////////////////////////////////////////////////
0081 
0082 template <typename SpacePoint>
0083 Seed<SpacePoint>::Seed(const Seed<SpacePoint>& s) {
0084   m_spacepoints = s.spacePoints();
0085   m_zvertex = s.zVertex();
0086 }
0087 
0088 template <typename SpacePoint>
0089 Seed<SpacePoint>& Seed<SpacePoint>::operator=(const Seed<SpacePoint>& s) {
0090   m_spacepoints = s.spacePoints();
0091   m_zvertex = s.zVertex();
0092   return *this;
0093 }
0094 
0095 template <typename SpacePoint>
0096 Seed<SpacePoint>::Seed() = default;
0097 
0098 template <typename SpacePoint>
0099 Seed<SpacePoint>::Seed(const SpacePoint* b, const SpacePoint* m,
0100                        const SpacePoint* u, const double vertex) {
0101   m_zvertex = vertex;
0102   m_spacepoints.push_back(b);
0103   m_spacepoints.push_back(m);
0104   m_spacepoints.push_back(u);
0105 }
0106 
0107 template <typename SpacePoint>
0108 Seed<SpacePoint>::~Seed() = default;
0109 
0110 /// @endcond
0111 
0112 }  // namespace Acts::Legacy