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
fe1cf96e
Commit
fe1cf96e
authored
8 years ago
by
Whitney Armstrong
Browse files
Options
Downloads
Patches
Plain Diff
Added conform transform functions
modified: include/GenFindHits.h modified: src/GenFindHits.cxx
parent
12cc856b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/GenFind/include/GenFindHits.h
+29
-1
29 additions, 1 deletion
src/GenFind/include/GenFindHits.h
src/GenFind/src/GenFindHits.cxx
+16
-1
16 additions, 1 deletion
src/GenFind/src/GenFindHits.cxx
with
45 additions
and
2 deletions
src/GenFind/include/GenFindHits.h
+
29
−
1
View file @
fe1cf96e
...
@@ -22,6 +22,8 @@ namespace genfind {
...
@@ -22,6 +22,8 @@ namespace genfind {
public
:
public
:
Hit
();
Hit
();
Hit
(
const
ROOT
::
Math
::
XYZTVector
&
);
Hit
(
double
x
,
double
y
,
double
z
,
double
t
=
0
);
Hit
(
const
Hit
&
)
=
default
;
Hit
(
const
Hit
&
)
=
default
;
Hit
(
Hit
&&
)
=
default
;
Hit
(
Hit
&&
)
=
default
;
Hit
&
operator
=
(
const
Hit
&
)
=
default
;
Hit
&
operator
=
(
const
Hit
&
)
=
default
;
...
@@ -41,7 +43,6 @@ namespace genfind {
...
@@ -41,7 +43,6 @@ namespace genfind {
/** Conform space hits.
/** Conform space hits.
*/
*/
class
ConformalHit
{
class
ConformalHit
{
public:
public:
ROOT
::
Math
::
XYZTVector
fPosition
=
{
0
,
0
,
0
,
0
};
ROOT
::
Math
::
XYZTVector
fPosition
=
{
0
,
0
,
0
,
0
};
std
::
shared_ptr
<
genfind
::
Hit
>
fImageHit
;
std
::
shared_ptr
<
genfind
::
Hit
>
fImageHit
;
...
@@ -63,7 +64,34 @@ namespace genfind {
...
@@ -63,7 +64,34 @@ namespace genfind {
ClassDef
(
ConformalHit
,
1
)
ClassDef
(
ConformalHit
,
1
)
};
};
/** @brief Compute the conformal transform of a hit.
*
* @param hit The hit that provides the position space coordinates.
* @param ref Hit providing the reference coordinates (x0,y0).
*
* \f$ u = \frac{x}{x^2+y^2} \f$
* \f$ v = \frac{y}{x^2+y^2} \f$
*
*/
ConformalHit
compute_conformal_hit
(
std
::
shared_ptr
<
Hit
>
hit
,
std
::
shared_ptr
<
Hit
>
ref
);
ConformalHit
compute_conformal_hit
(
std
::
shared_ptr
<
Hit
>
hit
,
std
::
shared_ptr
<
Hit
>
ref
);
ConformalHit
compute_conformal_hit
(
std
::
shared_ptr
<
Hit
>
hit
);
template
<
class
T
>
ConformalHit
compute_conformal_hit
(
const
T
&
hit
,
const
T
&
ref
)
{
ConformalHit
chit
;
//chit.fImageHit = std::make_shared<ROOT::Math::XYZTVector>({hit.X(), hit.Y(), 0.0,0.0}) ;
//chit.fImageRef = std::make_shared<ROOT::Math::XYZTVector>({ref.X(), ref.Y(), 0.0,0.0}) ;
double
x
=
hit
.
X
()
-
ref
.
X
();
double
y
=
hit
.
Y
()
-
ref
.
Y
();
double
R
=
x
*
x
+
y
*
y
;
if
(
!
(
hit
==
ref
)
)
{
chit
.
fPosition
=
{
2.0
*
x
/
R
,
2.0
*
y
/
R
,
hit
.
Z
(),
hit
.
T
()
}
;
}
return
chit
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/GenFind/src/GenFindHits.cxx
+
16
−
1
View file @
fe1cf96e
...
@@ -6,6 +6,14 @@ namespace genfind {
...
@@ -6,6 +6,14 @@ namespace genfind {
{
}
{
}
//__________________________________________________________________________
//__________________________________________________________________________
Hit
::
Hit
(
const
ROOT
::
Math
::
XYZTVector
&
p
)
:
fPosition
(
p
)
{
}
//__________________________________________________________________________
Hit
::
Hit
(
double
x
,
double
y
,
double
z
,
double
t
)
:
fPosition
({
x
,
y
,
z
,
t
})
{
}
//__________________________________________________________________________
Hit
::~
Hit
()
Hit
::~
Hit
()
{
}
{
}
//__________________________________________________________________________
//__________________________________________________________________________
...
@@ -27,9 +35,16 @@ namespace genfind {
...
@@ -27,9 +35,16 @@ namespace genfind {
double
y
=
hit
->
Y
()
-
ref
->
Y
();
double
y
=
hit
->
Y
()
-
ref
->
Y
();
double
R
=
x
*
x
+
y
*
y
;
double
R
=
x
*
x
+
y
*
y
;
if
(
!
(
hit
==
ref
)
)
{
if
(
!
(
hit
==
ref
)
)
{
chit
.
fPosition
=
{
2.0
*
x
/
R
,
-
2.0
*
y
/
R
,
hit
->
Z
(),
hit
->
T
()
}
;
chit
.
fPosition
=
{
2.0
*
x
/
R
,
2.0
*
y
/
R
,
hit
->
Z
(),
hit
->
T
()
}
;
}
}
return
chit
;
return
chit
;
}
}
ConformalHit
compute_conformal_hit
(
std
::
shared_ptr
<
Hit
>
hit
)
{
// Use ref = {0,0};
return
compute_conformal_hit
(
hit
,
std
::
make_shared
<
Hit
>
());
}
}
}
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