EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SingleHitSpacePointBuilder.ipp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SingleHitSpacePointBuilder.ipp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018-2019 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 template <typename Cluster>
11  const Cluster& cluster) const {
12  // Local position information
13  auto par = cluster.parameters();
16  return local;
17 }
18 
19 template <typename Cluster>
21  const GeometryContext& gctx, const Cluster& cluster) const {
22  // Receive corresponding surface
23  auto& clusterSurface = cluster.referenceObject();
24 
25  // Transform local into global position information
26  Acts::Vector3D mom(1., 1., 1.);
27  return clusterSurface.localToGlobal(gctx, localCoords(cluster), mom);
28 }
29 
30 template <typename Cluster>
31 void Acts::SpacePointBuilder<Acts::SpacePoint<Cluster>>::calculateSpacePoints(
32  const GeometryContext& gctx, const std::vector<const Cluster*>& clusters,
33  std::vector<Acts::SpacePoint<Cluster>>& spacePointStorage) const {
34  // Set the space point for all stored hits
35  for (const auto& c : clusters) {
36  Acts::SpacePoint<Cluster> spacePoint;
37  spacePoint.vector = globalCoords(gctx, *c);
38  spacePoint.clusterModule.push_back(c);
39  spacePointStorage.push_back(std::move(spacePoint));
40  }
41 }