BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
BDSSDSampler Class Reference

The sensitive detector class that provides sensitivity to BDSSampler instances. More...

#include <BDSSDSampler.hh>

Inheritance diagram for BDSSDSampler:
Inheritance graph
Collaboration diagram for BDSSDSampler:
Collaboration graph

Public Member Functions

 BDSSDSampler (const G4String &name)
 Construct a sampler with name and type (plane/cylinder).
 
virtual void Initialize (G4HCofThisEvent *HCE)
 
virtual G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *readOutTH)
 
virtual G4VHit * last () const
 Provide access to last hit.
 
- Public Member Functions inherited from BDSSensitiveDetector
 BDSSensitiveDetector (const G4String &name)
 
virtual G4VHit * last () const =0
 
virtual G4bool ProcessHitsOrdered (G4Step *step, G4TouchableHistory *rOHist, const std::vector< G4VHit * > &hits)
 
G4bool HitOrdered (G4Step *step, const std::vector< G4VHit * > &hits)
 

Private Attributes

BDSHitsCollectionSamplerSamplerCollection
 The hits collection for this sensitive detector class that's owned by each instance.
 
G4String itsCollectionName
 The name of the hits collection that's created and registered.
 
int itsHCID
 
BDSSamplerRegistryregistry
 Cached pointer to registry as accessed many times.
 
BDSGlobalConstantsglobals
 Cached pointer to global constants as accessed many times.
 

Detailed Description

The sensitive detector class that provides sensitivity to BDSSampler instances.

It creates BDSHitSampler instances for each particle impact on a sampler this SD is attached to.

Written and edited by many authors over time.

Definition at line 43 of file BDSSDSampler.hh.

Constructor & Destructor Documentation

◆ BDSSDSampler()

BDSSDSampler::BDSSDSampler ( const G4String &  name)
explicit

Construct a sampler with name and type (plane/cylinder).

Definition at line 43 of file BDSSDSampler.cc.

◆ ~BDSSDSampler()

BDSSDSampler::~BDSSDSampler ( )
virtual

Definition at line 54 of file BDSSDSampler.cc.

Member Function Documentation

◆ Initialize()

void BDSSDSampler::Initialize ( G4HCofThisEvent *  HCE)
virtual

Overriden from G4VSensitiveDetector. Creates hits collection and registers it with the hits collection of this event (HCE).

Definition at line 57 of file BDSSDSampler.cc.

References globals, BDSGlobalConstants::Instance(), BDSSamplerRegistry::Instance(), itsCollectionName, itsHCID, registry, and SamplerCollection.

Here is the call graph for this function:

◆ last()

G4VHit * BDSSDSampler::last ( ) const
virtual

Provide access to last hit.

Implements BDSSensitiveDetector.

Definition at line 173 of file BDSSDSampler.cc.

References SamplerCollection.

◆ ProcessHits()

G4bool BDSSDSampler::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *  readOutTH 
)
virtual

Overriden from G4VSensitiveDetector. Creates hit instances and appends them to the hits collection.

Definition at line 71 of file BDSSDSampler.cc.

References BDSSamplerPlacementRecord::BeamlineIndex(), BDSSamplerRegistry::GetInfo(), BDSSamplerRegistry::GetTransformInverse(), globals, BDS::IsFinite(), registry, BDS::Rigidity(), SamplerCollection, and BDSSamplerPlacementRecord::SPosition().

Here is the call graph for this function:

Field Documentation

◆ globals

BDSGlobalConstants* BDSSDSampler::globals
private

Cached pointer to global constants as accessed many times.

Definition at line 77 of file BDSSDSampler.hh.

Referenced by Initialize(), and ProcessHits().

◆ itsCollectionName

G4String BDSSDSampler::itsCollectionName
private

The name of the hits collection that's created and registered.

Definition at line 66 of file BDSSDSampler.hh.

Referenced by Initialize().

◆ itsHCID

int BDSSDSampler::itsHCID
private

Hits collection ID - an integer look up for the hits collection provided by G4SDManager (a registry) that is given to the G4HCofThisEvent (Hits collection of the event).

Definition at line 71 of file BDSSDSampler.hh.

Referenced by Initialize().

◆ registry

BDSSamplerRegistry* BDSSDSampler::registry
private

Cached pointer to registry as accessed many times.

Definition at line 74 of file BDSSDSampler.hh.

Referenced by Initialize(), and ProcessHits().

◆ SamplerCollection

BDSHitsCollectionSampler* BDSSDSampler::SamplerCollection
private

The hits collection for this sensitive detector class that's owned by each instance.

Definition at line 63 of file BDSSDSampler.hh.

Referenced by Initialize(), last(), and ProcessHits().


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