Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
21f64935
Commit
21f64935
authored
2 years ago
by
Wouter Deconinck
Committed by
Andre Sailer
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: use negative tracker_region_zmin (makes more sense)
parent
eafd371a
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
DDG4/plugins/Geant4TCUserParticleHandler.cpp
+3
-3
3 additions, 3 deletions
DDG4/plugins/Geant4TCUserParticleHandler.cpp
DDG4/python/DDSim/Helper/ParticleHandler.py
+1
-1
1 addition, 1 deletion
DDG4/python/DDSim/Helper/ParticleHandler.py
with
4 additions
and
4 deletions
DDG4/plugins/Geant4TCUserParticleHandler.cpp
+
3
−
3
View file @
21f64935
...
@@ -91,7 +91,7 @@ DECLARE_GEANT4ACTION(Geant4TCUserParticleHandler)
...
@@ -91,7 +91,7 @@ DECLARE_GEANT4ACTION(Geant4TCUserParticleHandler)
Geant4TCUserParticleHandler
::
Geant4TCUserParticleHandler
(
Geant4Context
*
ctxt
,
const
std
::
string
&
nam
)
Geant4TCUserParticleHandler
::
Geant4TCUserParticleHandler
(
Geant4Context
*
ctxt
,
const
std
::
string
&
nam
)
:
Geant4UserParticleHandler
(
ctxt
,
nam
)
:
Geant4UserParticleHandler
(
ctxt
,
nam
)
{
{
declareProperty
(
"TrackingVolume_Zmin"
,
m_zTrackerMin
=
1e100
);
declareProperty
(
"TrackingVolume_Zmin"
,
m_zTrackerMin
=
-
1e100
);
declareProperty
(
"TrackingVolume_Zmax"
,
m_zTrackerMax
=
1e100
);
declareProperty
(
"TrackingVolume_Zmax"
,
m_zTrackerMax
=
1e100
);
declareProperty
(
"TrackingVolume_Rmax"
,
m_rTracker
=
1e100
);
declareProperty
(
"TrackingVolume_Rmax"
,
m_rTracker
=
1e100
);
}
}
...
@@ -102,7 +102,7 @@ void Geant4TCUserParticleHandler::end(const G4Track* /* track */, Particle& p)
...
@@ -102,7 +102,7 @@ void Geant4TCUserParticleHandler::end(const G4Track* /* track */, Particle& p)
double
r_prod
=
std
::
sqrt
(
p
.
vsx
*
p
.
vsx
+
p
.
vsy
*
p
.
vsy
);
double
r_prod
=
std
::
sqrt
(
p
.
vsx
*
p
.
vsx
+
p
.
vsy
*
p
.
vsy
);
double
z_prod
=
p
.
vsz
;
double
z_prod
=
p
.
vsz
;
bool
starts_in_trk_vol
=
(
r_prod
<=
m_rTracker
bool
starts_in_trk_vol
=
(
r_prod
<=
m_rTracker
&&
z_prod
>=
(
m_zTrackerMin
==
1e100
?
-
m_zTrackerMax
:
-
m_zTrackerMin
)
&&
z_prod
>=
(
m_zTrackerMin
==
-
1e100
?
m_zTrackerMax
:
m_zTrackerMin
)
&&
z_prod
<=
m_zTrackerMax
&&
z_prod
<=
m_zTrackerMax
)
;
)
;
...
@@ -119,7 +119,7 @@ void Geant4TCUserParticleHandler::end(const G4Track* /* track */, Particle& p)
...
@@ -119,7 +119,7 @@ void Geant4TCUserParticleHandler::end(const G4Track* /* track */, Particle& p)
double
r_end
=
std
::
sqrt
(
p
.
vex
*
p
.
vex
+
p
.
vey
*
p
.
vey
);
double
r_end
=
std
::
sqrt
(
p
.
vex
*
p
.
vex
+
p
.
vey
*
p
.
vey
);
double
z_end
=
p
.
vez
;
double
z_end
=
p
.
vez
;
bool
ends_in_trk_vol
=
(
r_end
<=
m_rTracker
bool
ends_in_trk_vol
=
(
r_end
<=
m_rTracker
&&
z_end
>=
(
m_zTrackerMin
==
1e100
?
-
m_zTrackerMax
:
-
m_zTrackerMin
)
&&
z_end
>=
(
m_zTrackerMin
==
-
1e100
?
m_zTrackerMax
:
m_zTrackerMin
)
&&
z_end
<=
m_zTrackerMax
&&
z_end
<=
m_zTrackerMax
)
;
)
;
...
...
This diff is collapsed.
Click to expand it.
DDG4/python/DDSim/Helper/ParticleHandler.py
+
1
−
1
View file @
21f64935
...
@@ -143,7 +143,7 @@ class ParticleHandler(ConfigHelper):
...
@@ -143,7 +143,7 @@ class ParticleHandler(ConfigHelper):
except
AttributeError
as
e
:
except
AttributeError
as
e
:
logger
.
info
(
"
Attributes tracker_region_zmin for asymmetric tracker region missing %s
"
,
e
)
logger
.
info
(
"
Attributes tracker_region_zmin for asymmetric tracker region missing %s
"
,
e
)
logger
.
info
(
"
will use symmetric region defined by tracker_region_zmax
"
)
logger
.
info
(
"
will use symmetric region defined by tracker_region_zmax
"
)
user
.
TrackingVolume_Zmin
=
user
.
TrackingVolume_Zmax
user
.
TrackingVolume_Zmin
=
str
(
-
float
(
user
.
TrackingVolume_Zmax
))
logger
.
info
(
"
*** definition of tracker region ***
"
)
logger
.
info
(
"
*** definition of tracker region ***
"
)
logger
.
info
(
"
tracker_region_zmin = %s
"
,
user
.
TrackingVolume_Zmin
)
logger
.
info
(
"
tracker_region_zmin = %s
"
,
user
.
TrackingVolume_Zmin
)
...
...
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