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 #include "Identifier/Identifier.h"
12 
13 #define MSG_HELPER(LEVEL,body) if (this->msgLvl(LEVEL)) { this->msg(LEVEL) << body << endmsg;} do {} while (0)
14 #define GEO_MSG_DEBUG(body) MSG_HELPER(MSG::DEBUG,body)
15 #define GEO_MSG_INFO(body) MSG_HELPER(MSG::INFO,body)
16 #define GEO_MSG_WARNING(body) MSG_HELPER(MSG::WARNING,body)
17 #define GEO_MSG_ERROR(body) MSG_HELPER(MSG::ERROR,body)
18 
19 namespace InDetDD {
20  namespace detail {
23 
24  enum class FENumbering {
25  kRegular,
26  kMirror
27  };
28 
30  virtual ~MessagingAdapter() = default;
31  virtual MsgStream& msg (const MSG::Level lvl) const = 0;
32  virtual bool msgLvl (const MSG::Level lvl) const = 0;
33  };
34 
35  // helper to allow usage of MSG macros
38  const std::array<int,kNDirections> &circuits,
39  const std::array<int,kNDirections> &dimPerCircuit,
40  const std::array<std::array<double,kNDirections>,kNPixelLocations> &pitch,
41  FENumbering fe_numbering);
42  };
43 
44  template <class T_MsgParent>
46  T_MsgParent* m_msgParent;
47  PixelDiodeTreeMaker(T_MsgParent* msgParent) : m_msgParent(msgParent) {}
48  virtual MsgStream& msg (const MSG::Level lvl) const override { return m_msgParent->msg(lvl); }
49  virtual bool msgLvl (const MSG::Level lvl) const override { return m_msgParent ? m_msgParent->msgLvl(lvl) : false; }
50  };
51 
52  // create a pixel diode tree for run1-3 pixel, DBM
53  template <class T_MsgParent>
54  inline PixelDiodeTree makePixelDiodeTree(T_MsgParent* gmt_mgr,
55  InDetDD::PixelReadoutTechnology readoutTechnology,
56  const std::array<int,kNDirections> &circuits,
57  const std::array<int,kNDirections> &dimPerCircuit,
58  const std::array<std::array<double,kNDirections>,kNPixelLocations> &pitch,
59  FENumbering fe_numbering) {
60 
61  PixelDiodeTreeMaker<T_MsgParent> maker(gmt_mgr);
62  auto ret=maker.make(readoutTechnology, circuits, dimPerCircuit, pitch, fe_numbering);
63  return ret;
64  }
65  }
66 }
67 
68 #endif
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
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::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, FENumbering fe_numbering)
Definition: PixelGeoUtils.cxx:13
InDetDD::PixelReadoutTechnology
PixelReadoutTechnology
Definition: PixelReadoutDefinitions.h:37
InDetDD::detail::kNPixelLocations
@ kNPixelLocations
Definition: PixelGeoUtils.h:21
InDetDD::detail::EPixelLocation
EPixelLocation
Definition: PixelGeoUtils.h:21
InDetDD::detail::kOuterEdge
@ kOuterEdge
Definition: PixelGeoUtils.h:21
InDetDD::detail::PixelDiodeTreeMakerBase
Definition: PixelGeoUtils.h:36
detail
Definition: extract_histogram_tag.cxx:14
InDetDD::detail::MessagingAdapter
Definition: PixelGeoUtils.h:29
InDetDD::detail::PixelDiodeTreeMaker::msg
virtual MsgStream & msg(const MSG::Level lvl) const override
Definition: PixelGeoUtils.h:48
InDetDD::detail::kInnerEdge
@ kInnerEdge
Definition: PixelGeoUtils.h:21
InDetDD::detail::PixelDiodeTreeMaker::PixelDiodeTreeMaker
PixelDiodeTreeMaker(T_MsgParent *msgParent)
Definition: PixelGeoUtils.h:47
InDetDD::detail::MessagingAdapter::msg
virtual MsgStream & msg(const MSG::Level lvl) const =0
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, FENumbering fe_numbering)
Definition: PixelGeoUtils.h:54
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::FENumbering
FENumbering
Definition: PixelGeoUtils.h:24
InDetDD::detail::PixelDiodeTreeMaker
Definition: PixelGeoUtils.h:45
InDetDD::detail::FENumbering::kRegular
@ kRegular
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:46
InDetDD::detail::MessagingAdapter::~MessagingAdapter
virtual ~MessagingAdapter()=default
InDetDD::detail::FENumbering::kMirror
@ kMirror
InDetDD::detail::PixelDiodeTreeMaker::msgLvl
virtual bool msgLvl(const MSG::Level lvl) const override
Definition: PixelGeoUtils.h:49
InDetDD::detail::kEta
@ kEta
Definition: PixelGeoUtils.h:22
PixelReadoutDefinitions.h
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::detail::kCentral
@ kCentral
Definition: PixelGeoUtils.h:21
InDetDD::detail::kPhi
@ kPhi
Definition: PixelGeoUtils.h:22
InDetDD::detail::kNDirections
@ kNDirections
Definition: PixelGeoUtils.h:22
InDetDD::detail::EDirection
EDirection
Definition: PixelGeoUtils.h:22
PixelDiodeTree.h