Import Geant4 5.2.0 source tree
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GeoNav.cc,v 1.1 2002/06/04 07:40:20 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// $Id: G4GeoNav.cc,v 1.2 2003/06/16 16:49:25 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -67,7 +67,7 @@ G4LogicalVolume * G4GeoNav::NextLV()
|
||||
|
||||
|
||||
G4int G4GeoNav::FilterLV(const G4String & aRegexStr,
|
||||
G4std::vector<G4LogicalVolume*> & result,
|
||||
std::vector<G4LogicalVolume*> & result,
|
||||
G4bool stopAtFirst)
|
||||
{
|
||||
regex_t aRegex;
|
||||
@@ -85,7 +85,7 @@ G4int G4GeoNav::FilterLV(const G4String & aRegexStr,
|
||||
|
||||
|
||||
void G4GeoNav::FindLV(regex_t * aRegex, LVTree::node_t * node,
|
||||
G4std::vector<G4LogicalVolume*>& result,
|
||||
std::vector<G4LogicalVolume*>& result,
|
||||
G4bool stopAtFirst)
|
||||
{
|
||||
if( !regexec(aRegex, node->data()->GetName().data(), 0,0,0))
|
||||
@@ -106,7 +106,7 @@ void G4GeoNav::FindLV(regex_t * aRegex, LVTree::node_t * node,
|
||||
|
||||
}
|
||||
|
||||
G4int G4GeoNav::PathLV(G4std::vector<G4LogicalVolume*> & result)
|
||||
G4int G4GeoNav::PathLV(std::vector<G4LogicalVolume*> & result)
|
||||
{
|
||||
result.push_back(theCurLV->data());
|
||||
G4int level=1;
|
||||
@@ -123,7 +123,7 @@ G4int G4GeoNav::PathLV(G4std::vector<G4LogicalVolume*> & result)
|
||||
|
||||
|
||||
G4int G4GeoNav::Tokenize(const G4String & aStr,
|
||||
G4std::vector<G4String>& tokens)
|
||||
std::vector<G4String>& tokens)
|
||||
{
|
||||
G4String::size_type c = aStr.size();
|
||||
G4String::size_type idx = 0;
|
||||
@@ -137,7 +137,7 @@ G4int G4GeoNav::Tokenize(const G4String & aStr,
|
||||
}
|
||||
|
||||
// scan for '/'
|
||||
G4std::vector<G4int> pos;
|
||||
std::vector<G4int> pos;
|
||||
pos.push_back(0); // begin of input
|
||||
G4String sep("/");
|
||||
|
||||
@@ -188,14 +188,14 @@ G4int G4GeoNav::Tokenize(const G4String & aStr,
|
||||
|
||||
G4LogicalVolume * G4GeoNav::ChangeLV(const G4String & aRegExp)
|
||||
{
|
||||
G4std::vector<G4String> tokens;
|
||||
std::vector<G4String> tokens;
|
||||
G4int c = Tokenize(aRegExp,tokens);
|
||||
|
||||
LVTree::node_t * anItem = theCurLV;
|
||||
LVTree::node_t * anItemBefore = theCurLV;
|
||||
if (c) {
|
||||
|
||||
G4std::vector<G4String>::iterator it = tokens.begin();
|
||||
std::vector<G4String>::iterator it = tokens.begin();
|
||||
if (*it==G4String("/"))
|
||||
{ // absolute or relative
|
||||
anItem = theRootLV;
|
||||
@@ -270,7 +270,7 @@ G4LogicalVolume * G4GeoNav::ChangeLV(const G4String & aRegExp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
G4int G4GeoNav::PwdLV(G4std::vector<G4LogicalVolume *>& result)
|
||||
G4int G4GeoNav::PwdLV(std::vector<G4LogicalVolume *>& result)
|
||||
{
|
||||
result.push_back(theCurLV->data());
|
||||
LVTree::node_t * temp = theCurLV;
|
||||
@@ -287,14 +287,14 @@ void G4GeoNav::RecursiveFill(LVTree::node_t* node)
|
||||
{
|
||||
G4LogicalVolume * lv = node->data();
|
||||
|
||||
G4std::set<G4LogicalVolume*> lvset;
|
||||
std::set<G4LogicalVolume*> lvset;
|
||||
|
||||
for ( G4int i=0; i<lv->GetNoDaughters(); ++i)
|
||||
{
|
||||
lvset.insert(lv->GetDaughter(i)->GetLogicalVolume());
|
||||
}
|
||||
|
||||
G4std::set<G4LogicalVolume*>::iterator it = lvset.begin();
|
||||
std::set<G4LogicalVolume*>::iterator it = lvset.begin();
|
||||
for(;it!=lvset.end();++it)
|
||||
{
|
||||
LVTree::node_t * newnode = new LVTree::node_t(node, *it);
|
||||
@@ -304,7 +304,7 @@ void G4GeoNav::RecursiveFill(LVTree::node_t* node)
|
||||
|
||||
}
|
||||
|
||||
G4int G4GeoNav::LsLV(G4std::vector<G4LogicalVolume *>& result)
|
||||
G4int G4GeoNav::LsLV(std::vector<G4LogicalVolume *>& result)
|
||||
{
|
||||
G4int c=0;
|
||||
LVTree::node_t * n = theCurLV->firstChild();
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: OlapDetConstr.cc,v 1.1 2002/06/04 07:40:20 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// $Id: OlapDetConstr.cc,v 1.2 2003/06/12 12:24:32 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -602,7 +602,7 @@ void OlapDetConstr::ColorFirstLevel()
|
||||
|
||||
|
||||
// sets NewWorld invisible
|
||||
void OlapDetConstr::ResetColors(G4LogicalVolume* lv)
|
||||
void OlapDetConstr::ResetColors(G4LogicalVolume*)
|
||||
{
|
||||
/*
|
||||
G4ColorMap * aColMap = G4ColorMap::GetColorMap();
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: OlapEventAction.cc,v 1.1 2002/06/04 07:40:21 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// $Id: OlapEventAction.cc,v 1.3 2003/06/16 16:49:26 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -32,8 +32,9 @@
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "g4std/vector"
|
||||
#include "g4std/strstream"
|
||||
#include "globals.hh"
|
||||
#include <vector>
|
||||
#include <strstream>
|
||||
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4Trajectory.hh"
|
||||
@@ -52,8 +53,8 @@
|
||||
//#define OLAP_DEBUG
|
||||
//#define OLAP_DEBUG_2
|
||||
|
||||
G4std::ostream &
|
||||
operator<<(G4std::ostream& flux, OlapInfo & oi)
|
||||
std::ostream &
|
||||
operator<<(std::ostream& flux, OlapInfo & oi)
|
||||
{
|
||||
OlapStepInfo si;
|
||||
si.thePoint = oi.v1;
|
||||
@@ -145,11 +146,8 @@ OlapEventAction::~OlapEventAction()
|
||||
}
|
||||
|
||||
|
||||
void OlapEventAction::BeginOfEventAction(const G4Event* anEvent)
|
||||
void OlapEventAction::BeginOfEventAction(const G4Event*)
|
||||
{
|
||||
// G4cout << ">>>evt=" << anEvent->GetEventID() << " run=" <<
|
||||
// anEvent->G4endl;
|
||||
|
||||
while (!ABSteps.empty())
|
||||
{
|
||||
if (! dontDelete )
|
||||
@@ -274,7 +272,7 @@ void OlapEventAction::EndOfEventAction(const G4Event* anEvent)
|
||||
oi->probNot = true; // probably not an overlap, just numerics ....
|
||||
dontDelete = true;
|
||||
|
||||
G4std::ostrstream os;
|
||||
std::ostrstream os;
|
||||
os << "A,B diff. steps AB:" << ABSteps.size()
|
||||
<< " BA:" << BASteps.size() << '\0';
|
||||
|
||||
@@ -332,7 +330,7 @@ void OlapEventAction::EndOfEventAction(const G4Event* anEvent)
|
||||
|
||||
G4bool OlapEventAction::InsertOI(OlapInfo * oi)
|
||||
{
|
||||
G4std::vector<OlapInfo*>::iterator it = theRunAction->theOlaps.begin();
|
||||
std::vector<OlapInfo*>::iterator it = theRunAction->theOlaps.begin();
|
||||
G4bool flag(false);
|
||||
while (it != theRunAction->theOlaps.end())
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: OlapGenerator.cc,v 1.2 2002/06/04 09:23:44 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: OlapLogManager.cc,v 1.1 2002/06/04 07:40:21 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// $Id: OlapLogManager.cc,v 1.2 2003/06/16 16:49:27 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "OlapLogManager.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "g4std/fstream"
|
||||
#include <fstream>
|
||||
|
||||
OlapLogManager * OlapLogManager::theInstance = 0;
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: OlapManager.cc,v 1.1 2002/06/04 07:40:21 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// $Id: OlapManager.cc,v 1.2 2003/06/16 16:49:28 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -34,7 +34,7 @@
|
||||
//
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "g4std/vector"
|
||||
#include <vector>
|
||||
|
||||
#include "OlapManager.hh"
|
||||
#include "OlapDetConstr.hh"
|
||||
@@ -55,7 +55,7 @@ OlapManager::OlapManager() :
|
||||
theMessenger = new OlapManagerMessenger(this);
|
||||
theLVStore = G4LogicalVolumeStore::GetInstance();
|
||||
// for SUN
|
||||
//G4std::vector<G4LogicalVolume*>::iterator aIt = theLVStore->begin();
|
||||
//std::vector<G4LogicalVolume*>::iterator aIt = theLVStore->begin();
|
||||
//G4LogicalVolumeStore::iterator aIt = theLVStore->begin();
|
||||
|
||||
theRunManager = G4RunManager::GetRunManager();
|
||||
@@ -76,7 +76,7 @@ OlapManager::OlapManager() :
|
||||
// instantiate the logical volume tree & add it to the Gui
|
||||
theGeoNav = new G4GeoNav(theDet->GetFullWorld()->GetLogicalVolume());
|
||||
|
||||
G4std::vector<G4LogicalVolume*>::iterator aIt2;
|
||||
std::vector<G4LogicalVolume*>::iterator aIt2;
|
||||
for (aIt2=theLVStore->begin(); aIt2 != theLVStore->end(); aIt2++)
|
||||
NoOlapMap[*aIt2] = false;
|
||||
}
|
||||
@@ -245,7 +245,7 @@ void OlapManager::ListLV(const G4String & aRegexStr)
|
||||
{
|
||||
G4cout << "logical volumes matching " << aRegexStr << ":" <<G4endl;
|
||||
|
||||
G4std::vector<G4LogicalVolume *> aLVVec;
|
||||
std::vector<G4LogicalVolume *> aLVVec;
|
||||
G4int c = theGeoNav->FilterLV(aRegexStr,aLVVec);
|
||||
|
||||
for(G4int i=0; i<c; i++)
|
||||
@@ -257,7 +257,7 @@ void OlapManager::ListLV(const G4String & aRegexStr)
|
||||
|
||||
void OlapManager::LsLV()
|
||||
{
|
||||
G4std::vector<G4LogicalVolume *> lvs;
|
||||
std::vector<G4LogicalVolume *> lvs;
|
||||
G4int c = theGeoNav->LsLV(lvs);
|
||||
for (G4int i = 0; i<c; i++)
|
||||
G4cout << " " << (lvs[i])->GetName() << G4endl;
|
||||
@@ -265,7 +265,7 @@ void OlapManager::LsLV()
|
||||
|
||||
void OlapManager::PwdLV()
|
||||
{
|
||||
G4std::vector<G4LogicalVolume *> lvs;
|
||||
std::vector<G4LogicalVolume *> lvs;
|
||||
theGeoNav->PwdLV(lvs);
|
||||
G4String temp;
|
||||
G4cout << "/ = ";
|
||||
@@ -296,7 +296,7 @@ void OlapManager::ChangeLV(const G4String & aDir)
|
||||
|
||||
void OlapManager::GotoLV(const G4String & aRegexStr)
|
||||
{
|
||||
G4std::vector<G4LogicalVolume*> lvs;
|
||||
std::vector<G4LogicalVolume*> lvs;
|
||||
if (theGeoNav->FilterLV(aRegexStr,lvs,true))
|
||||
{
|
||||
G4cout << "new world: " << (lvs[0])->GetName() << G4endl;
|
||||
@@ -343,15 +343,15 @@ void OlapManager::SetGrid(G4int x, G4int y, G4int z)
|
||||
void OlapManager::notifyNewWorld(G4LogicalVolume* nw)
|
||||
{
|
||||
//G4cout << G4endl << "NewWorld-Notif: " << nw->GetName() << G4endl;
|
||||
G4std::set<OlapNotify*>::iterator i = theNotifs.begin();
|
||||
std::set<OlapNotify*>::iterator i = theNotifs.begin();
|
||||
for(;i!=theNotifs.end();++i)
|
||||
(*i)->worldChanged(nw);
|
||||
}
|
||||
|
||||
|
||||
void OlapManager::notifyOlaps(const G4std::vector<OlapInfo*> & ov)
|
||||
void OlapManager::notifyOlaps(const std::vector<OlapInfo*> & ov)
|
||||
{
|
||||
G4std::set<OlapNotify*>::iterator i = theNotifs.begin();
|
||||
std::set<OlapNotify*>::iterator i = theNotifs.begin();
|
||||
for(;i!=theNotifs.end();++i)
|
||||
(*i)->overlaps(ov);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: OlapManagerMessenger.cc,v 1.2 2002/12/05 01:07:00 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: OlapNotify.cc,v 1.1 2002/06/04 07:40:22 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: OlapPhysicsList.cc,v 1.1 2002/06/04 07:40:22 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: OlapRunAction.cc,v 1.2 2002/06/04 09:23:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// $Id: OlapRunAction.cc,v 1.4 2003/06/16 16:49:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "G4Run.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "g4std/fstream"
|
||||
#include <fstream>
|
||||
|
||||
OlapRunAction::OlapRunAction()
|
||||
{
|
||||
@@ -53,7 +53,7 @@ OlapRunAction::~OlapRunAction()
|
||||
}
|
||||
|
||||
|
||||
void OlapRunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
void OlapRunAction::BeginOfRunAction(const G4Run*)
|
||||
{
|
||||
while ( !theOlaps.empty() )
|
||||
{
|
||||
@@ -74,7 +74,7 @@ void OlapRunAction::EndOfRunAction(const G4Run* aRun)
|
||||
|
||||
OlapManager::GetOlapManager()->notifyOlaps(theOlaps);
|
||||
|
||||
G4std::vector<OlapInfo*>::iterator it = theOlaps.begin();
|
||||
std::vector<OlapInfo*>::iterator it = theOlaps.begin();
|
||||
G4int i=1;
|
||||
while (it!=theOlaps.end())
|
||||
{
|
||||
@@ -110,7 +110,7 @@ void OlapRunAction::EndOfRunAction(const G4Run* aRun)
|
||||
fname = logManager->logPath + volume + ".log";
|
||||
}
|
||||
|
||||
FILE.open(fname, G4std::ios::app);
|
||||
FILE.open(fname, std::ios::app);
|
||||
FILE << "===== collected overlaps of run [" << aRun->GetRunID() << "] "
|
||||
<< "(ol=" << theOlaps.size() << ")"<< G4endl;
|
||||
|
||||
@@ -133,7 +133,7 @@ void OlapRunAction::EndOfRunAction(const G4Run* aRun)
|
||||
|
||||
}
|
||||
|
||||
#include "g4std/vector"
|
||||
#include <vector>
|
||||
#include "G4Circle.hh"
|
||||
#include "G4Polyline.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: OlapSteppingAction.cc,v 1.1 2002/06/04 07:40:23 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// $Id: OlapSteppingAction.cc,v 1.2 2003/06/16 16:49:30 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -43,10 +43,10 @@
|
||||
#include "G4VSolid.hh"
|
||||
#include "SolidAnalyser.hh"
|
||||
|
||||
G4std::ostream&
|
||||
operator << (G4std::ostream& os, G4std::vector<OlapStepInfo*>& vec)
|
||||
std::ostream&
|
||||
operator << (std::ostream& os, std::vector<OlapStepInfo*>& vec)
|
||||
{
|
||||
G4std::vector<OlapStepInfo*>::iterator it = vec.begin();
|
||||
std::vector<OlapStepInfo*>::iterator it = vec.begin();
|
||||
while (it!=vec.end())
|
||||
{
|
||||
G4VPhysicalVolume * pv = (*it)->theHist.GetTopVolume();
|
||||
@@ -57,8 +57,8 @@ operator << (G4std::ostream& os, G4std::vector<OlapStepInfo*>& vec)
|
||||
return os;
|
||||
}
|
||||
|
||||
G4std::ostream&
|
||||
operator << (G4std::ostream& os, const OlapStepInfo& aStepInfo)
|
||||
std::ostream&
|
||||
operator << (std::ostream& os, const OlapStepInfo& aStepInfo)
|
||||
{
|
||||
//G4cout << "History depth="<<aStepInfo.theHist.GetDepth()<< G4endl;
|
||||
for (G4int i=0;i<=aStepInfo.theHist.GetDepth();i++)
|
||||
@@ -66,7 +66,7 @@ operator << (G4std::ostream& os, const OlapStepInfo& aStepInfo)
|
||||
G4VSolid * solid =
|
||||
aStepInfo.theHist.GetVolume(i)->GetLogicalVolume()->GetSolid();
|
||||
SolidAnalyser * solAna = SolidAnalyser::GetSolidAnalyser();
|
||||
G4std::vector< G4std::pair<G4String,G4double> > param;
|
||||
std::vector< std::pair<G4String,G4double> > param;
|
||||
solAna->GetParam(solid,param);
|
||||
|
||||
os << "["<<i<<"]: " ;
|
||||
@@ -115,7 +115,7 @@ operator << (G4std::ostream& os, const OlapStepInfo& aStepInfo)
|
||||
// solid specification
|
||||
|
||||
os << " " << solid->GetEntityType() << ": ";
|
||||
G4std::vector< G4std::pair<G4String,G4double> >::iterator it =
|
||||
std::vector< std::pair<G4String,G4double> >::iterator it =
|
||||
param.begin();
|
||||
while ( it != param.end() )
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: OlapVisManager.cc,v 1.1 2002/06/04 07:40:23 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: RandomDetector.cc,v 1.2 2003/02/19 07:59:09 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: SolidAnalyser.cc,v 1.2 2002/06/04 09:23:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// $Id: SolidAnalyser.cc,v 1.3 2003/06/16 16:49:31 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -34,7 +34,7 @@
|
||||
//
|
||||
#include "SolidAnalyser.hh"
|
||||
|
||||
#include "g4std/strstream"
|
||||
#include <strstream>
|
||||
|
||||
#include "G4Box.hh"
|
||||
#include "G4Cons.hh"
|
||||
@@ -67,7 +67,7 @@ SolidAnalyser * SolidAnalyser::GetSolidAnalyser()
|
||||
|
||||
|
||||
G4int SolidAnalyser::GetParam(const G4VSolid * s,
|
||||
G4std::vector<G4std::pair<G4String,G4double> > & result ) const
|
||||
std::vector<std::pair<G4String,G4double> > & result ) const
|
||||
{
|
||||
const G4Box * box = dynamic_cast<const G4Box*>(s);
|
||||
if ( box ) return GetParam(box,result);
|
||||
@@ -95,146 +95,146 @@ G4int SolidAnalyser::GetParam(const G4VSolid * s,
|
||||
|
||||
// default parameters for not implemented solids
|
||||
G4int SolidAnalyser::NotImplemented(const G4VSolid * s,
|
||||
G4std::vector<G4std::pair<G4String,G4double> > & result) const
|
||||
std::vector<std::pair<G4String,G4double> > & result) const
|
||||
{
|
||||
G4String temp = s->GetEntityType() + G4String(": not impl.");
|
||||
result.push_back(G4std::make_pair(temp,-1.0));
|
||||
result.push_back(std::make_pair(temp,-1.0));
|
||||
return -1;
|
||||
}
|
||||
|
||||
// G4Box
|
||||
G4int SolidAnalyser::GetParam(const G4Box * s,
|
||||
G4std::vector<G4std::pair<G4String,G4double> > & result) const
|
||||
std::vector<std::pair<G4String,G4double> > & result) const
|
||||
{
|
||||
result.push_back(G4std::make_pair(G4String("x/2"), s->GetXHalfLength()));
|
||||
result.push_back(G4std::make_pair(G4String("y/2"), s->GetYHalfLength()));
|
||||
result.push_back(G4std::make_pair(G4String("z/2"), s->GetZHalfLength()));
|
||||
result.push_back(std::make_pair(G4String("x/2"), s->GetXHalfLength()));
|
||||
result.push_back(std::make_pair(G4String("y/2"), s->GetYHalfLength()));
|
||||
result.push_back(std::make_pair(G4String("z/2"), s->GetZHalfLength()));
|
||||
return 3;
|
||||
}
|
||||
|
||||
// G4Cons
|
||||
G4int SolidAnalyser::GetParam(const G4Cons * s,
|
||||
G4std::vector<G4std::pair<G4String,G4double> > & result) const
|
||||
std::vector<std::pair<G4String,G4double> > & result) const
|
||||
{
|
||||
result.push_back(G4std::make_pair(G4String("z/2"),
|
||||
result.push_back(std::make_pair(G4String("z/2"),
|
||||
s->GetZHalfLength()));
|
||||
result.push_back(G4std::make_pair(G4String("rInZ-"),
|
||||
result.push_back(std::make_pair(G4String("rInZ-"),
|
||||
s->GetInnerRadiusMinusZ()));
|
||||
result.push_back(G4std::make_pair(G4String("rInZ+"),
|
||||
result.push_back(std::make_pair(G4String("rInZ+"),
|
||||
s->GetInnerRadiusPlusZ()));
|
||||
result.push_back(G4std::make_pair(G4String("rOutZ-"),
|
||||
result.push_back(std::make_pair(G4String("rOutZ-"),
|
||||
s->GetOuterRadiusMinusZ()));
|
||||
result.push_back(G4std::make_pair(G4String("rOutZ+"),
|
||||
result.push_back(std::make_pair(G4String("rOutZ+"),
|
||||
s->GetOuterRadiusPlusZ()));
|
||||
result.push_back(G4std::make_pair(G4String("startPhi"),
|
||||
result.push_back(std::make_pair(G4String("startPhi"),
|
||||
s->GetStartPhiAngle()));
|
||||
result.push_back(G4std::make_pair(G4String("deltaPhi"),
|
||||
result.push_back(std::make_pair(G4String("deltaPhi"),
|
||||
s->GetDeltaPhiAngle()));
|
||||
return 7;
|
||||
}
|
||||
|
||||
// G4Polycone
|
||||
G4int SolidAnalyser::GetParam(const G4Polycone * s,
|
||||
G4std::vector<G4std::pair<G4String,G4double> > & result) const
|
||||
std::vector<std::pair<G4String,G4double> > & result) const
|
||||
{
|
||||
result.push_back(G4std::make_pair(G4String("startPhi"), s->GetStartPhi()));
|
||||
result.push_back(G4std::make_pair(G4String("endPhi"), s->GetEndPhi()));
|
||||
result.push_back(std::make_pair(G4String("startPhi"), s->GetStartPhi()));
|
||||
result.push_back(std::make_pair(G4String("endPhi"), s->GetEndPhi()));
|
||||
|
||||
G4int nr = s->GetNumRZCorner();
|
||||
G4String temp("nrRZ");
|
||||
result.push_back(G4std::make_pair(temp, G4double(nr)));
|
||||
result.push_back(std::make_pair(temp, G4double(nr)));
|
||||
for (G4int i=0; i<nr; i++)
|
||||
{
|
||||
G4std::ostrstream sstr_r, sstr_z;
|
||||
std::ostrstream sstr_r, sstr_z;
|
||||
G4PolyconeSideRZ sideRz = s->GetCorner(i);
|
||||
sstr_z << "z_" << i << '\0';
|
||||
sstr_r << "r_" << i << '\0';
|
||||
G4String z_str(sstr_z.str());
|
||||
G4String r_str(sstr_r.str());
|
||||
result.push_back(G4std::make_pair(z_str, sideRz.z));
|
||||
result.push_back(G4std::make_pair(r_str, sideRz.r));
|
||||
result.push_back(std::make_pair(z_str, sideRz.z));
|
||||
result.push_back(std::make_pair(r_str, sideRz.r));
|
||||
}
|
||||
return 3 + 2*nr;
|
||||
}
|
||||
|
||||
// G4Polyhedra
|
||||
G4int SolidAnalyser::GetParam(const G4Polyhedra * s,
|
||||
G4std::vector<G4std::pair<G4String,G4double> > & result) const
|
||||
std::vector<std::pair<G4String,G4double> > & result) const
|
||||
{
|
||||
result.push_back(G4std::make_pair(G4String("startPhi"), s->GetStartPhi()));
|
||||
result.push_back(G4std::make_pair(G4String("endPhi"), s->GetEndPhi()));
|
||||
result.push_back(G4std::make_pair(G4String("nrSide"),
|
||||
result.push_back(std::make_pair(G4String("startPhi"), s->GetStartPhi()));
|
||||
result.push_back(std::make_pair(G4String("endPhi"), s->GetEndPhi()));
|
||||
result.push_back(std::make_pair(G4String("nrSide"),
|
||||
G4double(s->GetNumSide())));
|
||||
|
||||
G4int nr = s->GetNumRZCorner();
|
||||
|
||||
result.push_back(G4std::make_pair(G4String("nrRZ"), G4double(nr)));
|
||||
result.push_back(std::make_pair(G4String("nrRZ"), G4double(nr)));
|
||||
|
||||
for (G4int i=0; i<nr; i++)
|
||||
{
|
||||
G4std::ostrstream sstr_r, sstr_z;
|
||||
std::ostrstream sstr_r, sstr_z;
|
||||
G4PolyhedraSideRZ sideRz = s->GetCorner(i);
|
||||
sstr_z << "z_" << i << '\0';
|
||||
sstr_r << "r_" << i << '\0';
|
||||
G4String z_str(sstr_z.str());
|
||||
G4String r_str(sstr_r.str());
|
||||
result.push_back(G4std::make_pair(z_str, sideRz.z));
|
||||
result.push_back(G4std::make_pair(r_str, sideRz.r));
|
||||
result.push_back(std::make_pair(z_str, sideRz.z));
|
||||
result.push_back(std::make_pair(r_str, sideRz.r));
|
||||
}
|
||||
return 4 + 2*nr;
|
||||
}
|
||||
|
||||
// G4Trap
|
||||
G4int SolidAnalyser::GetParam(const G4Trap * s,
|
||||
G4std::vector<G4std::pair<G4String,G4double> > & result) const
|
||||
std::vector<std::pair<G4String,G4double> > & result) const
|
||||
{
|
||||
result.push_back(G4std::make_pair(G4String("z/2"), s->GetZHalfLength()));
|
||||
result.push_back(std::make_pair(G4String("z/2"), s->GetZHalfLength()));
|
||||
|
||||
result.push_back(G4std::make_pair(G4String("x/2_1"), s->GetXHalfLength1()));
|
||||
result.push_back(G4std::make_pair(G4String("x/2_2"), s->GetXHalfLength2()));
|
||||
result.push_back(G4std::make_pair(G4String("y/2_1"), s->GetYHalfLength1()));
|
||||
result.push_back(G4std::make_pair(G4String("tanAlpha_1"),s->GetTanAlpha1()));
|
||||
result.push_back(std::make_pair(G4String("x/2_1"), s->GetXHalfLength1()));
|
||||
result.push_back(std::make_pair(G4String("x/2_2"), s->GetXHalfLength2()));
|
||||
result.push_back(std::make_pair(G4String("y/2_1"), s->GetYHalfLength1()));
|
||||
result.push_back(std::make_pair(G4String("tanAlpha_1"),s->GetTanAlpha1()));
|
||||
|
||||
result.push_back(G4std::make_pair(G4String("x/2_3"), s->GetXHalfLength3()));
|
||||
result.push_back(G4std::make_pair(G4String("x/2_4"), s->GetXHalfLength4()));
|
||||
result.push_back(G4std::make_pair(G4String("y/2_2"), s->GetYHalfLength2()));
|
||||
result.push_back(G4std::make_pair(G4String("tanAlpha_2"),s->GetTanAlpha2()));
|
||||
result.push_back(std::make_pair(G4String("x/2_3"), s->GetXHalfLength3()));
|
||||
result.push_back(std::make_pair(G4String("x/2_4"), s->GetXHalfLength4()));
|
||||
result.push_back(std::make_pair(G4String("y/2_2"), s->GetYHalfLength2()));
|
||||
result.push_back(std::make_pair(G4String("tanAlpha_2"),s->GetTanAlpha2()));
|
||||
|
||||
return 9;
|
||||
}
|
||||
|
||||
// G4Trd
|
||||
G4int SolidAnalyser::GetParam(const G4Trd * s,
|
||||
G4std::vector<G4std::pair<G4String,G4double> > & result) const
|
||||
std::vector<std::pair<G4String,G4double> > & result) const
|
||||
{
|
||||
result.push_back(G4std::make_pair(G4String("z/2"), s->GetZHalfLength()));
|
||||
result.push_back(std::make_pair(G4String("z/2"), s->GetZHalfLength()));
|
||||
|
||||
result.push_back(G4std::make_pair(G4String("x/2_1"), s->GetXHalfLength1()));
|
||||
result.push_back(G4std::make_pair(G4String("x/2_2"), s->GetXHalfLength2()));
|
||||
result.push_back(G4std::make_pair(G4String("y/2_1"), s->GetYHalfLength1()));
|
||||
result.push_back(G4std::make_pair(G4String("y/2_2"), s->GetYHalfLength2()));
|
||||
result.push_back(std::make_pair(G4String("x/2_1"), s->GetXHalfLength1()));
|
||||
result.push_back(std::make_pair(G4String("x/2_2"), s->GetXHalfLength2()));
|
||||
result.push_back(std::make_pair(G4String("y/2_1"), s->GetYHalfLength1()));
|
||||
result.push_back(std::make_pair(G4String("y/2_2"), s->GetYHalfLength2()));
|
||||
return 5;
|
||||
}
|
||||
|
||||
// G4Tubs
|
||||
G4int SolidAnalyser::GetParam(const G4Tubs * s,
|
||||
G4std::vector<G4std::pair<G4String,G4double> > & result) const
|
||||
std::vector<std::pair<G4String,G4double> > & result) const
|
||||
{
|
||||
result.push_back(G4std::make_pair(G4String("z/2"), s->GetZHalfLength()));
|
||||
result.push_back(G4std::make_pair(G4String("rIn"), s->GetInnerRadius()));
|
||||
result.push_back(G4std::make_pair(G4String("rOut"), s->GetOuterRadius()));
|
||||
result.push_back(G4std::make_pair(G4String("startPhi"),
|
||||
result.push_back(std::make_pair(G4String("z/2"), s->GetZHalfLength()));
|
||||
result.push_back(std::make_pair(G4String("rIn"), s->GetInnerRadius()));
|
||||
result.push_back(std::make_pair(G4String("rOut"), s->GetOuterRadius()));
|
||||
result.push_back(std::make_pair(G4String("startPhi"),
|
||||
s->GetStartPhiAngle()));
|
||||
result.push_back(G4std::make_pair(G4String("deltaPhi"),
|
||||
result.push_back(std::make_pair(G4String("deltaPhi"),
|
||||
s->GetDeltaPhiAngle()));
|
||||
|
||||
return 5;
|
||||
}
|
||||
|
||||
G4std::ostream & operator<<(G4std::ostream& flux,
|
||||
G4std::vector<G4std::pair<G4String,G4double> > & v)
|
||||
std::ostream & operator<<(std::ostream& flux,
|
||||
std::vector<std::pair<G4String,G4double> > & v)
|
||||
{
|
||||
G4std::vector<G4std::pair<G4String,G4double> >::iterator it = v.begin();
|
||||
std::vector<std::pair<G4String,G4double> >::iterator it = v.begin();
|
||||
while ( it != v.end() )
|
||||
{
|
||||
flux << (*it).first << '=' << (*it).second << "<br/>" << G4endl;
|
||||
|
||||
Reference in New Issue
Block a user