2
#include "DetectorSD.hh"
4
#include "G4HCofThisEvent.hh"
5
#include "G4TouchableHistory.hh"
10
DetectorSD::DetectorSD(G4String name)
11
:G4VSensitiveDetector(name){
14
DetectorSD::~DetectorSD(){;}
16
void DetectorSD::Initialize(G4HCofThisEvent*HCE) {
17
//std::cout << "This is LqArTankSensitiveDetector::Initialize " << nSteps_ << std::endl ;
22
hit_->setNSteps(nSteps_);
23
hit_->setPosition(TLorentzVector(0., 0., 0., 0.));
24
hit_->setMuon(ParticleDescrShortRecord());
27
G4bool DetectorSD::ProcessHits(G4Step*aStep,G4TouchableHistory*) {
29
G4Track* track = aStep->GetTrack();
32
TLorentzVector pos( aStep->GetPreStepPoint()->GetPosition().x(),
33
aStep->GetPreStepPoint()->GetPosition().y(),
34
aStep->GetPreStepPoint()->GetPosition().z(), 0.);
37
ParticleDescrShortRecord muon;
38
TLorentzVector p4( track->GetMomentum().x(),
39
track->GetMomentum().y(),
40
track->GetMomentum().z(),
41
track->GetTotalEnergy() );
43
muon.setPDG( track->GetDefinition()->GetPDGEncoding() );
45
//hit_->setPosition(pos);
49
//ParticleDescrShortRecord fss;
52
Edep_ = aStep->GetTotalEnergyDeposit();
56
Edep_ += aStep->GetTotalEnergyDeposit();
63
void DetectorSD::EndOfEvent(G4HCofThisEvent* HCE){
65
hit_->setNSteps(nSteps_);
70
void DetectorSD::clear()
74
void DetectorSD::DrawAll()
78
void DetectorSD::PrintAll()