EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AlignmentDecorator.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file AlignmentDecorator.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 
17 
18 #include <mutex>
19 #include <vector>
20 
21 namespace ActsExamples {
22 
23 namespace Contextual {
24 
31  public:
32  using LayerStore = std::vector<std::shared_ptr<AlignedDetectorElement>>;
33  using DetectorStore = std::vector<LayerStore>;
34 
36  struct Config {
39 
41  unsigned int iovSize = 100;
42 
44  unsigned int flushSize = 200;
45 
46  std::shared_ptr<RandomNumbers> randomNumberSvc = nullptr;
47 
49  double gSigmaX = 0.; // smear position along local x Axis
50  double gSigmaY = 0.; // smear position along local y Axis
51  double gSigmaZ = 0.; // smear position along local z Axis
52  double aSigmaX = 0.; // rotate around local x Axis
53  double aSigmaY = 0.; // rotate around local y Axis
54  double aSigmaZ = 0.; // rotate around local z Axis
55 
56  bool firstIovNominal = false;
57  };
58 
63  AlignmentDecorator(const Config& cfg,
64  std::unique_ptr<const Acts::Logger> logger =
65  Acts::getDefaultLogger("AlignmentDecorator",
67 
69  virtual ~AlignmentDecorator() = default;
70 
78  ProcessCode decorate(AlgorithmContext& context) final override;
79 
81  const std::string& name() const final override { return m_name; }
82 
83  private:
85  std::unique_ptr<const Acts::Logger> m_logger;
86  std::string m_name = "AlignmentDecorator";
87 
89  std::mutex m_alignmentMutex;
90  std::vector<bool> m_iovStatus;
91  std::vector<bool> m_flushStatus;
92 
94  const Acts::Logger& logger() const { return *m_logger; }
95 };
96 } // namespace Contextual
97 } // namespace ActsExamples