Import Geant4 7.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 12:11:21 +02:00
parent 516dbf1a58
commit d93e1e39a9
5384 changed files with 125662 additions and 82444 deletions
+34 -34
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SmoothTrajectory.cc,v 1.13 2004/11/18 23:10:10 perl Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// $Id: G4SmoothTrajectory.cc,v 1.15 2005/05/03 17:48:51 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ---------------------------------------------------------------
@@ -43,8 +43,13 @@
#include "G4AttDefStore.hh"
#include "G4AttDef.hh"
#include "G4AttValue.hh"
#include "G4UIcommand.hh"
#include "G4UnitsTable.hh"
#include <strstream>
//#define G4ATTDEBUG
#ifdef G4ATTDEBUG
#include "G4AttCheck.hh"
#endif
G4Allocator<G4SmoothTrajectory> aSmoothTrajectoryAllocator;
@@ -129,24 +134,25 @@ const std::map<G4String,G4AttDef>* G4SmoothTrajectory::GetAttDefs() const
(*store)[PID] = G4AttDef(PID,"Parent ID","Bookkeeping","","G4int");
G4String PN("PN");
(*store)[PN] = G4AttDef(PN,"Particle Name","Physics","","G4String");
(*store)[PN] = G4AttDef(PN,"Particle Name","Bookkeeping","","G4String");
G4String Ch("Ch");
(*store)[Ch] = G4AttDef(Ch,"Charge","Physics","","G4double");
(*store)[Ch] = G4AttDef(Ch,"Charge","Physics","e+","G4double");
G4String PDG("PDG");
(*store)[PDG] = G4AttDef(PDG,"PDG Encoding","Physics","","G4int");
(*store)[PDG] = G4AttDef(PDG,"PDG Encoding","Bookkeeping","","G4int");
G4String IMom("IMom");
(*store)[IMom] = G4AttDef(IMom, "Momentum of track at start of trajectory",
"Physics","","G4ThreeVector");
"Physics","G4BestUnit","G4ThreeVector");
G4String IMag("IMag");
(*store)[IMag] = G4AttDef(IMag, "Magnitude of momentum of track at start of trajectory",
"Physics","","G4double");
(*store)[IMag] = G4AttDef
(IMag, "Magnitude of momentum of track at start of trajectory",
"Physics","G4BestUnit","G4double");
G4String NTP("NTP");
(*store)[NTP] = G4AttDef(NTP,"No. of points","Physics","","G4int");
(*store)[NTP] = G4AttDef(NTP,"No. of points","Bookkeeping","","G4int");
}
return store;
@@ -155,40 +161,34 @@ const std::map<G4String,G4AttDef>* G4SmoothTrajectory::GetAttDefs() const
std::vector<G4AttValue>* G4SmoothTrajectory::CreateAttValues() const
{
char c[100];
std::ostrstream s(c,100);
std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
s.seekp(std::ios::beg);
s << fTrackID << std::ends;
values->push_back(G4AttValue("ID",c,""));
values->push_back
(G4AttValue("ID",G4UIcommand::ConvertToString(fTrackID),""));
s.seekp(std::ios::beg);
s << fParentID << std::ends;
values->push_back(G4AttValue("PID",c,""));
values->push_back
(G4AttValue("PID",G4UIcommand::ConvertToString(fParentID),""));
values->push_back(G4AttValue("PN",ParticleName,""));
s.seekp(std::ios::beg);
s << PDGCharge << std::ends;
values->push_back(G4AttValue("Ch",c,""));
values->push_back
(G4AttValue("Ch",G4UIcommand::ConvertToString(PDGCharge),""));
s.seekp(std::ios::beg);
s << PDGEncoding << std::ends;
values->push_back(G4AttValue("PDG",c,""));
values->push_back
(G4AttValue("PDG",G4UIcommand::ConvertToString(PDGEncoding),""));
s.seekp(std::ios::beg);
s << G4BestUnit(initialMomentum,"Energy") << std::ends;
values->push_back(G4AttValue("IMom",c,""));
values->push_back
(G4AttValue("IMom",G4BestUnit(initialMomentum,"Energy"),""));
s.seekp(std::ios::beg);
s << initialMomentum.mag() << std::ends;
values->push_back(G4AttValue("IMag",c,""));
values->push_back
(G4AttValue("IMag",G4BestUnit(initialMomentum.mag(),"Energy"),""));
s.seekp(std::ios::beg);
s << GetPointEntries() << std::ends;
values->push_back(G4AttValue("NTP",c,""));
values->push_back
(G4AttValue("NTP",G4UIcommand::ConvertToString(GetPointEntries()),""));
#ifdef G4ATTDEBUG
G4cout << G4AttCheck(values,GetAttDefs());
#endif
return values;
}
+15 -14
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SmoothTrajectoryPoint.cc,v 1.12 2004/06/11 14:30:19 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// $Id: G4SmoothTrajectoryPoint.cc,v 1.14 2005/05/03 17:48:51 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ---------------------------------------------------------------
@@ -37,7 +37,11 @@
#include "G4AttDef.hh"
#include "G4AttValue.hh"
#include "G4UnitsTable.hh"
#include <strstream>
//#define G4ATTDEBUG
#ifdef G4ATTDEBUG
#include "G4AttCheck.hh"
#endif
G4Allocator<G4SmoothTrajectoryPoint> aSmoothTrajectoryPointAllocator;
@@ -82,34 +86,31 @@ G4SmoothTrajectoryPoint::GetAttDefs() const
if (isNew) {
G4String Pos("Pos");
(*store)[Pos] = G4AttDef(Pos, "Step Position",
"Physics","","G4ThreeVector");
"Physics","G4BestUnit","G4ThreeVector");
G4String Aux("Aux");
(*store)[Aux] = G4AttDef(Aux, "Auxiliary Point Position",
"Physics","","G4ThreeVector");
"Physics","G4BestUnit","G4ThreeVector");
}
return store;
}
std::vector<G4AttValue>* G4SmoothTrajectoryPoint::CreateAttValues() const
{
char c[100];
std::ostrstream s(c,100);
std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
if (fAuxiliaryPointVector) {
std::vector<G4ThreeVector>::iterator iAux;
for (iAux = fAuxiliaryPointVector->begin();
iAux != fAuxiliaryPointVector->end(); ++iAux) {
s.seekp(std::ios::beg);
s << G4BestUnit(*iAux,"Length") << std::ends;
values->push_back(G4AttValue("Aux",c,""));
values->push_back(G4AttValue("Aux",G4BestUnit(*iAux,"Length"),""));
}
}
s.seekp(std::ios::beg);
s << G4BestUnit(fPosition,"Length") << std::ends;
values->push_back(G4AttValue("Pos",c,""));
values->push_back(G4AttValue("Pos",G4BestUnit(fPosition,"Length"),""));
#ifdef G4ATTDEBUG
G4cout << G4AttCheck(values,GetAttDefs());
#endif
return values;
}
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4SteppingManager.cc,v 1.33 2004/08/12 00:50:11 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4SteppingManager2.cc,v 1.23 2004/12/07 09:16:54 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4SteppingVerbose.cc,v 1.16 2004/07/08 03:46:43 amako Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4TrackingManager.cc,v 1.15 2003/11/18 18:39:39 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4TrackingMessenger.cc,v 1.9 2003/06/16 17:13:23 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
//---------------------------------------------------------------
+34 -34
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Trajectory.cc,v 1.25 2004/11/18 23:10:10 perl Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// $Id: G4Trajectory.cc,v 1.27 2005/05/03 17:48:51 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ---------------------------------------------------------------
@@ -43,8 +43,13 @@
#include "G4AttDefStore.hh"
#include "G4AttDef.hh"
#include "G4AttValue.hh"
#include "G4UIcommand.hh"
#include "G4UnitsTable.hh"
#include <strstream>
//#define G4ATTDEBUG
#ifdef G4ATTDEBUG
#include "G4AttCheck.hh"
#endif
G4Allocator<G4Trajectory> aTrajectoryAllocator;
@@ -125,24 +130,25 @@ const std::map<G4String,G4AttDef>* G4Trajectory::GetAttDefs() const
(*store)[PID] = G4AttDef(PID,"Parent ID","Bookkeeping","","G4int");
G4String PN("PN");
(*store)[PN] = G4AttDef(PN,"Particle Name","Physics","","G4String");
(*store)[PN] = G4AttDef(PN,"Particle Name","Bookkeeping","","G4String");
G4String Ch("Ch");
(*store)[Ch] = G4AttDef(Ch,"Charge","Physics","","G4double");
(*store)[Ch] = G4AttDef(Ch,"Charge","Physics","e+","G4double");
G4String PDG("PDG");
(*store)[PDG] = G4AttDef(PDG,"PDG Encoding","Physics","","G4int");
(*store)[PDG] = G4AttDef(PDG,"PDG Encoding","Bookkeeping","","G4int");
G4String IMom("IMom");
(*store)[IMom] = G4AttDef(IMom, "Momentum of track at start of trajectory",
"Physics","","G4ThreeVector");
"Physics","G4BestUnit","G4ThreeVector");
G4String IMag("IMag");
(*store)[IMag] = G4AttDef(IMag, "Magnitude of momentum of track at start of trajectory",
"Physics","","G4double");
(*store)[IMag] =
G4AttDef(IMag, "Magnitude of momentum of track at start of trajectory",
"Physics","G4BestUnit","G4double");
G4String NTP("NTP");
(*store)[NTP] = G4AttDef(NTP,"No. of points","Physics","","G4int");
(*store)[NTP] = G4AttDef(NTP,"No. of points","Bookkeeping","","G4int");
}
return store;
@@ -150,40 +156,34 @@ const std::map<G4String,G4AttDef>* G4Trajectory::GetAttDefs() const
std::vector<G4AttValue>* G4Trajectory::CreateAttValues() const
{
char c[100];
std::ostrstream s(c,100);
std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
s.seekp(std::ios::beg);
s << fTrackID << std::ends;
values->push_back(G4AttValue("ID",c,""));
values->push_back
(G4AttValue("ID",G4UIcommand::ConvertToString(fTrackID),""));
s.seekp(std::ios::beg);
s << fParentID << std::ends;
values->push_back(G4AttValue("PID",c,""));
values->push_back
(G4AttValue("PID",G4UIcommand::ConvertToString(fParentID),""));
values->push_back(G4AttValue("PN",ParticleName,""));
s.seekp(std::ios::beg);
s << PDGCharge << std::ends;
values->push_back(G4AttValue("Ch",c,""));
values->push_back
(G4AttValue("Ch",G4UIcommand::ConvertToString(PDGCharge),""));
s.seekp(std::ios::beg);
s << PDGEncoding << std::ends;
values->push_back(G4AttValue("PDG",c,""));
values->push_back
(G4AttValue("PDG",G4UIcommand::ConvertToString(PDGEncoding),""));
s.seekp(std::ios::beg);
s << G4BestUnit(initialMomentum,"Energy") << std::ends;
values->push_back(G4AttValue("IMom",c,""));
values->push_back
(G4AttValue("IMom",G4BestUnit(initialMomentum,"Energy"),""));
s.seekp(std::ios::beg);
s << initialMomentum.mag() << std::ends;
values->push_back(G4AttValue("IMag",c,""));
values->push_back
(G4AttValue("IMag",G4BestUnit(initialMomentum.mag(),"Energy"),""));
s.seekp(std::ios::beg);
s << GetPointEntries() << std::ends;
values->push_back(G4AttValue("NTP",c,""));
values->push_back
(G4AttValue("NTP",G4UIcommand::ConvertToString(GetPointEntries()),""));
#ifdef G4ATTDEBUG
G4cout << G4AttCheck(values,GetAttDefs());
#endif
return values;
}
+14 -10
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4TrajectoryPoint.cc,v 1.14 2004/06/11 14:30:20 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// $Id: G4TrajectoryPoint.cc,v 1.16 2005/05/03 17:48:51 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ---------------------------------------------------------------
@@ -37,7 +37,11 @@
#include "G4AttDef.hh"
#include "G4AttValue.hh"
#include "G4UnitsTable.hh"
#include <strstream>
//#define G4ATTDEBUG
#ifdef G4ATTDEBUG
#include "G4AttCheck.hh"
#endif
G4Allocator<G4TrajectoryPoint> aTrajectoryPointAllocator;
@@ -67,21 +71,21 @@ const std::map<G4String,G4AttDef>* G4TrajectoryPoint::GetAttDefs() const
= G4AttDefStore::GetInstance("G4TrajectoryPoint",isNew);
if (isNew) {
G4String Pos("Pos");
(*store)[Pos] = G4AttDef(Pos, "Position", "Physics","","G4ThreeVector");
(*store)[Pos] =
G4AttDef(Pos, "Position", "Physics","G4BestUnit","G4ThreeVector");
}
return store;
}
std::vector<G4AttValue>* G4TrajectoryPoint::CreateAttValues() const
{
char c[100];
std::ostrstream s(c,100);
std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
s.seekp(std::ios::beg);
s << G4BestUnit(fPosition,"Length") << std::ends;
values->push_back(G4AttValue("Pos",c,""));
values->push_back(G4AttValue("Pos",G4BestUnit(fPosition,"Length"),""));
#ifdef G4ATTDEBUG
G4cout << G4AttCheck(values,GetAttDefs());
#endif
return values;
}
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4UserSteppingAction.cc,v 1.6 2001/07/11 10:08:43 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ---------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4UserTrackingAction.cc,v 1.6 2001/07/11 10:08:43 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ---------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VSteppingVerbose.cc,v 1.10 2004/11/10 11:23:27 tsasaki Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
//---------------------------------------------------------------
+25 -53
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VTrajectory.cc,v 1.6 2004/12/07 09:16:54 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
// $Id: G4VTrajectory.cc,v 1.7 2005/05/03 17:48:51 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ---------------------------------------------------------------
@@ -42,6 +42,7 @@
#include "G4AttDefStore.hh"
#include "G4AttDef.hh"
#include "G4AttValue.hh"
#include "G4AttCheck.hh"
#include "G4VVisManager.hh"
#include "G4VisAttributes.hh"
#include "G4Polyline.hh"
@@ -63,16 +64,10 @@ void G4VTrajectory::ShowTrajectory(std::ostream& os) const
// depending on the nature of os.
std::vector<G4AttValue>* attValues = CreateAttValues();
if (!attValues) {
os << "G4VTrajectory::ShowTrajectory: no attribute values defined.";
return;
}
const std::map<G4String,G4AttDef>* attDefs = GetAttDefs();
if (!attDefs) {
os << "G4VTrajectory::ShowTrajectory:"
"\n ERROR: no attribute definitions for attribute values.";
// Ensure validity...
if (G4AttCheck(attValues,attDefs).Check("G4VTrajectory::ShowTrajectory")) {
return;
}
@@ -83,59 +78,36 @@ void G4VTrajectory::ShowTrajectory(std::ostream& os) const
iAttVal != attValues->end(); ++iAttVal) {
std::map<G4String,G4AttDef>::const_iterator iAttDef =
attDefs->find(iAttVal->GetName());
if (iAttDef == attDefs->end()) {
os << "G4VTrajectory::ShowTrajectory:"
"\n WARNING: no matching definition for attribute \""
<< iAttVal->GetName() << "\", value: "
<< iAttVal->GetValue();
}
else {
os << "\n " << iAttDef->second.GetDesc() << ": "
<< iAttVal->GetValue();
}
os << "\n " << iAttDef->second.GetDesc() << ": "
<< iAttVal->GetValue();
}
delete attValues; // AttValues must be deleted after use.
//Now do trajectory points...
for (G4int i = 0; i < GetPointEntries(); i++) {
G4VTrajectoryPoint* aTrajectoryPoint = GetPoint(i);
std::vector<G4AttValue>* attValues
= aTrajectoryPoint->CreateAttValues();
if (!attValues) {
os <<
"\nG4VTrajectory::ShowTrajectory: no attribute values"
" for trajectory point defined.";
const std::map<G4String,G4AttDef>* attDefs
= aTrajectoryPoint->GetAttDefs();
// Ensure validity...
if (G4AttCheck(attValues,attDefs).Check("G4VTrajectory::ShowTrajectory")) {
return;
}
else {
const std::map<G4String,G4AttDef>* attDefs
= aTrajectoryPoint->GetAttDefs();
if (!attDefs) {
os << "\nG4VTrajectory::ShowTrajectory:"
"\n ERROR: no attribute definitions for attribute values"
" for trajectory point defined.";
}
else {
std::vector<G4AttValue>::iterator iAttVal;
for (iAttVal = attValues->begin();
iAttVal != attValues->end(); ++iAttVal) {
std::map<G4String,G4AttDef>::const_iterator iAttDef =
attDefs->find(iAttVal->GetName());
if (iAttDef == attDefs->end()) {
os << "\nG4VTrajectory::ShowTrajectory:"
"\n WARNING: no matching definition for trajectory"
" point attribute \""
<< iAttVal->GetName() << "\", value: "
<< iAttVal->GetValue();
}
else {
os << "\n " << iAttDef->second.GetDesc() << ": "
<< iAttVal->GetValue();
}
}
}
delete attValues; // AttValues must be deleted after use.
std::vector<G4AttValue>::iterator iAttVal;
for (iAttVal = attValues->begin();
iAttVal != attValues->end(); ++iAttVal) {
std::map<G4String,G4AttDef>::const_iterator iAttDef =
attDefs->find(iAttVal->GetName());
os << "\n " << iAttDef->second.GetDesc() << ": "
<< iAttVal->GetValue();
}
delete attValues; // AttValues must be deleted after use.
}
}
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VTrajectoryPoint.cc,v 1.1 2004/07/05 17:08:16 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
//---------------------------------------------------------------