ATLAS Offline Software
DetectorAlignStore.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef ACTSGEOMETRYINTERFACES_RawGeomAlignStore_H
5 #define ACTSGEOMETRYINTERFACES_RawGeomAlignStore_H
6 
10 #include "AthenaKernel/CLASS_DEF.h"
11 #include "AthenaKernel/CondCont.h"
17 
18 namespace ActsTrk {
19 
21  public:
22 
26  DetectorAlignStore(const DetectorType _type);
27 
29  virtual ~DetectorAlignStore() = default;
31  std::shared_ptr<GeoAlignmentStore> geoModelAlignment{std::make_unique<GeoAlignmentStore>()};
34  public:
38  static unsigned int drawTicket(const DetectorType detType);
40  static unsigned int distributedTickets(const DetectorType detType);
42  static void giveBackTicket(const DetectorType detType, unsigned int ticketNo);
44  const Amg::Transform3D* getTransform(unsigned int ticketNo) const {
45  return m_transforms[ticketNo].get();
46  }
49  const Amg::Transform3D& setTransform(unsigned int ticketNo, Amg::Transform3D && trf) const {
50  return (*m_transforms.at(ticketNo).set(std::make_unique<Amg::Transform3D>(std::move(trf))));
51  }
52 
53  static constexpr unsigned s_techs{static_cast<unsigned>(DetectorType::UnDefined)};
54  using TicketCounterArr = std::array<std::atomic<unsigned>, s_techs>;
55  using ReturnedTicketArr = std::array<std::vector<bool>, s_techs>;
56  using ReturnedHintArr = std::array<int, s_techs>;
57  private:
58  static TicketCounterArr s_clientCounter ATLAS_THREAD_SAFE;
59  static ReturnedTicketArr s_returnedTickets ATLAS_THREAD_SAFE;
60  static ReturnedHintArr s_returnedHints ATLAS_THREAD_SAFE;
61  std::vector<CxxUtils::CachedUniquePtr<Amg::Transform3D>> m_transforms{};
62  };
67  TrackingAlignStorePtr trackingAlignment{std::make_unique<TrackingAlignStore>(detType)};
72  };
73 
74 
75 } // namespace ActsTrk
76 
79 #endif
GeoModel::TransientConstSharedPtr< TrackingAlignStore >
CONDCONT_DEF
CONDCONT_DEF(ActsTrk::DetectorAlignStore, 133556083)
CondCont.h
Hold mappings of ranges to condition objects.
ActsTrk::DetectorAlignStore::geoModelAlignment
std::shared_ptr< GeoAlignmentStore > geoModelAlignment
Store containing the aligned GeoModel nodes.
Definition: DetectorAlignStore.h:31
ActsTrk::DetectorType
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
Definition: GeometryDefs.h:17
ActsTrk::DetectorAlignStore::TrackingAlignStore
Store holding the transfomations used by the Acts algorithms.
Definition: DetectorAlignStore.h:33
ActsTrk::DetectorAlignStore
Definition: DetectorAlignStore.h:20
ActsTrk::DetectorType::UnDefined
@ UnDefined
Small Thing Gap chambers (NSW)
ActsTrk::DetectorAlignStore::TrackingAlignStore::ATLAS_THREAD_SAFE
static TicketCounterArr s_clientCounter ATLAS_THREAD_SAFE
Definition: DetectorAlignStore.h:58
ActsTrk::DetectorAlignStore::TrackingAlignStore::setTransform
const Amg::Transform3D & setTransform(unsigned int ticketNo, Amg::Transform3D &&trf) const
Caches for the given ticket number the transformation in the store and returns the const reference to...
Definition: DetectorAlignStore.h:49
CLASS_DEF
CLASS_DEF(ActsTrk::DetectorAlignStore, 167523695, 1)
ActsTrk::DetectorAlignStore::TrackingAlignStore::s_techs
static constexpr unsigned s_techs
Definition: DetectorAlignStore.h:53
ActsTrk::DetectorAlignStore::TrackingAlignStore::TicketCounterArr
std::array< std::atomic< unsigned >, s_techs > TicketCounterArr
Definition: DetectorAlignStore.h:54
ActsTrk::DetectorAlignStore::InternalAlignStore
The muon system contains additional parameters such as B-lines, as-built, passivation.
Definition: DetectorAlignStore.h:69
ActsTrk::DetectorAlignStore::internalAlignment
InternalAlignPtr internalAlignment
Definition: DetectorAlignStore.h:71
ActsTrk::DetectorAlignStore::DetectorAlignStore
DetectorAlignStore(const DetectorAlignStore &other)=default
Copy constructor.
ActsTrk::DetectorAlignStore::TrackingAlignStore::ReturnedTicketArr
std::array< std::vector< bool >, s_techs > ReturnedTicketArr
Definition: DetectorAlignStore.h:55
ActsTrk::DetectorAlignStore::TrackingAlignStore::TrackingAlignStore
TrackingAlignStore(const DetectorType detType)
Definition: DetectorAlignStore.cxx:21
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
CachedUniquePtr.h
Cached unique_ptr with atomic update.
ActsTrk::DetectorAlignStore::TrackingAlignStore::m_transforms
std::vector< CxxUtils::CachedUniquePtr< Amg::Transform3D > > m_transforms
Definition: DetectorAlignStore.h:61
ActsTrk::DetectorAlignStore::TrackingAlignStore::ATLAS_THREAD_SAFE
static ReturnedHintArr s_returnedHints ATLAS_THREAD_SAFE
Definition: DetectorAlignStore.h:60
ActsTrk::DetectorAlignStore::TrackingAlignStore::giveBackTicket
static void giveBackTicket(const DetectorType detType, unsigned int ticketNo)
Definition: DetectorAlignStore.cxx:60
GeometryDefs.h
ActsTrk::DetectorAlignStore::TrackingAlignStore::drawTicket
static unsigned int drawTicket(const DetectorType detType)
Returns a unique ID to the client under which the client can store its transformation inside the cont...
Definition: DetectorAlignStore.cxx:24
ActsTrk::DetectorAlignStore::TrackingAlignStore::getTransform
const Amg::Transform3D * getTransform(unsigned int ticketNo) const
Returns the transformation associated with the ticket number.
Definition: DetectorAlignStore.h:44
GeoAlignmentStore.h
ActsTrk::DetectorAlignStore::trackingAlignment
TrackingAlignStorePtr trackingAlignment
Definition: DetectorAlignStore.h:67
ActsTrk::DetectorAlignStore::TrackingAlignStore::distributedTickets
static unsigned int distributedTickets(const DetectorType detType)
Returns the number of all distributed tickets.
Definition: DetectorAlignStore.cxx:57
ActsTrk::DetectorAlignStore::TrackingAlignStore::ReturnedHintArr
std::array< int, s_techs > ReturnedHintArr
Definition: DetectorAlignStore.h:56
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
ActsTrk::DetectorAlignStore::TrackingAlignStore::ATLAS_THREAD_SAFE
static ReturnedTicketArr s_returnedTickets ATLAS_THREAD_SAFE
Definition: DetectorAlignStore.h:59
TransientConstSharedPtr.h
ActsTrk::DetectorAlignStore::~DetectorAlignStore
virtual ~DetectorAlignStore()=default
Default virtual destructor.
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:54
CaloLCW_tf.trf
trf
Definition: CaloLCW_tf.py:20
ActsTrk::DetectorAlignStore::detType
DetectorType detType
The aligned detector element type.
Definition: DetectorAlignStore.h:64
CLASS_DEF.h
macros to associate a CLID to a type