ATLAS Offline Software
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) continue;
24 
26  m_transforms[index] = std::make_unique<MuonLayerHough>(descriptor);
27  }
28  }
29  }
30 
32 
34  for (auto& transform : m_transforms) {
35  if (transform) transform->reset();
36  }
37  }
38 
40  for (auto& sector : m_sectors) sector->reset();
41  for (auto& transform : m_phiTransforms) transform->reset();
42  }
43 
45 
48 
50  MuonDetectorDescription detectorDescription; // initialize all the regions
51  for (unsigned int i = 1; i <= 16; ++i) { m_sectors.push_back(std::make_unique<MuonSectorHough>(i, detectorDescription)); }
52  for (int i = 0; i < static_cast<int>(DetRegIdx::DetectorRegionIndexMax); ++i) {
53  m_phiTransforms.push_back(std::make_unique<MuonPhiLayerHough>(60, -M_PI, M_PI, static_cast<DetRegIdx>(i)));
54  }
55  }
56 
58 
60  bool isSmall = (sector % 2 == 0);
61  ChIdx chIndex = Muon::MuonStationIndex::toChamberIndex(region, layer, isSmall);
62  if (chIndex <= ChIdx::ChUnknown || chIndex >= ChIdx::ChIndexMax) {
63  return RegionDescriptor{};
64  }
65 
66  RegionDescriptor descriptor = m_regionDescriptions[static_cast<int>(chIndex)];
67  descriptor.sector = sector;
68  // exceptions for a few barrel regions
69  if (region == DetRegIdx::Barrel) {
70  if ((sector == 10 || sector == 14) && layer == LayIdx::Inner)
71  descriptor.referencePosition = 5400.;
72  else if ((sector == 11 || sector == 13) && layer == LayIdx::Outer)
73  descriptor.referencePosition = 10650.;
74  } else if (region == DetRegIdx::EndcapC) { // multiply reference position by -1 for C side
75  descriptor.region = region;
76  if (layer == LayIdx::BarrelExtended) {
77  descriptor.yMinRange *= -1;
78  descriptor.yMaxRange *= -1;
79  std::swap(descriptor.yMinRange, descriptor.yMaxRange);
80  } else {
81  descriptor.referencePosition *= -1;
82  }
83  }
84  return descriptor;
85  }
86 
88  double scalefactor = 1.0; // can be used to tune the steps in theta variation!
89  int inner_step = 3; // default is 3
90  int middle_step = 5 * scalefactor; // default is 5--range is 0.25
91  int outer_step = 7 * scalefactor; // default is 7--range is 0.35
92  double inner_gap = 0.05; // default is 0.05
93  double middle_gap = 0.1 / scalefactor; // default is 0.1
94  double outer_gap = middle_gap; // default is 0.1
95  int ystep = 30; // default is 30
96  m_regionDescriptions.resize(static_cast<int>(ChIdx::ChIndexMax));
98  4560, -7500, 7500, ystep, middle_gap, inner_step);
100  4950, -7000, 7000, ystep, middle_gap, inner_step);
102  8096, -9500, 9500, ystep, middle_gap, middle_step);
104  7153, -9500, 9500, ystep, middle_gap, middle_step);
106  10570, -13500, 13500, ystep, outer_gap, outer_step);
108  9500, -13500, 13500, ystep, outer_gap, outer_step);
109  m_regionDescriptions[static_cast<int>(ChIdx::BEE)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::BEE,
110  4415, 7500, 13000, ystep, middle_gap, middle_step);
111  m_regionDescriptions[static_cast<int>(ChIdx::EIS)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EIS,
112  7270, 1000, 7000, ystep, inner_gap, inner_step); // 7
113  m_regionDescriptions[static_cast<int>(ChIdx::EIL)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EIL,
114  7675, 1000, 8000, ystep, inner_gap, inner_step);
115  m_regionDescriptions[static_cast<int>(ChIdx::EES)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EES,
116  10800, 4000, 10000, ystep, middle_gap, middle_step);
117  m_regionDescriptions[static_cast<int>(ChIdx::EEL)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EEL,
118  11330, 4000, 10000, ystep, middle_gap, middle_step);
119  m_regionDescriptions[static_cast<int>(ChIdx::EMS)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EMS,
120  13872, 1500, 13000, ystep, middle_gap, middle_step);
121  m_regionDescriptions[static_cast<int>(ChIdx::EML)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EML,
122  14310, 1500, 13000, ystep, middle_gap, middle_step);
123  m_regionDescriptions[static_cast<int>(ChIdx::EOS)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EOS,
124  21841, 2000, 13500, ystep, outer_gap, outer_step);
125  m_regionDescriptions[static_cast<int>(ChIdx::EOL)] = RegionDescriptor(1, DetRegIdx::EndcapA, ChIdx::EOL,
126  21421, 2000, 13500, ystep, outer_gap, outer_step);
127  }
128 
129 } // namespace MuonHough
BIS
@ BIS
Definition: RegSelEnums.h:11
Muon::MuonStationIndex::toChamberIndex
static ChIndex toChamberIndex(DetectorRegionIndex region, LayerIndex layer, bool isSmall)
convert DetectorRegionIndex + LayerIndex + isSmall into ChIndex
Definition: MuonStationIndex.cxx:98
MuonRegionHough.h
MuonHough::MuonDetectorHough::m_sectors
std::vector< std::unique_ptr< MuonSectorHough > > m_sectors
Definition: MuonRegionHough.h:93
BIL
@ BIL
Definition: RegSelEnums.h:10
index
Definition: index.py:1
xAOD::L2MuonParameters::BEE
@ BEE
BEE measurement point.
Definition: TrigMuonDefs.h:24
Muon::MuonStationIndex::sectorLayerHashMax
static unsigned int sectorLayerHashMax()
maximum create a hash out of region and layer
Definition: MuonStationIndex.cxx:231
MuonHough::RegionDescriptor::yMinRange
float yMinRange
Definition: MuonLayerHough.h:49
Muon::MuonStationIndex::LayerIndex
LayerIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:38
Muon::MuonStationIndex::sectorLayerHash
static unsigned int sectorLayerHash(DetectorRegionIndex detectorRegionIndex, LayerIndex layerIndex)
create a hash out of region and layer
Definition: MuonStationIndex.cxx:226
M_PI
#define M_PI
Definition: ActiveFraction.h:11
MuonHough::MuonSectorHough::reset
void reset()
reset histograms
Definition: MuonRegionHough.cxx:33
MuonHough::RegionDescriptor::yMaxRange
float yMaxRange
Definition: MuonLayerHough.h:50
MuonHough::MuonDetectorDescription::initDefaultRegions
void initDefaultRegions()
initialize default geometry
Definition: MuonRegionHough.cxx:87
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
MuonHough::RegionDescriptor::region
DetRegIdx region
Definition: MuonLayerHough.h:46
MuonHough::RegionDescriptor::sector
int sector
Definition: MuonLayerHough.h:45
MuonHough::MuonDetectorHough::~MuonDetectorHough
~MuonDetectorHough()
destructor
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonHough::MuonDetectorDescription
class managing geometry of the Hough spaces
Definition: MuonRegionHough.h:19
MuonHough::MuonDetectorHough::m_phiTransforms
std::vector< std::unique_ptr< MuonPhiLayerHough > > m_phiTransforms
sector transforms
Definition: MuonRegionHough.h:94
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
MuonHough
Definition: MuonLayerHoughTool.h:41
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
MuonHough::MuonDetectorHough::reset
void reset()
reset histograms
Definition: MuonRegionHough.cxx:39
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
Muon::MuonStationIndex::DetectorRegionIndex
DetectorRegionIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:47
MuonHough::MuonDetectorDescription::getDescriptor
RegionDescriptor getDescriptor(int sector, DetRegIdx region, LayIdx layer) const
Definition: MuonRegionHough.cxx:59
MuonHough::MuonDetectorHough::MuonDetectorHough
MuonDetectorHough()
constructor using default region definitions
Definition: MuonRegionHough.cxx:44
MuonHough::MuonDetectorDescription::m_regionDescriptions
RegionDescriptionVec m_regionDescriptions
cached geometry
Definition: MuonRegionHough.h:35
MuonHough::MuonDetectorDescription::MuonDetectorDescription
MuonDetectorDescription()
constructor
Definition: MuonRegionHough.cxx:57
MuonHough::MuonSectorHough::m_transforms
std::vector< std::unique_ptr< MuonLayerHough > > m_transforms
Definition: MuonRegionHough.h:59
MuonHough::MuonSectorHough::~MuonSectorHough
~MuonSectorHough()
destructor
DeMoScan.index
string index
Definition: DeMoScan.py:364
BML
@ BML
Definition: RegSelEnums.h:12
MuonHough::MuonDetectorHough::init
void init()
Definition: MuonRegionHough.cxx:49
BMS
@ BMS
Definition: RegSelEnums.h:13
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
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