Geant4  10.02.p03
LXePMTSD Class Reference

#include <LXePMTSD.hh>

Inheritance diagram for LXePMTSD:
Collaboration diagram for LXePMTSD:

Public Member Functions

 LXePMTSD (G4String name)
 
virtual ~LXePMTSD ()
 
virtual void Initialize (G4HCofThisEvent *)
 
virtual G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *)
 
G4bool ProcessHits_constStep (const G4Step *, G4TouchableHistory *)
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
virtual void clear ()
 
void DrawAll ()
 
void PrintAll ()
 
void InitPMTs (G4int nPMTs)
 
void SetPmtPositions (const std::vector< G4ThreeVector > &positions)
 
- Public Member Functions inherited from G4VSensitiveDetector
 G4VSensitiveDetector (G4String name)
 
 G4VSensitiveDetector (const G4VSensitiveDetector &right)
 
virtual ~G4VSensitiveDetector ()
 
G4VSensitiveDetectoroperator= (const G4VSensitiveDetector &right)
 
G4int operator== (const G4VSensitiveDetector &right) const
 
G4int operator!= (const G4VSensitiveDetector &right) const
 
G4bool Hit (G4Step *aStep)
 
void SetROgeometry (G4VReadOutGeometry *value)
 
void SetFilter (G4VSDFilter *value)
 
G4int GetNumberOfCollections () const
 
G4String GetCollectionName (G4int id) const
 
void SetVerboseLevel (G4int vl)
 
void Activate (G4bool activeFlag)
 
G4bool isActive () const
 
G4String GetName () const
 
G4String GetPathName () const
 
G4String GetFullPathName () const
 
G4VReadOutGeometryGetROgeometry () const
 
G4VSDFilterGetFilter () const
 
virtual G4VSensitiveDetectorClone () const
 

Private Attributes

LXePMTHitsCollectionfPMTHitCollection
 
G4DataVectorfPMTPositionsX
 
G4DataVectorfPMTPositionsY
 
G4DataVectorfPMTPositionsZ
 

Additional Inherited Members

- Protected Member Functions inherited from G4VSensitiveDetector
virtual G4int GetCollectionID (G4int i)
 
- Protected Attributes inherited from G4VSensitiveDetector
G4CollectionNameVector collectionName
 
G4String SensitiveDetectorName
 
G4String thePathName
 
G4String fullPathName
 
G4int verboseLevel
 
G4bool active
 
G4VReadOutGeometryROgeometry
 
G4VSDFilterfilter
 

Detailed Description

Definition at line 44 of file LXePMTSD.hh.

Constructor & Destructor Documentation

◆ LXePMTSD()

LXePMTSD::LXePMTSD ( G4String  name)

Definition at line 49 of file LXePMTSD.cc.

52 {
53  collectionName.insert("pmtHitCollection");
54 }
LXePMTHitsCollection * fPMTHitCollection
Definition: LXePMTSD.hh:78
G4DataVector * fPMTPositionsZ
Definition: LXePMTSD.hh:82
G4DataVector * fPMTPositionsX
Definition: LXePMTSD.hh:80
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
G4DataVector * fPMTPositionsY
Definition: LXePMTSD.hh:81
Here is the call graph for this function:

◆ ~LXePMTSD()

LXePMTSD::~LXePMTSD ( )
virtual

Definition at line 58 of file LXePMTSD.cc.

58 {}

Member Function Documentation

◆ clear()

void LXePMTSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 152 of file LXePMTSD.cc.

152 {}

◆ DrawAll()

void LXePMTSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 156 of file LXePMTSD.cc.

156 {}

◆ EndOfEvent()

void LXePMTSD::EndOfEvent ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 148 of file LXePMTSD.cc.

148 {}

◆ Initialize()

void LXePMTSD::Initialize ( G4HCofThisEvent hitsCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 73 of file LXePMTSD.cc.

73  {
76  //Store collection with event and keep ID
77  static G4int hitCID = -1;
78  if(hitCID<0){
79  hitCID = GetCollectionID(0);
80  }
81  hitsCE->AddHitsCollection( hitCID, fPMTHitCollection );
82 }
LXePMTHitsCollection * fPMTHitCollection
Definition: LXePMTSD.hh:78
int G4int
Definition: G4Types.hh:78
virtual G4int GetCollectionID(G4int i)
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
G4THitsCollection< LXePMTHit > LXePMTHitsCollection
Definition: LXePMTHit.hh:93
G4CollectionNameVector collectionName
Here is the call graph for this function:

◆ InitPMTs()

void LXePMTSD::InitPMTs ( G4int  nPMTs)
inline

Definition at line 64 of file LXePMTSD.hh.

64  {
68  fPMTPositionsX=new G4DataVector(nPMTs);
69  fPMTPositionsY=new G4DataVector(nPMTs);
70  fPMTPositionsZ=new G4DataVector(nPMTs);
71  }
G4DataVector * fPMTPositionsZ
Definition: LXePMTSD.hh:82
G4DataVector * fPMTPositionsX
Definition: LXePMTSD.hh:80
G4DataVector * fPMTPositionsY
Definition: LXePMTSD.hh:81
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAll()

void LXePMTSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 160 of file LXePMTSD.cc.

160 {}

◆ ProcessHits()

G4bool LXePMTSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory  
)
virtual

