Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CEPCSW
Manage
Activity
Members
Labels
Plan
Issues
6
Issue boards
Milestones
Wiki
Code
Merge requests
8
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
cepc
CEPCSW
Commits
0f85604b
Commit
0f85604b
authored
4 years ago
by
lintao@ihep.ac.cn
Browse files
Options
Downloads
Patches
Plain Diff
WIP: prepare DDG4SensitiveDetector.
parent
f15b8462
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
Simulation/DetSimSD/DetSimSD/DDG4SensitiveDetector.h
+74
-0
74 additions, 0 deletions
Simulation/DetSimSD/DetSimSD/DDG4SensitiveDetector.h
Simulation/DetSimSD/src/DDG4SensitiveDetector.cpp
+31
-0
31 additions, 0 deletions
Simulation/DetSimSD/src/DDG4SensitiveDetector.cpp
with
105 additions
and
0 deletions
Simulation/DetSimSD/DetSimSD/DDG4SensitiveDetector.h
0 → 100644
+
74
−
0
View file @
0f85604b
#ifndef DDG4SensitiveDetector_h
#define DDG4SensitiveDetector_h
/*
* In order to access ID from DDG4, some utilities are necessary to retrieve information
* from DDG4. This base class defines such interfaces and utilities.
*
* Refer to the class DDG4/include/DDG4/Geant4SensitiveDetector.h for some APIs usage.
*
* We keep to reuse some types already defined in DDG4:
* - Geant4Hits
*
* -- 12 June 2020, Tao Lin <lintao@ihep.ac.cn>
*/
#include
"DD4hep/Detector.h"
#include
"DDG4/Geant4Hits.h"
#include
"G4Step.hh"
#include
"G4HCofThisEvent.hh"
#include
"G4TouchableHistory.hh"
#include
"G4VSensitiveDetector.hh"
#include
"G4THitsCollection.hh"
class
DDG4SensitiveDetector
:
public
G4VSensitiveDetector
{
public:
typedef
G4THitsCollection
<
dd4hep
::
sim
::
Geant4Hit
>
HitCollection
;
typedef
dd4hep
::
sim
::
Geant4Hit
::
Contribution
HitContribution
;
typedef
dd4hep
::
sim
::
Geant4StepHandler
StepHandler
;
public:
DDG4SensitiveDetector
();
public:
// Geant4 interface
virtual
void
Initialize
(
G4HCofThisEvent
*
HCE
);
virtual
G4bool
ProcessHits
(
G4Step
*
step
,
G4TouchableHistory
*
history
);
virtual
void
EndOfEvent
(
G4HCofThisEvent
*
HCE
);
public:
// DDG4 utilities
/// Returns the volumeID of the sensitive volume corresponding to the step -
/// combining the VolIDS of the complete geometry path (Geant4TouchableHistory)
// from the current sensitive volume to the world volume
virtual
long
long
getVolumeID
(
G4Step
*
step
);
/// Returns the volumeID of the sensitive volume corresponding to the step -
/// combining the VolIDS of the complete geometry path (Geant4TouchableHistory)
// from the current sensitive volume to the world volume
virtual
long
long
getCellID
(
G4Step
*
step
);
protected:
/// Reference to the detector description object
dd4hep
::
Detector
&
m_detDesc
;
/// Reference to the detector element describing this sensitive element
dd4hep
::
DetElement
m_detector
;
/// Reference to the sensitive detector element
dd4hep
::
SensitiveDetector
m_sensitive
;
/// Reference to the readout structure
dd4hep
::
Readout
m_readout
;
/// Geant4 event context
G4HCofThisEvent
*
m_hce
;
};
#endif
This diff is collapsed.
Click to expand it.
Simulation/DetSimSD/src/DDG4SensitiveDetector.cpp
0 → 100644
+
31
−
0
View file @
0f85604b
#include
"DetSimSD/DDG4SensitiveDetector.h"
void
DDG4SensitiveDetector
::
Initialize
(
G4HCofThisEvent
*
HCE
)
{
}
G4bool
DDG4SensitiveDetector
::
ProcessHits
(
G4Step
*
step
,
G4TouchableHistory
*
)
{
return
true
;
}
void
DDG4SensitiveDetector
::
EndOfEvent
(
G4HCofThisEvent
*
HCE
)
{
}
long
long
DDG4SensitiveDetector
::
getVolumeID
(
G4Step
*
step
)
{
long
long
vid
=
0
;
return
vid
;
}
long
long
DDG4SensitiveDetector
::
getCellID
(
G4Step
*
step
)
{
long
long
vid
=
0
;
return
vid
;
}
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