Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
SAXSSensitiveDetector Class Reference

Sensitive detector. More...

#include <Doxymodules_exoticphysics.h>

Inheritance diagram for SAXSSensitiveDetector:
G4VSensitiveDetector

Public Member Functions

 SAXSSensitiveDetector (G4String)
 
virtual ~SAXSSensitiveDetector ()
 
virtual void Initialize (G4HCofThisEvent *)
 
virtual G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
void SetVarStopAndKill (G4bool bVar)
 

Private Attributes

SensitiveDetectorHitsCollectionfHitsCollection
 
G4int fHCID
 
SAXSSensitiveDetectorMessengerfSDMessenger
 
G4bool fVarStopAndKill
 

Detailed Description

Sensitive detector.

It stores the features of the impinging particles.

Definition at line 72 of file Doxymodules_exoticphysics.h.

Constructor & Destructor Documentation

◆ SAXSSensitiveDetector()

SAXSSensitiveDetector::SAXSSensitiveDetector ( G4String  name)

Definition at line 44 of file SAXSSensitiveDetector.cc.

44 :
46{
47 G4String HCname;
48 collectionName.insert(HCname="collection");
49 fHCID = -1;
50
51 fVarStopAndKill = true;
52
54}
SAXSSensitiveDetectorMessenger * fSDMessenger

◆ ~SAXSSensitiveDetector()

SAXSSensitiveDetector::~SAXSSensitiveDetector ( )
virtual

Definition at line 58 of file SAXSSensitiveDetector.cc.

58{}

Member Function Documentation

◆ Initialize()

void SAXSSensitiveDetector::Initialize ( G4HCofThisEvent HCE)
virtual

Definition at line 62 of file SAXSSensitiveDetector.cc.

63{
65 new SensitiveDetectorHitsCollection(SensitiveDetectorName,collectionName[0]);
66 if(fHCID<0)
67 fHCID = G4SDManager::GetSDMpointer()->GetCollectionID(fHitsCollection);
68 HCE->AddHitsCollection(fHCID,fHitsCollection);
69}
G4THitsCollection< SAXSSensitiveDetectorHit > SensitiveDetectorHitsCollection
SensitiveDetectorHitsCollection * fHitsCollection

◆ ProcessHits()

bool SAXSSensitiveDetector::ProcessHits ( G4Step aStep,
G4TouchableHistory  
)
virtual

Definition at line 73 of file SAXSSensitiveDetector.cc.

74{
75 G4Track* vTrack = aStep->GetTrack();
76
77 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
78
79 G4ThreeVector worldPosition = preStepPoint->GetPosition();
80 G4ThreeVector localPosition = preStepPoint->GetTouchableHandle()->
81 GetHistory()->GetTopTransform().TransformPoint(worldPosition);
82
83 G4ThreeVector mom = preStepPoint->GetMomentumDirection();
84
85 //if the partcile is not on the boundary of the sensitive detector, return
86 if (!(preStepPoint->GetStepStatus() == fGeomBoundary)) {return false;}
87
88 G4int vType = -1;
89 if(preStepPoint->GetMass() == 0 && preStepPoint->GetCharge() == 0) {
90 vType = 0;
91 }
92 else if(preStepPoint->GetMass() != 0 && preStepPoint->GetCharge() == 0) {
93 vType = 1;
94 }
95 else if(preStepPoint->GetMass() != 0 && preStepPoint->GetCharge() > 0) {
96 vType = 2;
97 }
98 else if(preStepPoint->GetMass() != 0 && preStepPoint->GetCharge() < 0) {
99 vType = 3;
100 }
101
102 //insert a hit
104 aHit->SetPos(localPosition);
105 aHit->SetMom(mom);
106 aHit->SetType(vType);
107 aHit->SetEnergy(preStepPoint->GetKineticEnergy());
108 aHit->SetTime(preStepPoint->GetGlobalTime());
109 aHit->SetTrackID(vTrack->GetTrackID());
110 aHit->SetWeight(vTrack->GetWeight());
111 fHitsCollection->insert(aHit);
112
113 if (fVarStopAndKill) {vTrack->SetTrackStatus(fStopAndKill);}
114
115 return true;
116}

◆ EndOfEvent()

void SAXSSensitiveDetector::EndOfEvent ( G4HCofThisEvent )
virtual

Definition at line 119 of file SAXSSensitiveDetector.cc.

119{}

◆ SetVarStopAndKill()

void SAXSSensitiveDetector::SetVarStopAndKill ( G4bool  bVar)
inline

Definition at line 57 of file SAXSSensitiveDetector.hh.

57{fVarStopAndKill = bVar;}

Member Data Documentation

◆ fHitsCollection

SensitiveDetectorHitsCollection* SAXSSensitiveDetector::fHitsCollection
private

Definition at line 60 of file SAXSSensitiveDetector.hh.

◆ fHCID

G4int SAXSSensitiveDetector::fHCID
private

Definition at line 61 of file SAXSSensitiveDetector.hh.

◆ fSDMessenger

SAXSSensitiveDetectorMessenger* SAXSSensitiveDetector::fSDMessenger
private

Definition at line 63 of file SAXSSensitiveDetector.hh.

◆ fVarStopAndKill

G4bool SAXSSensitiveDetector::fVarStopAndKill
private

Definition at line 65 of file SAXSSensitiveDetector.hh.


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

Applications | User Support | Publications | Collaboration