Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "G4BiasingOperationManager.hh"
|
||||
|
||||
//G4BiasingOperationManager* G4BiasingOperationManager::fInstance = 0;
|
||||
G4VectorCache< G4VBiasingOperation* > G4BiasingOperationManager::fBiasingOperationVector;
|
||||
G4MapCache< G4VBiasingOperation*, std::size_t > G4BiasingOperationManager::fBiasingOperationIDtoPointerMap;
|
||||
|
||||
G4BiasingOperationManager::G4BiasingOperationManager()
|
||||
{}
|
||||
|
||||
G4BiasingOperationManager::~G4BiasingOperationManager()
|
||||
{}
|
||||
|
||||
G4BiasingOperationManager* G4BiasingOperationManager::GetInstance()
|
||||
{
|
||||
//Create an instance for each thread.
|
||||
static G4ThreadLocalSingleton<G4BiasingOperationManager> instance;
|
||||
return instance.Instance();
|
||||
// if (fInstance == 0) fInstance = new G4BiasingOperationManager();
|
||||
// return fInstance;
|
||||
}
|
||||
|
||||
std::size_t G4BiasingOperationManager::Register(G4VBiasingOperation* option)
|
||||
{
|
||||
std::size_t optionUniqueID = fBiasingOperationVector.Size();
|
||||
|
||||
fBiasingOperationVector.Push_back(option);
|
||||
fBiasingOperationIDtoPointerMap[option] = optionUniqueID;
|
||||
|
||||
return optionUniqueID;
|
||||
}
|
||||
|
||||
G4VBiasingOperation* G4BiasingOperationManager::GetBiasingOperation(std::size_t optionID)
|
||||
{
|
||||
if (optionID < fBiasingOperationVector.Size()) return fBiasingOperationVector[optionID];
|
||||
else return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "G4BiasingTrackData.hh"
|
||||
#include "G4BiasingTrackDataStore.hh"
|
||||
|
||||
G4BiasingTrackData::G4BiasingTrackData(const G4Track* track)
|
||||
: fTrack(track),
|
||||
fBirthOperation (0),
|
||||
fBirthOperator (0),
|
||||
fBirthProcess(0)
|
||||
{
|
||||
G4BiasingTrackDataStore::GetInstance()->Register( this );
|
||||
}
|
||||
|
||||
G4BiasingTrackData::G4BiasingTrackData(const G4Track* track,
|
||||
const G4VBiasingOperation* birthOperation,
|
||||
const G4VBiasingOperator* birthOperator,
|
||||
const G4BiasingProcessInterface* birthProcess)
|
||||
: fTrack(track),
|
||||
fBirthOperation (birthOperation),
|
||||
fBirthOperator (birthOperator),
|
||||
fBirthProcess(birthProcess)
|
||||
{
|
||||
G4BiasingTrackDataStore::GetInstance()->Register( this );
|
||||
}
|
||||
|
||||
G4BiasingTrackData::~G4BiasingTrackData()
|
||||
{
|
||||
G4BiasingTrackDataStore::GetInstance()->DeRegister( this );
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "G4BiasingTrackDataStore.hh"
|
||||
#include "G4BiasingTrackData.hh"
|
||||
|
||||
|
||||
//G4BiasingTrackDataStore* G4BiasingTrackDataStore::fInstance = 0;
|
||||
|
||||
G4BiasingTrackDataStore* G4BiasingTrackDataStore::GetInstance()
|
||||
{
|
||||
static G4ThreadLocalSingleton<G4BiasingTrackDataStore> instance;
|
||||
return instance.Instance();
|
||||
}
|
||||
|
||||
void G4BiasingTrackDataStore::Register(G4BiasingTrackData* data)
|
||||
{
|
||||
fTrackDataStore[data->GetTrack()] = data;
|
||||
}
|
||||
|
||||
void G4BiasingTrackDataStore::DeRegister(G4BiasingTrackData* data)
|
||||
{
|
||||
fTrackDataStore[data->GetTrack()] = 0;
|
||||
}
|
||||
|
||||
G4BiasingTrackDataStore::G4BiasingTrackDataStore()
|
||||
{}
|
||||
|
||||
G4BiasingTrackDataStore::~G4BiasingTrackDataStore()
|
||||
{
|
||||
for ( std::map < const G4Track*, G4BiasingTrackData* >::iterator it = fTrackDataStore.begin() ;
|
||||
it != fTrackDataStore.end() ; it++ )
|
||||
{
|
||||
G4BiasingTrackData* data = (*it).second;
|
||||
if ( data != 0 ) delete data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ProcessPlacer.cc 77477 2013-11-25 09:42:24Z gcosmo $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4ProcessPlacer.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4ProcessPlacer.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4VProcess.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
|
||||
G4ProcessPlacer::G4ProcessPlacer(const G4String &particlename)
|
||||
: fParticleName(particlename)
|
||||
{
|
||||
}
|
||||
|
||||
G4ProcessPlacer::~G4ProcessPlacer()
|
||||
{
|
||||
}
|
||||
|
||||
void G4ProcessPlacer::RemoveProcess(G4VProcess *process)
|
||||
{
|
||||
G4cout << "=== G4ProcessPlacer::RemoveProcess: for: " << fParticleName
|
||||
<< G4endl;
|
||||
G4cout << " ProcessName: " << process->GetProcessName()
|
||||
<< ", will be removed!" << G4endl;
|
||||
|
||||
G4cout << " The initial AlongStep Vectors: " << G4endl;
|
||||
PrintAlongStepGPILVec();
|
||||
PrintAlongStepDoItVec();
|
||||
|
||||
G4cout << " The initial PostStep Vectors: " << G4endl;
|
||||
PrintPostStepGPILVec();
|
||||
PrintPostStepDoItVec();
|
||||
|
||||
GetProcessManager()->RemoveProcess(process);
|
||||
|
||||
G4cout << " The final AlongStep Vectors: " << G4endl;
|
||||
PrintAlongStepGPILVec();
|
||||
PrintAlongStepDoItVec();
|
||||
|
||||
G4cout << " The final PostStep Vectors: " << G4endl;
|
||||
PrintPostStepGPILVec();
|
||||
PrintPostStepDoItVec();
|
||||
|
||||
G4cout << "================================================" << G4endl;
|
||||
|
||||
}
|
||||
|
||||
void G4ProcessPlacer::AddProcessAs(G4VProcess *process, SecondOrLast sol)
|
||||
{
|
||||
G4cout << " Modifying Process Order for ProcessName: " << process->GetProcessName() << G4endl;
|
||||
|
||||
G4cout << " The initial AlongStep Vectors: " << G4endl;
|
||||
PrintAlongStepGPILVec();
|
||||
PrintAlongStepDoItVec();
|
||||
|
||||
G4cout << "The initial PostStep Vectors: " << G4endl;
|
||||
PrintPostStepGPILVec();
|
||||
PrintPostStepDoItVec();
|
||||
|
||||
if (sol == eLast)
|
||||
{
|
||||
GetProcessManager()->AddProcess(process, ordInActive, ordInActive, ordLast);
|
||||
}
|
||||
else if (sol == eSecond)
|
||||
{
|
||||
// get transportation process
|
||||
G4VProcess *transportation =
|
||||
(* (GetProcessManager()->GetProcessList()))[0];
|
||||
|
||||
if (!transportation)
|
||||
{
|
||||
G4Exception("G4ProcessPlacer::AddProcessAs","Bias0001",RunMustBeAborted," could not get process id=0");
|
||||
}
|
||||
if (transportation->GetProcessName() != "Transportation" && transportation->GetProcessName() != "Transportation8" && transportation->GetProcessName() != "CoupledTransportation")
|
||||
{
|
||||
// G4cout << " GOT HERE CoupledTransportation" << G4endl;
|
||||
G4cout << transportation->GetProcessName() << G4endl;
|
||||
G4Exception("G4ProcessPlacer::AddProcessAs","Bias0002",RunMustBeAborted," process id=0 is not Transportation");
|
||||
}
|
||||
|
||||
// place the given proces as first for the moment
|
||||
// 31/5/11 previously set to first, then transportation set ahead of it,
|
||||
// which is more conveniently correctly set with placing it second!
|
||||
GetProcessManager()->AddProcess(process);
|
||||
GetProcessManager()->SetProcessOrderingToSecond(process,
|
||||
idxAlongStep);
|
||||
GetProcessManager()->SetProcessOrderingToSecond(process,
|
||||
idxPostStep);
|
||||
// xx test
|
||||
// if(process->GetProcessName() == "ImportanceProcess")
|
||||
//bug31/10/07 GetProcessManager()->SetProcessOrdering(process,
|
||||
//bug31/10/07 idxAlongStep, 1);
|
||||
// place transportation first again
|
||||
// GetProcessManager()->SetProcessOrderingToFirst(transportation,
|
||||
// idxAlongStep);
|
||||
// GetProcessManager()->SetProcessOrderingToFirst(transportation,
|
||||
// idxPostStep);
|
||||
}
|
||||
|
||||
// for verification inly
|
||||
G4cout << " The final AlongStep Vectors: " << G4endl;
|
||||
PrintAlongStepGPILVec();
|
||||
PrintAlongStepDoItVec();
|
||||
|
||||
G4cout << "The final PostStep Vectors: " << G4endl;
|
||||
PrintPostStepGPILVec();
|
||||
PrintPostStepDoItVec();
|
||||
|
||||
G4cout << "================================================" << G4endl;
|
||||
}
|
||||
|
||||
void G4ProcessPlacer::AddProcessAsSecondDoIt(G4VProcess *process)
|
||||
{
|
||||
G4cout << "=== G4ProcessPlacer::AddProcessAsSecondDoIt: for: "
|
||||
<< fParticleName << G4endl;
|
||||
AddProcessAs(process, eSecond);
|
||||
}
|
||||
|
||||
void G4ProcessPlacer::AddProcessAsLastDoIt(G4VProcess *process)
|
||||
{
|
||||
G4cout << "=== G4ProcessPlacer::AddProcessAsLastDoIt: for: "
|
||||
<< fParticleName << G4endl;
|
||||
AddProcessAs(process, eLast);
|
||||
}
|
||||
|
||||
G4ProcessManager *G4ProcessPlacer::GetProcessManager()
|
||||
{
|
||||
// get particle iterator to add processes ---------------------
|
||||
G4ParticleTable* theParticleTable = 0;
|
||||
G4ParticleTable::G4PTblDicIterator* theParticleIterator = 0;
|
||||
theParticleTable = G4ParticleTable::GetParticleTable();
|
||||
theParticleIterator = theParticleTable->GetIterator();
|
||||
// -------------------------------------------------------
|
||||
G4ProcessManager *processmanager = 0;
|
||||
// find process manager ---------------------------
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() )
|
||||
{
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
if (particle->GetParticleName() == fParticleName)
|
||||
{
|
||||
processmanager = particle->GetProcessManager();
|
||||
break;
|
||||
}
|
||||
}
|
||||
// ---------------------------------------------------------
|
||||
if (!processmanager)
|
||||
{
|
||||
G4Exception("G4ProcessPlacer::GetProcessManager()", "InvalidSetup",
|
||||
FatalException, "NULL pointer to Process Manager ! Sampler.Configure() must be after PhysicsList instantiation");
|
||||
}
|
||||
return processmanager;
|
||||
}
|
||||
|
||||
void G4ProcessPlacer::PrintAlongStepGPILVec()
|
||||
{
|
||||
G4cout << "GPIL Vector: " << G4endl;
|
||||
G4ProcessVector* processGPILVec =
|
||||
GetProcessManager()->GetAlongStepProcessVector(typeGPIL);
|
||||
PrintProcVec(processGPILVec);
|
||||
}
|
||||
|
||||
void G4ProcessPlacer::PrintAlongStepDoItVec()
|
||||
{
|
||||
G4cout << "DoIt Vector: " << G4endl;
|
||||
G4ProcessVector* processDoItVec =
|
||||
GetProcessManager()->GetAlongStepProcessVector(typeDoIt);
|
||||
PrintProcVec(processDoItVec);
|
||||
}
|
||||
|
||||
|
||||
void G4ProcessPlacer::PrintPostStepGPILVec()
|
||||
{
|
||||
G4cout << "GPIL Vector: " << G4endl;
|
||||
G4ProcessVector* processGPILVec =
|
||||
GetProcessManager()->GetPostStepProcessVector(typeGPIL);
|
||||
PrintProcVec(processGPILVec);
|
||||
}
|
||||
|
||||
void G4ProcessPlacer::PrintPostStepDoItVec()
|
||||
{
|
||||
G4cout << "DoIt Vector: " << G4endl;
|
||||
G4ProcessVector* processDoItVec =
|
||||
GetProcessManager()->GetPostStepProcessVector(typeDoIt);
|
||||
PrintProcVec(processDoItVec);
|
||||
}
|
||||
|
||||
|
||||
void G4ProcessPlacer::PrintProcVec(G4ProcessVector* processVec)
|
||||
{
|
||||
if (!processVec)
|
||||
{
|
||||
G4Exception("G4ProcessPlacer::G4ProcessPlacer()", "InvalidArgument",
|
||||
FatalException, "NULL pointer to process-vector !");
|
||||
}
|
||||
size_t len = processVec->length();
|
||||
if (len==0)
|
||||
{
|
||||
G4Exception("G4ProcessPlacer::G4ProcessPlacer()", "InvalidSetup",
|
||||
FatalException, "Length of process-vector is zero !");
|
||||
}
|
||||
for (size_t i=0; i<len; i++)
|
||||
{
|
||||
G4VProcess *p = (*processVec)[i];
|
||||
if (p)
|
||||
{
|
||||
G4cout << " " << p->GetProcessName() << G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout << " " << "no process found for position: " << i
|
||||
<< ", in vector of length: " << len << G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "G4VBiasingOperation.hh"
|
||||
#include "G4BiasingOperationManager.hh"
|
||||
|
||||
G4VBiasingOperation::G4VBiasingOperation(G4String name)
|
||||
: fName(name)
|
||||
{
|
||||
// -- have to move from initialization to here, as giving error on windows:
|
||||
fUniqueID = G4BiasingOperationManager::GetInstance()->Register(this);
|
||||
}
|
||||
|
||||
G4VBiasingOperation::~G4VBiasingOperation()
|
||||
{}
|
||||
@@ -0,0 +1,241 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "G4VBiasingOperator.hh"
|
||||
#include "G4VBiasingOperation.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "G4BiasingTrackData.hh"
|
||||
#include "G4BiasingTrackDataStore.hh"
|
||||
|
||||
|
||||
G4MapCache< const G4LogicalVolume*, G4VBiasingOperator* > G4VBiasingOperator::fLogicalToSetupMap;
|
||||
G4VectorCache< G4VBiasingOperator* > G4VBiasingOperator::fOperators;
|
||||
|
||||
|
||||
G4VBiasingOperator::G4VBiasingOperator(G4String name)
|
||||
: fName(name)
|
||||
{
|
||||
fOperators.Push_back(this);
|
||||
}
|
||||
|
||||
G4VBiasingOperator::~G4VBiasingOperator()
|
||||
{
|
||||
}
|
||||
|
||||
void G4VBiasingOperator::AttachTo(const G4LogicalVolume* logical)
|
||||
{
|
||||
G4MapCache< const G4LogicalVolume*, G4VBiasingOperator* >::iterator it;
|
||||
it = fLogicalToSetupMap.Find(logical);
|
||||
if ( it == fLogicalToSetupMap.End() ) fLogicalToSetupMap[logical] = this;
|
||||
else if ( (*it).second != this )
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Biasing operator `" << GetName()
|
||||
<< "' can not be attached to Logical volume `"
|
||||
<< logical->GetName() << "' which is already used by an other operator !" << G4endl;
|
||||
G4Exception("G4VBiasingOperator::AttachTo(...)",
|
||||
"BIAS.MNG.01",
|
||||
JustWarning,
|
||||
ed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
G4VBiasingOperator* G4VBiasingOperator::GetBiasingOperator(const G4LogicalVolume* logical)
|
||||
{
|
||||
G4MapCache< const G4LogicalVolume*, G4VBiasingOperator* >::iterator it;
|
||||
it = fLogicalToSetupMap.Find(logical);
|
||||
if ( it == fLogicalToSetupMap.End() ) return 0;
|
||||
else return (*it).second;
|
||||
}
|
||||
|
||||
G4VBiasingOperation* G4VBiasingOperator::GetProposedOccurenceBiasingOperation(const G4Track* track, const G4BiasingProcessInterface* callingProcess)
|
||||
{
|
||||
fOccurenceBiasingOperation = ProposeOccurenceBiasingOperation(track, callingProcess);
|
||||
// G4cout << GetName() << " Occurence : ";
|
||||
// if ( fOccurenceBiasingOperation ) G4cout << fOccurenceBiasingOperation->GetName() << G4endl;
|
||||
// else G4cout << " (none) " << G4endl;
|
||||
return fOccurenceBiasingOperation;
|
||||
}
|
||||
|
||||
G4VBiasingOperation* G4VBiasingOperator::GetProposedFinalStateBiasingOperation(const G4Track* track, const G4BiasingProcessInterface* callingProcess)
|
||||
{
|
||||
fFinalStateBiasingOperation = ProposeFinalStateBiasingOperation(track, callingProcess);
|
||||
// G4cout << GetName() << " Final State : ";
|
||||
// if ( fFinalStateBiasingOperation ) G4cout << fFinalStateBiasingOperation->GetName() << G4endl;
|
||||
// else G4cout << " (none) " << G4endl;
|
||||
return fFinalStateBiasingOperation;
|
||||
}
|
||||
|
||||
G4VBiasingOperation* G4VBiasingOperator::GetProposedNonPhysicsBiasingOperation(const G4Track* track, const G4BiasingProcessInterface* callingProcess)
|
||||
{
|
||||
fNonPhysicsBiasingOperation = ProposeNonPhysicsBiasingOperation(track, callingProcess);
|
||||
// G4cout << GetName() << " Non Physics : ";
|
||||
// if ( fNonPhysicsBiasingOperation ) G4cout << fNonPhysicsBiasingOperation->GetName() << G4endl;
|
||||
// else G4cout << " (none) " << G4endl;
|
||||
return fNonPhysicsBiasingOperation;
|
||||
}
|
||||
|
||||
// void G4VBiasingOperator::RegisterSecondariesBirth( G4VBiasingOperation* operation, const G4VParticleChange* pChange )
|
||||
// {
|
||||
// for (G4int i2nd = 0; i2nd < pChange->GetNumberOfSecondaries (); i2nd++)
|
||||
// RegisterSecondaryBirth( operation, pChange->GetSecondary (i2nd) );
|
||||
// }
|
||||
|
||||
// void G4VBiasingOperator::RegisterSecondaryBirth( G4VBiasingOperation* operation, const G4Track* track )
|
||||
// {
|
||||
// // G4cout << " --> Registering operation, track = " << operation->GetName() << " " << track << G4endl;
|
||||
// fSecondaryBirthOperation[track] = operation;
|
||||
// }
|
||||
|
||||
const G4VBiasingOperation* G4VBiasingOperator::GetBirthOperation( const G4Track* track )
|
||||
{
|
||||
const G4BiasingTrackData* biasingData = G4BiasingTrackDataStore::GetInstance()->GetBiasingTrackData(track);
|
||||
if ( biasingData != 0 ) return biasingData->GetBirthOperation();
|
||||
else return 0;
|
||||
}
|
||||
|
||||
|
||||
void G4VBiasingOperator::ReportOperationApplied( const G4BiasingProcessInterface* callingProcess,
|
||||
G4BiasingAppliedCase biasingCase,
|
||||
G4VBiasingOperation* operationApplied,
|
||||
const G4VParticleChange* particleChangeProduced )
|
||||
{
|
||||
fPreviousBiasingAppliedCase = biasingCase;
|
||||
// if ( operationApplied != 0 )
|
||||
// {
|
||||
// if ( operationApplied->GetRememberSecondaries() )
|
||||
// {
|
||||
// for (G4int i2nd = 0; i2nd < particleChangeProduced->GetNumberOfSecondaries (); i2nd++)
|
||||
// new G4BiasingTrackData( particleChangeProduced->GetSecondary (i2nd),
|
||||
// operationApplied,
|
||||
// this,
|
||||
// callingProcess);
|
||||
// }
|
||||
// }
|
||||
fPreviousAppliedOccurenceBiasingOperation = 0;
|
||||
fPreviousAppliedFinalStateBiasingOperation = 0;
|
||||
fPreviousAppliedNonPhysicsBiasingOperation = 0;
|
||||
switch ( biasingCase )
|
||||
{
|
||||
case BAC_None:
|
||||
break;
|
||||
case BAC_NonPhysics:
|
||||
fPreviousAppliedNonPhysicsBiasingOperation = operationApplied ;
|
||||
break;
|
||||
case BAC_DenyInteraction:
|
||||
fPreviousAppliedOccurenceBiasingOperation = operationApplied;
|
||||
break;
|
||||
case BAC_FinalState:
|
||||
fPreviousAppliedFinalStateBiasingOperation = operationApplied;
|
||||
break;
|
||||
case BAC_Occurence:
|
||||
G4Exception("G4VBiasingOperator::ReportOperationApplied(...)",
|
||||
"BIAS.MNG.02",
|
||||
JustWarning,
|
||||
"Internal logic error, please report !");
|
||||
break;
|
||||
default:
|
||||
G4Exception("G4VBiasingOperator::ReportOperationApplied(...)",
|
||||
"BIAS.MNG.03",
|
||||
JustWarning,
|
||||
"Internal logic error, please report !");
|
||||
}
|
||||
OperationApplied( callingProcess, biasingCase, operationApplied, particleChangeProduced );
|
||||
}
|
||||
|
||||
void G4VBiasingOperator::ReportOperationApplied( const G4BiasingProcessInterface* callingProcess,
|
||||
G4BiasingAppliedCase biasingCase,
|
||||
G4VBiasingOperation* occurenceOperationApplied,
|
||||
G4double weightForOccurenceInteraction,
|
||||
G4VBiasingOperation* finalStateOperationApplied,
|
||||
const G4VParticleChange* particleChangeProduced )
|
||||
{
|
||||
fPreviousBiasingAppliedCase = biasingCase;
|
||||
// G4VBiasingOperation* operation(finalStateOperationApplied != 0 ? finalStateOperationApplied : occurenceOperationApplied);
|
||||
// G4bool remember = occurenceOperationApplied->GetRememberSecondaries();
|
||||
// if ( finalStateOperationApplied != 0 ) remember = remember || finalStateOperationApplied->GetRememberSecondaries();
|
||||
// if ( remember )
|
||||
// {
|
||||
// for (G4int i2nd = 0; i2nd < particleChangeProduced->GetNumberOfSecondaries (); i2nd++)
|
||||
// new G4BiasingTrackData( particleChangeProduced->GetSecondary (i2nd),
|
||||
// operation,
|
||||
// this,
|
||||
// callingProcess);
|
||||
// }
|
||||
fPreviousAppliedOccurenceBiasingOperation = occurenceOperationApplied;
|
||||
fPreviousAppliedFinalStateBiasingOperation = finalStateOperationApplied;
|
||||
OperationApplied( callingProcess, biasingCase, occurenceOperationApplied, weightForOccurenceInteraction, finalStateOperationApplied, particleChangeProduced );
|
||||
}
|
||||
|
||||
|
||||
void G4VBiasingOperator::ExitingBiasing( const G4Track* track, const G4BiasingProcessInterface* callingProcess )
|
||||
{
|
||||
ExitBiasing( track, callingProcess );
|
||||
|
||||
// -- reset all data members:
|
||||
fOccurenceBiasingOperation = 0 ;
|
||||
fFinalStateBiasingOperation = 0 ;
|
||||
fNonPhysicsBiasingOperation = 0 ;
|
||||
fPreviousProposedOccurenceBiasingOperation = 0 ;
|
||||
fPreviousProposedFinalStateBiasingOperation = 0 ;
|
||||
fPreviousProposedNonPhysicsBiasingOperation = 0 ;
|
||||
fPreviousAppliedOccurenceBiasingOperation = 0 ;
|
||||
fPreviousAppliedFinalStateBiasingOperation = 0 ;
|
||||
fPreviousAppliedNonPhysicsBiasingOperation = 0 ;
|
||||
fPreviousBiasingAppliedCase = BAC_None ;
|
||||
}
|
||||
|
||||
|
||||
void G4VBiasingOperator::RememberSecondaries( const G4BiasingProcessInterface* callingProcess,
|
||||
const G4VBiasingOperation* operationApplied,
|
||||
const G4VParticleChange* particleChangeProduced)
|
||||
{
|
||||
for (G4int i2nd = 0; i2nd < particleChangeProduced->GetNumberOfSecondaries (); i2nd++)
|
||||
new G4BiasingTrackData( particleChangeProduced->GetSecondary (i2nd),
|
||||
operationApplied,
|
||||
this,
|
||||
callingProcess);
|
||||
}
|
||||
|
||||
void G4VBiasingOperator::ForgetTrack( const G4Track* track )
|
||||
{
|
||||
G4BiasingTrackData* biasingData = G4BiasingTrackDataStore::GetInstance()->GetBiasingTrackData(track);
|
||||
if ( biasingData != 0 ) delete biasingData;
|
||||
}
|
||||
|
||||
|
||||
// -- dummy empty implementations to allow letting arguments visible in the .hh
|
||||
// -- but avoiding annoying warning messages about unused variables
|
||||
// -- methods to inform operator that its biasing control is over:
|
||||
void G4VBiasingOperator::ExitBiasing( const G4Track*, const G4BiasingProcessInterface*)
|
||||
{}
|
||||
void G4VBiasingOperator::OperationApplied( const G4BiasingProcessInterface*, G4BiasingAppliedCase,
|
||||
G4VBiasingOperation*, const G4VParticleChange* )
|
||||
{}
|
||||
void G4VBiasingOperator::OperationApplied( const G4BiasingProcessInterface*, G4BiasingAppliedCase,
|
||||
G4VBiasingOperation*, G4double,
|
||||
G4VBiasingOperation*, const G4VParticleChange* )
|
||||
{}
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VProcessPlacer.cc 77477 2013-11-25 09:42:24Z gcosmo $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4VProcessPlacer.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4VProcessPlacer.hh"
|
||||
|
||||
G4VProcessPlacer::G4VProcessPlacer()
|
||||
{}
|
||||
G4VProcessPlacer::~G4VProcessPlacer()
|
||||
{}
|
||||
Reference in New Issue
Block a user