Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
MuonRegionHough.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 namespace MuonHough {
10  MuonSectorHough::MuonSectorHough(int sector, const MuonDetectorDescription& regionDescriptions) {
12 
13  // loop over regions and layers of the detector and build the transforms
14  constexpr int detRegMax = static_cast<int>(DetRegIdx::DetectorRegionIndexMax);
15  constexpr int layIdxMax = static_cast<int>(LayIdx::LayerIndexMax);
16  for (int reg = 0; reg < detRegMax; ++reg) {
17  const auto region = static_cast<DetRegIdx>(reg);
18  for (int lay = 0; lay < layIdxMax; ++lay) {
19  const auto layer = static_cast<LayIdx>(lay);
20 
21  // skip the few empty slots in the hash
22  RegionDescriptor descriptor = regionDescriptions.getDescriptor(sector, region, layer);
23  if (descriptor.chIndex == ChIdx::ChUnknown) {
24  continue;
25  }
27  m_transforms[index] = std::make_unique<MuonLayerHough>(descriptor);
28  }
29  }
30  }
31 
33 
35  for (auto& transform : m_transforms) {
36  if (transform) transform->reset();
37  }
38  }
39 
41  for (auto& sector : m_sectors) sector->reset();
42  for (auto& transform : m_phiTransforms) transform->reset();
43  }
44 
46 
49 
51  MuonDetectorDescription detectorDescription; // initialize all the regions
52  for (unsigned int i = 1; i <= 16; ++i) { m_sectors.push_back(std::make_unique<MuonSectorHough>(i, detectorDescription)); }
53  using namespace Muon::MuonStationIndex;
54  for (int i = 0; i < toInt(DetRegIdx::DetectorRegionIndexMax); ++i) {
55  m_phiTransforms.push_back(std::make_unique<MuonPhiLayerHough>(60, -M_PI, M_PI, static_cast<DetRegIdx>(i)));
56  }
57  }
58 
60 
62  bool isSmall = (sector % 2 == 0);
63  using namespace Muon::MuonStationIndex;
66  return RegionDescriptor{};
67  }
68 
69  RegionDescriptor descriptor = m_regionDescriptions[toInt(chIndex)];
70  descriptor.sector = sector;
71  // exceptions for a few barrel regions
72  if (region == DetRegIdx::Barrel) {
73  if ((sector == 10 || sector == 14) && layer == LayIdx::Inner)
74  descriptor.referencePosition = 5400.;
75  else if ((sector == 11 || sector == 13) && layer == LayIdx::Outer)
76  descriptor.referencePosition = 10650.;
77  } else if (region == DetRegIdx::EndcapC) { // multiply reference position by -1 for C side
78  descriptor.region = region;
80  descriptor.yMinRange *= -1;
81  descriptor.yMaxRange *= -1;
82  std::swap(descriptor.yMinRange, descriptor.yMaxRange);
83  } else {
84  descriptor.referencePosition *= -1;
85  }
86  }
87  return descriptor;
88  }
89 
91  double scalefactor = 1.0; // can be used to tune the steps in theta variation!
92  int inner_step = 3; // default is 3
93  int middle_step = 5 * scalefactor; // default is 5--range is 0.25
94  int outer_step = 7 * scalefactor; // default is 7--range is 0.35
95  double inner_gap = 0.05; // default is 0.05
96  double middle_gap = 0.1 / scalefactor; // default is 0.1
97  double outer_gap = middle_gap; // default is 0.1
98  int ystep = 30; // default is 30
99  m_regionDescriptions.resize(static_cast<int>(ChIdx::ChIndexMax));
100  m_regionDescriptions[static_cast<int>(ChIdx::BIS)] = RegionDescriptor(1, DetRegIdx::Barrel, ChIdx::BIS,
101  4560, -7500, 7500, ystep, middle_gap, inner_step);
102  m_regionDescriptions[static_cast<int>(ChIdx::BIL)] = RegionDescriptor(1, DetRegIdx::Barrel, ChIdx::BIL,
103  4950, -7000, 7000, ystep, middle_gap, inner_step);
104  m_regionDescriptions[static_cast<int>(ChIdx::BMS)] = RegionDescriptor(1, DetRegIdx::Barrel, ChIdx::BMS,
105  8096, -9500, 9500, ystep, middle_gap, middle_step);
106  m_regionDescriptions[static_cast<int>(ChIdx::BML)] = RegionDescriptor(1, DetRegIdx::Barrel, ChIdx::BML,
107  7153, -9500, 9500, ystep, middle_gap, middle_step);
108  m_regionDescriptions[static_cast<int>(ChIdx::BOS)] = RegionDescriptor(1, DetRegIdx::Barrel, ChIdx::BOS,
109  10570, -13500, 13500, ystep, outer_gap, outer_step);
110  m_regionDescriptions[static_cast<int>(ChIdx::BOL)] = RegionDescriptor(1, DetRegIdx::Barrel, ChIdx::BOL,
111  9500, -13500, 13500, ystep, outer_gap, outer_step);
112  m_regionDescriptions[static_cast<int>(ChIdx::BEE)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::BEE,
113  4415, 7500, 13000, ystep, middle_gap, middle_step);
114  m_regionDescriptions[static_cast<int>(ChIdx::EIS)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EIS,
115  7270, 1000, 7000, ystep, inner_gap, inner_step); // 7
116  m_regionDescriptions[static_cast<int>(ChIdx::EIL)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EIL,
117  7675, 1000, 8000, ystep, inner_gap, inner_step);
118  m_regionDescriptions[static_cast<int>(ChIdx::EES)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EES,
119  10800, 4000, 10000, ystep, middle_gap, middle_step);
120  m_regionDescriptions[static_cast<int>(ChIdx::EEL)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EEL,
121  11330, 4000, 10000, ystep, middle_gap, middle_step);
122  m_regionDescriptions[static_cast<int>(ChIdx::EMS)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EMS,
123  13872, 1500, 13000, ystep, middle_gap, middle_step);
124  m_regionDescriptions[static_cast<int>(ChIdx::EML)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EML,
125  14310, 1500, 13000, ystep, middle_gap, middle_step);
126  m_regionDescriptions[static_cast<int>(ChIdx::EOS)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EOS,
127  21841, 2000, 13500, ystep, outer_gap, outer_step);
128  m_regionDescriptions[static_cast<int>(ChIdx::EOL)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EOL,
129  21421, 2000, 13500, ystep, outer_gap, outer_step);
130  }
131 
132 } // namespace MuonHough
BIS
@ BIS
Definition: RegSelEnums.h:11
Muon::MuonStationIndex::LayerIndex
LayerIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:38
Muon::MuonStationIndex::EIL
@ EIL
Definition: MuonStationIndex.h:18
MuonRegionHough.h
MuonHough::MuonDetectorHough::m_sectors
std::vector< std::unique_ptr< MuonSectorHough > > m_sectors
Definition: MuonRegionHough.h:95
BIL
@ BIL
Definition: RegSelEnums.h:10
Muon::MuonStationIndex::toChamberIndex
ChIndex toChamberIndex(DetectorRegionIndex region, LayerIndex layer, bool isSmall)
convert DetectorRegionIndex + LayerIndex + isSmall into ChIndex
Definition: MuonStationIndex.cxx:63
Muon::MuonStationIndex::sectorLayerHashMax
constexpr unsigned int sectorLayerHashMax()
maximum create a hash out of region and layer
Definition: MuonStationIndex.h:108
Muon::MuonStationIndex
Definition: MuonStationIndex.h:13
Muon::MuonStationIndex::EOL
@ EOL
Definition: MuonStationIndex.h:18
index
Definition: index.py:1
Muon::MuonStationIndex::sectorLayerHash
unsigned int sectorLayerHash(DetectorRegionIndex detectorRegionIndex, LayerIndex layerIndex)
create a hash out of region and layer
xAOD::L2MuonParameters::BEE
@ BEE
BEE measurement point.
Definition: TrigMuonDefs.h:24
Muon::MuonStationIndex::BarrelExtended
@ BarrelExtended
EE.
Definition: MuonStationIndex.h:42
MuonHough::RegionDescriptor::yMinRange
float yMinRange
Definition: MuonLayerHough.h:49
Muon::MuonStationIndex::EndcapA
@ EndcapA
Definition: MuonStationIndex.h:49
M_PI
#define M_PI
Definition: ActiveFraction.h:11
MuonHough::MuonSectorHough::reset
void reset()
reset histograms
Definition: MuonRegionHough.cxx:34
MuonHough::RegionDescriptor::yMaxRange
float yMaxRange
Definition: MuonLayerHough.h:50
MuonHough::MuonDetectorDescription::initDefaultRegions
void initDefaultRegions()
initialize default geometry
Definition: MuonRegionHough.cxx:90
MuonHough::RegionDescriptor::referencePosition
float referencePosition
Definition: MuonLayerHough.h:48
BOL
@ BOL
Definition: RegSelEnums.h:14
MuonHough::RegionDescriptor
struct containing all information to build a Hough transform for a given chamber index
Definition: MuonLayerHough.h:25
MuonHough::MuonSectorHough::MuonSectorHough
MuonSectorHough(int sector, const MuonDetectorDescription &regionDescriptions)
constructor for a given sector using the default geometry
Definition: MuonRegionHough.cxx:10
DetType::Barrel
@ Barrel
Definition: DetType.h:14
Muon::MuonStationIndex::EMS
@ EMS
Definition: MuonStationIndex.h:18
MuonHough::RegionDescriptor::region
DetRegIdx region
Definition: MuonLayerHough.h:46
MuonHough::RegionDescriptor::sector
int sector
Definition: MuonLayerHough.h:45
MuonHough::MuonDetectorHough::~MuonDetectorHough
~MuonDetectorHough()
destructor
Muon::MuonStationIndex::EES
@ EES
Definition: MuonStationIndex.h:18
Muon::MuonStationIndex::ChUnknown
@ ChUnknown
Definition: MuonStationIndex.h:16
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonHough::MuonDetectorDescription
class managing geometry of the Hough spaces
Definition: MuonRegionHough.h:20
Muon::MuonStationIndex::chIndex
ChIndex chIndex(const std::string &index)
convert ChIndex name string to enum
Definition: MuonStationIndex.cxx:11
MuonHough::MuonDetectorHough::m_phiTransforms
std::vector< std::unique_ptr< MuonPhiLayerHough > > m_phiTransforms
sector transforms
Definition: MuonRegionHough.h:96
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
Muon::MuonStationIndex::EML
@ EML
Definition: MuonStationIndex.h:18
MuonHough
Definition: MuonLayerHoughTool.h:40
Muon::MuonStationIndex::Outer
@ Outer
Definition: MuonStationIndex.h:40
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
Muon::MuonStationIndex::EndcapC
@ EndcapC
Definition: MuonStationIndex.h:49
MuonHough::MuonDetectorHough::reset
void reset()
reset histograms
Definition: MuonRegionHough.cxx:40
Muon::MuonStationIndex::LayerIndexMax
@ LayerIndexMax
BEE.
Definition: MuonStationIndex.h:43
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
MuonHough::MuonDetectorDescription::getDescriptor
RegionDescriptor getDescriptor(int sector, DetRegIdx region, LayIdx layer) const
Definition: MuonRegionHough.cxx:61
MuonHough::MuonDetectorHough::MuonDetectorHough
MuonDetectorHough()
constructor using default region definitions
Definition: MuonRegionHough.cxx:45
MuonR4::SegmentFit::toInt
constexpr int toInt(const ParamDefs p)
Definition: MuonHoughDefs.h:42
MuonHough::MuonDetectorDescription::MuonDetectorDescription
MuonDetectorDescription()
constructor
Definition: MuonRegionHough.cxx:59
MuonHough::MuonSectorHough::m_transforms
std::vector< std::unique_ptr< MuonLayerHough > > m_transforms
Definition: MuonRegionHough.h:61
MuonHough::MuonSectorHough::~MuonSectorHough
~MuonSectorHough()
destructor
DeMoScan.index
string index
Definition: DeMoScan.py:364
Muon::MuonStationIndex::Inner
@ Inner
Definition: MuonStationIndex.h:40
Muon::MuonStationIndex::DetectorRegionIndex
DetectorRegionIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:47
BML
@ BML
Definition: RegSelEnums.h:12
MuonHough::MuonDetectorHough::init
void init()
Definition: MuonRegionHough.cxx:50
BMS
@ BMS
Definition: RegSelEnums.h:13
Muon::MuonStationIndex::EEL
@ EEL
Definition: MuonStationIndex.h:18
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
BOS
@ BOS
Definition: RegSelEnums.h:15
MuonHough::RegionDescriptor::chIndex
ChIdx chIndex
Definition: MuonLayerHough.h:47
Muon::MuonStationIndex::ChIndexMax
@ ChIndexMax
Definition: MuonStationIndex.h:19
Muon::MuonStationIndex::EOS
@ EOS
Definition: MuonStationIndex.h:18
Muon::MuonStationIndex::EIS
@ EIS
Definition: MuonStationIndex.h:18
Muon::MuonStationIndex::isSmall
bool isSmall(const ChIndex index)
Returns true if the chamber index is in a small sector.
Muon::MuonStationIndex::DetectorRegionIndexMax
@ DetectorRegionIndexMax
Definition: MuonStationIndex.h:50