Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CEPCSW_OTE_development
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
yudian2002@sjtu.edu.cn
CEPCSW_OTE_development
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
Branches containing commit
No related tags found
Tags containing commit
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 @@
#include
<array>
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
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 @@
#include
"CLHEP/Vector/Rotation.h"
#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
()){
int
type
=
hit
.
getType
();
if
(
std
::
bitset
<
32
>
(
type
)[
CEPCConf
::
TrkHitTypeBit
::
COMPOSITE_SPACEPOINT
]){
...
...
@@ -23,51 +23,52 @@ std::array<float,6> CEPC::GetCovMatrix(edm4hep::TrackerHit& hit){
float
thetaV
=
hit
.
getCovMatrix
(
3
);
float
phiV
=
hit
.
getCovMatrix
(
4
);
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
);
TMatrixF
covMatrixUV
(
2
,
2
);
covMatrixUV
(
0
,
0
)
=
dU
*
dU
;
covMatrixUV
(
0
,
1
)
=
0
;
covMatrixUV
(
1
,
0
)
=
0
;
covMatrixUV
(
1
,
1
)
=
dV
*
dV
;
TMatrixF
covMatrixXYZ
(
3
,
3
);
covMatrixXYZ
=
diffsT
*
covMatrixUV
*
diffs
;
cov
[
0
]
=
covMatrixXYZ
(
0
,
0
);
cov
[
1
]
=
covMatrixXYZ
(
1
,
0
);
cov
[
2
]
=
covMatrixXYZ
(
1
,
1
);
cov
[
3
]
=
covMatrixXYZ
(
2
,
0
);
cov
[
4
]
=
covMatrixXYZ
(
2
,
1
);
cov
[
5
]
=
covMatrixXYZ
(
2
,
2
);
#else // Method used in SpacePointBuilder, results are almost same with above
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
));
CLHEP
::
Hep3Vector
w_sensor
=
u_sensor
.
cross
(
v_sensor
);
CLHEP
::
HepRotation
rot_sensor
(
u_sensor
,
v_sensor
,
w_sensor
);
CLHEP
::
HepMatrix
rot_sensor_matrix
;
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
];
#endif
if
(
!
useSpacePointBuilderMethod
){
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
);
TMatrixF
covMatrixUV
(
2
,
2
);
covMatrixUV
(
0
,
0
)
=
dU
*
dU
;
covMatrixUV
(
0
,
1
)
=
0
;
covMatrixUV
(
1
,
0
)
=
0
;
covMatrixUV
(
1
,
1
)
=
dV
*
dV
;
TMatrixF
covMatrixXYZ
(
3
,
3
);
covMatrixXYZ
=
diffsT
*
covMatrixUV
*
diffs
;
cov
[
0
]
=
covMatrixXYZ
(
0
,
0
);
cov
[
1
]
=
covMatrixXYZ
(
1
,
0
);
cov
[
2
]
=
covMatrixXYZ
(
1
,
1
);
cov
[
3
]
=
covMatrixXYZ
(
2
,
0
);
cov
[
4
]
=
covMatrixXYZ
(
2
,
1
);
cov
[
5
]
=
covMatrixXYZ
(
2
,
2
);
}
else
{
// Method used in SpacePointBuilder, results are almost same with above
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
));
CLHEP
::
Hep3Vector
w_sensor
=
u_sensor
.
cross
(
v_sensor
);
CLHEP
::
HepRotation
rot_sensor
(
u_sensor
,
v_sensor
,
w_sensor
);
CLHEP
::
HepMatrix
rot_sensor_matrix
;
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
;
}
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