EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PayloadDetectorElement.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PayloadDetectorElement.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 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 #pragma once
10 
18 
19 #include <map>
20 
21 namespace ActsExamples {
22 
23 namespace Contextual {
24 
42  public:
45  struct ContextType {
46  // The alignment store of this event
47  // not the fastest, but good enough for a demonstrator
48  std::vector<Acts::Transform3D> alignmentStore;
49  };
50 
54  template <typename... Args>
56  : Generic::GenericDetectorElement(std::forward<Args>(args)...) {}
57 
64  const Acts::GeometryContext& gctx) const final override;
65 };
66 
68  const Acts::GeometryContext& gctx) const {
69  // cast into the right context object
70  auto alignContext = std::any_cast<ContextType>(gctx);
72 
73  // check if we have the right alignment parameter in hand
74  if (idValue < alignContext.alignmentStore.size()) {
75  return alignContext.alignmentStore[idValue];
76  }
77  // Return the standard transform if not found
79 }
80 
81 } // end of namespace Contextual
82 } // end of namespace ActsExamples