Import Geant4 9.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:16:48 +02:00
parent 75c7fd177d
commit a8e9364cea
6592 changed files with 84274 additions and 69292 deletions
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4AttFilterUtils.cc,v 1.4 2006/12/13 15:50:06 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
// Visualisation attribute filter utility functions.
//
@@ -25,7 +25,7 @@
//
//
// $Id: G4AxesModel.cc,v 1.6 2006/06/29 21:32:38 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// John Allison 3rd April 2001
@@ -25,7 +25,7 @@
//
//
// $Id: G4BoundingSphereScene.cc,v 1.11 2006/06/29 21:32:40 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// John Allison 7th June 1997
@@ -25,7 +25,7 @@
//
//
// $Id: G4FlavoredParallelWorldModel.cc,v 1.7 2006/06/29 21:32:42 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
// P. Mora de Freitas et M.Verderi - 19 June 1998.
// Model for flavored parallel world volumes.
@@ -24,7 +24,7 @@
// ********************************************************************
//
/// $Id: G4HitFilterFactories.cc,v 1.1 2006/09/12 18:53:03 tinslay Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// Trajectory filter model factories creating filters
@@ -25,7 +25,7 @@
//
//
// $Id: G4HitsModel.cc,v 1.18 2006/11/14 14:42:08 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// John Allison 26th August 1998.
@@ -25,7 +25,7 @@
//
//
// $Id: G4LogicalVolumeModel.cc,v 1.14 2006/11/01 10:28:42 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// John Allison 26th July 1999.
@@ -25,7 +25,7 @@
//
//
// $Id: G4ModelingParameters.cc,v 1.15 2006/11/14 14:42:08 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// John Allison 31st December 1997.
@@ -25,7 +25,7 @@
//
//
// $Id: G4NullModel.cc,v 1.9 2006/06/29 21:32:50 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// John Allison 4th April 1998.
@@ -25,7 +25,7 @@
//
//
// $Id: G4PhysicalVolumeMassScene.cc,v 1.7 2006/11/06 09:24:13 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// John Allison 10th August 1998.
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4PhysicalVolumeModel.cc,v 1.58 2007/01/05 16:07:02 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
// $Id: G4PhysicalVolumeModel.cc,v 1.62 2007/05/30 07:58:19 allison Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// John Allison 31st December 1997.
@@ -49,6 +49,7 @@
#include "G4AttDef.hh"
#include "G4AttValue.hh"
#include "G4UnitsTable.hh"
#include "G4Vector3D.hh"
#include <sstream>
@@ -94,6 +95,7 @@ G4PhysicalVolumeModel::G4PhysicalVolumeModel
fpCurrentPV (0),
fpCurrentLV (0),
fpCurrentMaterial (0),
fpCurrentTransform (0),
fCurtailDescent (false),
fpClippingPolyhedron (0),
fClippingMode (subtraction)
@@ -172,6 +174,7 @@ void G4PhysicalVolumeModel::DescribeYourselfTo
fpCurrentPV = 0;
fpCurrentLV = 0;
fpCurrentMaterial = 0;
fFullPVPath.clear();
fDrawnPVPath.clear();
}
@@ -357,6 +360,7 @@ void G4PhysicalVolumeModel::DescribeAndDescend
// not be accumulated.
G4Transform3D theNewAT (theAT);
if (fCurrentDepth != 0) theNewAT = theAT * theLT;
fpCurrentTransform = &theNewAT;
/********************************************************
G4cout << "G4PhysicalVolumeModel::DescribeAndDescend: "
@@ -421,6 +425,11 @@ void G4PhysicalVolumeModel::DescribeAndDescend
}
}
// Update full path of physical volumes...
G4int copyNo = fpCurrentPV->GetCopyNo();
fFullPVPath.push_back
(G4PhysicalVolumeNodeID(fpCurrentPV,copyNo,fCurrentDepth));
if (thisToBeDrawn) {
// Update path of drawn physical volumes...
@@ -519,7 +528,8 @@ void G4PhysicalVolumeModel::DescribeAndDescend
// Reset for normal descending of next volume at this level...
fCurtailDescent = false;
// Pop item from path of drawn physical volumes...
// Pop item from paths physical volumes...
fFullPVPath.pop_back();
if (thisToBeDrawn) {
fDrawnPVPath.pop_back();
}
@@ -671,20 +681,18 @@ const std::map<G4String,G4AttDef>* G4PhysicalVolumeModel::GetAttDefs() const
std::map<G4String,G4AttDef>* store
= G4AttDefStore::GetInstance("G4PhysicalVolumeModel", isNew);
if (isNew) {
(*store)["PVol"] =
G4AttDef("PVol","Physical Volume","Physics","","G4String");
(*store)["Copy"] =
G4AttDef("Copy","Physical Volume Copy No.","Physics","","G4int");
(*store)["PVPath"] =
G4AttDef("PVPath","Physical Volume Path","Physics","","G4String");
(*store)["LVol"] =
G4AttDef("LVol","Logical Volume","Physics","","G4String");
(*store)["Region"] =
G4AttDef("Region","Cuts Region","Physics","","G4String");
(*store)["RootRegion"] =
G4AttDef("RootRegion","Root Region (0/1 = false/true)","Physics","","G4bool");
(*store)["Solid"] =
G4AttDef("Solid","Solid Name","Physics","","G4String");
(*store)["EType"] =
G4AttDef("EType","Entity Type","Physics","","G4String");
(*store)["DmpSol"] =
G4AttDef("DmpSol","Dump of Solid properties","Physics","","G4String");
(*store)["Trans"] =
G4AttDef("Trans","Transformation of volume","Physics","","G4String");
(*store)["Material"] =
G4AttDef("Material","Material Name","Physics","","G4String");
(*store)["Density"] =
@@ -694,33 +702,85 @@ const std::map<G4String,G4AttDef>* G4PhysicalVolumeModel::GetAttDefs() const
(*store)["Radlen"] =
G4AttDef("Radlen","Material Radiation Length","Physics","G4BestUnit","G4double");
}
(*store)["Region"] =
G4AttDef("Region","Cuts Region","Physics","","G4String");
(*store)["RootRegion"] =
G4AttDef("RootRegion","Root Region (0/1 = false/true)","Physics","","G4bool");
return store;
}
#include <iomanip>
static std::ostream& operator<< (std::ostream& o, const G4Transform3D t)
{
using namespace std;
G4Scale3D s;
G4Rotate3D r;
G4Translate3D tl;
t.getDecomposition(s, r, tl);
const int w = 10;
// Transformation itself
o << setw(w) << t.xx() << setw(w) << t.xy() << setw(w) << t.xz() << setw(w) << t.dx() << endl;
o << setw(w) << t.yx() << setw(w) << t.yy() << setw(w) << t.yz() << setw(w) << t.dy() << endl;
o << setw(w) << t.zx() << setw(w) << t.zy() << setw(w) << t.zz() << setw(w) << t.dz() << endl;
// Translation
o << "= translation:" << endl;
o << setw(w) << tl.dx() << setw(w) << tl.dy() << setw(w) << tl.dz() << endl;
// Rotation
o << "* rotation:" << endl;
o << setw(w) << r.xx() << setw(w) << r.xy() << setw(w) << r.xz() << endl;
o << setw(w) << r.yx() << setw(w) << r.yy() << setw(w) << r.yz() << endl;
o << setw(w) << r.zx() << setw(w) << r.zy() << setw(w) << r.zz() << endl;
// Scale
o << "* scale:" << endl;
o << setw(w) << s.xx() << setw(w) << s.yy() << setw(w) << s.zz() << endl;
// Transformed axes
o << "Transformed axes:" << endl;
o << "x': " << r * G4Vector3D(1., 0., 0.) << endl;
o << "y': " << r * G4Vector3D(0., 1., 0.) << endl;
o << "z': " << r * G4Vector3D(0., 0., 1.) << endl;
return o;
}
std::vector<G4AttValue>* G4PhysicalVolumeModel::CreateCurrentAttValues() const
{
std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
std::ostringstream oss;
values->push_back(G4AttValue("PVol", fpCurrentPV->GetName(),""));
oss << fpCurrentPV->GetCopyNo();
values->push_back(G4AttValue("Copy", oss.str(),""));
values->push_back(G4AttValue("LVol", fpCurrentLV->GetName(),""));
G4Region* region = fpCurrentLV->GetRegion();
G4String regionName = region? region->GetName(): G4String("No region");
values->push_back(G4AttValue("Region", regionName,""));
oss.str(""); oss << fpCurrentLV->IsRootRegion();
values->push_back(G4AttValue("RootRegion", oss.str(),""));
G4VSolid* pSol = fpCurrentLV->GetSolid();
values->push_back(G4AttValue("Solid", pSol->GetName(),""));
values->push_back(G4AttValue("EType", pSol->GetEntityType(),""));
G4String matName = fpCurrentMaterial? fpCurrentMaterial->GetName(): G4String("No material");
values->push_back(G4AttValue("Material", matName,""));
G4double matDensity = fpCurrentMaterial? fpCurrentMaterial->GetDensity(): 0.;
values->push_back(G4AttValue("Density", G4BestUnit(matDensity,"Volumic Mass"),""));
G4State matState = fpCurrentMaterial? fpCurrentMaterial->GetState(): kStateUndefined;
oss.str(""); oss << matState;
values->push_back(G4AttValue("State", oss.str(),""));
G4double matRadlen = fpCurrentMaterial? fpCurrentMaterial->GetRadlen(): 0.;
values->push_back(G4AttValue("Radlen", G4BestUnit(matRadlen,"Length"),""));
return values;
std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
std::ostringstream oss;
for (size_t i = 0; i < fFullPVPath.size(); ++i) {
oss << fFullPVPath[i].GetPhysicalVolume()->GetName()
<< ':' << fFullPVPath[i].GetCopyNo();
if (i != fFullPVPath.size() - 1) oss << '/';
}
values->push_back(G4AttValue("PVPath", oss.str(),""));
values->push_back(G4AttValue("LVol", fpCurrentLV->GetName(),""));
G4VSolid* pSol = fpCurrentLV->GetSolid();
values->push_back(G4AttValue("Solid", pSol->GetName(),""));
values->push_back(G4AttValue("EType", pSol->GetEntityType(),""));
oss.str(""); oss << '\n' << *pSol;
values->push_back(G4AttValue("DmpSol", oss.str(),""));
oss.str(""); oss << '\n' << *fpCurrentTransform;
values->push_back(G4AttValue("Trans", oss.str(),""));
G4String matName = fpCurrentMaterial? fpCurrentMaterial->GetName(): G4String("No material");
values->push_back(G4AttValue("Material", matName,""));
G4double matDensity = fpCurrentMaterial? fpCurrentMaterial->GetDensity(): 0.;
values->push_back(G4AttValue("Density", G4BestUnit(matDensity,"Volumic Mass"),""));
G4State matState = fpCurrentMaterial? fpCurrentMaterial->GetState(): kStateUndefined;
oss.str(""); oss << matState;
values->push_back(G4AttValue("State", oss.str(),""));
G4double matRadlen = fpCurrentMaterial? fpCurrentMaterial->GetRadlen(): 0.;
values->push_back(G4AttValue("Radlen", G4BestUnit(matRadlen,"Length"),""));
G4Region* region = fpCurrentLV->GetRegion();
G4String regionName = region? region->GetName(): G4String("No region");
values->push_back(G4AttValue("Region", regionName,""));
oss.str(""); oss << fpCurrentLV->IsRootRegion();
values->push_back(G4AttValue("RootRegion", oss.str(),""));
return values;
}
@@ -25,7 +25,7 @@
//
//
// $Id: G4PhysicalVolumeSearchScene.cc,v 1.13 2006/11/05 20:38:08 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// John Allison 10th August 1998.
@@ -25,7 +25,7 @@
//
//
// $Id: G4ScaleModel.cc,v 1.4 2006/06/29 21:32:58 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// John Allison 21st July 2001.
@@ -25,7 +25,7 @@
//
//
// $Id: G4TextModel.cc,v 1.7 2006/06/29 21:33:00 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// John Allison 3rd April 2001
@@ -25,7 +25,7 @@
//
//
// $Id: G4TrajectoriesModel.cc,v 1.24 2006/11/14 14:42:08 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// John Allison 26th August 1998.
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4TrajectoryChargeFilter.cc,v 1.4 2006/08/25 19:44:14 tinslay Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
// Filter trajectories according to charge. Only registered
// charges will pass the filter.
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4TrajectoryDrawByAttribute.cc,v 1.3 2006/09/14 15:41:42 tinslay Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
// Jane Tinslay August 2006
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4TrajectoryDrawByCharge.cc,v 1.8 2006/06/29 21:33:06 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
#include "G4TrajectoryDrawByCharge.hh"
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4TrajectoryDrawByOriginVolume.cc,v 1.4 2006/06/29 21:33:08 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
// Jane Tinslay March 2006
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4TrajectoryDrawByParticleID.cc,v 1.8 2006/06/29 21:33:10 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryDrawerUtils.cc,v 1.10 2006/08/30 10:32:14 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4TrajectoryDrawerUtils.cc,v 1.11 2007/05/30 08:56:55 allison Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
@@ -356,6 +356,8 @@ namespace G4TrajectoryDrawerUtils {
myContext.SetAuxPtsSize(markerSize);
myContext.SetStepPtsSize(markerSize);
static G4bool warnedAboutIMode = false;
if (!warnedAboutIMode) {
G4cout<<"Trajectory drawing configuration will be based on imode value of "<<i_mode<<G4endl;
warnedAboutIMode = true;
@@ -24,7 +24,7 @@
// ********************************************************************
//
/// $Id: G4TrajectoryFilterFactories.cc,v 1.5 2006/09/12 18:53:03 tinslay Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// Trajectory filter model factories creating filters
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4TrajectoryGenericDrawer.cc,v 1.2 2006/06/29 21:33:16 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
// Jane Tinslay May 2006
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4TrajectoryModelFactories.cc,v 1.7 2006/09/12 18:53:03 tinslay Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
// Jane Tinslay, John Allison, Joseph Perl October 2005
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4TrajectoryOriginVolumeFilter.cc,v 1.3 2006/08/25 19:44:14 tinslay Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
// Filter trajectories according to volume name. Only registered
// volumes will pass the filter.
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4TrajectoryParticleFilter.cc,v 1.3 2006/08/25 19:44:14 tinslay Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
// Filter trajectories according to particle type. Only registered
// particle types will pass the filter.
@@ -25,7 +25,7 @@
//
//
// $Id: G4VModel.cc,v 1.14 2006/11/01 10:33:00 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// John Allison 31st December 1997.
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4VTrajectoryModel.cc,v 1.3 2006/06/29 21:33:26 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// GEANT4 tag $Name: geant4-09-00 $
//
// Jane Tinslay May 2006
//