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
6ffd160e
Commit
6ffd160e
authored
1 year ago
by
Wouter Deconinck
Committed by
MarkusFrankATcernch
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
feat: add Geant4TestStackAction
parent
1ad0cf2e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
DDG4/include/DDG4/Geant4TestActions.h
+20
-0
20 additions, 0 deletions
DDG4/include/DDG4/Geant4TestActions.h
DDG4/plugins/Geant4Factories.cpp
+1
-1
1 addition, 1 deletion
DDG4/plugins/Geant4Factories.cpp
DDG4/src/Geant4TestActions.cpp
+27
-0
27 additions, 0 deletions
DDG4/src/Geant4TestActions.cpp
with
48 additions
and
1 deletion
DDG4/include/DDG4/Geant4TestActions.h
+
20
−
0
View file @
6ffd160e
...
...
@@ -148,6 +148,26 @@ namespace dd4hep {
void
operator
()(
const
G4Step
*
,
G4SteppingManager
*
)
override
;
};
/// Example stacking action doing nothing, but print
/**
* \author M.Frank
* \version 1.0
* \ingroup DD4HEP_SIMULATION
*/
class
Geant4TestStackAction
:
public
Geant4StackingAction
,
public
Geant4TestBase
{
public:
/// Standard constructor with initializing arguments
Geant4TestStackAction
(
Geant4Context
*
c
,
const
std
::
string
&
n
);
/// Default destructor
virtual
~
Geant4TestStackAction
();
/// New-stage callback
virtual
void
newStage
(
G4StackManager
*
)
override
;
/// Preparation callback
virtual
void
prepare
(
G4StackManager
*
)
override
;
/// Return TrackClassification with enum G4ClassificationOfNewTrack or NoTrackClassification
virtual
TrackClassification
classifyNewTrack
(
G4StackManager
*
,
const
G4Track
*
)
override
;
};
/// Example sensitve detector action doing nothing, but print
/**
* \author M.Frank
...
...
This diff is collapsed.
Click to expand it.
DDG4/plugins/Geant4Factories.cpp
+
1
−
1
View file @
6ffd160e
...
...
@@ -139,7 +139,7 @@ DECLARE_GEANT4ACTION(Geant4TestRunAction)
DECLARE_GEANT4ACTION
(
Geant4TestEventAction
)
DECLARE_GEANT4ACTION
(
Geant4TestStepAction
)
DECLARE_GEANT4ACTION
(
Geant4TestTrackAction
)
//
DECLARE_GEANT4ACTION(Geant4TestStack
ing
Action)
DECLARE_GEANT4ACTION
(
Geant4TestStackAction
)
DECLARE_GEANT4ACTION
(
Geant4TestGeneratorAction
)
DECLARE_GEANT4SENSITIVE
(
Geant4TestSensitive
)
DECLARE_GEANT4SENSITIVE
(
Geant4TestSensitiveTracker
)
...
...
This diff is collapsed.
Click to expand it.
DDG4/src/Geant4TestActions.cpp
+
27
−
0
View file @
6ffd160e
...
...
@@ -183,6 +183,33 @@ void Geant4TestStepAction::operator()(const G4Step*, G4SteppingManager*) {
PRINT
(
"%s> calling operator()"
,
m_type
.
c_str
());
}
/// Standard constructor with initializing arguments
Geant4TestStackAction
::
Geant4TestStackAction
(
Geant4Context
*
c
,
const
std
::
string
&
n
)
:
Geant4StackingAction
(
c
,
n
),
Geant4TestBase
(
this
,
"Geant4TestStackAction"
)
{
InstanceCount
::
increment
(
this
);
}
/// Default destructor
Geant4TestStackAction
::~
Geant4TestStackAction
()
{
InstanceCount
::
decrement
(
this
);
}
/// New-stage callback
void
Geant4TestStackAction
::
newStage
(
G4StackManager
*
)
{
PRINT
(
"%s> calling newStage()"
,
m_type
.
c_str
());
}
/// Preparation callback
void
Geant4TestStackAction
::
prepare
(
G4StackManager
*
)
{
PRINT
(
"%s> calling prepare()"
,
m_type
.
c_str
());
}
/// Return TrackClassification with enum G4ClassificationOfNewTrack or NoTrackClassification
TrackClassification
Geant4TestStackAction
::
classifyNewTrack
(
G4StackManager
*
,
const
G4Track
*
trk
)
{
PRINT
(
"%s> calling classifyNewTrack(track=%d, parent=%d, position=(%f,%f,%f) Context: run=%p evt=%p)"
,
m_type
.
c_str
(),
trk
->
GetTrackID
(),
trk
->
GetParentID
(),
trk
->
GetPosition
().
x
(),
trk
->
GetPosition
().
y
(),
trk
->
GetPosition
().
z
(),
&
context
()
->
run
(),
&
context
()
->
event
());
return
TrackClassification
();
}
/// Standard constructor with initializing arguments
Geant4TestSensitive
::
Geant4TestSensitive
(
Geant4Context
*
c
,
const
std
::
string
&
n
,
DetElement
det
,
Detector
&
description
)
:
Geant4Sensitive
(
c
,
n
,
det
,
description
),
Geant4TestBase
(
this
,
"Geant4TestSensitive"
)
{
...
...
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