Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CEPCSW
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
maxt@ihep.ac.cn
CEPCSW
Commits
82b7af54
Commit
82b7af54
authored
4 years ago
by
FU Chengdong
Browse files
Options
Downloads
Patches
Plain Diff
change control from macro to parameter
parent
af9bbbe4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Utilities/DataHelper/include/DataHelper/TrackerHitHelper.h
+1
-1
1 addition, 1 deletion
Utilities/DataHelper/include/DataHelper/TrackerHitHelper.h
Utilities/DataHelper/src/TrackerHitHelper.cpp
+46
-45
46 additions, 45 deletions
Utilities/DataHelper/src/TrackerHitHelper.cpp
with
47 additions
and
46 deletions
Utilities/DataHelper/include/DataHelper/TrackerHitHelper.h
+
1
−
1
View file @
82b7af54
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#include
<array>
#include
<array>
namespace
CEPC
{
namespace
CEPC
{
std
::
array
<
float
,
6
>
GetCovMatrix
(
edm4hep
::
TrackerHit
&
hit
);
std
::
array
<
float
,
6
>
GetCovMatrix
(
edm4hep
::
TrackerHit
&
hit
,
bool
useSpacePointerBuilderMethod
=
false
);
float
GetResolutionRPhi
(
edm4hep
::
TrackerHit
&
hit
);
float
GetResolutionRPhi
(
edm4hep
::
TrackerHit
&
hit
);
float
GetResolutionZ
(
edm4hep
::
TrackerHit
&
hit
);
float
GetResolutionZ
(
edm4hep
::
TrackerHit
&
hit
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Utilities/DataHelper/src/TrackerHitHelper.cpp
+
46
−
45
View file @
82b7af54
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
#include
"CLHEP/Vector/Rotation.h"
#include
"CLHEP/Vector/Rotation.h"
#include
<bitset>
#include
<bitset>
std
::
array
<
float
,
6
>
CEPC
::
GetCovMatrix
(
edm4hep
::
TrackerHit
&
hit
){
std
::
array
<
float
,
6
>
CEPC
::
GetCovMatrix
(
edm4hep
::
TrackerHit
&
hit
,
bool
useSpacePointBuilderMethod
){
if
(
hit
.
isAvailable
()){
if
(
hit
.
isAvailable
()){
int
type
=
hit
.
getType
();
int
type
=
hit
.
getType
();
if
(
std
::
bitset
<
32
>
(
type
)[
CEPCConf
::
TrkHitTypeBit
::
COMPOSITE_SPACEPOINT
]){
if
(
std
::
bitset
<
32
>
(
type
)[
CEPCConf
::
TrkHitTypeBit
::
COMPOSITE_SPACEPOINT
]){
...
@@ -23,51 +23,52 @@ std::array<float,6> CEPC::GetCovMatrix(edm4hep::TrackerHit& hit){
...
@@ -23,51 +23,52 @@ std::array<float,6> CEPC::GetCovMatrix(edm4hep::TrackerHit& hit){
float
thetaV
=
hit
.
getCovMatrix
(
3
);
float
thetaV
=
hit
.
getCovMatrix
(
3
);
float
phiV
=
hit
.
getCovMatrix
(
4
);
float
phiV
=
hit
.
getCovMatrix
(
4
);
float
dV
=
hit
.
getCovMatrix
(
5
);
float
dV
=
hit
.
getCovMatrix
(
5
);
#ifndef MethodUsedInSpacePointBuilder
TMatrixF
diffs
(
2
,
3
);
TMatrixF
diffsT
(
3
,
2
);
diffs
(
0
,
0
)
=
sin
(
thetaU
)
*
cos
(
phiU
);
diffs
(
0
,
1
)
=
sin
(
thetaU
)
*
sin
(
phiU
);
diffs
(
0
,
2
)
=
cos
(
thetaU
);
diffs
(
1
,
0
)
=
sin
(
thetaV
)
*
cos
(
phiV
);
diffs
(
1
,
1
)
=
sin
(
thetaV
)
*
sin
(
phiV
);
diffs
(
1
,
2
)
=
cos
(
thetaV
);
diffsT
.
Transpose
(
diffs
);
if
(
!
useSpacePointBuilderMethod
){
TMatrixF
diffs
(
2
,
3
);
TMatrixF
covMatrixUV
(
2
,
2
);
TMatrixF
diffsT
(
3
,
2
);
covMatrixUV
(
0
,
0
)
=
dU
*
dU
;
diffs
(
0
,
0
)
=
sin
(
thetaU
)
*
cos
(
phiU
);
covMatrixUV
(
0
,
1
)
=
0
;
diffs
(
0
,
1
)
=
sin
(
thetaU
)
*
sin
(
phiU
);
covMatrixUV
(
1
,
0
)
=
0
;
diffs
(
0
,
2
)
=
cos
(
thetaU
);
covMatrixUV
(
1
,
1
)
=
dV
*
dV
;
diffs
(
1
,
0
)
=
sin
(
thetaV
)
*
cos
(
phiV
);
diffs
(
1
,
1
)
=
sin
(
thetaV
)
*
sin
(
phiV
);
TMatrixF
covMatrixXYZ
(
3
,
3
);
diffs
(
1
,
2
)
=
cos
(
thetaV
);
covMatrixXYZ
=
diffsT
*
covMatrixUV
*
diffs
;
cov
[
0
]
=
covMatrixXYZ
(
0
,
0
);
diffsT
.
Transpose
(
diffs
);
cov
[
1
]
=
covMatrixXYZ
(
1
,
0
);
cov
[
2
]
=
covMatrixXYZ
(
1
,
1
);
TMatrixF
covMatrixUV
(
2
,
2
);
cov
[
3
]
=
covMatrixXYZ
(
2
,
0
);
covMatrixUV
(
0
,
0
)
=
dU
*
dU
;
cov
[
4
]
=
covMatrixXYZ
(
2
,
1
);
covMatrixUV
(
0
,
1
)
=
0
;
cov
[
5
]
=
covMatrixXYZ
(
2
,
2
);
covMatrixUV
(
1
,
0
)
=
0
;
#else // Method used in SpacePointBuilder, results are almost same with above
covMatrixUV
(
1
,
1
)
=
dV
*
dV
;
CLHEP
::
Hep3Vector
u_sensor
(
sin
(
thetaU
)
*
cos
(
phiU
),
sin
(
thetaU
)
*
sin
(
phiU
),
cos
(
thetaU
));
CLHEP
::
Hep3Vector
v_sensor
(
sin
(
thetaV
)
*
cos
(
phiV
),
sin
(
thetaV
)
*
sin
(
phiV
),
cos
(
thetaV
));
TMatrixF
covMatrixXYZ
(
3
,
3
);
CLHEP
::
Hep3Vector
w_sensor
=
u_sensor
.
cross
(
v_sensor
);
covMatrixXYZ
=
diffsT
*
covMatrixUV
*
diffs
;
CLHEP
::
HepRotation
rot_sensor
(
u_sensor
,
v_sensor
,
w_sensor
);
cov
[
0
]
=
covMatrixXYZ
(
0
,
0
);
CLHEP
::
HepMatrix
rot_sensor_matrix
;
cov
[
1
]
=
covMatrixXYZ
(
1
,
0
);
rot_sensor_matrix
=
rot_sensor
;
cov
[
2
]
=
covMatrixXYZ
(
1
,
1
);
CLHEP
::
HepSymMatrix
cov_plane
(
3
,
0
);
cov
[
3
]
=
covMatrixXYZ
(
2
,
0
);
cov_plane
(
1
,
1
)
=
dU
*
dU
;
cov
[
4
]
=
covMatrixXYZ
(
2
,
1
);
cov_plane
(
2
,
2
)
=
dV
*
dV
;
cov
[
5
]
=
covMatrixXYZ
(
2
,
2
);
CLHEP
::
HepSymMatrix
cov_xyz
=
cov_plane
.
similarity
(
rot_sensor_matrix
);
}
cov
[
0
]
=
cov_xyz
[
0
][
0
];
else
{
// Method used in SpacePointBuilder, results are almost same with above
cov
[
1
]
=
cov_xyz
[
1
][
0
];
CLHEP
::
Hep3Vector
u_sensor
(
sin
(
thetaU
)
*
cos
(
phiU
),
sin
(
thetaU
)
*
sin
(
phiU
),
cos
(
thetaU
));
cov
[
2
]
=
cov_xyz
[
1
][
1
];
CLHEP
::
Hep3Vector
v_sensor
(
sin
(
thetaV
)
*
cos
(
phiV
),
sin
(
thetaV
)
*
sin
(
phiV
),
cos
(
thetaV
));
cov
[
3
]
=
cov_xyz
[
2
][
0
];
CLHEP
::
Hep3Vector
w_sensor
=
u_sensor
.
cross
(
v_sensor
);
cov
[
4
]
=
cov_xyz
[
2
][
1
];
CLHEP
::
HepRotation
rot_sensor
(
u_sensor
,
v_sensor
,
w_sensor
);
cov
[
5
]
=
cov_xyz
[
2
][
2
];
CLHEP
::
HepMatrix
rot_sensor_matrix
;
#endif
rot_sensor_matrix
=
rot_sensor
;
CLHEP
::
HepSymMatrix
cov_plane
(
3
,
0
);
cov_plane
(
1
,
1
)
=
dU
*
dU
;
cov_plane
(
2
,
2
)
=
dV
*
dV
;
CLHEP
::
HepSymMatrix
cov_xyz
=
cov_plane
.
similarity
(
rot_sensor_matrix
);
cov
[
0
]
=
cov_xyz
[
0
][
0
];
cov
[
1
]
=
cov_xyz
[
1
][
0
];
cov
[
2
]
=
cov_xyz
[
1
][
1
];
cov
[
3
]
=
cov_xyz
[
2
][
0
];
cov
[
4
]
=
cov_xyz
[
2
][
1
];
cov
[
5
]
=
cov_xyz
[
2
][
2
];
}
return
cov
;
return
cov
;
}
}
else
{
else
{
...
...
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