Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-26 08:56:30

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // INCL++ intra-nuclear cascade model
0027 // Alain Boudard, CEA-Saclay, France
0028 // Joseph Cugnon, University of Liege, Belgium
0029 // Jean-Christophe David, CEA-Saclay, France
0030 // Pekka Kaitaniemi, CEA-Saclay, France, and Helsinki Institute of Physics, Finland
0031 // Sylvie Leray, CEA-Saclay, France
0032 // Davide Mancusi, CEA-Saclay, France
0033 //
0034 #define INCLXX_IN_GEANT4_MODE 1
0035 
0036 #include "globals.hh"
0037 
0038 #ifndef G4INCLBook_hh
0039 #define G4INCLBook_hh 1
0040 
0041 #include <map>
0042 #include "G4INCLIAvatar.hh"
0043 
0044 namespace G4INCL {
0045   class Book {
0046   public:
0047     Book() {
0048       reset();
0049     }
0050     ~Book() {};
0051 
0052     void reset() {
0053       nAcceptedCollisions = 0;
0054       nBlockedCollisions = 0;
0055       nAcceptedDecays = 0;
0056       nBlockedDecays = 0;
0057       nAcceptedSrc=0;
0058       nSrcPairs = 0;
0059       currentTime = 0.0;
0060       firstCollisionTime = 0.0;
0061       firstCollisionXSec = 0.0;
0062       firstCollisionSpectatorPosition = 0.0;
0063       firstCollisionSpectatorMomentum = 0.0;
0064       firstCollisionIsElastic = false;
0065       nAvatars[SurfaceAvatarType] = 0;
0066       nAvatars[CollisionAvatarType] = 0;
0067       nAvatars[DecayAvatarType] = 0;
0068       nAvatars[ParticleEntryAvatarType] = 0;
0069       nCascading = 0;
0070       nEmittedClusters = 0;
0071       nEnergyViolationInteraction = 0;
0072     };
0073  
0074     void incrementAcceptedSrcCollisions() { nAcceptedSrc++; };
0075     void incrementAcceptedCollisions() { nAcceptedCollisions++; };
0076     void incrementBlockedCollisions() { nBlockedCollisions++; };
0077     void incrementAcceptedDecays() { nAcceptedDecays++; };
0078     void incrementSrcPairs() { nSrcPairs++; };
0079     void incrementBlockedDecays() { nBlockedDecays++; };
0080     void incrementAvatars(AvatarType type) { nAvatars[type]++; };
0081     void incrementCascading() { nCascading++; }
0082     void decrementCascading() { nCascading--; }
0083     void incrementEmittedClusters() { nEmittedClusters++; }
0084     void incrementEnergyViolationInteraction() { nEnergyViolationInteraction++; }
0085 
0086     void setFirstCollisionTime(const G4double t) { firstCollisionTime = t; };
0087     G4double getFirstCollisionTime() const { return firstCollisionTime; };
0088 
0089     void setFirstCollisionXSec(const G4double x) { firstCollisionXSec = x; };
0090     G4double getFirstCollisionXSec() const { return firstCollisionXSec; };
0091 
0092     void setFirstCollisionSpectatorPosition(const G4double x) { firstCollisionSpectatorPosition = x; };
0093     G4double getFirstCollisionSpectatorPosition() const { return firstCollisionSpectatorPosition; };
0094 
0095     void setFirstCollisionSpectatorMomentum(const G4double x) { firstCollisionSpectatorMomentum = x; };
0096     G4double getFirstCollisionSpectatorMomentum() const { return firstCollisionSpectatorMomentum; };
0097 
0098     void setFirstCollisionIsElastic(const G4bool e) { firstCollisionIsElastic = e; };
0099     G4bool getFirstCollisionIsElastic() const { return firstCollisionIsElastic; };
0100 
0101     void setCurrentTime(G4double t) { currentTime = t; };
0102     G4double getCurrentTime() const { return currentTime; };
0103  
0104     void setSrcPairs(G4int n) { nSrcPairs=n; };
0105     G4int getSrcPairs() const { return nSrcPairs; };
0106     
0107     void setAcceptedSrcCollisions(G4int n) { nAcceptedSrc=n; };  
0108     G4int getAcceptedSrcCollisions() const { return nAcceptedSrc; };
0109 
0110     G4int getAcceptedCollisions() const { return nAcceptedCollisions; };
0111     G4int getBlockedCollisions() const {return nBlockedCollisions; };
0112     G4int getAcceptedDecays() const { return nAcceptedDecays; };
0113     G4int getBlockedDecays() const {return nBlockedDecays; };
0114     G4int getAvatars(AvatarType type) const { return nAvatars.find(type)->second; };
0115     G4int getCascading() const { return nCascading; };
0116     G4int getEmittedClusters() const { return nEmittedClusters; };
0117     G4int getEnergyViolationInteraction() const { return nEnergyViolationInteraction; };
0118 
0119   private:
0120     G4int nAcceptedSrc;
0121     G4int nAcceptedCollisions;
0122     G4int nBlockedCollisions;
0123     G4int nAcceptedDecays;
0124     G4int nBlockedDecays;
0125     G4int nSrcPairs;
0126     G4double currentTime;
0127     G4double firstCollisionTime;
0128     G4double firstCollisionXSec;
0129     G4double firstCollisionSpectatorPosition;
0130     G4double firstCollisionSpectatorMomentum;
0131     G4bool firstCollisionIsElastic;
0132     std::map<AvatarType,G4int> nAvatars;
0133     G4int nCascading;
0134     G4int nEmittedClusters;
0135     G4int nEnergyViolationInteraction;
0136   };
0137 }
0138 
0139 #endif