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

Drift chamber sensitive detector. More...

#include <Doxymodules_basic.h>

Inheritance diagram for B5::DriftChamberSD:
G4VSensitiveDetector

Public Member Functions

 DriftChamberSD (G4String name)
 
 ~DriftChamberSD () override=default
 
void Initialize (G4HCofThisEvent *HCE) override
 
G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *ROhist) override
 

Private Attributes

DriftChamberHitsCollectionfHitsCollection = nullptr
 
G4int fHCID = -1
 

Detailed Description

Drift chamber sensitive detector.

Definition at line 188 of file Doxymodules_basic.h.

Constructor & Destructor Documentation

◆ DriftChamberSD()

B5::DriftChamberSD::DriftChamberSD ( G4String  name)

Definition at line 45 of file DriftChamberSD.cc.

47{
48 collectionName.insert("driftChamberColl");
49}

◆ ~DriftChamberSD()

B5::DriftChamberSD::~DriftChamberSD ( )
overridedefault

Member Function Documentation

◆ Initialize()

void B5::DriftChamberSD::Initialize ( G4HCofThisEvent HCE)
override

Definition at line 53 of file DriftChamberSD.cc.

54{
56 = new DriftChamberHitsCollection(SensitiveDetectorName,collectionName[0]);
57
58 if (fHCID<0) {
59 fHCID = G4SDManager::GetSDMpointer()->GetCollectionID(fHitsCollection);
60 }
61 hce->AddHitsCollection(fHCID,fHitsCollection);
62}
DriftChamberHitsCollection * fHitsCollection
G4THitsCollection< DriftChamberHit > DriftChamberHitsCollection

◆ ProcessHits()

G4bool B5::DriftChamberSD::ProcessHits ( G4Step aStep,
G4TouchableHistory ROhist 
)
override

Definition at line 66 of file DriftChamberSD.cc.

67{
68 auto charge = step->GetTrack()->GetDefinition()->GetPDGCharge();
69 if (charge==0.) return true;
70
71 auto preStepPoint = step->GetPreStepPoint();
72
73 auto touchable = step->GetPreStepPoint()->GetTouchable();
74 auto motherPhysical = touchable->GetVolume(1); // mother
75 auto copyNo = motherPhysical->GetCopyNo();
76
77 auto worldPos = preStepPoint->GetPosition();
78 auto localPos
79 = touchable->GetHistory()->GetTopTransform().TransformPoint(worldPos);
80
81 auto hit = new DriftChamberHit(copyNo);
82 hit->SetWorldPos(worldPos);
83 hit->SetLocalPos(localPos);
84 hit->SetTime(preStepPoint->GetGlobalTime());
85
86 fHitsCollection->insert(hit);
87
88 return true;
89}

Member Data Documentation

◆ fHitsCollection

DriftChamberHitsCollection* B5::DriftChamberSD::fHitsCollection = nullptr
private

Definition at line 56 of file DriftChamberSD.hh.

◆ fHCID

G4int B5::DriftChamberSD::fHCID = -1
private

Definition at line 57 of file DriftChamberSD.hh.


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

Applications | User Support | Publications | Collaboration