ATLAS Offline Software
PixelGeoUtils.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3  */
4 #ifndef PIXEL_GEO_UTILS_H
5 #define PIXEL_GEO_UTILS_H
6 
9 #include <array>
10 
11 #define MSG_HELPER(LEVEL,body) if (this->msgLvl(LEVEL)) { this->msg(LEVEL) << body << endmsg;} do {} while (0)
12 #define GEO_MSG_DEBUG(body) MSG_HELPER(MSG::DEBUG,body)
13 #define GEO_MSG_INFO(body) MSG_HELPER(MSG::INFO,body)
14 #define GEO_MSG_WARNING(body) MSG_HELPER(MSG::WARNING,body)
15 #define GEO_MSG_ERROR(body) MSG_HELPER(MSG::ERROR,body)
16 
17 namespace InDetDD {
18  namespace detail {
21 
23  virtual ~MessagingAdapter() = default;
24  virtual MsgStream& msg (const MSG::Level lvl) const = 0;
25  virtual bool msgLvl (const MSG::Level lvl) const = 0;
26  };
27 
28  // helper to allow usage of MSG macros
31  const std::array<int,kNDirections> &circuits,
32  const std::array<int,kNDirections> &dimPerCircuit,
33  const std::array<std::array<double,kNDirections>,kNPixelLocations> &pitch);
34  };
35 
36  template <class T_MsgParent>
38  T_MsgParent* m_msgParent;
39  PixelDiodeTreeMaker(T_MsgParent* msgParent) : m_msgParent(msgParent) {}
40  virtual MsgStream& msg (const MSG::Level lvl) const override { return m_msgParent->msg(lvl); }
41  virtual bool msgLvl (const MSG::Level lvl) const override { return m_msgParent ? m_msgParent->msgLvl(lvl) : false; }
42  };
43 
44  // create a pixel diode tree for run1-3 pixel, DBM
45  template <class T_MsgParent>
46  inline PixelDiodeTree makePixelDiodeTree(T_MsgParent* gmt_mgr,
47  InDetDD::PixelReadoutTechnology readoutTechnology,
48  const std::array<int,kNDirections> &circuits,
49  const std::array<int,kNDirections> &dimPerCircuit,
50  const std::array<std::array<double,kNDirections>,kNPixelLocations> &pitch) {
51 
52  PixelDiodeTreeMaker<T_MsgParent> maker(gmt_mgr);
53  auto ret=maker.make( readoutTechnology, circuits, dimPerCircuit, pitch);
54  return ret;
55  }
56  }
57 }
58 
59 #endif
InDetDD::PixelDiodeTree
Tree structure to find the position, index or pitch of a pixel on a semi-regular grid The grid is con...
Definition: PixelDiodeTree.h:33
InDetDD::PixelReadoutTechnology
PixelReadoutTechnology
Definition: PixelReadoutDefinitions.h:37
InDetDD::detail::kNPixelLocations
@ kNPixelLocations
Definition: PixelGeoUtils.h:19
InDetDD::detail::EPixelLocation
EPixelLocation
Definition: PixelGeoUtils.h:19
InDetDD::detail::kOuterEdge
@ kOuterEdge
Definition: PixelGeoUtils.h:19
InDetDD::detail::PixelDiodeTreeMakerBase
Definition: PixelGeoUtils.h:29
detail
Definition: extract_histogram_tag.cxx:14
InDetDD::detail::MessagingAdapter
Definition: PixelGeoUtils.h:22
InDetDD::detail::PixelDiodeTreeMaker::msg
virtual MsgStream & msg(const MSG::Level lvl) const override
Definition: PixelGeoUtils.h:40
InDetDD::detail::kInnerEdge
@ kInnerEdge
Definition: PixelGeoUtils.h:19
InDetDD::detail::PixelDiodeTreeMaker::PixelDiodeTreeMaker
PixelDiodeTreeMaker(T_MsgParent *msgParent)
Definition: PixelGeoUtils.h:39
InDetDD::detail::MessagingAdapter::msg
virtual MsgStream & msg(const MSG::Level lvl) const =0
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
InDetDD::detail::MessagingAdapter::msgLvl
virtual bool msgLvl(const MSG::Level lvl) const =0
InDetDD::detail::PixelDiodeTreeMaker
Definition: PixelGeoUtils.h:37
columnar::final
CM final
Definition: ColumnAccessor.h:106
lumiFormat.array
array
Definition: lumiFormat.py:91
InDetDD::detail::PixelDiodeTreeMaker::m_msgParent
T_MsgParent * m_msgParent
Definition: PixelGeoUtils.h:38
InDetDD::detail::MessagingAdapter::~MessagingAdapter
virtual ~MessagingAdapter()=default
InDetDD::detail::PixelDiodeTreeMaker::msgLvl
virtual bool msgLvl(const MSG::Level lvl) const override
Definition: PixelGeoUtils.h:41
InDetDD::detail::kEta
@ kEta
Definition: PixelGeoUtils.h:20
InDetDD::detail::PixelDiodeTreeMakerBase::make
PixelDiodeTree make(InDetDD::PixelReadoutTechnology readoutTechnology, const std::array< int, kNDirections > &circuits, const std::array< int, kNDirections > &dimPerCircuit, const std::array< std::array< double, kNDirections >, kNPixelLocations > &pitch)
Definition: PixelGeoUtils.cxx:12
PixelReadoutDefinitions.h
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::detail::kCentral
@ kCentral
Definition: PixelGeoUtils.h:19
InDetDD::detail::kPhi
@ kPhi
Definition: PixelGeoUtils.h:20
InDetDD::detail::kNDirections
@ kNDirections
Definition: PixelGeoUtils.h:20
InDetDD::detail::makePixelDiodeTree
PixelDiodeTree makePixelDiodeTree(T_MsgParent *gmt_mgr, InDetDD::PixelReadoutTechnology readoutTechnology, const std::array< int, kNDirections > &circuits, const std::array< int, kNDirections > &dimPerCircuit, const std::array< std::array< double, kNDirections >, kNPixelLocations > &pitch)
Definition: PixelGeoUtils.h:46
InDetDD::detail::EDirection
EDirection
Definition: PixelGeoUtils.h:20
PixelDiodeTree.h