Import Geant4 8.0.0 source tree
This commit is contained in:
@@ -0,0 +1,178 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RichTrajectory.cc,v 1.1 2005/11/24 12:47:36 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
//
|
||||
// G4RichTrajectory.cc
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments on G4Trajectory, on which this is based,
|
||||
// should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Makoto Asai (e-mail: asai@kekvax.kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
// and on the extended code to:
|
||||
// John Allison (e-mail: John.Allison@manchester.ac.uk)
|
||||
// Joseph Perl (e-mail: perl@slac.stanford.edu)
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
#include "G4RichTrajectory.hh"
|
||||
#include "G4RichTrajectoryPoint.hh"
|
||||
#include "G4AttDefStore.hh"
|
||||
#include "G4AttDef.hh"
|
||||
#include "G4AttValue.hh"
|
||||
#include "G4VProcess.hh"
|
||||
|
||||
//#define G4ATTDEBUG
|
||||
#ifdef G4ATTDEBUG
|
||||
#include "G4AttCheck.hh"
|
||||
#endif
|
||||
|
||||
G4Allocator<G4RichTrajectory> aRichTrajectoryAllocator;
|
||||
|
||||
G4RichTrajectory::G4RichTrajectory() {}
|
||||
|
||||
G4RichTrajectory::G4RichTrajectory(const G4Track* aTrack):
|
||||
G4Trajectory(aTrack) // Note: this initialises the base class data
|
||||
// members and, unfortunately but never mind,
|
||||
// creates a G4TrajectoryPoint in
|
||||
// TrajectoryPointContainer that we cannot
|
||||
// access because it's private. We store the
|
||||
// same information (plus more) in a
|
||||
// G4RichTrajectoryPoint in the
|
||||
// RichTrajectoryPointsContainer
|
||||
{
|
||||
fpInitialVolume = aTrack->GetVolume();
|
||||
fpInitialNextVolume = aTrack->GetNextVolume();
|
||||
fpCreatorProcess = aTrack->GetCreatorProcess();
|
||||
fpRichPointsContainer = new RichTrajectoryPointsContainer;
|
||||
// Insert the first rich trajectory point (see note above)...
|
||||
fpRichPointsContainer->push_back(new G4RichTrajectoryPoint(aTrack));
|
||||
}
|
||||
|
||||
G4RichTrajectory::G4RichTrajectory(G4RichTrajectory & right):
|
||||
G4Trajectory(right)
|
||||
{
|
||||
fpInitialVolume = right.fpInitialVolume;
|
||||
fpInitialNextVolume = right.fpInitialNextVolume;
|
||||
fpCreatorProcess = right.fpCreatorProcess;
|
||||
fpRichPointsContainer = new RichTrajectoryPointsContainer;
|
||||
for(size_t i=0;i<right.fpRichPointsContainer->size();i++)
|
||||
{
|
||||
G4RichTrajectoryPoint* rightPoint =
|
||||
(G4RichTrajectoryPoint*)((*(right.fpRichPointsContainer))[i]);
|
||||
fpRichPointsContainer->push_back(new G4RichTrajectoryPoint(*rightPoint));
|
||||
}
|
||||
}
|
||||
|
||||
G4RichTrajectory::~G4RichTrajectory()
|
||||
{
|
||||
// fpRichPointsContainer->clearAndDestroy();
|
||||
size_t i;
|
||||
for(i=0;i<fpRichPointsContainer->size();i++){
|
||||
delete (*fpRichPointsContainer)[i];
|
||||
}
|
||||
fpRichPointsContainer->clear();
|
||||
|
||||
delete fpRichPointsContainer;
|
||||
}
|
||||
|
||||
void G4RichTrajectory::AppendStep(const G4Step* aStep)
|
||||
{
|
||||
fpRichPointsContainer->push_back(new G4RichTrajectoryPoint(aStep));
|
||||
}
|
||||
|
||||
void G4RichTrajectory::MergeTrajectory(G4VTrajectory* secondTrajectory)
|
||||
{
|
||||
if(!secondTrajectory) return;
|
||||
|
||||
G4Trajectory::MergeTrajectory(secondTrajectory);
|
||||
|
||||
G4RichTrajectory* seco = (G4RichTrajectory*)secondTrajectory;
|
||||
G4int ent = seco->GetPointEntries();
|
||||
for(G4int i=1;i<ent;i++) {
|
||||
// initial point of the second trajectory should not be merged
|
||||
fpRichPointsContainer->push_back((*(seco->fpRichPointsContainer))[i]);
|
||||
// fpRichPointsContainer->push_back(seco->fpRichPointsContainer->removeAt(1));
|
||||
}
|
||||
delete (*seco->fpRichPointsContainer)[0];
|
||||
seco->fpRichPointsContainer->clear();
|
||||
}
|
||||
|
||||
const std::map<G4String,G4AttDef>* G4RichTrajectory::GetAttDefs() const
|
||||
{
|
||||
G4bool isNew;
|
||||
std::map<G4String,G4AttDef>* store
|
||||
= G4AttDefStore::GetInstance("G4RichTrajectory",isNew);
|
||||
if (isNew) {
|
||||
|
||||
*store = *(G4Trajectory::GetAttDefs());
|
||||
|
||||
G4String ID;
|
||||
|
||||
ID = "IVN";
|
||||
(*store)[ID] = G4AttDef(ID,"Initial Volume Name",
|
||||
"Bookkeeping","","G4String");
|
||||
|
||||
ID = "INVN";
|
||||
(*store)[ID] = G4AttDef(ID,"Initial Next Volume Name",
|
||||
"Bookkeeping","","G4String");
|
||||
|
||||
ID = "CPN";
|
||||
(*store)[ID] = G4AttDef(ID,"Creator Process Name",
|
||||
"Bookkeeping","","G4String");
|
||||
|
||||
ID = "CPTN";
|
||||
(*store)[ID] = G4AttDef(ID,"Creator Process Type Name",
|
||||
"Bookkeeping","","G4String");
|
||||
|
||||
}
|
||||
|
||||
return store;
|
||||
}
|
||||
|
||||
std::vector<G4AttValue>* G4RichTrajectory::CreateAttValues() const
|
||||
{
|
||||
std::vector<G4AttValue>* values = G4Trajectory::CreateAttValues();
|
||||
|
||||
values->push_back(G4AttValue("IVN",fpInitialVolume->GetName(),""));
|
||||
|
||||
values->push_back(G4AttValue("INVN",fpInitialNextVolume->GetName(),""));
|
||||
|
||||
if (fpCreatorProcess) {
|
||||
values->push_back(G4AttValue("CPN",fpCreatorProcess->GetProcessName(),""));
|
||||
G4ProcessType type = fpCreatorProcess->GetProcessType();
|
||||
values->push_back(G4AttValue("CPTN",G4VProcess::GetProcessTypeName(type),""));
|
||||
}
|
||||
|
||||
#ifdef G4ATTDEBUG
|
||||
G4cout << G4AttCheck(values,GetAttDefs());
|
||||
#endif
|
||||
|
||||
return values;
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RichTrajectoryPoint.cc,v 1.1 2005/11/24 12:47:36 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
//
|
||||
// G4RichTrajectoryPoint.cc
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments on G4TrajectoryPoint, on which this is based,
|
||||
// should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Makoto Asai (e-mail: asai@kekvax.kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
// and on the extended code to:
|
||||
// John Allison (e-mail: John.Allison@manchester.ac.uk)
|
||||
// Joseph Perl (e-mail: perl@slac.stanford.edu)
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
#include "G4RichTrajectoryPoint.hh"
|
||||
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4VProcess.hh"
|
||||
|
||||
#include "G4AttDefStore.hh"
|
||||
#include "G4AttDef.hh"
|
||||
#include "G4AttValue.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//#define G4ATTDEBUG
|
||||
#ifdef G4ATTDEBUG
|
||||
#include "G4AttCheck.hh"
|
||||
#endif
|
||||
|
||||
G4Allocator<G4RichTrajectoryPoint> aRichTrajectoryPointAllocator;
|
||||
|
||||
G4RichTrajectoryPoint::G4RichTrajectoryPoint():
|
||||
fTotEDep(0.),
|
||||
fpProcess(0)
|
||||
{}
|
||||
|
||||
G4RichTrajectoryPoint::G4RichTrajectoryPoint(const G4Track* aTrack):
|
||||
G4TrajectoryPoint(aTrack->GetPosition()),
|
||||
fTotEDep(0.),
|
||||
fpProcess(0)
|
||||
{}
|
||||
|
||||
G4RichTrajectoryPoint::G4RichTrajectoryPoint(const G4Step* aStep):
|
||||
G4TrajectoryPoint(aStep->GetPostStepPoint()->GetPosition()),
|
||||
fTotEDep(aStep->GetTotalEnergyDeposit()),
|
||||
fpProcess(aStep->GetPostStepPoint()->GetProcessDefinedStep())
|
||||
{}
|
||||
|
||||
G4RichTrajectoryPoint::G4RichTrajectoryPoint
|
||||
(const G4RichTrajectoryPoint &right):
|
||||
G4TrajectoryPoint(right)
|
||||
{}
|
||||
|
||||
G4RichTrajectoryPoint::~G4RichTrajectoryPoint()
|
||||
{}
|
||||
|
||||
const std::map<G4String,G4AttDef>*
|
||||
G4RichTrajectoryPoint::GetAttDefs() const
|
||||
{
|
||||
G4bool isNew;
|
||||
std::map<G4String,G4AttDef>* store
|
||||
= G4AttDefStore::GetInstance("G4RichTrajectoryPoint",isNew);
|
||||
if (isNew) {
|
||||
*store = *(G4TrajectoryPoint::GetAttDefs());
|
||||
|
||||
G4String ID;
|
||||
|
||||
ID = "TED";
|
||||
(*store)[ID] = G4AttDef(ID,"Total Energy Deposit",
|
||||
"Physics","G4BestUnit","G4double");
|
||||
ID = "PDS";
|
||||
(*store)[ID] = G4AttDef(ID,"Process Defined Step",
|
||||
"Bookkeeping","","G4String");
|
||||
ID = "PTDS";
|
||||
(*store)[ID] = G4AttDef(ID,"Process Type Defined Step",
|
||||
"Bookkeeping","","G4String");
|
||||
}
|
||||
return store;
|
||||
}
|
||||
|
||||
std::vector<G4AttValue>* G4RichTrajectoryPoint::CreateAttValues() const
|
||||
{
|
||||
std::vector<G4AttValue>* values = G4TrajectoryPoint::CreateAttValues();
|
||||
|
||||
values->push_back(G4AttValue("TED",G4BestUnit(fTotEDep,"Energy"),""));
|
||||
|
||||
if (fpProcess) {
|
||||
values->push_back
|
||||
(G4AttValue("PDS",fpProcess->GetProcessName(),""));
|
||||
values->push_back
|
||||
(G4AttValue
|
||||
("PTDS",G4VProcess::GetProcessTypeName(fpProcess->GetProcessType()),
|
||||
""));
|
||||
} else {
|
||||
values->push_back
|
||||
(G4AttValue("PDS","User Defined Limit in Current Volume",""));
|
||||
values->push_back(G4AttValue("PTDS","User",""));
|
||||
}
|
||||
|
||||
#ifdef G4ATTDEBUG
|
||||
G4cout << G4AttCheck(values,GetAttDefs());
|
||||
#endif
|
||||
|
||||
return values;
|
||||
}
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4SmoothTrajectory.cc,v 1.15 2005/05/03 17:48:51 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4SmoothTrajectoryPoint.cc,v 1.14 2005/05/03 17:48:51 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4SteppingManager.cc,v 1.33 2004/08/12 00:50:11 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SteppingManager2.cc,v 1.23 2004/12/07 09:16:54 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4SteppingManager2.cc,v 1.25 2005/09/21 09:49:15 tsasaki Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -167,7 +167,12 @@ void G4SteppingManager::GetProcessNumber()
|
||||
->SetProcessDefinedStep(fCurrentProcess);
|
||||
}
|
||||
}
|
||||
if (fCondition==ExclusivelyForced) return; // Take note the 'return' at here !!!
|
||||
if (fCondition==ExclusivelyForced) {
|
||||
for(size_t nrest=np+1; nrest < MAXofPostStepLoops; nrest++){
|
||||
(*fSelectedPostStepDoItVector)[nrest] = InActivated;
|
||||
}
|
||||
return; // Take note the 'return' at here !!!
|
||||
}
|
||||
}
|
||||
|
||||
if(fPostStepDoItProcTriggered<MAXofPostStepLoops)
|
||||
@@ -402,7 +407,7 @@ void G4SteppingManager::InvokeAlongStepDoItProcs()
|
||||
|
||||
// Set the track status according to what the process defined
|
||||
// if kinetic energy >0, otherwise set fStopButAlive
|
||||
// fTrack->SetTrackStatus( fParticleChange->GetTrackStatus() );
|
||||
fTrack->SetTrackStatus( fParticleChange->GetTrackStatus() );
|
||||
|
||||
// clear ParticleChange
|
||||
fParticleChange->Clear();
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4SteppingVerbose.cc,v 1.16 2004/07/08 03:46:43 amako Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TrackingManager.cc,v 1.15 2003/11/18 18:39:39 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4TrackingManager.cc,v 1.16 2005/11/21 23:37:19 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -106,7 +106,7 @@ void G4TrackingManager::ProcessOneTrack(G4Track* apValueG4Track)
|
||||
fpTrack->SetStep(fpSteppingManager->GetStep());
|
||||
|
||||
// Inform beginning of tracking to physics processes
|
||||
fpTrack->GetDefinition()->GetProcessManager()->StartTracking();
|
||||
fpTrack->GetDefinition()->GetProcessManager()->StartTracking(fpTrack);
|
||||
|
||||
// Track the particle Step-by-Step while it is alive
|
||||
G4StepStatus stepStatus;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TrackingMessenger.cc,v 1.9 2003/06/16 17:13:23 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4TrackingMessenger.cc,v 1.10 2005/11/21 23:37:19 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -52,8 +52,6 @@
|
||||
#include "G4TrackStatus.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include <strstream>
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
G4TrackingMessenger::G4TrackingMessenger(G4TrackingManager * trMan)
|
||||
///////////////////////////////////////////////////////////////////
|
||||
@@ -116,11 +114,7 @@ void G4TrackingMessenger::SetNewValue(G4UIcommand * command,G4String newValues)
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
if( command == VerboseCmd ){
|
||||
G4int vl;
|
||||
const char* t = newValues;
|
||||
std::istrstream is((char*)t);
|
||||
is >> vl;
|
||||
trackingManager->SetVerboseLevel(vl);
|
||||
trackingManager->SetVerboseLevel(VerboseCmd->ConvertToInt(newValues));
|
||||
}
|
||||
|
||||
if( command == AbortCmd ){
|
||||
@@ -133,11 +127,7 @@ void G4TrackingMessenger::SetNewValue(G4UIcommand * command,G4String newValues)
|
||||
}
|
||||
|
||||
if( command == StoreTrajectoryCmd ){
|
||||
G4int vl;
|
||||
const char* t = newValues;
|
||||
std::istrstream is((char*)t);
|
||||
is >> vl;
|
||||
trackingManager->SetStoreTrajectory(vl!=0);
|
||||
trackingManager->SetStoreTrajectory(StoreTrajectoryCmd->ConvertToBool(newValues));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,10 +137,7 @@ G4String G4TrackingMessenger::GetCurrentValue(G4UIcommand * command)
|
||||
////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
if( command == VerboseCmd ){
|
||||
char line[100];
|
||||
std::ostrstream os(line,100);
|
||||
os << trackingManager->GetVerboseLevel() << '\0';
|
||||
return G4String(line);
|
||||
return VerboseCmd->ConvertToString(trackingManager->GetVerboseLevel());
|
||||
}
|
||||
else if( command == StoreTrajectoryCmd ){
|
||||
G4String ll = "0";
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Trajectory.cc,v 1.27 2005/05/03 17:48:51 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4TrajectoryPoint.cc,v 1.16 2005/05/03 17:48:51 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UserSteppingAction.cc,v 1.6 2001/07/11 10:08:43 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4UserSteppingAction.cc,v 1.7 2005/11/22 21:04:07 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
@@ -41,6 +41,31 @@
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
G4UserSteppingAction::G4UserSteppingAction()
|
||||
/////////////////////////////////////////////////////////
|
||||
{
|
||||
if(!(G4ParticleTable::GetParticleTable()->GetReadiness()))
|
||||
{
|
||||
G4String msg;
|
||||
msg = " You are instantiating G4UserSteppingAction BEFORE your\n";
|
||||
msg += "G4VUserPhysicsList is instantiated and assigned to G4RunManager.\n";
|
||||
msg += " Such an instantiation is prohibited by Geant4 version 8.0. To fix this problem,\n";
|
||||
msg += "please make sure that your main() instantiates G4VUserPhysicsList AND\n";
|
||||
msg += "set it to G4RunManager before instantiating other user action classes\n";
|
||||
msg += "such as G4UserSteppingAction.";
|
||||
G4Exception("G4UserSteppingAction::G4UserSteppingAction()",
|
||||
"Tracking0002",FatalException,msg);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
G4UserSteppingAction::~G4UserSteppingAction()
|
||||
/////////////////////////////////////////////////////////
|
||||
{;}
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
void G4UserSteppingAction::
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UserTrackingAction.cc,v 1.6 2001/07/11 10:08:43 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4UserTrackingAction.cc,v 1.7 2005/11/22 21:04:07 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
@@ -37,6 +37,31 @@
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
#include "G4UserTrackingAction.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
G4UserTrackingAction::G4UserTrackingAction()
|
||||
/////////////////////////////////////////////////////////
|
||||
{
|
||||
if(!(G4ParticleTable::GetParticleTable()->GetReadiness()))
|
||||
{
|
||||
G4String msg;
|
||||
msg = " You are instantiating G4UserTrackingAction BEFORE your\n";
|
||||
msg += "G4VUserPhysicsList is instantiated and assigned to G4RunManager.\n";
|
||||
msg += " Such an instantiation is prohibited by Geant4 version 8.0. To fix this problem,\n";
|
||||
msg += "please make sure that your main() instantiates G4VUserPhysicsList AND\n";
|
||||
msg += "set it to G4RunManager before instantiating other user action classes\n";
|
||||
msg += "such as G4UserTrackingAction.";
|
||||
G4Exception("G4UserTrackingAction::G4UserTrackingAction()",
|
||||
"Tracking0001",FatalException,msg);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
G4UserTrackingAction::~G4UserTrackingAction()
|
||||
/////////////////////////////////////////////////////////
|
||||
{;}
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
void G4UserTrackingAction::
|
||||
@@ -44,7 +69,8 @@ void G4UserTrackingAction::
|
||||
/////////////////////////////////////////////////////////
|
||||
{
|
||||
fpTrackingManager = pValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VSteppingVerbose.cc,v 1.10 2004/11/10 11:23:27 tsasaki Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VTrajectory.cc,v 1.7 2005/05/03 17:48:51 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4VTrajectory.cc,v 1.8 2005/11/15 03:52:26 tinslay Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
@@ -113,71 +113,9 @@ void G4VTrajectory::ShowTrajectory(std::ostream& os) const
|
||||
|
||||
void G4VTrajectory::DrawTrajectory(G4int i_mode) const
|
||||
{
|
||||
// If i_mode>=0, draws a trajectory as a polyline (blue for
|
||||
// positive, red for negative, green for neutral) and, if i_mode!=0,
|
||||
// adds markers - yellow circles for step points and magenta squares
|
||||
// for auxiliary points, if any - whose screen size in pixels is
|
||||
// given by std::abs(i_mode)/1000. E.g: i_mode = 5000 gives easily
|
||||
// visible markers.
|
||||
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if (!pVVisManager) return;
|
||||
|
||||
const G4double markerSize = std::abs(i_mode)/1000;
|
||||
G4bool lineRequired (i_mode >= 0);
|
||||
G4bool markersRequired (markerSize > 0.);
|
||||
|
||||
G4Polyline trajectoryLine;
|
||||
G4Polymarker stepPoints;
|
||||
G4Polymarker auxiliaryPoints;
|
||||
|
||||
for (G4int i = 0; i < GetPointEntries() ; i++) {
|
||||
G4VTrajectoryPoint* aTrajectoryPoint = GetPoint(i);
|
||||
const std::vector<G4ThreeVector>* auxiliaries
|
||||
= aTrajectoryPoint->GetAuxiliaryPoints();
|
||||
if (auxiliaries) {
|
||||
for (size_t iAux = 0; iAux < auxiliaries->size(); ++iAux) {
|
||||
const G4ThreeVector pos((*auxiliaries)[iAux]);
|
||||
if (lineRequired) {
|
||||
trajectoryLine.push_back(pos);
|
||||
}
|
||||
if (markersRequired) {
|
||||
auxiliaryPoints.push_back(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
const G4ThreeVector pos(aTrajectoryPoint->GetPosition());
|
||||
if (lineRequired) {
|
||||
trajectoryLine.push_back(pos);
|
||||
}
|
||||
if (markersRequired) {
|
||||
stepPoints.push_back(pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (lineRequired) {
|
||||
G4Colour colour;
|
||||
const G4double charge = GetCharge();
|
||||
if(charge>0.) colour = G4Colour(0.,0.,1.); // Blue = positive.
|
||||
else if(charge<0.) colour = G4Colour(1.,0.,0.); // Red = negative.
|
||||
else colour = G4Colour(0.,1.,0.); // Green = neutral.
|
||||
G4VisAttributes trajectoryLineAttribs(colour);
|
||||
trajectoryLine.SetVisAttributes(&trajectoryLineAttribs);
|
||||
pVVisManager->Draw(trajectoryLine);
|
||||
}
|
||||
if (markersRequired) {
|
||||
auxiliaryPoints.SetMarkerType(G4Polymarker::squares);
|
||||
auxiliaryPoints.SetScreenSize(markerSize);
|
||||
auxiliaryPoints.SetFillStyle(G4VMarker::filled);
|
||||
G4VisAttributes auxiliaryPointsAttribs(G4Colour(0.,1.,1.)); // Magenta
|
||||
auxiliaryPoints.SetVisAttributes(&auxiliaryPointsAttribs);
|
||||
pVVisManager->Draw(auxiliaryPoints);
|
||||
|
||||
stepPoints.SetMarkerType(G4Polymarker::circles);
|
||||
stepPoints.SetScreenSize(markerSize);
|
||||
stepPoints.SetFillStyle(G4VMarker::filled);
|
||||
G4VisAttributes stepPointsAttribs(G4Colour(1.,1.,0.)); // Yellow.
|
||||
stepPoints.SetVisAttributes(&stepPointsAttribs);
|
||||
pVVisManager->Draw(stepPoints);
|
||||
if (0 != pVVisManager) {
|
||||
pVVisManager->DispatchToModel(*this, i_mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VTrajectoryPoint.cc,v 1.1 2004/07/05 17:08:16 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user