ATLAS Offline Software
MuonSegmentTagSurfaces.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONCOMBINEDEVENT_MUONSEGMENTTAGSURFACES_H
5 #define MUONCOMBINEDEVENT_MUONSEGMENTTAGSURFACES_H
6 
7 #include <array>
8 #include <memory>
9 #include <string>
10 #include <vector>
11 
13 #include "TrkSurfaces/Surface.h"
14 
15 /*
16  Helper class defining a super simple model of the MS consisting of cylinders to represent the barrels
17  & disks to represent the endcap stations. The simplification is used in the Segment Tagging alg
18 */
19 
20 namespace MuonCombined {
21  class MuonSegmentTagSurfaces final {
22  public:
23  enum SurfDef {
24  BI = 0,
25  BM = 1,
26  BO = 2,
27  EIA = 3,
28  EMA = 4,
29  EOA = 5,
30  EEA = 6,
31  EIC = 7,
32  EMC = 8,
33  EOC = 9,
34  EEC = 10,
35  NumSurf = 11,
36  };
39  static int stIdxToSurfDef(Muon::MuonStationIndex::StIndex st_idx, bool pos_eta);
40 
41  using SurfaceVec = std::array<std::unique_ptr<Trk::Surface>, SurfDef::NumSurf>;
42  using SurfaceStations = std::array<std::string, SurfDef::NumSurf>;
43 
46 
47  const SurfaceVec& getSurfaces() const { return m_vec; };
48  void setSurface(const Trk::Surface* surface, SurfDef def) { m_vec[def].reset(surface->clone()); };
49 
50  const std::string stationType(unsigned int count) const {
51  if (count >= m_station.size())
52  return "";
53  else
54  return m_station[count];
55  };
56 
57  const Trk::Surface* getSurface(SurfDef surf) const { return m_vec[surf].get(); };
58 
59  const Trk::Surface* getSurface(unsigned int surf_count) const {
60  if (surf_count >= m_vec.size())
61  return nullptr;
62  else
63  return m_vec[surf_count].get();
64  };
65 
66  const Trk::Surface* operator[](SurfDef surf) const { return m_vec[surf].get(); };
67 
68  SurfaceVec::const_iterator begin() const { return m_vec.begin(); };
69  SurfaceVec::const_iterator end() const { return m_vec.end(); };
70 
71  private:
74  };
75 
76 } // namespace MuonCombined
77 
78 #endif //
MuonCombined::MuonSegmentTagSurfaces::m_station
SurfaceStations m_station
Definition: MuonSegmentTagSurfaces.h:73
MuonCombined::MuonSegmentTagSurfaces::EMA
@ EMA
Definition: MuonSegmentTagSurfaces.h:28
Surface.h
MuonCombined::MuonSegmentTagSurfaces::EIA
@ EIA
Definition: MuonSegmentTagSurfaces.h:27
MuonCombined::MuonSegmentTagSurfaces::EIC
@ EIC
Definition: MuonSegmentTagSurfaces.h:31
MuonCombined::MuonSegmentTagSurfaces::getSurface
const Trk::Surface * getSurface(SurfDef surf) const
Definition: MuonSegmentTagSurfaces.h:57
MuonCombined::MuonSegmentTagSurfaces::stIdxToSurfDef
static int stIdxToSurfDef(Muon::MuonStationIndex::StIndex st_idx, bool pos_eta)
Transforms the Muon Station index to a SurfDef index.
Definition: MuonSegmentTagSurfaces.cxx:21
MuonCombined::MuonSegmentTagSurfaces::EOC
@ EOC
Definition: MuonSegmentTagSurfaces.h:33
MuonCombined::MuonSegmentTagSurfaces::SurfaceStations
std::array< std::string, SurfDef::NumSurf > SurfaceStations
Definition: MuonSegmentTagSurfaces.h:42
MuonCombined::MuonSegmentTagSurfaces::BO
@ BO
Definition: MuonSegmentTagSurfaces.h:26
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
MuonCombined::MuonSegmentTagSurfaces::getSurface
const Trk::Surface * getSurface(unsigned int surf_count) const
Definition: MuonSegmentTagSurfaces.h:59
MuonCombined::MuonSegmentTagSurfaces::m_vec
SurfaceVec m_vec
Definition: MuonSegmentTagSurfaces.h:72
MuonCombined::MuonSegmentTagSurfaces::stationType
const std::string stationType(unsigned int count) const
Definition: MuonSegmentTagSurfaces.h:50
MuonCombined::MuonSegmentTagSurfaces::getSurfaces
const SurfaceVec & getSurfaces() const
Definition: MuonSegmentTagSurfaces.h:47
MuonCombined::MuonSegmentTagSurfaces::EEC
@ EEC
Definition: MuonSegmentTagSurfaces.h:34
MuonCombined::MuonSegmentTagSurfaces::BM
@ BM
Definition: MuonSegmentTagSurfaces.h:25
MuonCombined::MuonSegmentTagSurfaces::setSurface
void setSurface(const Trk::Surface *surface, SurfDef def)
Definition: MuonSegmentTagSurfaces.h:48
MuonCombined::MuonSegmentTagSurfaces
Definition: MuonSegmentTagSurfaces.h:21
MuonCombined::MuonSegmentTagSurfaces::operator[]
const Trk::Surface * operator[](SurfDef surf) const
Definition: MuonSegmentTagSurfaces.h:66
MuonCombined::MuonSegmentTagSurfaces::NumSurf
@ NumSurf
Definition: MuonSegmentTagSurfaces.h:35
MuonCombined::MuonSegmentTagSurfaces::SurfDef
SurfDef
Definition: MuonSegmentTagSurfaces.h:23
MuonCombined::MuonSegmentTagSurfaces::EMC
@ EMC
Definition: MuonSegmentTagSurfaces.h:32
Trk::Surface::clone
virtual Surface * clone() const =0
Implicit constructor - uses the copy constructor.
MuonCombined::MuonSegmentTagSurfaces::~MuonSegmentTagSurfaces
~MuonSegmentTagSurfaces()=default
MuonCombined::MuonSegmentTagSurfaces::end
SurfaceVec::const_iterator end() const
Definition: MuonSegmentTagSurfaces.h:69
MuonCombined::MuonSegmentTagSurfaces::BI
@ BI
Definition: MuonSegmentTagSurfaces.h:24
MuonCombined
The MuonTagToSegMap is an auxillary construct that links the MuonSegments associated with a combined ...
Definition: IMuonSystemExtensionTool.h:23
MuonCombined::MuonSegmentTagSurfaces::EEA
@ EEA
Definition: MuonSegmentTagSurfaces.h:30
MuonCombined::MuonSegmentTagSurfaces::SurfaceVec
std::array< std::unique_ptr< Trk::Surface >, SurfDef::NumSurf > SurfaceVec
Definition: MuonSegmentTagSurfaces.h:41
Muon::MuonStationIndex::StIndex
StIndex
enum to classify the different station layers in the muon spectrometer
Definition: MuonStationIndex.h:23
MuonStationIndex.h
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
MuonCombined::MuonSegmentTagSurfaces::EOA
@ EOA
Definition: MuonSegmentTagSurfaces.h:29
MuonCombined::MuonSegmentTagSurfaces::MuonSegmentTagSurfaces
MuonSegmentTagSurfaces()
Definition: MuonSegmentTagSurfaces.cxx:37
MuonCombined::MuonSegmentTagSurfaces::begin
SurfaceVec::const_iterator begin() const
Definition: MuonSegmentTagSurfaces.h:68