#include <MuonPhiLayerHough.h>
|
| MuonPhiLayerHough (int nbins, float rangemin, float rangemax, Muon::MuonStationIndex::DetectorRegionIndex region_) |
|
| ~MuonPhiLayerHough () |
|
void | reset () const |
|
void | setDebug (bool d) |
|
bool | findMaximum (Maximum &maximum, float maxval) const |
|
void | associateHitsToMaximum (Maximum &maximum, const PhiHitVec &hits) const |
|
std::pair< int, int > | range (float, float phi1, float phi2) const |
|
void | fillLayer (const PhiHitVec &hits, bool substract=false) const |
|
void | fillLayer2 (const PhiHitVec &hits, bool substract=false) const |
|
float | maximum (float r, float phimin, float phimax, int &posbin) const |
|
std::vector< TH1 * > | rootHistos (const std::string &prefix, const float *phimin=0, const float *phimax=0) const |
|
Definition at line 22 of file MuonPhiLayerHough.h.
◆ MuonPhiLayerHough() [1/2]
◆ ~MuonPhiLayerHough()
MuonHough::MuonPhiLayerHough::~MuonPhiLayerHough |
( |
| ) |
|
|
default |
◆ MuonPhiLayerHough() [2/2]
◆ associateHitsToMaximum()
Definition at line 246 of file MuonPhiLayerHough.cxx.
249 PhiHitVec::const_iterator
it =
hits.begin();
250 PhiHitVec::const_iterator it_end =
hits.end();
251 for (;
it != it_end; ++
it) {
253 std::pair<int, int> minMax =
range((*it)->r, (*it)->phimin, (*it)->phimax);
255 std::cout <<
" hit: r " << (*it)->r <<
" phimin " << (*it)->phimin <<
" phimax " << (*it)->phimax <<
" range "
256 << minMax.first <<
" " << minMax.second <<
" maximum range " <<
maximum.binposmin <<
" " <<
maximum.binposmax
258 if (minMax.first >
maximum.binposmax)
continue;
259 if (minMax.second <
maximum.binposmin)
continue;
◆ fillLayer()
void MuonHough::MuonPhiLayerHough::fillLayer |
( |
const PhiHitVec & |
hits, |
|
|
bool |
substract = false |
|
) |
| const |
Definition at line 94 of file MuonPhiLayerHough.cxx.
95 if (
hits.empty())
return;
96 if (
m_debug) std::cout <<
" filling layers, hits " <<
hits.size() <<
" subtract " << subtract << std::endl;
98 int prevbinmin = 10000;
101 PhiHitVec::const_iterator
it =
hits.begin();
102 PhiHitVec::const_iterator it_end =
hits.end();
103 for (;
it != it_end; ++
it) {
104 std::pair<int, int> minMax =
range((*it)->r, (*it)->phimin, (*it)->phimax);
106 int binmin = minMax.first;
107 int binmax = minMax.second;
109 if (binmin >=
m_nbins)
continue;
110 if (binmax < 0)
continue;
112 if (binmin < 0) binmin = 0;
115 std::cout <<
" layer " << (*it)->layer <<
" r " << (*it)->r <<
" phimin " << (*it)->phimin <<
" phimax " << (*it)->phimax
116 <<
" new min " << binmin <<
" " << binmax << std::endl;
119 if (prevbinmax == -1) {
121 std::cout <<
" first range " << (*it)->layer <<
" r " << (*it)->r <<
" range " << binmin <<
" " << binmax <<
" new min "
122 << binmin <<
" " << binmax << std::endl;
125 prevlayer = (*it)->layer;
129 if (binmin < prevbinmin && prevlayer == (*it)->layer)
130 std::cout <<
"Error hits are out of order: min " << binmin <<
" max " << binmax << std::endl;
134 if (prevbinmax < binmin || prevlayer != (*it)->layer) {
136 std::cout <<
" filling " << (*it)->layer <<
" r " << (*it)->r <<
" phimin " << (*it)->phimin <<
" phimax "
137 << (*it)->phimax <<
" range " << prevbinmin <<
" " << prevbinmax <<
" new min " << binmin <<
" " << binmax
139 for (
int n = prevbinmin;
n <= prevbinmax; ++
n) {
141 int w = 1000 * (*it)->w;
142 if (subtract)
w *= -1;
143 if (
w < 0 && (
int)
val < -
w)
150 prevlayer = (*it)->layer;
155 std::cout <<
" updating range " << (*it)->layer <<
" r " << (*it)->r <<
" phimin " << (*it)->phimin <<
" phimax "
156 << (*it)->phimax <<
" range " << prevbinmin <<
" " << prevbinmax <<
" new min " << binmin <<
" " << binmax
161 if (prevbinmax != -1) {
163 std::cout <<
" filling " <<
hits.back()->layer <<
" r " <<
hits.back()->r <<
" phimin " <<
hits.back()->phimin <<
" phimax "
164 <<
hits.back()->phimax <<
" range " << prevbinmin <<
" " << prevbinmax << std::endl;
165 for (
int n = prevbinmin;
n <= prevbinmax; ++
n) {
167 int w = 1000 *
hits.back()->w;
168 if (subtract)
w *= -1;
169 if (
w < 0 && (
int)
val < -
w)
◆ fillLayer2()
void MuonHough::MuonPhiLayerHough::fillLayer2 |
( |
const PhiHitVec & |
hits, |
|
|
bool |
substract = false |
|
) |
| const |
Definition at line 29 of file MuonPhiLayerHough.cxx.
30 if (
hits.empty())
return;
32 std::vector<int> layerCounts(
m_nbins, 0);
33 int sign = subtract ? -1000 : 1000;
37 int prevlayer =
hits.front()->layer;
40 PhiHitVec::const_iterator
it =
hits.begin();
41 PhiHitVec::const_iterator it_end =
hits.end();
42 for (;
it != it_end; ++
it) {
44 if (prevlayer != (*it)->layer) {
46 if (subtract && -layerCounts[
i] >=
static_cast<int>(
m_histo[
i]))
53 prevlayer = (*it)->layer;
57 std::pair<int, int> minMax =
range((*it)->r, (*it)->phimin, (*it)->phimax);
58 int binmin = minMax.first;
59 int binmax = minMax.second;
62 if (binmin >=
m_nbins)
continue;
63 if (binmax < 0)
continue;
66 if (binmin < 0) binmin = 0;
71 std::cout <<
" filling hit " << (*it)->layer <<
" phimin " << (*it)->phimin <<
" phimax " << (*it)->phimax <<
" weight "
72 << (*it)->w <<
" binmin " << binmin <<
" max " << binmax;
73 if ((*it)->debugInfo()) {
74 const HitDebugInfo*
db1 = (*it)->debugInfo();
78 std::cout << std::endl;
82 for (; binmin <= binmax; ++binmin) layerCounts[binmin] =
weight;
86 if (subtract && -layerCounts[
i] >=
static_cast<int>(
m_histo[
i]))
◆ findMaximum()
Definition at line 190 of file MuonPhiLayerHough.cxx.
201 if (maxval < 0)
return false;
203 unsigned int tmax = 0;
205 unsigned int imaxval = maxval * 1000;
212 if (posb == -1)
return false;
213 if (tmax < imaxval)
return false;
221 std::cout <<
" too large maximum: " <<
maximum.max <<
" tmax " << tmax << std::endl;
227 unsigned int sidemax = 0.7 *
imax;
229 for (
int n = posb != 0 ? posb - 1 : posb;
n >= 0; --
n) {
◆ maximum()
float MuonHough::MuonPhiLayerHough::maximum |
( |
float |
r, |
|
|
float |
phimin, |
|
|
float |
phimax, |
|
|
int & |
posbin |
|
) |
| const |
|
inline |
Definition at line 63 of file MuonPhiLayerHough.h.
67 std::pair<int, int> minMax =
range(
r, phimin, phimax);
68 for (
int n = minMax.first;
n <= minMax.second; ++
n) {
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; }
◆ operator=()
◆ range()
std::pair<int, int> MuonHough::MuonPhiLayerHough::range |
( |
float |
, |
|
|
float |
phi1, |
|
|
float |
phi2 |
|
) |
| const |
|
inline |
◆ reset()
void MuonHough::MuonPhiLayerHough::reset |
( |
| ) |
const |
◆ rootHistos()
std::vector< TH1 * > MuonHough::MuonPhiLayerHough::rootHistos |
( |
const std::string & |
prefix, |
|
|
const float * |
phimin = 0 , |
|
|
const float * |
phimax = 0 |
|
) |
| const |
◆ setDebug()
void MuonHough::MuonPhiLayerHough::setDebug |
( |
bool |
d | ) |
|
|
inline |
◆ m_binsize
float MuonHough::MuonPhiLayerHough::m_binsize {0.} |
◆ m_debug
bool MuonHough::MuonPhiLayerHough::m_debug {false} |
◆ m_histo
std::unique_ptr<unsigned int[]> MuonHough::MuonPhiLayerHough::m_histo |
◆ m_invbinsize
float MuonHough::MuonPhiLayerHough::m_invbinsize {0.} |
◆ m_nbins
int MuonHough::MuonPhiLayerHough::m_nbins |
◆ m_rangemax
float MuonHough::MuonPhiLayerHough::m_rangemax {0.} |
◆ m_rangemin
float MuonHough::MuonPhiLayerHough::m_rangemin {0.} |
◆ m_region
The documentation for this struct was generated from the following files: