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

#include <Doxymodules_optical.h>

Inheritance diagram for LXePMTSD:
G4VSensitiveDetector

Public Member Functions

 LXePMTSD (G4String name)
 
 ~LXePMTSD () override
 
void Initialize (G4HCofThisEvent *) override
 
G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *) override
 
G4bool ProcessHits_boundary (const G4Step *, G4TouchableHistory *)
 
void InitPMTs ()
 
void SetPmtPositions (const std::vector< G4ThreeVector > &positions)
 

Private Attributes

LXePMTHitsCollectionfPMTHitCollection = nullptr
 
G4DataVectorfPMTPositionsX = nullptr
 
G4DataVectorfPMTPositionsY = nullptr
 
G4DataVectorfPMTPositionsZ = nullptr
 
G4int fHitCID = -1
 

Detailed Description

Definition at line 57 of file Doxymodules_optical.h.

Constructor & Destructor Documentation

◆ LXePMTSD()

LXePMTSD::LXePMTSD ( G4String  name)

Definition at line 50 of file LXePMTSD.cc.

52{
53 collectionName.insert("pmtHitCollection");
54}

◆ ~LXePMTSD()

LXePMTSD::~LXePMTSD ( )
override

Definition at line 58 of file LXePMTSD.cc.

59{
60 delete fPMTPositionsX;
61 delete fPMTPositionsY;
62 delete fPMTPositionsZ;
63}
G4DataVector * fPMTPositionsX
Definition LXePMTSD.hh:76
G4DataVector * fPMTPositionsY
Definition LXePMTSD.hh:77
G4DataVector * fPMTPositionsZ
Definition LXePMTSD.hh:78

Member Function Documentation

◆ Initialize()

void LXePMTSD::Initialize ( G4HCofThisEvent hitsCE)
override

Definition at line 82 of file LXePMTSD.cc.

83{
85 new LXePMTHitsCollection(SensitiveDetectorName, collectionName[0]);
86
87 if(fHitCID < 0)
88 {
89 fHitCID = G4SDManager::GetSDMpointer()->GetCollectionID(fPMTHitCollection);
90 }
91 hitsCE->AddHitsCollection(fHitCID, fPMTHitCollection);
92}
G4THitsCollection< LXePMTHit > LXePMTHitsCollection
Definition LXePMTHit.hh:86
G4int fHitCID
Definition LXePMTSD.hh:80
LXePMTHitsCollection * fPMTHitCollection
Definition LXePMTSD.hh:74

◆ ProcessHits()

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

Definition at line 96 of file LXePMTSD.cc.

96{ return false; }

◆ ProcessHits_boundary()

G4bool LXePMTSD::ProcessHits_boundary ( const G4Step aStep,
G4TouchableHistory  
)

Definition at line 104 of file LXePMTSD.cc.

105{
106 // need to know if this is an optical photon
107 if(aStep->GetTrack()->GetDefinition() !=
108 G4OpticalPhoton::OpticalPhotonDefinition())
109 return false;
110
111 // User replica number 1 since photocathode is a daughter volume
112 // to the pmt which was replicated
113 G4int pmtNumber =
114 aStep->GetPostStepPoint()->GetTouchable()->GetReplicaNumber(1);
115 G4VPhysicalVolume* physVol =
116 aStep->GetPostStepPoint()->GetTouchable()->GetVolume(1);
117
118 // Find the correct hit collection
119 size_t n = fPMTHitCollection->entries();
120 LXePMTHit* hit = nullptr;
121 for(size_t i = 0; i < n; ++i)
122 {
123 if((*fPMTHitCollection)[i]->GetPMTNumber() == pmtNumber)
124 {
125 hit = (*fPMTHitCollection)[i];
126 break;
127 }
128 }
129
130 if(hit == nullptr)
131 { // this pmt wasn't previously hit in this event
132 hit = new LXePMTHit(); // so create new hit
133 hit->SetPMTNumber(pmtNumber);
134 hit->SetPMTPhysVol(physVol);
135 fPMTHitCollection->insert(hit);
136 hit->SetPMTPos((*fPMTPositionsX)[pmtNumber], (*fPMTPositionsY)[pmtNumber],
137 (*fPMTPositionsZ)[pmtNumber]);
138 }
139
140 hit->IncPhotonCount(); // increment hit for the selected pmt
141
143 {
144 hit->SetDrawit(true);
145 // If the sphere is disabled then this hit is automaticaly drawn
146 }
147 else
148 { // sphere enabled
149 auto trackInfo =
150 (LXeUserTrackInformation*) aStep->GetTrack()->GetUserInformation();
151 if(trackInfo->GetTrackStatus() & hitSphere)
152 // only draw this hit if the photon has hit the sphere first
153 hit->SetDrawit(true);
154 }
155
156 return true;
157}
void IncPhotonCount()
Definition LXePMTHit.hh:59
void SetPMTPos(G4double x, G4double y, G4double z)
Definition LXePMTHit.hh:71
void SetPMTPhysVol(G4VPhysicalVolume *physVol)
Definition LXePMTHit.hh:65
void SetPMTNumber(G4int n)
Definition LXePMTHit.hh:62
void SetDrawit(G4bool b)
Definition LXePMTHit.hh:56

◆ InitPMTs()

void LXePMTSD::InitPMTs ( )
inline

Definition at line 57 of file LXePMTSD.hh.

◆ SetPmtPositions()

void LXePMTSD::SetPmtPositions ( const std::vector< G4ThreeVector > &  positions)

Definition at line 67 of file LXePMTSD.cc.

68{
69 for(size_t i = 0; i < positions.size(); ++i)
70 {
72 fPMTPositionsX->push_back(positions[i].x());
74 fPMTPositionsY->push_back(positions[i].y());
76 fPMTPositionsZ->push_back(positions[i].z());
77 }
78}

Member Data Documentation

◆ fPMTHitCollection

LXePMTHitsCollection* LXePMTSD::fPMTHitCollection = nullptr
private

Definition at line 74 of file LXePMTSD.hh.

◆ fPMTPositionsX

G4DataVector* LXePMTSD::fPMTPositionsX = nullptr
private

Definition at line 76 of file LXePMTSD.hh.

◆ fPMTPositionsY

G4DataVector* LXePMTSD::fPMTPositionsY = nullptr
private

Definition at line 77 of file LXePMTSD.hh.

◆ fPMTPositionsZ

G4DataVector* LXePMTSD::fPMTPositionsZ = nullptr
private

Definition at line 78 of file LXePMTSD.hh.

◆ fHitCID

G4int LXePMTSD::fHitCID = -1
private

Definition at line 80 of file LXePMTSD.hh.


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

Applications | User Support | Publications | Collaboration