Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GenFind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sjohnston
GenFind
Commits
ab8c0045
Commit
ab8c0045
authored
8 years ago
by
Whitney Armstrong
Browse files
Options
Downloads
Patches
Plain Diff
modified: include/GenFindHits.h
modified: include/HoughTransform.h modified: src/HoughTransform.cxx
parent
b25e27b1
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/GenFind/include/GenFindHits.h
+0
-1
0 additions, 1 deletion
src/GenFind/include/GenFindHits.h
src/GenFind/include/HoughTransform.h
+26
-3
26 additions, 3 deletions
src/GenFind/include/HoughTransform.h
src/GenFind/src/HoughTransform.cxx
+40
-0
40 additions, 0 deletions
src/GenFind/src/HoughTransform.cxx
with
66 additions
and
4 deletions
src/GenFind/include/GenFindHits.h
+
0
−
1
View file @
ab8c0045
...
@@ -92,7 +92,6 @@ namespace genfind {
...
@@ -92,7 +92,6 @@ namespace genfind {
return
chit
;
return
chit
;
}
}
template
<
class
T
>
template
<
class
T
>
std
::
vector
<
ConformalHit
>
compute_conformal_hits
(
const
std
::
vector
<
T
>&
hits
,
const
T
&
ref
)
std
::
vector
<
ConformalHit
>
compute_conformal_hits
(
const
std
::
vector
<
T
>&
hits
,
const
T
&
ref
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/GenFind/include/HoughTransform.h
+
26
−
3
View file @
ab8c0045
...
@@ -11,13 +11,12 @@
...
@@ -11,13 +11,12 @@
#include
"TSpectrum.h"
#include
"TSpectrum.h"
#include
"TSpectrum2.h"
#include
"TSpectrum2.h"
#include
"TMultiGraph.h"
#include
"TMultiGraph.h"
#include
"GenFindHits.h"
namespace
genfind
{
namespace
genfind
{
class
HoughTransform
:
public
TObject
{
class
HoughTransform
:
public
TObject
{
protected:
public:
public:
TH1F
*
fPhi
=
nullptr
;
TH1F
*
fPhi
=
nullptr
;
...
@@ -36,13 +35,37 @@ namespace genfind {
...
@@ -36,13 +35,37 @@ namespace genfind {
public:
public:
HoughTransform
();
HoughTransform
();
virtual
~
HoughTransform
();
virtual
~
HoughTransform
();
std
::
vector
<
ROOT
::
Math
::
XYZTVector
>
GetConformalCoordinates
(
std
::
vector
<
ROOT
::
Math
::
XYZTVector
>
GetConformalCoordinates
(
const
ROOT
::
Math
::
XYZTVector
ref_point
,
const
ROOT
::
Math
::
XYZTVector
ref_point
,
const
std
::
vector
<
ROOT
::
Math
::
XYZTVector
>&
hits
)
const
;
const
std
::
vector
<
ROOT
::
Math
::
XYZTVector
>&
hits
)
const
;
/** @brief Method to get the result.
*
* @param hits Vector of hit type T which.
*
* Returns vector of vector of hits group into possilbe track candidates.
* Note: the reference hit for the conformal transform is at the origin.
*
*/
template
<
class
T
>
std
::
vector
<
std
::
vector
<
T
>>
operator
()(
const
std
::
vector
<
T
>&
hits
){
std
::
vector
<
std
::
vector
<
T
>>
res
;
T
ref
=
{
0.0
,
0.0
,
0.0
,
0.0
};
auto
chits
=
genfind
::
compute_conformal_hits
(
hits
,
ref
);
res
.
push_back
(
hits
);
return
res
;
}
/** @brief Fill the Hough transform histograms for searching.
*
* @param chits Vector of ConformalHits used to find lines.
*
*/
void
FillHistograms
(
const
std
::
vector
<
genfind
::
ConformalHit
>&
chits
);
TMultiGraph
*
FillHoughTransforms
(
const
std
::
vector
<
ROOT
::
Math
::
XYZTVector
>&
hits
);
TMultiGraph
*
FillHoughTransforms
(
const
std
::
vector
<
ROOT
::
Math
::
XYZTVector
>&
hits
);
int
FindPeaks
(
const
std
::
vector
<
ROOT
::
Math
::
XYZTVector
>&
hits
);
int
FindPeaks
(
const
std
::
vector
<
ROOT
::
Math
::
XYZTVector
>&
hits
);
...
...
This diff is collapsed.
Click to expand it.
src/GenFind/src/HoughTransform.cxx
+
40
−
0
View file @
ab8c0045
...
@@ -52,6 +52,46 @@ namespace genfind {
...
@@ -52,6 +52,46 @@ namespace genfind {
}
}
//__________________________________________________________________________
//__________________________________________________________________________
void
HoughTransform
::
FillHistograms
(
const
std
::
vector
<
genfind
::
ConformalHit
>&
chits
)
{
double
degree
=
TMath
::
Pi
()
/
180.0
;
double
phi_min
=
0.0
;
double
phi_max
=
180.0
;
TH1F
*
temp0
=
(
TH1F
*
)
fRhoTheta0
->
Clone
();
TH1F
*
temp1
=
(
TH1F
*
)
fRhoTheta1
->
Clone
();
TH1F
*
temp2
=
(
TH1F
*
)
fRhoTheta2
->
Clone
();
fRhoTheta0
->
Reset
();
fRhoTheta1
->
Reset
();
fRhoTheta2
->
Reset
();
for
(
const
auto
&
ahit
:
chits
)
{
temp0
->
Reset
();
temp1
->
Reset
();
temp2
->
Reset
();
for
(
int
i_theta
=
0
;
i_theta
<
1000
;
i_theta
++
)
{
double
theta
=
180.0
*
degree
*
double
(
i_theta
)
/
double
(
500
);
//rand.Uniform(0.0,180.0)*degree;
int
bin
=
temp0
->
FindBin
(
theta
/
degree
,
ahit
.
X
()
*
TMath
::
Cos
(
theta
)
+
ahit
.
Y
()
*
TMath
::
Sin
(
theta
)
);
temp0
->
SetBinContent
(
bin
,
1
);
bin
=
temp1
->
FindBin
(
theta
/
degree
,
ahit
.
X
()
*
TMath
::
Cos
(
theta
)
+
ahit
.
Y
()
*
TMath
::
Sin
(
theta
)
);
temp1
->
SetBinContent
(
bin
,
1
);
bin
=
temp2
->
FindBin
(
theta
/
degree
,
ahit
.
X
()
*
TMath
::
Cos
(
theta
)
+
ahit
.
Y
()
*
TMath
::
Sin
(
theta
)
);
temp2
->
SetBinContent
(
bin
,
1
);
}
fRhoTheta0
->
Add
(
temp0
);
fRhoTheta1
->
Add
(
temp1
);
fRhoTheta2
->
Add
(
temp2
);
}
delete
temp0
;
delete
temp1
;
delete
temp2
;
}
//__________________________________________________________________________
TMultiGraph
*
HoughTransform
::
FillHoughTransforms
(
const
std
::
vector
<
ROOT
::
Math
::
XYZTVector
>&
hits
)
TMultiGraph
*
HoughTransform
::
FillHoughTransforms
(
const
std
::
vector
<
ROOT
::
Math
::
XYZTVector
>&
hits
)
{
{
double
degree
=
TMath
::
Pi
()
/
180.0
;
double
degree
=
TMath
::
Pi
()
/
180.0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment