Geant4  10.00.p02
G4INCLCascadeAction.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // INCL++ intra-nuclear cascade model
27 // Pekka Kaitaniemi, CEA and Helsinki Institute of Physics
28 // Davide Mancusi, CEA
29 // Alain Boudard, CEA
30 // Sylvie Leray, CEA
31 // Joseph Cugnon, University of Liege
32 //
33 #define INCLXX_IN_GEANT4_MODE 1
34 
35 #include "globals.hh"
36 
37 #include "G4INCLCascadeAction.hh"
38 #include "G4INCLLogger.hh"
39 #include "G4INCLRandom.hh"
40 
41 namespace G4INCL {
42 
44  stepCounter(0)
45  {}
46 
48  {}
49 
51  beforeRunDefaultAction(config);
52  beforeRunUserAction(config);
53  }
54 
58  }
59 
63  }
64 
68  }
69 
71  afterAvatarDefaultAction(a, n, fs);
72  afterAvatarUserAction(a, n, fs);
73  }
74 
77  afterPropagationUserAction(pm, avatar);
78  }
79 
83  }
84 
88  }
89 
90 
91 
93 
95 
97  // assert(pm->getNucleus()->getStore()->getBook().getCascading() == pm->getNucleus()->getStore()->countCascading());
98  }
99 
102  INCL_DEBUG("Random seeds before avatar " << a->getID() << ": "
103  << G4INCL::Random::getSeeds() << std::endl);
104  INCL_DEBUG("Next avatar:" << std::endl << a->dump() << std::endl);
105  }
106 
108 
109  if(!fs) // do nothing if there is no final state
110  return;
111 
112  INCL_DEBUG("Random seeds after avatar " << a->getID() << ": "
113  << G4INCL::Random::getSeeds() << std::endl);
114 
115  ParticleList modified = fs->getModifiedParticles();
116  for(ParticleIter p=modified.begin(), e=modified.end(); p!=e; ++p )
117  if(a->isACollision())
118  (*p)->incrementNumberOfCollisions();
119  else if(a->isADecay())
120  (*p)->incrementNumberOfDecays();
121 
122  ParticleList created = fs->getCreatedParticles();
123  for(ParticleIter p=created.begin(), e=created.end(); p!=e; ++p )
124  if(a->isACollision())
125  (*p)->incrementNumberOfCollisions();
126  else if(a->isADecay())
127  (*p)->incrementNumberOfDecays();
128 
129  }
130 
132  IAvatar * /*avatar */) {
133  ++stepCounter; // Increment the step counter
134 
135 #ifdef INCL_DEBUG_LOG
136  // INCL_DATABLOCK(pm->getNucleus()->getStore()->printParticleConfiguration());
137 #endif
138  }
139 
141 
143 
144 }
The INCL configuration object.
Definition: G4INCLConfig.hh:67
virtual void beforeAvatarUserAction(IAvatar *, Nucleus *)
void beforePropagationDefaultAction(IPropagationModel *pm)
void beforeRunDefaultAction(Config const *config)
void afterPropagationDefaultAction(IPropagationModel *pm, IAvatar *avatar)
void beforeRunAction(Config const *config)
ParticleList const & getModifiedParticles() const
void beforeCascadeAction(IPropagationModel *)
Store * getStore() const
G4bool isACollision() const
G4double a
Definition: TRTMaterials.hh:39
Propagation model takes care of transporting the particles until something interesting (i...
Class containing default actions to be performed at intermediate cascade steps.
void incrementAvatars(AvatarType type)
Definition: G4INCLBook.hh:75
virtual void beforeCascadeUserAction(IPropagationModel *)
SeedVector getSeeds()
Get the seeds of the current generator.
Definition: G4INCLRandom.cc:70
void beforeAvatarAction(IAvatar *a, Nucleus *n)
ParticleList const & getCreatedParticles() const
virtual std::string dump() const =0
Final state of an interaction.
Book & getBook()
Return the pointer to the Book object which keeps track of various counters.
Definition: G4INCLStore.hh:237
virtual void afterRunUserAction()
void beforePropagationAction(IPropagationModel *pm)
long getID() const
const G4int n
void afterCascadeAction(Nucleus *)
virtual void afterPropagationUserAction(IPropagationModel *, IAvatar *)
virtual void afterAvatarUserAction(IAvatar *, Nucleus *, FinalState *)
void afterAvatarDefaultAction(IAvatar *a, Nucleus *n, FinalState *fs)
void beforeCascadeDefaultAction(IPropagationModel *pm)
G4bool isADecay() const
virtual void beforePropagationUserAction(IPropagationModel *)
virtual void beforeRunUserAction(Config const *)
void afterCascadeDefaultAction(Nucleus *)
void afterPropagationAction(IPropagationModel *pm, IAvatar *avatar)
#define INCL_DEBUG(x)
virtual void afterCascadeUserAction(Nucleus *)
void afterAvatarAction(IAvatar *a, Nucleus *n, FinalState *fs)
void beforeAvatarDefaultAction(IAvatar *a, Nucleus *n)
AvatarType getType() const
ParticleList::const_iterator ParticleIter