Implements G4VSensitiveDetector.

Definition at line 86 of file LXePMTSD.cc.

86  {
87  return false;
88 }

◆ ProcessHits_constStep()

G4bool LXePMTSD::ProcessHits_constStep ( const G4Step *  aStep,
G4TouchableHistory  
)

Definition at line 96 of file LXePMTSD.cc.

97  {
98 
99  //need to know if this is an optical photon
100  if(aStep->GetTrack()->GetDefinition()
101  != G4OpticalPhoton::OpticalPhotonDefinition()) return false;
102 
103  //User replica number 1 since photocathode is a daughter volume
104  //to the pmt which was replicated
105  G4int pmtNumber=
106  aStep->GetPostStepPoint()->GetTouchable()->GetReplicaNumber(1);
107  G4VPhysicalVolume* physVol=
108  aStep->GetPostStepPoint()->GetTouchable()->GetVolume(1);
109 
110  //Find the correct hit collection
112  LXePMTHit* hit=NULL;
113  for(G4int i=0;i<n;i++){
114  if((*fPMTHitCollection)[i]->GetPMTNumber()==pmtNumber){
115  hit=(*fPMTHitCollection)[i];
116  break;
117  }
118  }
119 
120  if(hit==NULL){//this pmt wasnt previously hit in this event
121  hit = new LXePMTHit(); //so create new hit
122  hit->SetPMTNumber(pmtNumber);
123  hit->SetPMTPhysVol(physVol);
125  hit->SetPMTPos((*fPMTPositionsX)[pmtNumber],(*fPMTPositionsY)[pmtNumber],
126  (*fPMTPositionsZ)[pmtNumber]);
127  }
128 
129  hit->IncPhotonCount(); //increment hit for the selected pmt
130 
132  hit->SetDrawit(true);
133  //If the sphere is disabled then this hit is automaticaly drawn
134  }
135  else{//sphere enabled
136  LXeUserTrackInformation* trackInfo=
137  (LXeUserTrackInformation*)aStep->GetTrack()->GetUserInformation();
138  if(trackInfo->GetTrackStatus()&hitSphere)
139  //only draw this hit if the photon has hit the sphere first
140  hit->SetDrawit(true);
141  }
142 
143  return true;
144 }
LXePMTHitsCollection * fPMTHitCollection
Definition: LXePMTSD.hh:78
void SetPMTNumber(G4int n)
Definition: LXePMTHit.hh:71
void SetDrawit(G4bool b)
Definition: LXePMTHit.hh:65
int G4int
Definition: G4Types.hh:78
G4DataVector * fPMTPositionsZ
Definition: LXePMTSD.hh:82
Char_t n[5]
void IncPhotonCount()
Definition: LXePMTHit.hh:68
G4DataVector * fPMTPositionsX
Definition: LXePMTSD.hh:80
void SetPMTPhysVol(G4VPhysicalVolume *physVol)
Definition: LXePMTHit.hh:74
void SetPMTPos(G4double x, G4double y, G4double z)
Definition: LXePMTHit.hh:77
G4DataVector * fPMTPositionsY
Definition: LXePMTSD.hh:81
static G4OpticalPhoton * OpticalPhotonDefinition()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetPmtPositions()

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

Definition at line 62 of file LXePMTSD.cc.

63 {
64  for (G4int i=0; i<G4int(positions.size()); ++i) {
65  if(fPMTPositionsX)fPMTPositionsX->push_back(positions[i].x());
66  if(fPMTPositionsY)fPMTPositionsY->push_back(positions[i].y());
67  if(fPMTPositionsZ)fPMTPositionsZ->push_back(positions[i].z());
68  }
69 }
int G4int
Definition: G4Types.hh:78
G4DataVector * fPMTPositionsZ
Definition: LXePMTSD.hh:82
Double_t y
G4DataVector * fPMTPositionsX
Definition: LXePMTSD.hh:80
G4DataVector * fPMTPositionsY
Definition: LXePMTSD.hh:81
Here is the caller graph for this function:

Member Data Documentation

◆ fPMTHitCollection

LXePMTHitsCollection* LXePMTSD::fPMTHitCollection
private

Definition at line 78 of file LXePMTSD.hh.

◆ fPMTPositionsX

G4DataVector* LXePMTSD::fPMTPositionsX
private

Definition at line 80 of file LXePMTSD.hh.

◆ fPMTPositionsY

G4DataVector* LXePMTSD::fPMTPositionsY
private

Definition at line 81 of file LXePMTSD.hh.

◆ fPMTPositionsZ

G4DataVector* LXePMTSD::fPMTPositionsZ
private

Definition at line 82 of file LXePMTSD.hh.


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