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
6c172b3f
Commit
6c172b3f
authored
4 years ago
by
myliu@ihep.ac.cn
Browse files
Options
Downloads
Patches
Plain Diff
Add function cellposition()
parent
83f055df
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
Detector/DetSegmentation/DetSegmentation/GridDriftChamber.h
+25
-11
25 additions, 11 deletions
Detector/DetSegmentation/DetSegmentation/GridDriftChamber.h
Detector/DetSegmentation/src/GridDriftChamber.cpp
+22
-4
22 additions, 4 deletions
Detector/DetSegmentation/src/GridDriftChamber.cpp
with
47 additions
and
15 deletions
Detector/DetSegmentation/DetSegmentation/GridDriftChamber.h
+
25
−
11
View file @
6c172b3f
...
...
@@ -45,6 +45,7 @@ public:
virtual
CellID
cellID
(
const
Vector3D
&
aLocalPosition
,
const
Vector3D
&
aGlobalPosition
,
const
VolumeID
&
aVolumeID
)
const
;
virtual
double
distanceTrackWire
(
const
CellID
&
cID
,
const
TVector3
&
hit_start
,
const
TVector3
&
hit_end
)
const
;
virtual
void
cellposition
(
const
CellID
&
cID
,
TVector3
&
Wstart
,
TVector3
&
Wend
)
const
;
// double phi(const CellID& cID) const;
inline
double
cell_Size
()
const
{
return
m_cellSize
;
}
...
...
@@ -86,13 +87,13 @@ public:
inline
auto
returnAllWires
()
const
{
return
m_wiresPositions
;
}
inline
TVector3
returnWirePosition
(
double
angle
,
int
sign
)
const
{
TVector3
w
(
0
,
0
,
0
);
w
.
SetX
(
_currentRadius
*
std
::
cos
(
angle
));
w
.
SetY
(
_currentRadius
*
std
::
sin
(
angle
));
w
.
SetZ
(
sign
*
m_detectorLength
/
2.0
);
return
w
;
}
//
inline TVector3 returnWirePosition(double angle, int sign) const {
//
TVector3 w(0, 0, 0);
//
w.SetX(_currentRadius * std::cos(angle));
//
w.SetY(_currentRadius * std::sin(angle));
//
w.SetZ(sign * m_detectorLength / 2.0);
//
return w;
//
}
void
updateParams
(
int
layer
)
const
{
auto
it_end
=
layer_params
.
cend
();
...
...
@@ -115,10 +116,10 @@ public:
m_offset
=
offset
;
}
inline
double
returnAlpha
()
const
{
double
alpha
=
2
*
std
::
asin
(
m_detectorLength
*
std
::
tan
(
m_epsilon0
)
/
(
2
*
_currentRadius
));
return
alpha
;
}
//
inline double returnAlpha() const {
//
double alpha = 2 * std::asin(m_detectorLength * std::tan(m_epsilon0)/(2 * _currentRadius));
//
return alpha;
//
}
protected
:
...
...
@@ -126,6 +127,19 @@ protected:
std
::
map
<
int
,
LAYER
>
layer_params
;
// <layer, {layerphi, R, eps, offset}>
std
::
map
<
int
,
std
::
vector
<
std
::
pair
<
TVector3
,
TVector3
>
>>
m_wiresPositions
;
// < layer, vec<WireMidpoint, WireDirection> >
inline
TVector3
returnWirePosition
(
double
angle
,
int
sign
)
const
{
TVector3
w
(
0
,
0
,
0
);
w
.
SetX
(
_currentRadius
*
std
::
cos
(
angle
));
w
.
SetY
(
_currentRadius
*
std
::
sin
(
angle
));
w
.
SetZ
(
sign
*
m_detectorLength
/
2.0
);
return
w
;
}
inline
double
returnAlpha
()
const
{
double
alpha
=
2
*
std
::
asin
(
m_detectorLength
*
std
::
tan
(
m_epsilon0
)
/
(
2
*
_currentRadius
));
return
alpha
;
}
double
m_cellSize
;
double
m_epsilon0
;
double
m_detectorLength
;
...
...
This diff is collapsed.
Click to expand it.
Detector/DetSegmentation/src/GridDriftChamber.cpp
+
22
−
4
View file @
6c172b3f
...
...
@@ -72,8 +72,8 @@ double GridDriftChamber::phi(const CellID& cID) const {
return
binToPosition
(
phiValue
,
_currentLayerphi
,
m_offset
);
}
double
GridDriftChamber
::
distanceTrackWire
(
const
CellID
&
cID
,
const
TVector3
&
hit_
start
,
const
TVector3
&
hit_
end
)
const
{
void
GridDriftChamber
::
cellposition
(
const
CellID
&
cID
,
TVector3
&
W
start
,
TVector3
&
W
end
)
const
{
auto
layerIndex
=
_decoder
->
get
(
cID
,
"layer"
);
updateParams
(
layerIndex
);
...
...
@@ -81,8 +81,26 @@ double GridDriftChamber::distanceTrackWire(const CellID& cID, const TVector3& hi
double
phi_start
=
phi
(
cID
);
double
phi_end
=
phi_start
+
returnAlpha
();
TVector3
Wstart
=
returnWirePosition
(
phi_start
,
-
1
);
// The default centimeter unit in DD4hep
TVector3
Wend
=
returnWirePosition
(
phi_end
,
1
);
// The default centimeter unit in DD4hep
Wstart
=
returnWirePosition
(
phi_start
,
-
1
);
Wend
=
returnWirePosition
(
phi_end
,
1
);
}
double
GridDriftChamber
::
distanceTrackWire
(
const
CellID
&
cID
,
const
TVector3
&
hit_start
,
const
TVector3
&
hit_end
)
const
{
// auto layerIndex = _decoder->get(cID, "layer");
// updateParams(layerIndex);
//
// double phi_start = phi(cID);
// double phi_end = phi_start + returnAlpha();
// TVector3 Wstart = returnWirePosition(phi_start, -1); // The default centimeter unit in DD4hep
// TVector3 Wend = returnWirePosition(phi_end, 1); // The default centimeter unit in DD4hep
TVector3
Wstart
=
{
0
,
0
,
0
};
TVector3
Wend
=
{
0
,
0
,
0
};
cellposition
(
cID
,
Wstart
,
Wend
);
TVector3
a
=
hit_end
-
hit_start
;
TVector3
b
=
Wend
-
Wstart
;
...
...
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