Geant4  10.02.p03
PhantomSD Class Reference

#include <PhantomSD.hh>

Inheritance diagram for PhantomSD:
Collaboration diagram for PhantomSD:

Public Member Functions

 PhantomSD (const G4String &)
 
virtual ~PhantomSD ()
 
void Initialize (G4HCofThisEvent *)
 
G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
void EndOfEvent (G4HCofThisEvent *)
 
void clear ()
 
void PrintAll ()
 
void SetShiftZ (G4double val)
 
- 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
 
virtual void DrawAll ()
 
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 Member Functions

PhantomSDoperator= (const PhantomSD &right)
 
 PhantomSD (const PhantomSD &)
 

Private Attributes

HistofHisto
 
G4double fShiftZ
 
G4int fCounter
 

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 55 of file PhantomSD.hh.

Constructor & Destructor Documentation

◆ PhantomSD() [1/2]

PhantomSD::PhantomSD ( const G4String name)

Definition at line 52 of file PhantomSD.cc.

54  fShiftZ(0.0),fCounter(0)
55 {}
static Histo * GetPointer()
G4int fCounter
Definition: PhantomSD.hh:78
Histo * fHisto
Definition: PhantomSD.hh:76
G4double fShiftZ
Definition: PhantomSD.hh:77
G4VSensitiveDetector(G4String name)
Here is the caller graph for this function:

◆ ~PhantomSD()

PhantomSD::~PhantomSD ( )
virtual

Definition at line 59 of file PhantomSD.cc.

60 {}

◆ PhantomSD() [2/2]

PhantomSD::PhantomSD ( const PhantomSD )
private

Member Function Documentation

◆ clear()

void PhantomSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 115 of file PhantomSD.cc.

116 {}

◆ EndOfEvent()

void PhantomSD::EndOfEvent ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 110 of file PhantomSD.cc.

111 {}

◆ Initialize()

void PhantomSD::Initialize ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 64 of file PhantomSD.cc.

65 {
66  ++fCounter;
67  if(0 < fHisto->GetVerbose()) {
68  G4cout << "PhantomSD: Begin Of Event # " << fCounter << G4endl;
69  }
70 }
G4int fCounter
Definition: PhantomSD.hh:78
Histo * fHisto
Definition: PhantomSD.hh:76
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:

◆ operator=()

PhantomSD& PhantomSD::operator= ( const PhantomSD right)
private
Here is the caller graph for this function:

◆ PrintAll()

void PhantomSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 121 of file PhantomSD.cc.

122 {}

◆ ProcessHits()

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

Implements G4VSensitiveDetector.

Definition at line 74 of file PhantomSD.cc.

75 {
76  G4double edep = aStep->GetTotalEnergyDeposit();
77 
78  // only if there is energy deposition
79  if(0.0 < edep) {
80 
81  G4ThreeVector p1 = aStep->GetPreStepPoint()->GetPosition();
82  G4ThreeVector p2 = aStep->GetPostStepPoint()->GetPosition();
83  G4double x1 = p1.x();
84  G4double y1 = p1.y();
85  G4double z1 = p1.z() - fShiftZ;
86  G4double r1 = std::sqrt(x1*x1 + y1*y1);
87  G4double x2 = p2.x();
88  G4double y2 = p2.y();
89  G4double z2 = p2.z() - fShiftZ;
90  G4double r2 = std::sqrt(x2*x2 + y2*y2);
91  G4double x0 = 0.5*(x1 + x2);
92  G4double y0 = 0.5*(y1 + y2);
93  G4double z0 = 0.5*(z1 + z2);
94  G4double r0 = std::sqrt(x0*x0 + y0*y0);
95 
96  fHisto->AddPhantomStep(edep,r1,z1,r2,z2,r0,z0);
97 
98  if(1 < fHisto->GetVerbose()) {
99  G4cout << "PhantomSD: energy = " << edep/MeV
100  << " MeV is deposited at the step at r1,z1= " << r1 << " " << z1
101  << "; r2,z2= " << r2 << " " << z2 << G4endl;
102  }
103  }
104 
105  return true;
106 }
Double_t y2[nxs]
static const double MeV
Definition: G4SIunits.hh:211
Double_t y1[nxs]
Double_t x2[nxs]
Histo * fHisto
Definition: PhantomSD.hh:76
Double_t edep
G4double fShiftZ
Definition: PhantomSD.hh:77
G4GLOB_DLL std::ostream G4cout
Double_t x1[nxs]
double x() const
double y() const
double z() const
#define G4endl
Definition: G4ios.hh:61
void AddPhantomStep(G4double e, G4double r1, G4double z1, G4double r2, G4double z2, G4double r0, G4double z0)
double G4double
Definition: G4Types.hh:76
const G4double r0
Here is the call graph for this function:

◆ SetShiftZ()

void PhantomSD::SetShiftZ ( G4double  val)
inline

Definition at line 69 of file PhantomSD.hh.

69 { fShiftZ = val;};
G4double fShiftZ
Definition: PhantomSD.hh:77
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fCounter

G4int PhantomSD::fCounter
private

Definition at line 78 of file PhantomSD.hh.

◆ fHisto

Histo* PhantomSD::fHisto
private

Definition at line 76 of file PhantomSD.hh.

◆ fShiftZ

G4double PhantomSD::fShiftZ
private

Definition at line 77 of file PhantomSD.hh.


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