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

#include <DMXScintSD.hh>

Inheritance diagram for DMXScintSD:
G4VSensitiveDetector

Public Member Functions

 DMXScintSD (G4String)
 
 ~DMXScintSD ()
 
void Initialize (G4HCofThisEvent *)
 
G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
void EndOfEvent (G4HCofThisEvent *)
 
void clear ()
 
void DrawAll ()
 
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 54 of file DMXScintSD.hh.

Constructor & Destructor Documentation

DMXScintSD::DMXScintSD ( G4String  name)

Definition at line 58 of file DMXScintSD.cc.

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

60 {
61  G4String HCname="scintillatorCollection";
62  collectionName.insert(HCname);
63 }
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
DMXScintSD::~DMXScintSD ( )

Definition at line 67 of file DMXScintSD.cc.

67 { }

Member Function Documentation

void DMXScintSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 129 of file DMXScintSD.cc.

130 {}
void DMXScintSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 134 of file DMXScintSD.cc.

135 {}
void DMXScintSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 110 of file DMXScintSD.cc.

References G4HCofThisEvent::AddHitsCollection(), G4VSensitiveDetector::collectionName, G4THitsCollection< T >::entries(), G4cout, G4endl, G4SDManager::GetCollectionID(), G4SDManager::GetSDMpointer(), G4THitsCollection< T >::PrintAllHits(), and G4VSensitiveDetector::verboseLevel.

111 {
112 
113  G4String HCname = collectionName[0];
114  static G4int HCID = -1;
115  if(HCID<0)
117  HCE->AddHitsCollection(HCID,scintillatorCollection);
118 
119  G4int nHits = scintillatorCollection->entries();
120  if (verboseLevel>=1)
121  G4cout << " LXe collection: " << nHits << " hits" << G4endl;
122  if (verboseLevel>=2)
123  scintillatorCollection->PrintAllHits();
124 
125 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:131
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
#define G4endl
Definition: G4ios.hh:61
G4CollectionNameVector collectionName
void DMXScintSD::Initialize ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 71 of file DMXScintSD.cc.

References G4VSensitiveDetector::collectionName, and G4VSensitiveDetector::SensitiveDetectorName.

72 {
73  scintillatorCollection = new DMXScintHitsCollection
75 
76  HitID = -1;
77 }
G4THitsCollection< DMXScintHit > DMXScintHitsCollection
Definition: DMXScintHit.hh:96
G4CollectionNameVector collectionName
void DMXScintSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 139 of file DMXScintSD.cc.

140 {}
G4bool DMXScintSD::ProcessHits ( G4Step aStep,
G4TouchableHistory  
)
virtual

Implements G4VSensitiveDetector.

Definition at line 81 of file DMXScintSD.cc.

References G4Track::GetDefinition(), G4StepPoint::GetGlobalTime(), G4StepPoint::GetKineticEnergy(), G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetPDGCharge(), G4StepPoint::GetPosition(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4Step::GetStepLength(), G4Step::GetTotalEnergyDeposit(), G4Step::GetTrack(), G4THitsCollection< T >::insert(), DMXScintHit::SetEdep(), DMXScintHit::SetParticle(), DMXScintHit::SetParticleEnergy(), DMXScintHit::SetPos(), and DMXScintHit::SetTime().

82 {
83  G4double edep = aStep->GetTotalEnergyDeposit();
84  G4ParticleDefinition* particleType = aStep->GetTrack()->GetDefinition();
85  G4String particleName = particleType->GetParticleName();
86 
87  G4double stepl = 0.;
88  if (particleType->GetPDGCharge() != 0.)
89  stepl = aStep->GetStepLength();
90 
91  if ((edep==0.)&&(stepl==0.)) return false;
92 
93 
94  // fill in hit
95  DMXScintHit* newHit = new DMXScintHit();
96  newHit->SetEdep(edep);
97  newHit->SetPos(aStep->GetPostStepPoint()->GetPosition());
98  newHit->SetTime(aStep->GetPreStepPoint()->GetGlobalTime());
99  newHit->SetParticle(particleName);
100  newHit->SetParticleEnergy(aStep->GetPreStepPoint()->GetKineticEnergy() );
101 
102  HitID = scintillatorCollection->insert(newHit);
103 
104  return true;
105 }
void SetParticle(G4String name)
Definition: DMXScintHit.hh:72
G4ParticleDefinition * GetDefinition() const
G4double GetStepLength() const
void SetPos(G4ThreeVector xyz)
Definition: DMXScintHit.hh:71
const G4String & GetParticleName() const
G4StepPoint * GetPreStepPoint() const
const G4ThreeVector & GetPosition() const
void SetParticleEnergy(G4double e1)
Definition: DMXScintHit.hh:73
G4double GetTotalEnergyDeposit() const
void SetTime(G4double t2)
Definition: DMXScintHit.hh:74
G4StepPoint * GetPostStepPoint() const
G4double GetGlobalTime() const
G4double GetKineticEnergy() const
double G4double
Definition: G4Types.hh:76
G4Track * GetTrack() const
G4double GetPDGCharge() const
void SetEdep(G4double de)
Definition: DMXScintHit.hh:70

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