Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
 

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

Definition at line 52 of file PhantomSD.cc.

53  : G4VSensitiveDetector(name), fHisto(Histo::GetPointer()),
54  fShiftZ(0.0),fCounter(0)
55 {}
static Histo * GetPointer()
Definition: Histo.cc:59
G4VSensitiveDetector(G4String name)
PhantomSD::~PhantomSD ( )
virtual

Definition at line 59 of file PhantomSD.cc.

60 {}

Member Function Documentation

void PhantomSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 115 of file PhantomSD.cc.

116 {}
void PhantomSD::EndOfEvent ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 110 of file PhantomSD.cc.

111 {}
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 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4int GetVerbose() const
Definition: Histo.hh:94

Here is the call graph for this function:

void PhantomSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 121 of file PhantomSD.cc.

122 {}
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();
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 x() const
double z() const
G4StepPoint * GetPreStepPoint() const
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetPosition() const
G4double GetTotalEnergyDeposit() const
G4StepPoint * GetPostStepPoint() const
double y() const
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
G4int GetVerbose() const
Definition: Histo.hh:94
void AddPhantomStep(G4double e, G4double r1, G4double z1, G4double r2, G4double z2, G4double r0, G4double z0)
Definition: Histo.cc:416
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void PhantomSD::SetShiftZ ( G4double  val)
inline

Definition at line 69 of file PhantomSD.hh.

69 { fShiftZ = val;};

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