Import Geant4 10.7.0.beta source tree
This commit is contained in:
@@ -23,130 +23,147 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4MaterialCutsCouple
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
//
|
||||
// Class Description
|
||||
// This class is
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// First Implementation 17 Sep. 2002 H.Kurahige
|
||||
// ------------------------------------------------------------
|
||||
// The same material can be used in regions with different cut values,
|
||||
// and physics processes must prepare several different cross-sections
|
||||
// for that material.
|
||||
// The G4ProductionCutsTable has G4MaterialCutsCouple objects, each of
|
||||
// which consists of a material paired with a cut value.
|
||||
// G4MaterialCutsCouples objects are numbered with an index which is the
|
||||
// same as the index of a G4PhysicsVector for the corresponding
|
||||
// G4MaterialCutsCouple in the G4PhysicsTable.
|
||||
// The list of G4MaterialCutsCouple objects used in the geometry setup
|
||||
// is updated before starting the event loop in each run.
|
||||
|
||||
#ifndef G4MaterialCutsCouple_h
|
||||
#define G4MaterialCutsCouple_h 1
|
||||
// Author: H.Kurashige, 17 September 2002 - First implementation
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4MaterialCutsCouple_hh
|
||||
#define G4MaterialCutsCouple_hh 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4ProductionCuts.hh"
|
||||
|
||||
class G4Material;
|
||||
#include "G4ProductionCuts.hh"
|
||||
|
||||
class G4MaterialCutsCouple
|
||||
{
|
||||
public: // with description
|
||||
// constructor
|
||||
G4MaterialCutsCouple();
|
||||
G4MaterialCutsCouple(const G4Material*, G4ProductionCuts* cut=0);
|
||||
public:
|
||||
|
||||
// copy constructor
|
||||
G4MaterialCutsCouple(const G4MaterialCutsCouple &right);
|
||||
G4MaterialCutsCouple();
|
||||
G4MaterialCutsCouple(const G4Material*, G4ProductionCuts* cut = nullptr);
|
||||
// Constructors
|
||||
|
||||
G4MaterialCutsCouple & operator=(const G4MaterialCutsCouple &right);
|
||||
virtual ~G4MaterialCutsCouple();
|
||||
// Destructor
|
||||
|
||||
public:
|
||||
// destructor
|
||||
virtual ~G4MaterialCutsCouple();
|
||||
G4MaterialCutsCouple(const G4MaterialCutsCouple& right);
|
||||
G4MaterialCutsCouple& operator=(const G4MaterialCutsCouple& right);
|
||||
// Copy constructor & assignment operator
|
||||
|
||||
// equal opperators
|
||||
G4bool operator==(const G4MaterialCutsCouple &right) const;
|
||||
G4bool operator!=(const G4MaterialCutsCouple &right) const;
|
||||
G4bool operator==(const G4MaterialCutsCouple& right) const;
|
||||
G4bool operator!=(const G4MaterialCutsCouple& right) const;
|
||||
// Equality operators
|
||||
|
||||
public: // with description
|
||||
void SetMaterial(const G4Material*);
|
||||
// Set pointer to material
|
||||
void SetMaterial(const G4Material*);
|
||||
// Set pointer to material
|
||||
|
||||
const G4Material* GetMaterial() const;
|
||||
// Get pointer to material
|
||||
const G4Material* GetMaterial() const;
|
||||
// Get pointer to material
|
||||
|
||||
void SetProductionCuts(G4ProductionCuts*);
|
||||
// Set pointer to production cuts
|
||||
void SetProductionCuts(G4ProductionCuts*);
|
||||
// Set pointer to production cuts
|
||||
|
||||
G4ProductionCuts* GetProductionCuts() const;
|
||||
// Get pointer to production cuts
|
||||
G4ProductionCuts* GetProductionCuts() const;
|
||||
// Get pointer to production cuts
|
||||
|
||||
G4bool IsRecalcNeeded() const;
|
||||
// return true if cut and/or material has been modified
|
||||
// after last calculation of PhysicsTable
|
||||
G4bool IsRecalcNeeded() const;
|
||||
// Return true if cut and/or material has been modified
|
||||
// after last calculation of PhysicsTable
|
||||
|
||||
void PhysicsTableUpdated();
|
||||
// inform end of calculation of PhysicsTable
|
||||
void PhysicsTableUpdated();
|
||||
// Inform end of calculation of Physics Table
|
||||
|
||||
void SetIndex(G4int idx);
|
||||
G4int GetIndex() const;
|
||||
// Set/Get the index number in G4ProductionCutsTable
|
||||
void SetIndex(G4int idx);
|
||||
G4int GetIndex() const;
|
||||
// Set/Get the index number in G4ProductionCutsTable
|
||||
|
||||
void SetUseFlag(G4bool flg=true);
|
||||
G4bool IsUsed() const;
|
||||
void SetUseFlag(G4bool flg = true);
|
||||
G4bool IsUsed() const;
|
||||
|
||||
private:
|
||||
G4bool isMaterialModified;
|
||||
const G4Material* fMaterial;
|
||||
G4ProductionCuts* fCuts;
|
||||
G4int indexNumber;
|
||||
G4bool isUsedInGeometry;
|
||||
|
||||
G4bool isMaterialModified = false;
|
||||
const G4Material* fMaterial = nullptr;
|
||||
G4ProductionCuts* fCuts = nullptr;
|
||||
G4int indexNumber = -1;
|
||||
G4bool isUsedInGeometry = false;
|
||||
};
|
||||
|
||||
#include "G4ProductionCuts.hh"
|
||||
inline
|
||||
void G4MaterialCutsCouple::SetIndex(G4int idx)
|
||||
{ indexNumber = idx; }
|
||||
|
||||
inline
|
||||
G4int G4MaterialCutsCouple::GetIndex() const
|
||||
{ return indexNumber; }
|
||||
// ------------------
|
||||
// Inline methods
|
||||
// ------------------
|
||||
|
||||
inline
|
||||
void G4MaterialCutsCouple::SetUseFlag(G4bool flg)
|
||||
{ isUsedInGeometry = flg; }
|
||||
void G4MaterialCutsCouple::SetIndex(G4int idx)
|
||||
{
|
||||
indexNumber = idx;
|
||||
}
|
||||
|
||||
inline
|
||||
G4bool G4MaterialCutsCouple::IsUsed() const
|
||||
{ return isUsedInGeometry; }
|
||||
G4int G4MaterialCutsCouple::GetIndex() const
|
||||
{
|
||||
return indexNumber;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4MaterialCutsCouple::SetUseFlag(G4bool flg)
|
||||
{
|
||||
isUsedInGeometry = flg;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4MaterialCutsCouple::SetProductionCuts(G4ProductionCuts* aCut)
|
||||
{ fCuts = aCut; }
|
||||
G4bool G4MaterialCutsCouple::IsUsed() const
|
||||
{
|
||||
return isUsedInGeometry;
|
||||
}
|
||||
|
||||
inline
|
||||
G4ProductionCuts* G4MaterialCutsCouple::GetProductionCuts() const
|
||||
{ return fCuts; }
|
||||
void G4MaterialCutsCouple::SetProductionCuts(G4ProductionCuts* aCut)
|
||||
{
|
||||
fCuts = aCut;
|
||||
}
|
||||
|
||||
inline
|
||||
G4bool G4MaterialCutsCouple::operator==(const G4MaterialCutsCouple &right) const
|
||||
G4ProductionCuts* G4MaterialCutsCouple::GetProductionCuts() const
|
||||
{
|
||||
return fCuts;
|
||||
}
|
||||
|
||||
inline
|
||||
G4bool G4MaterialCutsCouple::operator==(const G4MaterialCutsCouple& right) const
|
||||
{
|
||||
return (this == &right);
|
||||
}
|
||||
|
||||
inline
|
||||
G4bool G4MaterialCutsCouple::operator!=(const G4MaterialCutsCouple &right) const
|
||||
G4bool G4MaterialCutsCouple::operator!=(const G4MaterialCutsCouple& right) const
|
||||
{
|
||||
return (this != &right);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4MaterialCutsCouple::SetMaterial(const G4Material* material)
|
||||
void G4MaterialCutsCouple::SetMaterial(const G4Material* material)
|
||||
{
|
||||
fMaterial = material;
|
||||
isMaterialModified = true;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4Material* G4MaterialCutsCouple::GetMaterial() const
|
||||
const G4Material* G4MaterialCutsCouple::GetMaterial() const
|
||||
{
|
||||
return fMaterial;
|
||||
}
|
||||
@@ -155,22 +172,15 @@ inline
|
||||
G4bool G4MaterialCutsCouple::IsRecalcNeeded() const
|
||||
{
|
||||
G4bool isCutModified = false;
|
||||
if (fCuts !=0 ) isCutModified = fCuts->IsModified();
|
||||
if (fCuts != nullptr ) isCutModified = fCuts->IsModified();
|
||||
return (isMaterialModified || isCutModified);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4MaterialCutsCouple::PhysicsTableUpdated()
|
||||
void G4MaterialCutsCouple::PhysicsTableUpdated()
|
||||
{
|
||||
if (fCuts !=0 ) fCuts->PhysicsTableUpdated();
|
||||
if (fCuts != nullptr ) fCuts->PhysicsTableUpdated();
|
||||
isMaterialModified = false;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user