1 | #include "ELYSE/StackingAction.hh"
|
---|
2 |
|
---|
3 | //Geant4
|
---|
4 | #include "G4Track.hh"
|
---|
5 | #include "G4TrackStatus.hh"
|
---|
6 | #include "G4VPhysicalVolume.hh"
|
---|
7 | #include "Randomize.hh"
|
---|
8 | #include "G4Navigator.hh"
|
---|
9 | #include "G4TransportationManager.hh"
|
---|
10 | #include "G4ParticleDefinition.hh"
|
---|
11 | #include "G4ParticleTypes.hh"
|
---|
12 | //#include "G4VProcess.hh"
|
---|
13 |
|
---|
14 | //ELYSE
|
---|
15 | #include "ELYSE/DetectorConstruction.hh"
|
---|
16 |
|
---|
17 | ELYSE::StackingAction::StackingAction() : gammaCounter(0), stage(0) {}
|
---|
18 | ELYSE::StackingAction::~StackingAction() {}
|
---|
19 |
|
---|
20 | G4ClassificationOfNewTrack ELYSE::StackingAction::ClassifyNewTrack (const G4Track* aTrack) {
|
---|
21 | //JEC unused varaible 22/2/07 G4ClassificationOfNewTrack classification = fWaiting;
|
---|
22 | G4ParticleDefinition* particleType = aTrack->GetDefinition();
|
---|
23 | G4String particleName = particleType->GetParticleName();
|
---|
24 |
|
---|
25 | // G4cout << "(JEC):StackingAction::ClassifyNewTrack stage (" << stage << ")" << particleName
|
---|
26 | // << G4endl;
|
---|
27 |
|
---|
28 | //Not to track neutrinos
|
---|
29 | if(particleName == "nu_e" || particleName == "anti_nu_e" ||
|
---|
30 | particleName == "nu_mu" || particleName == "anti_nu_mu" ||
|
---|
31 | particleName == "nu_tau" || particleName == "anti_nu_tau" ) return fKill;
|
---|
32 |
|
---|
33 | //count number of secondary Optical Photons
|
---|
34 | if( particleName == "opticalphoton" ) {
|
---|
35 | if(aTrack->GetParentID()>0)
|
---|
36 | { // particle is secondary
|
---|
37 | gammaCounter++;
|
---|
38 | }
|
---|
39 | }
|
---|
40 |
|
---|
41 | return fUrgent;
|
---|
42 | }//ClassifyNewTrack
|
---|
43 |
|
---|
44 | //-------------------------------------------------------------------------
|
---|
45 | void ELYSE::StackingAction::NewStage() {
|
---|
46 | stage++;
|
---|
47 | G4cout << "Number of optical photons produces in this event : "
|
---|
48 | << gammaCounter << G4endl;
|
---|
49 |
|
---|
50 | }//NewStage
|
---|
51 |
|
---|
52 | //-------------------------------------------------------------------------
|
---|
53 |
|
---|
54 | void ELYSE::StackingAction::PrepareNewEvent() {
|
---|
55 | gammaCounter = 0;
|
---|
56 | stage = 0;
|
---|
57 | }//PrepareNewEvent
|
---|
58 |
|
---|
59 |
|
---|
60 |
|
---|
61 |
|
---|