ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonReconstruction
MuonRecUtils
MuonLayerHough
MuonLayerHough
MuonPhiLayerHough.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef MUONPHILAYERHOUGH_H
6
#define MUONPHILAYERHOUGH_H
7
8
#include <cmath>
9
#include <iostream>
10
#include <memory>
11
#include <string>
12
#include <vector>
13
14
#include "
MuonLayerHough/Hit.h
"
15
16
class
TH1;
17
18
namespace
MuonHough
{
19
20
using
PhiHitVec
= std::vector<std::shared_ptr<MuonHough::PhiHit>>;
21
22
struct
MuonPhiLayerHough
{
23
struct
Maximum
{
24
Maximum
() =
default
;
25
26
float
max
{0.};
27
float
pos
{0.};
28
29
int
binpos
{-1};
30
int
binposmin
{-1};
31
int
binposmax
{-1};
32
33
int
sector
{-1};
34
35
PhiHitVec
hits
;
36
37
const
MuonPhiLayerHough
*
hough
{
nullptr
};
38
};
39
40
MuonPhiLayerHough
(
int
nbins,
float
rangemin,
float
rangemax,
Muon::MuonStationIndex::DetectorRegionIndex
region_);
41
~MuonPhiLayerHough
();
42
43
void
reset
()
const
;
44
void
setDebug
(
bool
d) {
m_debug
= d; }
45
46
bool
findMaximum
(Maximum&
maximum
,
float
maxval)
const
;
47
void
associateHitsToMaximum
(Maximum&
maximum
,
const
PhiHitVec
& hits)
const
;
48
49
std::pair<int, int>
range
(
float
/*r*/
,
float
phi1,
float
phi2)
const
{
50
float
phimin = std::min(phi1, phi2);
51
float
phimax = std::max(phi1, phi2);
52
int
bphimin = (phimin -
m_rangemin
) *
m_invbinsize
;
53
int
bphimax = (phimax -
m_rangemin
) *
m_invbinsize
;
54
// add neighbouring bin
55
if
((
m_rangemin
+
m_binsize
* bphimin - phimin) *
m_invbinsize
> 0) bphimin -= 1;
56
if
((
m_rangemin
+
m_binsize
* bphimax - phimax) *
m_invbinsize
< 0) bphimax += 1;
57
return
std::make_pair(bphimin, bphimax);
58
}
59
60
void
fillLayer
(
const
PhiHitVec
& hits,
bool
substract =
false
)
const
;
61
void
fillLayer2
(
const
PhiHitVec
& hits,
bool
substract =
false
)
const
;
62
63
float
maximum
(
float
r
,
float
phimin,
float
phimax,
int
& posbin)
const
{
64
unsigned
int
max
= 0;
65
posbin = -1;
66
67
std::pair<int, int> minMax =
range
(
r
, phimin, phimax);
68
for
(
int
n = minMax.first; n <= minMax.second; ++n) {
69
if
(
max
<
m_histo
[n]) {
70
max
=
m_histo
[n];
71
posbin = n;
72
}
73
}
74
if
(
max
> 100000) {
75
std::cout <<
" maximum too large "
<<
max
* 0.001 <<
" min "
<< minMax.first <<
" max "
<< minMax.second <<
" nbins "
76
<<
m_nbins
<<
" phimin "
<< phimin <<
" phimax "
<< phimax << std::endl;
77
for
(
int
n = minMax.first; n <= minMax.second; ++n) { std::cout <<
" bin "
<< n <<
" val "
<<
m_histo
[n] << std::endl; }
78
}
79
80
return
0.001 *
max
;
81
}
82
83
std::vector<TH1*>
rootHistos
(
const
std::string& prefix,
const
float
* phimin = 0,
const
float
* phimax = 0)
const
;
84
85
float
m_binsize
{0.};
86
float
m_invbinsize
{0.};
87
float
m_rangemin
{0.};
88
float
m_rangemax
{0.};
89
90
Muon::MuonStationIndex::DetectorRegionIndex
m_region
;
91
int
m_nbins
;
92
bool
m_debug
{
false
};
93
std::unique_ptr<unsigned int[]>
m_histo
;
94
95
private
:
96
// fake copy constructor and assignment operator
97
MuonPhiLayerHough
(
const
MuonPhiLayerHough
&);
98
MuonPhiLayerHough
&
operator=
(
const
MuonPhiLayerHough
& right);
99
};
100
101
}
// namespace MuonHough
102
#endif
Hit.h
max
#define max(a, b)
Definition
cfImp.cxx:41
r
int r
Definition
globals.cxx:22
MuonHough
Definition
MuonLayerHoughTool.h:40
MuonHough::PhiHitVec
std::vector< std::shared_ptr< MuonHough::PhiHit > > PhiHitVec
Definition
MuonPhiLayerHough.h:20
Muon::MuonStationIndex::DetectorRegionIndex
DetectorRegionIndex
enum to classify the different layers in the muon spectrometer
Definition
MuonStationIndex.h:48
MuonHough::MuonPhiLayerHough::Maximum::binposmin
int binposmin
Definition
MuonPhiLayerHough.h:30
MuonHough::MuonPhiLayerHough::Maximum::hits
PhiHitVec hits
Definition
MuonPhiLayerHough.h:35
MuonHough::MuonPhiLayerHough::Maximum::max
float max
Definition
MuonPhiLayerHough.h:26
MuonHough::MuonPhiLayerHough::Maximum::Maximum
Maximum()=default
MuonHough::MuonPhiLayerHough::Maximum::hough
const MuonPhiLayerHough * hough
Definition
MuonPhiLayerHough.h:37
MuonHough::MuonPhiLayerHough::Maximum::pos
float pos
Definition
MuonPhiLayerHough.h:27
MuonHough::MuonPhiLayerHough::Maximum::sector
int sector
Definition
MuonPhiLayerHough.h:33
MuonHough::MuonPhiLayerHough::Maximum::binposmax
int binposmax
Definition
MuonPhiLayerHough.h:31
MuonHough::MuonPhiLayerHough::Maximum::binpos
int binpos
Definition
MuonPhiLayerHough.h:29
MuonHough::MuonPhiLayerHough::~MuonPhiLayerHough
~MuonPhiLayerHough()
MuonHough::MuonPhiLayerHough::fillLayer2
void fillLayer2(const PhiHitVec &hits, bool substract=false) const
Definition
MuonPhiLayerHough.cxx:29
MuonHough::MuonPhiLayerHough::MuonPhiLayerHough
MuonPhiLayerHough(int nbins, float rangemin, float rangemax, Muon::MuonStationIndex::DetectorRegionIndex region_)
Definition
MuonPhiLayerHough.cxx:15
MuonHough::MuonPhiLayerHough::fillLayer
void fillLayer(const PhiHitVec &hits, bool substract=false) const
Definition
MuonPhiLayerHough.cxx:94
MuonHough::MuonPhiLayerHough::m_binsize
float m_binsize
Definition
MuonPhiLayerHough.h:85
MuonHough::MuonPhiLayerHough::maximum
float maximum(float r, float phimin, float phimax, int &posbin) const
Definition
MuonPhiLayerHough.h:63
MuonHough::MuonPhiLayerHough::m_invbinsize
float m_invbinsize
Definition
MuonPhiLayerHough.h:86
MuonHough::MuonPhiLayerHough::MuonPhiLayerHough
MuonPhiLayerHough(const MuonPhiLayerHough &)
MuonHough::MuonPhiLayerHough::m_rangemin
float m_rangemin
Definition
MuonPhiLayerHough.h:87
MuonHough::MuonPhiLayerHough::findMaximum
bool findMaximum(Maximum &maximum, float maxval) const
Definition
MuonPhiLayerHough.cxx:190
MuonHough::MuonPhiLayerHough::operator=
MuonPhiLayerHough & operator=(const MuonPhiLayerHough &right)
MuonHough::MuonPhiLayerHough::m_histo
std::unique_ptr< unsigned int[]> m_histo
Definition
MuonPhiLayerHough.h:93
MuonHough::MuonPhiLayerHough::m_rangemax
float m_rangemax
Definition
MuonPhiLayerHough.h:88
MuonHough::MuonPhiLayerHough::m_nbins
int m_nbins
Definition
MuonPhiLayerHough.h:91
MuonHough::MuonPhiLayerHough::associateHitsToMaximum
void associateHitsToMaximum(Maximum &maximum, const PhiHitVec &hits) const
Definition
MuonPhiLayerHough.cxx:246
MuonHough::MuonPhiLayerHough::m_region
Muon::MuonStationIndex::DetectorRegionIndex m_region
Definition
MuonPhiLayerHough.h:90
MuonHough::MuonPhiLayerHough::m_debug
bool m_debug
Definition
MuonPhiLayerHough.h:92
MuonHough::MuonPhiLayerHough::reset
void reset() const
Definition
MuonPhiLayerHough.cxx:27
MuonHough::MuonPhiLayerHough::range
std::pair< int, int > range(float, float phi1, float phi2) const
Definition
MuonPhiLayerHough.h:49
MuonHough::MuonPhiLayerHough::rootHistos
std::vector< TH1 * > rootHistos(const std::string &prefix, const float *phimin=0, const float *phimax=0) const
Definition
MuonPhiLayerHough.cxx:177
MuonHough::MuonPhiLayerHough::setDebug
void setDebug(bool d)
Definition
MuonPhiLayerHough.h:44
Generated on
for ATLAS Offline Software by
1.17.0