Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "EcalFastSimG4Model.h"
#include "G4Track.hh"
#include "G4FastTrack.hh"
EcalFastSimG4Model::EcalFastSimG4Model(G4String aModelName, G4Region* aEnvelope)
: G4VFastSimulationModel(aModelName, aEnvelope) {
}
EcalFastSimG4Model::~EcalFastSimG4Model() {
}
G4bool EcalFastSimG4Model::IsApplicable(const G4ParticleDefinition& aParticle) {
return aParticle.GetPDGCharge() != 0;
}
G4bool EcalFastSimG4Model::ModelTrigger(const G4FastTrack& aFastTrack) {
//G4cout << __FILE__ << __LINE__ << ": ModelTrigger." << G4endl;
// bool istrigged = false;
bool istrigged = true;
// only select the secondaries
const G4Track* track = aFastTrack.GetPrimaryTrack();
// secondaries
//G4cout << "trackID = " << track->GetTrackID() <<G4endl;
// if (track->GetTrackID() != 0) {
// istrigged = true;
// }
//G4cout << "istrigged = " << istrigged <<G4endl;
return istrigged;
}
void EcalFastSimG4Model::DoIt(const G4FastTrack& aFastTrack, G4FastStep& aFastStep) {
//G4cout << __FILE__ << __LINE__ << ": DoIt." << G4endl;
aFastStep.ProposeTrackStatus(fStopAndKill);
}