Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
LXeScintSD Class Reference

#include <Doxymodules_optical.h>

Inheritance diagram for LXeScintSD:
G4VSensitiveDetector

Public Member Functions

 LXeScintSD (G4String name)
 
 ~LXeScintSD () override=default
 
void Initialize (G4HCofThisEvent *) override
 
G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *) override
 

Private Attributes

LXeScintHitsCollectionfScintCollection = nullptr
 
G4int fHitsCID = -1
 

Detailed Description

Definition at line 63 of file Doxymodules_optical.h.

Constructor & Destructor Documentation

◆ LXeScintSD()

LXeScintSD::LXeScintSD ( G4String  name)

Definition at line 48 of file LXeScintSD.cc.

50{
51 collectionName.insert("scintCollection");
52}

◆ ~LXeScintSD()

LXeScintSD::~LXeScintSD ( )
overridedefault

Member Function Documentation

◆ Initialize()

void LXeScintSD::Initialize ( G4HCofThisEvent hitsCE)
override

Definition at line 56 of file LXeScintSD.cc.

57{
59 new LXeScintHitsCollection(SensitiveDetectorName, collectionName[0]);
60
61 if(fHitsCID < 0)
62 {
63 fHitsCID = G4SDManager::GetSDMpointer()->GetCollectionID(fScintCollection);
64 }
65 hitsCE->AddHitsCollection(fHitsCID, fScintCollection);
66}
G4THitsCollection< LXeScintHit > LXeScintHitsCollection
LXeScintHitsCollection * fScintCollection
Definition LXeScintSD.hh:51
G4int fHitsCID
Definition LXeScintSD.hh:52

◆ ProcessHits()

G4bool LXeScintSD::ProcessHits ( G4Step aStep,
G4TouchableHistory  
)
override

Definition at line 70 of file LXeScintSD.cc.

71{
72 G4double edep = aStep->GetTotalEnergyDeposit();
73 if(edep == 0.)
74 return false; // No edep so don't count as hit
75
76 G4StepPoint* thePrePoint = aStep->GetPreStepPoint();
77 auto theTouchable =
78 (G4TouchableHistory*) (aStep->GetPreStepPoint()->GetTouchable());
79 G4VPhysicalVolume* thePrePV = theTouchable->GetVolume();
80
81 G4StepPoint* thePostPoint = aStep->GetPostStepPoint();
82
83 // Get the average position of the hit
84 G4ThreeVector pos = thePrePoint->GetPosition() + thePostPoint->GetPosition();
85 pos /= 2.;
86
87 auto scintHit = new LXeScintHit(thePrePV);
88
89 scintHit->SetEdep(edep);
90 scintHit->SetPos(pos);
91
92 fScintCollection->insert(scintHit);
93
94 return true;
95}

Member Data Documentation

◆ fScintCollection

LXeScintHitsCollection* LXeScintSD::fScintCollection = nullptr
private

Definition at line 51 of file LXeScintSD.hh.

◆ fHitsCID

G4int LXeScintSD::fHitsCID = -1
private

Definition at line 52 of file LXeScintSD.hh.


The documentation for this class was generated from the following files:

Applications | User Support | Publications | Collaboration