Skip to content
Snippets Groups Projects
Commit 0f85604b authored by lintao@ihep.ac.cn's avatar lintao@ihep.ac.cn
Browse files

WIP: prepare DDG4SensitiveDetector.

parent f15b8462
No related branches found
No related tags found
No related merge requests found
#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
#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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment