00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // INCL++ intra-nuclear cascade model 00027 // Pekka Kaitaniemi, CEA and Helsinki Institute of Physics 00028 // Davide Mancusi, CEA 00029 // Alain Boudard, CEA 00030 // Sylvie Leray, CEA 00031 // Joseph Cugnon, University of Liege 00032 // 00033 #define INCLXX_IN_GEANT4_MODE 1 00034 00035 #include "globals.hh" 00036 00037 #ifndef G4INCLBook_hh 00038 #define G4INCLBook_hh 1 00039 00040 #include <map> 00041 #include "G4INCLIAvatar.hh" 00042 00043 namespace G4INCL { 00044 class Book { 00045 public: 00046 Book() { 00047 reset(); 00048 } 00049 ~Book() {}; 00050 00051 void reset() { 00052 nAcceptedCollisions = 0; 00053 nBlockedCollisions = 0; 00054 nAcceptedDecays = 0; 00055 nBlockedDecays = 0; 00056 currentTime = 0.0; 00057 firstCollisionTime = 0.0; 00058 firstCollisionXSec = 0.0; 00059 nAvatars[SurfaceAvatarType] = 0; 00060 nAvatars[CollisionAvatarType] = 0; 00061 nAvatars[DecayAvatarType] = 0; 00062 nAvatars[ParticleEntryAvatarType] = 0; 00063 nCascading = 0; 00064 }; 00065 00066 void incrementAcceptedCollisions() { nAcceptedCollisions++; }; 00067 void incrementBlockedCollisions() { nBlockedCollisions++; }; 00068 void incrementAcceptedDecays() { nAcceptedDecays++; }; 00069 void incrementBlockedDecays() { nBlockedDecays++; }; 00070 void incrementAvatars(AvatarType type) { nAvatars[type]++; }; 00071 void incrementCascading() { nCascading++; } 00072 void decrementCascading() { nCascading--; } 00073 00074 void setFirstCollisionTime(G4double t) { firstCollisionTime = t; }; 00075 G4double getFirstCollisionTime() { return firstCollisionTime; }; 00076 00077 void setFirstCollisionXSec(G4double x) { firstCollisionXSec = x; }; 00078 G4double getFirstCollisionXSec() { return firstCollisionXSec; }; 00079 00080 void setCurrentTime(G4double t) { currentTime = t; }; 00081 G4double getCurrentTime() { return currentTime; }; 00082 00083 G4int getAcceptedCollisions() const { return nAcceptedCollisions; }; 00084 G4int getBlockedCollisions() const {return nBlockedCollisions; }; 00085 G4int getAcceptedDecays() const { return nAcceptedDecays; }; 00086 G4int getBlockedDecays() const {return nBlockedDecays; }; 00087 G4int getAvatars(AvatarType type) const { return nAvatars.find(type)->second; }; 00088 G4int getCascading() const { return nCascading; }; 00089 00090 private: 00091 G4int nAcceptedCollisions; 00092 G4int nBlockedCollisions; 00093 G4int nAcceptedDecays; 00094 G4int nBlockedDecays; 00095 G4double currentTime; 00096 G4double firstCollisionTime; 00097 G4double firstCollisionXSec; 00098 std::map<AvatarType,G4int> nAvatars; 00099 G4int nCascading; 00100 }; 00101 } 00102 00103 #endif