00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "G4HadronicWhiteBoard.hh"
00027
00028
00029 G4HadronicWhiteBoard::G4HadronicWhiteBoard()
00030 : theProjectile(0), theDef(0), theName(0), theE(0.0), thePx(0.0),
00031 thePy(0.0), thePz(0.0), theA(0), theZ(0)
00032 {}
00033
00034
00035 G4HadronicWhiteBoard & G4HadronicWhiteBoard::Instance()
00036 {
00037 static G4HadronicWhiteBoard theInstance;
00038 return theInstance;
00039 }
00040
00041 const G4HadProjectile * G4HadronicWhiteBoard::GetProjectile()
00042 {
00043 return theProjectile;
00044 }
00045
00046 const G4Nucleus & G4HadronicWhiteBoard::GetTargetNucleus()
00047 {
00048 return theTarget;
00049 }
00050
00051 G4ParticleDefinition * G4HadronicWhiteBoard::GetPDef() {return theDef;}
00052 G4String G4HadronicWhiteBoard::GetParticleName() {return theName;}
00053 G4double G4HadronicWhiteBoard::GetEnergy() {return theE;}
00054 G4double G4HadronicWhiteBoard::GetPx(){return thePx;}
00055 G4double G4HadronicWhiteBoard::GetPy(){return thePy;}
00056 G4double G4HadronicWhiteBoard::GetPz(){return thePz;}
00057 G4int G4HadronicWhiteBoard::GetA(){return theA;}
00058 G4int G4HadronicWhiteBoard::GetZ(){return theZ;}
00059
00060
00061 void G4HadronicWhiteBoard::SetProjectile(const G4HadProjectile & aProjectile)
00062 {
00063 theProjectile = const_cast<G4HadProjectile*>(& aProjectile);
00064 theDef = const_cast<G4ParticleDefinition*>(theProjectile->GetDefinition());
00065 theName = const_cast<char *>(theDef->GetParticleName().c_str() );
00066 theE = theProjectile->Get4Momentum().t();
00067 thePx = theProjectile->Get4Momentum().vect().x();
00068 thePy = theProjectile->Get4Momentum().vect().y();
00069 thePz = theProjectile->Get4Momentum().vect().z();
00070 }
00071
00072
00073 void G4HadronicWhiteBoard::SetTargetNucleus(const G4Nucleus & aTarget)
00074 {
00075 theTarget = aTarget;
00076 theA = theTarget.GetA_asInt();
00077 theZ = theTarget.GetZ_asInt();
00078 }
00079
00080
00081 void G4HadronicWhiteBoard::SetProcessName(const G4String& aProcessName)
00082 {
00083 theProcessName = aProcessName;
00084 }
00085
00086
00087 void G4HadronicWhiteBoard::SetModelName(const G4String& aModelName)
00088 {
00089 theModelName = aModelName;
00090 }
00091
00092
00093 void G4HadronicWhiteBoard::Dump()
00094 {
00095 std::cerr << std::endl;
00096 std::cerr << "*** Geant4 Hadronic Reaction Information ***"
00097 << std::endl;
00098 std::cerr << " Process: " << theProcessName << " , Model: "
00099 << theModelName << std::endl;
00100 std::cerr << " Nucleus A, Z = " << theA << " " << theZ
00101 << std::endl;
00102 std::cerr << " Projectile was a " << theName
00103 << std::endl;
00104 std::cerr << " projectile momentum (px, py, pz) = (" << thePx << ", "
00105 << thePy << ", " << thePz << ")" << std::endl;
00106 std::cerr << " Projectile energy = "<< theE
00107 << std::endl;
00108 std::cerr << "*** End of Geant4 Hadronic Reaction Information ***"
00109 << std::endl;
00110 G4Exception(theModelName, "001", FatalException, "segmentation fault");
00111 }