Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Project Juggler
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
EIC
Project Juggler
Commits
d50771d3
Commit
d50771d3
authored
4 years ago
by
Chao Peng
Browse files
Options
Downloads
Patches
Plain Diff
fix resolution calculation in EMCal digitization, improve depth correction parameters
parent
c3646411
No related branches found
No related tags found
1 merge request
!15
fix resolution calculation in EMCal digitization, improve depth correction parameters
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
JugDigi/src/components/CrystalEndcapsDigi.cpp
+7
-4
7 additions, 4 deletions
JugDigi/src/components/CrystalEndcapsDigi.cpp
JugReco/src/components/ClusterRecoCoG.cpp
+7
-5
7 additions, 5 deletions
JugReco/src/components/ClusterRecoCoG.cpp
with
14 additions
and
9 deletions
JugDigi/src/components/CrystalEndcapsDigi.cpp
+
7
−
4
View file @
d50771d3
...
...
@@ -32,9 +32,10 @@ namespace Jug {
// ill-formed: using GaudiAlgorithm::GaudiAlgorithm;
CrystalEndcapsDigi
(
const
std
::
string
&
name
,
ISvcLocator
*
svcLoc
)
:
GaudiAlgorithm
(
name
,
svcLoc
)
{
declareProperty
(
"inputHitCollection"
,
m_inputHitCollection
,
""
);
declareProperty
(
"outputHitCollection"
,
m_outputHitCollection
,
""
);
}
declareProperty
(
"inputHitCollection"
,
m_inputHitCollection
,
""
);
declareProperty
(
"outputHitCollection"
,
m_outputHitCollection
,
""
);
}
StatusCode
initialize
()
override
{
if
(
GaudiAlgorithm
::
initialize
().
isFailure
())
return
StatusCode
::
FAILURE
;
...
...
@@ -45,6 +46,7 @@ namespace Jug {
}
return
StatusCode
::
SUCCESS
;
}
StatusCode
execute
()
override
{
// input collections
const
dd4pod
::
CalorimeterHitCollection
*
simhits
=
m_inputHitCollection
.
get
();
...
...
@@ -52,9 +54,10 @@ namespace Jug {
auto
rawhits
=
m_outputHitCollection
.
createAndPut
();
eic
::
RawCalorimeterHitCollection
*
rawHitCollection
=
new
eic
::
RawCalorimeterHitCollection
();
for
(
const
auto
&
ahit
:
*
simhits
)
{
double
res
=
m_gaussDist
()
/
sqrt
(
ahit
.
energyDeposit
()
/
Gaudi
::
Units
::
GeV
);
eic
::
RawCalorimeterHit
rawhit
(
(
long
long
)
ahit
.
cellID
(),
(
long
long
)
(
ahit
.
energyDeposit
()
+
m_gaussDist
*
sqrt
(
ahit
.
energyDeposit
())
)
/
Gaudi
::
Units
::
MeV
*
100.0
,
(
long
long
)
ahit
.
energyDeposit
()
*
(
1.
+
res
)
/
Gaudi
::
Units
::
MeV
*
100.0
,
(
double
)
ahit
.
truth
().
time
/
Gaudi
::
Units
::
ns
);
rawhits
->
push_back
(
rawhit
);
}
...
...
This diff is collapsed.
Click to expand it.
JugReco/src/components/ClusterRecoCoG.cpp
+
7
−
5
View file @
d50771d3
...
...
@@ -32,12 +32,12 @@ class ClusterRecoCoG : public GaudiAlgorithm
{
public:
Gaudi
::
Property
<
double
>
m_logWeightBase
{
this
,
"logWeightBase"
,
3.6
};
Gaudi
::
Property
<
std
::
string
>
m_moduleDimZName
{
this
,
"moduleDimZName"
,
"CrystalBox_z_length"
};
Gaudi
::
Property
<
double
>
m_depthCorrection
{
this
,
"depthCorrection"
,
0.0
};
Gaudi
::
Property
<
std
::
string
>
m_moduleDimZName
{
this
,
"moduleDimZName"
,
""
};
DataHandle
<
eic
::
ClusterCollection
>
m_clusterCollection
{
"clusterCollection"
,
Gaudi
::
DataHandle
::
Reader
,
this
};
// Pointer to the geometry service
SmartIF
<
IGeoSvc
>
m_geoSvc
;
double
m_depthCorr
;
// ill-formed: using GaudiAlgorithm::GaudiAlgorithm;
ClusterRecoCoG
(
const
std
::
string
&
name
,
ISvcLocator
*
svcLoc
)
...
...
@@ -57,8 +57,10 @@ public:
<<
"Make sure you have GeoSvc and SimSvc in the right order in the configuration."
<<
endmsg
;
return
StatusCode
::
FAILURE
;
}
// depth: z length of the crystal block
m_depthCorr
=
m_geoSvc
->
detector
()
->
constantAsDouble
(
m_moduleDimZName
);
// update depth correction if a name is provided
if
(
!
m_moduleDimZName
.
value
().
empty
())
{
m_depthCorrection
=
m_geoSvc
->
detector
()
->
constantAsDouble
(
m_moduleDimZName
);
}
//info() << "z_length " << depth << endmsg;
return
StatusCode
::
SUCCESS
;
}
...
...
@@ -112,7 +114,7 @@ private:
// convert local position to global position, use the cell with max edep as a reference
auto
volman
=
m_geoSvc
->
detector
()
->
volumeManager
();
auto
alignment
=
volman
.
lookupDetector
(
centerID
).
nominal
();
auto
gpos
=
alignment
.
localToWorld
(
dd4hep
::
Position
(
x
/
tw
,
y
/
tw
,
z
/
tw
+
m_depthCorr
));
auto
gpos
=
alignment
.
localToWorld
(
dd4hep
::
Position
(
x
/
tw
,
y
/
tw
,
z
/
tw
+
m_depthCorr
ection
));
cl
.
position
({
gpos
.
x
(),
gpos
.
y
(),
gpos
.
z
()});
}
...
...
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