Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:25

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       currentTime = 0.0;
0058       firstCollisionTime = 0.0;
0059       firstCollisionXSec = 0.0;
0060       firstCollisionSpectatorPosition = 0.0;
0061       firstCollisionSpectatorMomentum = 0.0;
0062       firstCollisionIsElastic = false;
0063       nAvatars[SurfaceAvatarType] = 0;
0064       nAvatars[CollisionAvatarType] = 0;
0065       nAvatars[DecayAvatarType] = 0;
0066       nAvatars[ParticleEntryAvatarType] = 0;
0067       nCascading = 0;
0068       nEmittedClusters = 0;
0069       nEnergyViolationInteraction = 0;
0070     };
0071 
0072     void incrementAcceptedCollisions() { nAcceptedCollisions++; };
0073     void incrementBlockedCollisions() { nBlockedCollisions++; };
0074     void incrementAcceptedDecays() { nAcceptedDecays++; };
0075     void incrementBlockedDecays() { nBlockedDecays++; };
0076     void incrementAvatars(AvatarType type) { nAvatars[type]++; };
0077     void incrementCascading() { nCascading++; }
0078     void decrementCascading() { nCascading--; }
0079     void incrementEmittedClusters() { nEmittedClusters++; }
0080     void incrementEnergyViolationInteraction() { nEnergyViolationInteraction++; }
0081 
0082     void setFirstCollisionTime(const G4double t) { firstCollisionTime = t; };
0083     G4double getFirstCollisionTime() const { return firstCollisionTime; };
0084 
0085     void setFirstCollisionXSec(const G4double x) { firstCollisionXSec = x; };
0086     G4double getFirstCollisionXSec() const { return firstCollisionXSec; };
0087 
0088     void setFirstCollisionSpectatorPosition(const G4double x) { firstCollisionSpectatorPosition = x; };
0089     G4double getFirstCollisionSpectatorPosition() const { return firstCollisionSpectatorPosition; };
0090 
0091     void setFirstCollisionSpectatorMomentum(const G4double x) { firstCollisionSpectatorMomentum = x; };
0092     G4double getFirstCollisionSpectatorMomentum() const { return firstCollisionSpectatorMomentum; };
0093 
0094     void setFirstCollisionIsElastic(const G4bool e) { firstCollisionIsElastic = e; };
0095     G4bool getFirstCollisionIsElastic() const { return firstCollisionIsElastic; };
0096 
0097     void setCurrentTime(G4double t) { currentTime = t; };
0098     G4double getCurrentTime() const { return currentTime; };
0099 
0100     G4int getAcceptedCollisions() const { return nAcceptedCollisions; };
0101     G4int getBlockedCollisions() const {return nBlockedCollisions; };
0102     G4int getAcceptedDecays() const { return nAcceptedDecays; };
0103     G4int getBlockedDecays() const {return nBlockedDecays; };
0104     G4int getAvatars(AvatarType type) const { return nAvatars.find(type)->second; };
0105     G4int getCascading() const { return nCascading; };
0106     G4int getEmittedClusters() const { return nEmittedClusters; };
0107     G4int getEnergyViolationInteraction() const { return nEnergyViolationInteraction; };
0108 
0109   private:
0110     G4int nAcceptedCollisions;
0111     G4int nBlockedCollisions;
0112     G4int nAcceptedDecays;
0113     G4int nBlockedDecays;
0114     G4double currentTime;
0115     G4double firstCollisionTime;
0116     G4double firstCollisionXSec;
0117     G4double firstCollisionSpectatorPosition;
0118     G4double firstCollisionSpectatorMomentum;
0119     G4bool firstCollisionIsElastic;
0120     std::map<AvatarType,G4int> nAvatars;
0121     G4int nCascading;
0122     G4int nEmittedClusters;
0123     G4int nEnergyViolationInteraction;
0124   };
0125 }
0126 
0127 #endif