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

#include <LXeScintSD.hh>

Inheritance diagram for LXeScintSD:
G4VSensitiveDetector

Public Member Functions

 LXeScintSD (G4String name)
 
virtual ~LXeScintSD ()
 
virtual void Initialize (G4HCofThisEvent *)
 
virtual G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *)
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
virtual void clear ()
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 
- 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 42 of file LXeScintSD.hh.

Constructor & Destructor Documentation

LXeScintSD::LXeScintSD ( G4String  name)

Definition at line 46 of file LXeScintSD.cc.

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

47  : G4VSensitiveDetector(name)
48 {
49  fScintCollection = NULL;
50  collectionName.insert("scintCollection");
51 }
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
LXeScintSD::~LXeScintSD ( )
virtual

Definition at line 55 of file LXeScintSD.cc.

55 {}

Member Function Documentation

void LXeScintSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 103 of file LXeScintSD.cc.

103 {}
void LXeScintSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 107 of file LXeScintSD.cc.

107 {}
void LXeScintSD::EndOfEvent ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 99 of file LXeScintSD.cc.

99 {}
void LXeScintSD::Initialize ( G4HCofThisEvent hitsCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 59 of file LXeScintSD.cc.

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

59  {
60  fScintCollection = new LXeScintHitsCollection
62  //A way to keep all the hits of this event in one place if needed
63  static G4int hitsCID = -1;
64  if(hitsCID<0){
65  hitsCID = GetCollectionID(0);
66  }
67  hitsCE->AddHitsCollection( hitsCID, fScintCollection );
68 }
int G4int
Definition: G4Types.hh:78
virtual G4int GetCollectionID(G4int i)
G4THitsCollection< LXeScintHit > LXeScintHitsCollection
Definition: LXeScintHit.hh:79
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
G4CollectionNameVector collectionName
void LXeScintSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 111 of file LXeScintSD.cc.

111 {}
G4bool LXeScintSD::ProcessHits ( G4Step aStep,
G4TouchableHistory  
)
virtual

Implements G4VSensitiveDetector.

Definition at line 72 of file LXeScintSD.cc.

References G4StepPoint::GetPosition(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4Step::GetTotalEnergyDeposit(), G4StepPoint::GetTouchable(), G4TouchableHistory::GetVolume(), G4THitsCollection< T >::insert(), LXeScintHit::SetEdep(), and LXeScintHit::SetPos().

72  {
73  G4double edep = aStep->GetTotalEnergyDeposit();
74  if(edep==0.) return false; //No edep so dont count as hit
75 
76  G4StepPoint* thePrePoint = aStep->GetPreStepPoint();
77  G4TouchableHistory* theTouchable =
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  LXeScintHit* scintHit = new LXeScintHit(thePrePV);
88 
89  scintHit->SetEdep(edep);
90  scintHit->SetPos(pos);
91 
92  fScintCollection->insert(scintHit);
93 
94  return true;
95 }
G4VPhysicalVolume * GetVolume(G4int depth=0) const
void SetPos(G4ThreeVector xyz)
Definition: LXeScintHit.hh:67
const G4VTouchable * GetTouchable() const
G4StepPoint * GetPreStepPoint() const
const G4ThreeVector & GetPosition() const
void SetEdep(G4double de)
Definition: LXeScintHit.hh:63
G4double GetTotalEnergyDeposit() const
G4StepPoint * GetPostStepPoint() const
double G4double
Definition: G4Types.hh:76

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