Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
LXePMTSD Class Reference

#include <LXePMTSD.hh>

Inheritance diagram for LXePMTSD:
G4VSensitiveDetector

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 ()
 
const 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
 

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 ( G4String  name)

Definition at line 49 of file LXePMTSD.cc.

References G4VSensitiveDetector::collectionName, and G4CollectionNameVector::insert().

50  : G4VSensitiveDetector(name),fPMTHitCollection(0),fPMTPositionsX(0)
51  ,fPMTPositionsY(0),fPMTPositionsZ(0)
52 {
53  collectionName.insert("pmtHitCollection");
54 }
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
LXePMTSD::~LXePMTSD ( )
virtual

Definition at line 58 of file LXePMTSD.cc.

58 {}

Member Function Documentation

void LXePMTSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 152 of file LXePMTSD.cc.

152 {}
void LXePMTSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 156 of file LXePMTSD.cc.

156 {}
void LXePMTSD::EndOfEvent ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 148 of file LXePMTSD.cc.

148 {}
void LXePMTSD::Initialize ( G4HCofThisEvent hitsCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 73 of file LXePMTSD.cc.

References G4HCofThisEvent::AddHitsCollection(), G4VSensitiveDetector::collectionName, G4VSensitiveDetector::GetCollectionID(), and G4VSensitiveDetector::SensitiveDetectorName.

73  {
74  fPMTHitCollection = new LXePMTHitsCollection
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 }
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
void LXePMTSD::InitPMTs ( G4int  nPMTs)
inline

Definition at line 64 of file LXePMTSD.hh.

Referenced by LXeDetectorConstruction::ConstructSDandField().

64  {
65  if(fPMTPositionsX)delete fPMTPositionsX;
66  if(fPMTPositionsY)delete fPMTPositionsY;
67  if(fPMTPositionsZ)delete fPMTPositionsZ;
68  fPMTPositionsX=new G4DataVector(nPMTs);
69  fPMTPositionsY=new G4DataVector(nPMTs);
70  fPMTPositionsZ=new G4DataVector(nPMTs);
71  }
void LXePMTSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 160 of file LXePMTSD.cc.

160 {}
G4bool LXePMTSD::ProcessHits ( G4Step aStep,
G4TouchableHistory  
)
virtual

Implements G4VSensitiveDetector.

Definition at line 86 of file LXePMTSD.cc.

86  {
87  return false;
88 }
G4bool LXePMTSD::ProcessHits_constStep ( const G4Step aStep,
G4TouchableHistory  
)

Definition at line 96 of file LXePMTSD.cc.

References G4THitsCollection< T >::entries(), G4Track::GetDefinition(), G4Step::GetPostStepPoint(), G4VTouchable::GetReplicaNumber(), LXeDetectorConstruction::GetSphereOn(), G4StepPoint::GetTouchable(), G4Step::GetTrack(), LXeUserTrackInformation::GetTrackStatus(), G4Track::GetUserInformation(), G4VTouchable::GetVolume(), hitSphere, LXePMTHit::IncPhotonCount(), G4THitsCollection< T >::insert(), n, G4OpticalPhoton::OpticalPhotonDefinition(), LXePMTHit::SetDrawit(), LXePMTHit::SetPMTNumber(), LXePMTHit::SetPMTPhysVol(), and LXePMTHit::SetPMTPos().

Referenced by LXeSteppingAction::UserSteppingAction().

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=
107  G4VPhysicalVolume* physVol=
108  aStep->GetPostStepPoint()->GetTouchable()->GetVolume(1);
109 
110  //Find the correct hit collection
111  G4int n=fPMTHitCollection->entries();
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);
124  fPMTHitCollection->insert(hit);
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=
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 }
G4ParticleDefinition * GetDefinition() const
void SetPMTNumber(G4int n)
Definition: LXePMTHit.hh:71
void SetDrawit(G4bool b)
Definition: LXePMTHit.hh:65
const G4VTouchable * GetTouchable() const
int G4int
Definition: G4Types.hh:78
G4VUserTrackInformation * GetUserInformation() const
void IncPhotonCount()
Definition: LXePMTHit.hh:68
const G4int n
void SetPMTPhysVol(G4VPhysicalVolume *physVol)
Definition: LXePMTHit.hh:74
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
Definition: G4VTouchable.cc:44
G4StepPoint * GetPostStepPoint() const
virtual G4int GetReplicaNumber(G4int depth=0) const
Definition: G4VTouchable.cc:58
void SetPMTPos(G4double x, G4double y, G4double z)
Definition: LXePMTHit.hh:77
static G4OpticalPhoton * OpticalPhotonDefinition()
G4Track * GetTrack() const
void LXePMTSD::SetPmtPositions ( const std::vector< G4ThreeVector > &  positions)

Definition at line 62 of file LXePMTSD.cc.

References test::x, and z.

Referenced by LXeDetectorConstruction::ConstructSDandField().

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 }
G4double z
Definition: TRTMaterials.hh:39
int G4int
Definition: G4Types.hh:78

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