Import Geant4 10.5.1 source tree
This commit is contained in:
+1
-1
@@ -167,7 +167,7 @@ endif
|
||||
|
||||
banner:
|
||||
@$(ECHO) "*************************************************************"
|
||||
@$(ECHO) " Installation Geant4 version geant4-10-05 "
|
||||
@$(ECHO) " Installation Geant4 version geant4-10-05-patch-01 "
|
||||
@$(ECHO) " Copyright (C) 1994-2019 Geant4 Collaboration "
|
||||
@$(ECHO) "*************************************************************"
|
||||
|
||||
|
||||
@@ -16,6 +16,9 @@ committal in the SVN repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
March 11, 2019 G. Cosmo (analysis-V10-04-11)
|
||||
- Fixed typos in printouts in G4P1Messenger, G4PlotMessenger, G4PlotParameters.
|
||||
|
||||
November 28, 2018 I. Hrivnacova (analysis-V10-04-10)
|
||||
- Use the same mutex in Root pntuple add_row and end_fill.
|
||||
This should fix occassional failures of tests in MT mode.
|
||||
|
||||
@@ -63,7 +63,7 @@ G4String ObjectType(const G4String& hnType)
|
||||
|
||||
//_____________________________________________________________________________
|
||||
void Replace(std::string& str, const std::string& from, const std::string& to) {
|
||||
// Replace all occurences of from string
|
||||
// Replace all occurrences of from string
|
||||
if (from.empty()) return;
|
||||
size_t start_pos = 0;
|
||||
while ((start_pos = str.find(from, start_pos)) != std::string::npos) {
|
||||
|
||||
@@ -105,7 +105,7 @@ void G4P1Messenger::CreateP1Cmd()
|
||||
auto p1xValFcn0 = new G4UIparameter("xvalFcn0", 's', true);
|
||||
G4String fcnxGuidance = "The function applied to filled x-values (log, log10, exp, none).\n";
|
||||
fcnxGuidance += "Note that the unit parameter cannot be omitted in this case,\n";
|
||||
fcnxGuidance += "but none value should be used insted.";
|
||||
fcnxGuidance += "but none value should be used instead.";
|
||||
p1xValFcn0->SetGuidance(fcnxGuidance);
|
||||
p1xValFcn0->SetParameterCandidates("log log10 exp none");
|
||||
p1xValFcn0->SetDefaultValue("none");
|
||||
@@ -115,7 +115,7 @@ void G4P1Messenger::CreateP1Cmd()
|
||||
p1xValBinScheme0->SetParameterCandidates("linear log");
|
||||
binSchemeGuidance
|
||||
+= "Note that the unit and fcn parameters cannot be omitted in this case,\n";
|
||||
binSchemeGuidance += "but none value should be used insted.";
|
||||
binSchemeGuidance += "but none value should be used instead.";
|
||||
p1xValBinScheme0->SetGuidance(binSchemeGuidance);
|
||||
p1xValBinScheme0->SetDefaultValue("linear");
|
||||
|
||||
@@ -136,7 +136,7 @@ void G4P1Messenger::CreateP1Cmd()
|
||||
auto p1yValFcn0 = new G4UIparameter("yvalFcn0", 's', true);
|
||||
G4String fcnyGuidance = "The function applied to filled y-values (log, log10, exp, none).\n";
|
||||
fcnyGuidance += "Note that the unit parameter cannot be omitted in this case,\n";
|
||||
fcnyGuidance += "but none value should be used insted.";
|
||||
fcnyGuidance += "but none value should be used instead.";
|
||||
p1yValFcn0->SetGuidance(fcnyGuidance);
|
||||
p1yValFcn0->SetParameterCandidates("log log10 exp none");
|
||||
p1yValFcn0->SetDefaultValue("none");
|
||||
@@ -183,7 +183,7 @@ void G4P1Messenger::SetP1Cmd()
|
||||
p1xValFcn->SetParameterCandidates("log log10 exp none");
|
||||
G4String fcnxGuidance = "The function applied to filled x-values (log, log10, exp, none).\n";
|
||||
fcnxGuidance += "Note that the unit parameter cannot be omitted in this case,\n";
|
||||
fcnxGuidance += "but none value should be used insted.";
|
||||
fcnxGuidance += "but none value should be used instead.";
|
||||
p1xValFcn->SetGuidance(fcnxGuidance);
|
||||
p1xValFcn->SetDefaultValue("none");
|
||||
|
||||
@@ -192,7 +192,7 @@ void G4P1Messenger::SetP1Cmd()
|
||||
p1xValBinScheme->SetParameterCandidates("linear log");
|
||||
binSchemeGuidance
|
||||
+= "Note that the unit and fcn parameters cannot be omitted in this case,\n";
|
||||
binSchemeGuidance += "but none value should be used insted.";
|
||||
binSchemeGuidance += "but none value should be used instead.";
|
||||
p1xValBinScheme->SetGuidance(binSchemeGuidance);
|
||||
p1xValBinScheme->SetDefaultValue("linear");
|
||||
|
||||
@@ -210,7 +210,7 @@ void G4P1Messenger::SetP1Cmd()
|
||||
p1yValFcn->SetParameterCandidates("log log10 exp none");
|
||||
G4String fcnyGuidance = "The function applied to filled y-values (log, log10, exp, none).\n";
|
||||
fcnyGuidance += "Note that the unit parameter cannot be omitted in this case,\n";
|
||||
fcnyGuidance += "but none value should be used insted.";
|
||||
fcnyGuidance += "but none value should be used instead.";
|
||||
p1yValFcn->SetGuidance(fcnyGuidance);
|
||||
p1yValFcn->SetDefaultValue("none");
|
||||
|
||||
|
||||
@@ -112,11 +112,11 @@ void G4PlotMessenger::SetLayoutCmd()
|
||||
fSetLayoutCmd = G4Analysis::make_unique<G4UIcommand>("/analysis/plot/setLayout", this);
|
||||
// Guidance text:
|
||||
// Set page layout (number of columns and rows per page).
|
||||
// Suported layouts:
|
||||
// Supported layouts:
|
||||
// columns = 1 .. maxValueAllowed
|
||||
// rows = 1 .. maxValueAllowed, and >= columns
|
||||
fSetLayoutCmd->SetGuidance("Set page layout (number of columns and rows per page).");
|
||||
fSetLayoutCmd->SetGuidance(" Suported layouts: ");
|
||||
fSetLayoutCmd->SetGuidance(" Supported layouts: ");
|
||||
G4String guidance = " columns = 1 .. ";
|
||||
guidance.append(osMaxColumns.str());
|
||||
fSetLayoutCmd->SetGuidance(guidance);
|
||||
|
||||
@@ -77,7 +77,7 @@ void G4PlotParameters::SetLayout(G4int columns, G4int rows)
|
||||
G4ExceptionDescription description;
|
||||
description
|
||||
<< "Layout: " << columns << " x " << rows << " was ignored." << G4endl
|
||||
<< "Suported layouts: " << G4endl
|
||||
<< "Supported layouts: " << G4endl
|
||||
<< " columns <= rows" << G4endl
|
||||
<< " columns = 1 .. " << fMaxColumns << G4endl
|
||||
<< " rows = 1 .. " << fMaxRows << G4endl;
|
||||
|
||||
@@ -16,6 +16,20 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
March 13th, 2019 M. Asai (digits_hits-V10-04-13)
|
||||
- Defining unit categories for UI commands that take units. Co-working with
|
||||
intercoms-V10-05-02.
|
||||
|
||||
March 10th, 2019 M. Asai
|
||||
- G4SDManager, G4VSDFilter :
|
||||
Cleanly deleting all the G4VSDFilter objects at the end of program.
|
||||
|
||||
January 31st, 2019 I. Hrivnacova
|
||||
- Merged GitHub PR #4: all Boolean operators now return G4bool.
|
||||
|
||||
December 20th, 2018 G. Cosmo
|
||||
- Fixed shadowing compilation warning in G4ScoringBox and G4ScoringCylinder.
|
||||
|
||||
October 30th, 2018 I. Hrivnacova (digits_hits-V10-04-11,12)
|
||||
- Removed the dependence on analysis:
|
||||
Introduced a new interface class, G4VScoreNtupleWriter, in
|
||||
|
||||
@@ -37,6 +37,9 @@ class G4VSensitiveDetector;
|
||||
class G4HCofThisEvent;
|
||||
class G4SDmessenger;
|
||||
|
||||
#include "G4VSDFilter.hh"
|
||||
#include <vector>
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This is a singleton class which manages the sensitive detectors.
|
||||
@@ -104,6 +107,12 @@ private:
|
||||
G4SDManager( const G4SDManager& );
|
||||
G4SDManager& operator=(const G4SDManager&);
|
||||
|
||||
public:
|
||||
void RegisterSDFilter(G4VSDFilter* filter);
|
||||
void DeRegisterSDFilter(G4VSDFilter* filter);
|
||||
private:
|
||||
void DestroyFilters();
|
||||
std::vector<G4VSDFilter*> FilterList;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class G4SDStructure
|
||||
G4SDStructure(G4String aPath);
|
||||
~G4SDStructure();
|
||||
|
||||
G4int operator==(const G4SDStructure &right) const;
|
||||
G4bool operator==(const G4SDStructure &right) const;
|
||||
|
||||
void AddNewDetector(G4VSensitiveDetector*aSD, G4String treeStructure);
|
||||
void Activate(G4String aName, G4bool sensitiveFlag);
|
||||
|
||||
@@ -67,8 +67,8 @@ class G4SensitiveVolumeList
|
||||
);
|
||||
|
||||
//Equality Operations
|
||||
G4int operator==(const G4SensitiveVolumeList &right) const;
|
||||
G4int operator!=(const G4SensitiveVolumeList &right) const;
|
||||
G4bool operator==(const G4SensitiveVolumeList &right) const;
|
||||
G4bool operator!=(const G4SensitiveVolumeList &right) const;
|
||||
|
||||
|
||||
//Other Operations
|
||||
|
||||
@@ -46,8 +46,8 @@ class G4VReadOutGeometry
|
||||
G4VReadOutGeometry(G4String);
|
||||
virtual ~G4VReadOutGeometry();
|
||||
|
||||
G4int operator==(const G4VReadOutGeometry &right) const;
|
||||
G4int operator!=(const G4VReadOutGeometry &right) const;
|
||||
G4bool operator==(const G4VReadOutGeometry &right) const;
|
||||
G4bool operator!=(const G4VReadOutGeometry &right) const;
|
||||
|
||||
// buildROGeomety must be invoked to Build (ie Build() method)
|
||||
// the ROGeometry. It sets up in addition the needed
|
||||
|
||||
@@ -35,7 +35,7 @@ class G4Step;
|
||||
// class description:
|
||||
//
|
||||
// This is the abstract base class of a filter to be associated with a
|
||||
// sensitive detector.
|
||||
// sensitive detector or a primitive scorer.
|
||||
|
||||
class G4VSDFilter
|
||||
{
|
||||
|
||||
@@ -61,8 +61,8 @@ class G4VSensitiveDetector
|
||||
|
||||
G4VSensitiveDetector & operator=(const G4VSensitiveDetector &right);
|
||||
|
||||
G4int operator==(const G4VSensitiveDetector &right) const;
|
||||
G4int operator!=(const G4VSensitiveDetector &right) const;
|
||||
G4bool operator==(const G4VSensitiveDetector &right) const;
|
||||
G4bool operator!=(const G4VSensitiveDetector &right) const;
|
||||
|
||||
public: // with description
|
||||
virtual void Initialize(G4HCofThisEvent*);
|
||||
|
||||
@@ -61,6 +61,7 @@ G4SDManager::~G4SDManager()
|
||||
delete theMessenger;
|
||||
delete HCtable;
|
||||
delete treeTop;
|
||||
DestroyFilters();
|
||||
theMessenger = nullptr;
|
||||
HCtable = nullptr;
|
||||
treeTop = nullptr;
|
||||
@@ -149,4 +150,32 @@ G4int G4SDManager::GetCollectionID(G4VHitsCollection* aHC)
|
||||
return GetCollectionID(HCname);
|
||||
}
|
||||
|
||||
void G4SDManager::RegisterSDFilter(G4VSDFilter* filter)
|
||||
{
|
||||
FilterList.push_back(filter);
|
||||
}
|
||||
|
||||
void G4SDManager::DeRegisterSDFilter(G4VSDFilter* filter)
|
||||
{
|
||||
for(auto f = FilterList.begin(); f != FilterList.end(); f++)
|
||||
{
|
||||
if(*f == filter)
|
||||
{
|
||||
FilterList.erase(f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void G4SDManager::DestroyFilters()
|
||||
{
|
||||
auto f = FilterList.begin();
|
||||
while( f != FilterList.end() )
|
||||
{
|
||||
if(verboseLevel>0) G4cout << "### deleting " << (*f)->GetName() << " " << (*f) << G4endl;
|
||||
delete *f;
|
||||
f = FilterList.begin();
|
||||
}
|
||||
FilterList.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ G4SDStructure::~G4SDStructure()
|
||||
detector.clear();
|
||||
}
|
||||
|
||||
G4int G4SDStructure::operator==(const G4SDStructure &right) const
|
||||
G4bool G4SDStructure::operator==(const G4SDStructure &right) const
|
||||
{
|
||||
return (this==&right);
|
||||
}
|
||||
|
||||
@@ -63,12 +63,12 @@
|
||||
|
||||
|
||||
//Equality Operations
|
||||
G4int G4SensitiveVolumeList::operator==(const G4SensitiveVolumeList &right) const
|
||||
G4bool G4SensitiveVolumeList::operator==(const G4SensitiveVolumeList &right) const
|
||||
{
|
||||
return (this == (G4SensitiveVolumeList *) &right);
|
||||
}
|
||||
|
||||
G4int G4SensitiveVolumeList::operator!=(const G4SensitiveVolumeList &right) const
|
||||
G4bool G4SensitiveVolumeList::operator!=(const G4SensitiveVolumeList &right) const
|
||||
{
|
||||
return (this != (G4SensitiveVolumeList *) &right);
|
||||
}
|
||||
|
||||
@@ -94,10 +94,10 @@ G4VReadOutGeometry & G4VReadOutGeometry::operator=(const G4VReadOutGeometry &rig
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4int G4VReadOutGeometry::operator==(const G4VReadOutGeometry &right) const
|
||||
G4bool G4VReadOutGeometry::operator==(const G4VReadOutGeometry &right) const
|
||||
{ return (this == (G4VReadOutGeometry *) &right); }
|
||||
|
||||
G4int G4VReadOutGeometry::operator!=(const G4VReadOutGeometry &right) const
|
||||
G4bool G4VReadOutGeometry::operator!=(const G4VReadOutGeometry &right) const
|
||||
{ return (this != (G4VReadOutGeometry *) &right); }
|
||||
|
||||
void G4VReadOutGeometry::BuildROGeometry()
|
||||
|
||||
@@ -27,10 +27,16 @@
|
||||
//
|
||||
// G4VSensitiveDetector
|
||||
#include "G4VSDFilter.hh"
|
||||
#include "G4SDManager.hh"
|
||||
|
||||
G4VSDFilter::G4VSDFilter(G4String name)
|
||||
:filterName(name)
|
||||
{;}
|
||||
{
|
||||
G4SDManager::GetSDMpointer()->RegisterSDFilter(this);
|
||||
}
|
||||
|
||||
G4VSDFilter::~G4VSDFilter()
|
||||
{;}
|
||||
{
|
||||
G4SDManager::GetSDMpointer()->DeRegisterSDFilter(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -88,12 +88,12 @@ G4VSensitiveDetector & G4VSensitiveDetector::operator=(const G4VSensitiveDetecto
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4int G4VSensitiveDetector::operator==(const G4VSensitiveDetector &right) const
|
||||
G4bool G4VSensitiveDetector::operator==(const G4VSensitiveDetector &right) const
|
||||
{
|
||||
return (this==&right);
|
||||
}
|
||||
|
||||
G4int G4VSensitiveDetector::operator!=(const G4VSensitiveDetector &right) const
|
||||
G4bool G4VSensitiveDetector::operator!=(const G4VSensitiveDetector &right) const
|
||||
{
|
||||
return (this!=&right);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class G4DigiCollection : public G4VDigiCollection
|
||||
G4DigiCollection();
|
||||
G4DigiCollection(G4String detName,G4String colNam);
|
||||
virtual ~G4DigiCollection();
|
||||
G4int operator==(const G4DigiCollection &right) const;
|
||||
G4bool operator==(const G4DigiCollection &right) const;
|
||||
|
||||
protected:
|
||||
void* theCollection;
|
||||
@@ -71,7 +71,7 @@ template <class T> class G4TDigiCollection : public G4DigiCollection
|
||||
// Constructor.
|
||||
public:
|
||||
virtual ~G4TDigiCollection();
|
||||
G4int operator==(const G4TDigiCollection &right) const;
|
||||
G4bool operator==(const G4TDigiCollection &right) const;
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void* aDC);
|
||||
@@ -170,7 +170,7 @@ template <class T> G4TDigiCollection<T>::~G4TDigiCollection()
|
||||
delete theDigiCollection;
|
||||
}
|
||||
|
||||
template <class T> G4int G4TDigiCollection<T>::operator==(const G4TDigiCollection<T> &right) const
|
||||
template <class T> G4bool G4TDigiCollection<T>::operator==(const G4TDigiCollection<T> &right) const
|
||||
{
|
||||
if (!aDCAllocator_G4MT_TLS_()) aDCAllocator_G4MT_TLS_() = new G4Allocator<G4DigiCollection>;
|
||||
return (collectionName==right.collectionName);
|
||||
|
||||
@@ -51,7 +51,7 @@ class G4VDigi
|
||||
G4VDigi();
|
||||
virtual ~G4VDigi();
|
||||
|
||||
G4int operator==(const G4VDigi &right) const;
|
||||
G4bool operator==(const G4VDigi &right) const;
|
||||
|
||||
virtual void Draw();
|
||||
virtual void Print();
|
||||
|
||||
@@ -47,7 +47,7 @@ class G4VDigiCollection
|
||||
G4VDigiCollection();
|
||||
G4VDigiCollection(G4String DMnam,G4String colNam);
|
||||
virtual ~G4VDigiCollection();
|
||||
G4int operator==(const G4VDigiCollection &right) const;
|
||||
G4bool operator==(const G4VDigiCollection &right) const;
|
||||
|
||||
virtual void DrawAllDigi();
|
||||
virtual void PrintAllDigi();
|
||||
|
||||
@@ -44,6 +44,6 @@ G4DigiCollection::G4DigiCollection(G4String detName,G4String colNam)
|
||||
G4DigiCollection::~G4DigiCollection()
|
||||
{ if (!aDCAllocator_G4MT_TLS_()) aDCAllocator_G4MT_TLS_() = new G4Allocator<G4DigiCollection> ;;}
|
||||
|
||||
G4int G4DigiCollection::operator==(const G4DigiCollection &right) const
|
||||
G4bool G4DigiCollection::operator==(const G4DigiCollection &right) const
|
||||
{ if (!aDCAllocator_G4MT_TLS_()) aDCAllocator_G4MT_TLS_() = new G4Allocator<G4DigiCollection> ; return (collectionName==right.collectionName); }
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ G4VDigi::G4VDigi()
|
||||
G4VDigi::~G4VDigi()
|
||||
{;}
|
||||
|
||||
G4int G4VDigi::operator==(const G4VDigi &right) const
|
||||
G4bool G4VDigi::operator==(const G4VDigi &right) const
|
||||
{ return (this==&right); }
|
||||
|
||||
void G4VDigi::Draw()
|
||||
|
||||
@@ -45,7 +45,7 @@ G4VDigiCollection::G4VDigiCollection(G4String DMnam,G4String colNam)
|
||||
G4VDigiCollection::~G4VDigiCollection()
|
||||
{ ; }
|
||||
|
||||
G4int G4VDigiCollection::operator==(const G4VDigiCollection &right) const
|
||||
G4bool G4VDigiCollection::operator==(const G4VDigiCollection &right) const
|
||||
{
|
||||
return ((collectionName==right.collectionName)
|
||||
&&(DMname==right.DMname));
|
||||
|
||||
@@ -51,7 +51,7 @@ class G4HitsCollection : public G4VHitsCollection
|
||||
G4HitsCollection();
|
||||
G4HitsCollection(G4String detName,G4String colNam);
|
||||
virtual ~G4HitsCollection();
|
||||
G4int operator==(const G4HitsCollection &right) const;
|
||||
G4bool operator==(const G4HitsCollection &right) const;
|
||||
|
||||
protected:
|
||||
void* theCollection;
|
||||
@@ -72,7 +72,7 @@ template <class T> class G4THitsCollection : public G4HitsCollection
|
||||
// constructor.
|
||||
public:
|
||||
virtual ~G4THitsCollection();
|
||||
G4int operator==(const G4THitsCollection<T> &right) const;
|
||||
G4bool operator==(const G4THitsCollection<T> &right) const;
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void* anHC);
|
||||
@@ -166,7 +166,7 @@ template <class T> G4THitsCollection<T>::~G4THitsCollection()
|
||||
delete theHitsCollection;
|
||||
}
|
||||
|
||||
template <class T> G4int G4THitsCollection<T>::operator==(const G4THitsCollection<T> &right) const
|
||||
template <class T> G4bool G4THitsCollection<T>::operator==(const G4THitsCollection<T> &right) const
|
||||
{
|
||||
if (!anHCAllocator_G4MT_TLS_()) anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection>;
|
||||
return (collectionName==right.collectionName);
|
||||
|
||||
@@ -87,7 +87,7 @@ public: // with description
|
||||
// destructor
|
||||
virtual ~G4VTHitsMap();
|
||||
// equivalence operator
|
||||
G4int operator==(const G4VTHitsMap<T, Map_t> &right) const;
|
||||
G4bool operator==(const G4VTHitsMap<T, Map_t> &right) const;
|
||||
|
||||
//------------------------------------------------------------------------//
|
||||
// Generic operator += where add(...) overloads handle various
|
||||
@@ -499,7 +499,7 @@ G4VTHitsMap<T, Map_t>::~G4VTHitsMap()
|
||||
//============================================================================//
|
||||
|
||||
template <typename T, typename Map_t>
|
||||
G4int G4VTHitsMap<T, Map_t>::operator==(const G4VTHitsMap<T, Map_t> &right) const
|
||||
G4bool G4VTHitsMap<T, Map_t>::operator==(const G4VTHitsMap<T, Map_t> &right) const
|
||||
{
|
||||
return (collectionName==right.collectionName);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
// destructor
|
||||
virtual ~G4VTHitsVector();
|
||||
// equivalence operator
|
||||
G4int operator==(const this_type& rhs) const;
|
||||
G4bool operator==(const this_type& rhs) const;
|
||||
|
||||
virtual void DrawAllHits();
|
||||
virtual void PrintAllHits();
|
||||
@@ -613,7 +613,7 @@ G4VTHitsVector<T, Vector_t>::~G4VTHitsVector()
|
||||
//============================================================================//
|
||||
|
||||
template <typename T, typename Vector_t>
|
||||
G4int G4VTHitsVector<T, Vector_t>::operator==(const G4VTHitsVector<T, Vector_t> &right) const
|
||||
G4bool G4VTHitsVector<T, Vector_t>::operator==(const G4VTHitsVector<T, Vector_t> &right) const
|
||||
{
|
||||
return (collectionName==right.collectionName);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ class G4VHit
|
||||
G4VHit();
|
||||
virtual ~G4VHit();
|
||||
|
||||
G4int operator==(const G4VHit &right) const;
|
||||
G4bool operator==(const G4VHit &right) const;
|
||||
|
||||
virtual void Draw();
|
||||
virtual void Print();
|
||||
|
||||
@@ -47,7 +47,7 @@ class G4VHitsCollection
|
||||
G4VHitsCollection();
|
||||
G4VHitsCollection(G4String detName,G4String colNam);
|
||||
virtual ~G4VHitsCollection();
|
||||
G4int operator==(const G4VHitsCollection &right) const;
|
||||
G4bool operator==(const G4VHitsCollection &right) const;
|
||||
|
||||
virtual void DrawAllHits();
|
||||
virtual void PrintAllHits();
|
||||
|
||||
@@ -44,6 +44,6 @@ G4HitsCollection::G4HitsCollection(G4String detName,G4String colNam)
|
||||
G4HitsCollection::~G4HitsCollection()
|
||||
{ if (!anHCAllocator_G4MT_TLS_()) anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection> ;;}
|
||||
|
||||
int G4HitsCollection::operator==(const G4HitsCollection &right) const
|
||||
G4bool G4HitsCollection::operator==(const G4HitsCollection &right) const
|
||||
{ if (!anHCAllocator_G4MT_TLS_()) anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection> ; return (collectionName==right.collectionName); }
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ G4VHit::G4VHit()
|
||||
G4VHit::~G4VHit()
|
||||
{;}
|
||||
|
||||
G4int G4VHit::operator==(const G4VHit &) const
|
||||
G4bool G4VHit::operator==(const G4VHit &) const
|
||||
{ return false; }
|
||||
|
||||
void G4VHit::Draw()
|
||||
|
||||
@@ -47,7 +47,7 @@ G4VHitsCollection::G4VHitsCollection(G4String detName,G4String colNam)
|
||||
G4VHitsCollection::~G4VHitsCollection()
|
||||
{ ; }
|
||||
|
||||
G4int G4VHitsCollection::operator==(const G4VHitsCollection &right) const
|
||||
G4bool G4VHitsCollection::operator==(const G4VHitsCollection &right) const
|
||||
{
|
||||
return ((collectionName==right.collectionName)
|
||||
&&(SDname==right.SDname));
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWith3VectorAndUnit.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4UIparameter.hh"
|
||||
#include "G4Tokenizer.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
@@ -128,7 +129,7 @@ void G4ScoreQuantityMessenger::FilterCommands()
|
||||
G4String smax = DtoS(DBL_MAX);
|
||||
param->SetDefaultValue(smax);
|
||||
param = new G4UIparameter("unit",'s',true);
|
||||
param->SetDefaultValue("keV");
|
||||
param->SetDefaultUnit("keV");
|
||||
fkinECmd->SetParameter(param);
|
||||
//
|
||||
fparticleCmd = new G4UIcommand("/score/filter/particle",this);
|
||||
@@ -161,7 +162,7 @@ void G4ScoreQuantityMessenger::FilterCommands()
|
||||
param->SetDefaultValue(smax);
|
||||
fparticleKinECmd->SetParameter(param);
|
||||
param = new G4UIparameter("unit",'s',true);
|
||||
param->SetDefaultValue("keV");
|
||||
param->SetDefaultUnit("keV");
|
||||
fparticleKinECmd->SetParameter(param);
|
||||
param = new G4UIparameter("particlelist",'s',false);
|
||||
param->SetDefaultValue("");
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWith3VectorAndUnit.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4UIparameter.hh"
|
||||
#include "G4Tokenizer.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
@@ -103,31 +104,31 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
qeDepCmd = new G4UIcommand("/score/quantity/energyDeposit",this);
|
||||
qeDepCmd->SetGuidance("Energy deposit scorer.");
|
||||
qeDepCmd->
|
||||
SetGuidance("[usage] /score/quantiy/energyDeposit qname unit");
|
||||
SetGuidance("[usage] /score/quantity/energyDeposit qname unit");
|
||||
qeDepCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qeDepCmd->SetGuidance(" unit :(String) unit");
|
||||
param = new G4UIparameter("qname",'s',false);
|
||||
qeDepCmd->SetParameter(param);
|
||||
param = new G4UIparameter("unit",'s',true);
|
||||
param->SetDefaultValue("MeV");
|
||||
param->SetDefaultUnit("MeV");
|
||||
qeDepCmd->SetParameter(param);
|
||||
//
|
||||
qCellChgCmd = new G4UIcommand("/score/quantity/cellCharge",this);
|
||||
qCellChgCmd->SetGuidance("Cell charge scorer.");
|
||||
qCellChgCmd->
|
||||
SetGuidance("[usage] /score/quantiy/cellCharge qname unit");
|
||||
SetGuidance("[usage] /score/quantity/cellCharge qname unit");
|
||||
qCellChgCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qCellChgCmd->SetGuidance(" unit :(String) unit");
|
||||
param = new G4UIparameter("qname",'s',false);
|
||||
qCellChgCmd->SetParameter(param);
|
||||
param = new G4UIparameter("unit",'s',true);
|
||||
param->SetDefaultValue("e+");
|
||||
param->SetDefaultUnit("e+");
|
||||
qCellChgCmd->SetParameter(param);
|
||||
//
|
||||
qCellFluxCmd = new G4UIcommand("/score/quantity/cellFlux",this);
|
||||
qCellFluxCmd->SetGuidance("Cell flux scorer.");
|
||||
qCellFluxCmd->
|
||||
SetGuidance("[usage] /score/quantiy/cellFlux qname unit");
|
||||
SetGuidance("[usage] /score/quantity/cellFlux qname unit");
|
||||
qCellFluxCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qCellFluxCmd->SetGuidance(" unit :(String) unit");
|
||||
param = new G4UIparameter("qname",'s',false);
|
||||
@@ -139,7 +140,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
qPassCellFluxCmd = new G4UIcommand("/score/quantity/passageCellFlux",this);
|
||||
qPassCellFluxCmd->SetGuidance("Passage cell flux scorer");
|
||||
qPassCellFluxCmd->
|
||||
SetGuidance("[usage] /score/quantiy/passageCellFlux qname unit");
|
||||
SetGuidance("[usage] /score/quantity/passageCellFlux qname unit");
|
||||
qPassCellFluxCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qPassCellFluxCmd->SetGuidance(" unit :(String) unit");
|
||||
param = new G4UIparameter("qname",'s',false);
|
||||
@@ -151,21 +152,21 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
qdoseDepCmd = new G4UIcommand("/score/quantity/doseDeposit",this);
|
||||
qdoseDepCmd->SetGuidance("Dose deposit scorer.");
|
||||
qdoseDepCmd->
|
||||
SetGuidance("[usage] /score/quantiy/doseDeposit qname unit");
|
||||
SetGuidance("[usage] /score/quantity/doseDeposit qname unit");
|
||||
qdoseDepCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qdoseDepCmd->SetGuidance(" unit :(String) unit");
|
||||
param = new G4UIparameter("qname",'s',false);
|
||||
qdoseDepCmd->SetParameter(param);
|
||||
param = new G4UIparameter("unit",'s',true);
|
||||
param->SetDefaultValue("Gy");
|
||||
param->SetDefaultUnit("Gy");
|
||||
qdoseDepCmd->SetParameter(param);
|
||||
//
|
||||
qnOfStepCmd = new G4UIcommand("/score/quantity/nOfStep",this);
|
||||
qnOfStepCmd->SetGuidance("Number of step scorer.");
|
||||
qnOfStepCmd->
|
||||
SetGuidance("[usage] /score/quantiy/nOfStep qname");
|
||||
SetGuidance("[usage] /score/quantity/nOfStep qname");
|
||||
qnOfStepCmd->
|
||||
SetGuidance("[usage] /score/quantiy/nOfStep qname bflag");
|
||||
SetGuidance("[usage] /score/quantity/nOfStep qname bflag");
|
||||
qnOfStepCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qnOfStepCmd->SetGuidance(" bflag :(Bool) Skip zero step ");
|
||||
qnOfStepCmd->SetGuidance(" at geometry boundary if true");
|
||||
@@ -178,7 +179,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
qnOfSecondaryCmd = new G4UIcommand("/score/quantity/nOfSecondary",this);
|
||||
qnOfSecondaryCmd->SetGuidance("Number of secondary scorer.");
|
||||
qnOfSecondaryCmd->
|
||||
SetGuidance("[usage] /score/quantiy/nOfSecondary qname");
|
||||
SetGuidance("[usage] /score/quantity/nOfSecondary qname");
|
||||
qnOfSecondaryCmd->SetGuidance(" qname :(String) scorer name");
|
||||
param = new G4UIparameter("qname",'s',false);
|
||||
qnOfSecondaryCmd->SetParameter(param);
|
||||
@@ -186,7 +187,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
qTrackLengthCmd = new G4UIcommand("/score/quantity/trackLength",this);
|
||||
qTrackLengthCmd->SetGuidance("Track length scorer.");
|
||||
qTrackLengthCmd->
|
||||
SetGuidance("[usage] /score/quantiy/trackLength qname wflag kflag vflag unit");
|
||||
SetGuidance("[usage] /score/quantity/trackLength qname wflag kflag vflag unit");
|
||||
qTrackLengthCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qTrackLengthCmd->SetGuidance(" wflag :(Bool) weighted");
|
||||
qTrackLengthCmd->SetGuidance(" kflag :(Bool) multiply kinetic energy");
|
||||
@@ -204,13 +205,13 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
param->SetDefaultValue("false");
|
||||
qTrackLengthCmd->SetParameter(param);
|
||||
param = new G4UIparameter("unit",'s',true);
|
||||
param->SetDefaultValue("mm");
|
||||
param->SetDefaultUnit("mm");
|
||||
qTrackLengthCmd->SetParameter(param);
|
||||
//
|
||||
qPassCellCurrCmd = new G4UIcommand("/score/quantity/passageCellCurrent",this);
|
||||
qPassCellCurrCmd->SetGuidance("Passage cell current scorer.");
|
||||
qPassCellCurrCmd->
|
||||
SetGuidance("[usage] /score/quantiy/passageCellCurrent qname wflag");
|
||||
SetGuidance("[usage] /score/quantity/passageCellCurrent qname wflag");
|
||||
qPassCellCurrCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qPassCellCurrCmd->SetGuidance(" wflag :(Bool) weighted");
|
||||
param = new G4UIparameter("qname",'s',false);
|
||||
@@ -222,7 +223,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
qPassTrackLengthCmd = new G4UIcommand("/score/quantity/passageTrackLength",this);
|
||||
qPassTrackLengthCmd->SetGuidance("Passage track length scorer.");
|
||||
qPassTrackLengthCmd->
|
||||
SetGuidance("[usage] /score/quantiy/passageTrackLength qname wflag unit");
|
||||
SetGuidance("[usage] /score/quantity/passageTrackLength qname wflag unit");
|
||||
qPassTrackLengthCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qPassTrackLengthCmd->SetGuidance(" wflag :(Bool) weighted");
|
||||
qPassTrackLengthCmd->SetGuidance(" unit :(Bool) unit");
|
||||
@@ -232,13 +233,13 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
param->SetDefaultValue("true");
|
||||
qPassTrackLengthCmd->SetParameter(param);
|
||||
param = new G4UIparameter("unit",'s',true);
|
||||
param->SetDefaultValue("mm");
|
||||
param->SetDefaultUnit("mm");
|
||||
qPassTrackLengthCmd->SetParameter(param);
|
||||
//
|
||||
qFlatSurfCurrCmd = new G4UIcommand("/score/quantity/flatSurfaceCurrent",this);
|
||||
qFlatSurfCurrCmd->SetGuidance("Flat surface current Scorer.");
|
||||
qFlatSurfCurrCmd->
|
||||
SetGuidance("[usage] /score/quantiy/flatSurfaceCurrent qname dflag wflag aflag unit");
|
||||
SetGuidance("[usage] /score/quantity/flatSurfaceCurrent qname dflag wflag aflag unit");
|
||||
qFlatSurfCurrCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qFlatSurfCurrCmd->SetGuidance(" dflag :(Int) direction flag");
|
||||
qFlatSurfCurrCmd->SetGuidance(" : 0 = Both In and Out");
|
||||
@@ -246,7 +247,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
qFlatSurfCurrCmd->SetGuidance(" : 2 = Out only");
|
||||
qFlatSurfCurrCmd->SetGuidance(" wflag :(Bool) weighted");
|
||||
qFlatSurfCurrCmd->SetGuidance(" aflag :(Bool) divide by area");
|
||||
qFlatSurfCurrCmd->SetGuidance(" unit :(Bool) unit");
|
||||
qFlatSurfCurrCmd->SetGuidance(" unit :(String) unit");
|
||||
param = new G4UIparameter("qname",'s',false);
|
||||
qFlatSurfCurrCmd->SetParameter(param);
|
||||
param = new G4UIparameter("dflag",'i',true);
|
||||
@@ -265,7 +266,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
qFlatSurfFluxCmd = new G4UIcommand("/score/quantity/flatSurfaceFlux",this);
|
||||
qFlatSurfFluxCmd->SetGuidance("Flat surface flux scorer.");
|
||||
qFlatSurfFluxCmd->
|
||||
SetGuidance("[usage] /score/quantiy/flatSurfaceFlux qname dflag unit");
|
||||
SetGuidance("[usage] /score/quantity/flatSurfaceFlux qname dflag unit");
|
||||
qFlatSurfFluxCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qFlatSurfFluxCmd->SetGuidance(" dflag :(Int) direction flag");
|
||||
qFlatSurfFluxCmd->SetGuidance(" : 0 = Both In and Out");
|
||||
@@ -292,7 +293,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
// qSphereSurfCurrCmd = new G4UIcommand("/score/quantity/sphereSurfaceCurrent",this);
|
||||
// qSphereSurfCurrCmd->SetGuidance("Sphere surface current Scorer.");
|
||||
// qSphereSurfCurrCmd->
|
||||
// SetGuidance("[usage] /score/quantiy/sphereSurfaceCurrent qname dflag wflag aflag unit");
|
||||
// SetGuidance("[usage] /score/quantity/sphereSurfaceCurrent qname dflag wflag aflag unit");
|
||||
// qSphereSurfCurrCmd->SetGuidance(" qname :(String) scorer name");
|
||||
// qSphereSurfCurrCmd->SetGuidance(" dflag :(Int) direction flag");
|
||||
// qSphereSurfCurrCmd->SetGuidance(" : 0 = Both In and Out");
|
||||
@@ -320,7 +321,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
// qSphereSurfFluxCmd = new G4UIcommand("/score/quantity/sphereSurfaceFlux",this);
|
||||
// qSphereSurfFluxCmd->SetGuidance("Sphere surface Flux Scorer.");
|
||||
// qSphereSurfFluxCmd->
|
||||
// SetGuidance("[usage] /score/quantiy/sphereSurfaceFlux qname dflag unit");
|
||||
// SetGuidance("[usage] /score/quantity/sphereSurfaceFlux qname dflag unit");
|
||||
// qSphereSurfFluxCmd->SetGuidance(" qname :(String) scorer name");
|
||||
// qSphereSurfFluxCmd->SetGuidance(" dflag :(Int) direction flag");
|
||||
// qSphereSurfFluxCmd->SetGuidance(" : 0 = Both In and Out");
|
||||
@@ -348,7 +349,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
// qCylSurfCurrCmd = new G4UIcommand("/score/quantity/cylinderSurfaceCurrent",this);
|
||||
// qCylSurfCurrCmd->SetGuidance("Cylinder surface current Scorer.");
|
||||
// qCylSurfCurrCmd->
|
||||
// SetGuidance("[usage] /score/quantiy/cylinderSurfaceCurrent qname dflag wflag aflag unit");
|
||||
// SetGuidance("[usage] /score/quantity/cylinderSurfaceCurrent qname dflag wflag aflag unit");
|
||||
// qCylSurfCurrCmd->SetGuidance(" qname :(String) scorer name");
|
||||
// qCylSurfCurrCmd->SetGuidance(" dflag :(Int) direction flag");
|
||||
// qCylSurfCurrCmd->SetGuidance(" : 0 = Both In and Out");
|
||||
@@ -375,7 +376,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
// qCylSurfFluxCmd = new G4UIcommand("/score/quantity/cylinderSurfaceFlux",this);
|
||||
// qCylSurfFluxCmd->SetGuidance("Cylinder surface Flux Scorer.");
|
||||
// qCylSurfFluxCmd->
|
||||
// SetGuidance("[usage] /score/quantiy/cylinderSurfaceFlux qname dflag unit");
|
||||
// SetGuidance("[usage] /score/quantity/cylinderSurfaceFlux qname dflag unit");
|
||||
// qCylSurfFluxCmd->SetGuidance(" qname :(String) scorer name");
|
||||
// qCylSurfFluxCmd->SetGuidance(" dflag :(Int) direction flag");
|
||||
// qCylSurfFluxCmd->SetGuidance(" : 0 = Both In and Out");
|
||||
@@ -403,7 +404,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
qNofCollisionCmd = new G4UIcommand("/score/quantity/nOfCollision",this);
|
||||
qNofCollisionCmd->SetGuidance("Number of collision scorer.");
|
||||
qNofCollisionCmd->
|
||||
SetGuidance("[usage] /score/quantiy/nOfCollision qname wflag");
|
||||
SetGuidance("[usage] /score/quantity/nOfCollision qname wflag");
|
||||
qNofCollisionCmd->SetGuidance(" qname :(String) scorer name");
|
||||
param = new G4UIparameter("qname",'s',false);
|
||||
qNofCollisionCmd->SetParameter(param);
|
||||
@@ -414,7 +415,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
qPopulationCmd = new G4UIcommand("/score/quantity/population",this);
|
||||
qPopulationCmd->SetGuidance("Population scorer.");
|
||||
qPopulationCmd->
|
||||
SetGuidance("[usage] /score/quantiy/population qname wflag");
|
||||
SetGuidance("[usage] /score/quantity/population qname wflag");
|
||||
qPopulationCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qPopulationCmd->SetGuidance(" wflag :(Bool) weighted");
|
||||
param = new G4UIparameter("qname",'s',false);
|
||||
@@ -427,7 +428,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
qTrackCountCmd = new G4UIcommand("/score/quantity/nOfTrack",this);
|
||||
qTrackCountCmd->SetGuidance("Number of track scorer.");
|
||||
qTrackCountCmd->
|
||||
SetGuidance("[usage] /score/quantiy/nOfTrack qname dflag wflag");
|
||||
SetGuidance("[usage] /score/quantity/nOfTrack qname dflag wflag");
|
||||
qTrackCountCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qTrackCountCmd->SetGuidance(" dflag :(Int) direction");
|
||||
qTrackCountCmd->SetGuidance(" : 0 = Both In and Out");
|
||||
@@ -447,7 +448,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
qTerminationCmd = new G4UIcommand("/score/quantity/nOfTerminatedTrack",this);
|
||||
qTerminationCmd->SetGuidance("Number of terminated tracks scorer.");
|
||||
qTerminationCmd->
|
||||
SetGuidance("[usage] /score/quantiy/nOfTerminatedTrack qname wflag");
|
||||
SetGuidance("[usage] /score/quantity/nOfTerminatedTrack qname wflag");
|
||||
qTerminationCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qTerminationCmd->SetGuidance(" wflag :(Bool) weighted");
|
||||
param = new G4UIparameter("qname",'s',false);
|
||||
@@ -460,19 +461,19 @@ void G4ScoreQuantityMessenger::QuantityCommands()
|
||||
qMinKinEAtGeneCmd = new G4UIcommand("/score/quantity/minKinEAtGeneration",this);
|
||||
qMinKinEAtGeneCmd->SetGuidance("Min Kinetic Energy at Generation");
|
||||
qMinKinEAtGeneCmd->
|
||||
SetGuidance("[usage] /score/quantiy/minKinEAtGeneration qname unit");
|
||||
SetGuidance("[usage] /score/quantity/minKinEAtGeneration qname unit");
|
||||
qMinKinEAtGeneCmd->SetGuidance(" qname :(String) scorer name");
|
||||
qMinKinEAtGeneCmd->SetGuidance(" unit :(String) unit name");
|
||||
param = new G4UIparameter("qname",'s',false);
|
||||
qMinKinEAtGeneCmd->SetParameter(param);
|
||||
param = new G4UIparameter("unit",'s',true);
|
||||
param->SetDefaultValue("MeV");
|
||||
param->SetDefaultUnit("MeV");
|
||||
qMinKinEAtGeneCmd->SetParameter(param);
|
||||
//
|
||||
qStepCheckerCmd = new G4UIcommand("/score/quantity/stepChecker",this);
|
||||
qStepCheckerCmd->SetGuidance("Display a comment when this PS is invoked");
|
||||
qStepCheckerCmd->
|
||||
SetGuidance("[usage] /score/quantiy/stepChecker qname");
|
||||
SetGuidance("[usage] /score/quantity/stepChecker qname");
|
||||
qStepCheckerCmd->SetGuidance(" qname :(String) scorer name");
|
||||
param = new G4UIparameter("qname",'s',false);
|
||||
qStepCheckerCmd->SetParameter(param);
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
#include "G4ScoringBox.hh"
|
||||
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
@@ -47,6 +46,8 @@
|
||||
#include "G4ScoringManager.hh"
|
||||
#include "G4StatDouble.hh"
|
||||
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
#include <map>
|
||||
#include <fstream>
|
||||
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
|
||||
#include "G4ScoringCylinder.hh"
|
||||
|
||||
#include "G4PhysicalConstants.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
@@ -51,6 +49,8 @@
|
||||
#include "G4ScoringManager.hh"
|
||||
#include "G4StatDouble.hh"
|
||||
|
||||
#include "G4PhysicalConstants.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
G4ScoringCylinder::G4ScoringCylinder(G4String wName)
|
||||
:G4VScoringMesh(wName)
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWith3VectorAndUnit.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4UIparameter.hh"
|
||||
#include "G4Tokenizer.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4VScoreColorMap.hh"
|
||||
@@ -111,7 +112,7 @@ G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
|
||||
param->SetParameterRange("Dz>0");
|
||||
mCylinderSizeCmd->SetParameter(param);
|
||||
param = new G4UIparameter("unit",'s',true);
|
||||
param->SetDefaultValue("mm");
|
||||
param->SetDefaultUnit("mm");
|
||||
mCylinderSizeCmd->SetParameter(param);
|
||||
//
|
||||
// Division command
|
||||
@@ -223,7 +224,7 @@ G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
|
||||
listColorMapCmd->SetToBeBroadcasted(false);
|
||||
|
||||
floatMinMaxCmd = new G4UIcmdWithAString("/score/colorMap/floatMinMax",this);
|
||||
floatMinMaxCmd->SetGuidance("Min/Max of the color map is calculated accorging to the actual scores.");
|
||||
floatMinMaxCmd->SetGuidance("Min/Max of the color map is calculated according to the actual scores.");
|
||||
floatMinMaxCmd->SetParameterName("colorMapName",true,false);
|
||||
floatMinMaxCmd->SetDefaultValue("defaultLinearColorMap");
|
||||
floatMinMaxCmd->SetToBeBroadcasted(false);
|
||||
|
||||
@@ -16,6 +16,19 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
March 11th, 2019 G. Cosmo (event-V10-04-09)
|
||||
- Fixed typos in printouts in G4GeneralParticleSourceMessenger.
|
||||
|
||||
January 31st, 2019 I. Hrivnacova
|
||||
- Merged GitHub PR #4: all Boolean operators now return G4bool.
|
||||
|
||||
January 28th, 2019 M. Asai
|
||||
- G4HEPEvtInterface.cc : Clean up G4Exception seviorities when
|
||||
end-of-file is detected.
|
||||
|
||||
December 14th, 2018 M. Asai
|
||||
- G4PrimaryTransformer.cc : Allowing absolute zero proper decay time.
|
||||
|
||||
November 9th, 2018 G. Cosmo (event-V10-04-08)
|
||||
- Fixed printout typos.
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ class G4Event
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void* anEvent);
|
||||
|
||||
G4int operator==(const G4Event &right) const;
|
||||
G4int operator!=(const G4Event &right) const;
|
||||
G4bool operator==(const G4Event &right) const;
|
||||
G4bool operator!=(const G4Event &right) const;
|
||||
|
||||
public: // with description
|
||||
void Print() const;
|
||||
|
||||
@@ -51,8 +51,8 @@ class G4HEPEvtParticle
|
||||
~G4HEPEvtParticle();
|
||||
|
||||
G4HEPEvtParticle & operator=(const G4HEPEvtParticle &right);
|
||||
G4int operator==(const G4HEPEvtParticle &right) const;
|
||||
G4int operator!=(const G4HEPEvtParticle &right) const;
|
||||
G4bool operator==(const G4HEPEvtParticle &right) const;
|
||||
G4bool operator!=(const G4HEPEvtParticle &right) const;
|
||||
|
||||
private:
|
||||
G4PrimaryParticle * theParticle;
|
||||
|
||||
@@ -75,8 +75,8 @@ class G4ParticleGun:public G4VPrimaryGenerator
|
||||
private:
|
||||
G4ParticleGun(const G4ParticleGun&) = delete;
|
||||
const G4ParticleGun & operator=(const G4ParticleGun&) = delete;
|
||||
G4int operator==(const G4ParticleGun&) const = delete;
|
||||
G4int operator!=(const G4ParticleGun&) const = delete;
|
||||
G4bool operator==(const G4ParticleGun&) const = delete;
|
||||
G4bool operator!=(const G4ParticleGun&) const = delete;
|
||||
|
||||
public: // with description
|
||||
virtual void GeneratePrimaryVertex(G4Event* evt);
|
||||
|
||||
@@ -51,8 +51,8 @@ class G4SmartTrackStack
|
||||
private:
|
||||
const G4SmartTrackStack & operator=
|
||||
(const G4SmartTrackStack &right);
|
||||
G4int operator==(const G4SmartTrackStack &right) const;
|
||||
G4int operator!=(const G4SmartTrackStack &right) const;
|
||||
G4bool operator==(const G4SmartTrackStack &right) const;
|
||||
G4bool operator!=(const G4SmartTrackStack &right) const;
|
||||
|
||||
public:
|
||||
void PushToStack(const G4StackedTrack& aStackedTrack);
|
||||
|
||||
@@ -66,8 +66,8 @@ class G4StackManager
|
||||
|
||||
private:
|
||||
const G4StackManager& operator=(const G4StackManager &right);
|
||||
G4int operator==(const G4StackManager &right) const;
|
||||
G4int operator!=(const G4StackManager &right) const;
|
||||
G4bool operator==(const G4StackManager &right) const;
|
||||
G4bool operator!=(const G4StackManager &right) const;
|
||||
|
||||
public:
|
||||
G4int PushOneTrack(G4Track *newTrack, G4VTrajectory *newTrajectory = 0);
|
||||
|
||||
@@ -54,8 +54,8 @@ public:
|
||||
|
||||
private:
|
||||
const G4TrackStack & operator=(const G4TrackStack &right);
|
||||
G4int operator==(const G4TrackStack &right) const;
|
||||
G4int operator!=(const G4TrackStack &right) const;
|
||||
G4bool operator==(const G4TrackStack &right) const;
|
||||
G4bool operator!=(const G4TrackStack &right) const;
|
||||
|
||||
public:
|
||||
void PushToStack(const G4StackedTrack& aStackedTrack) { push_back(aStackedTrack); }
|
||||
|
||||
@@ -61,8 +61,8 @@ class G4TrajectoryContainer
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void* anEvent);
|
||||
|
||||
G4int operator==(const G4TrajectoryContainer& right) const;
|
||||
G4int operator!=(const G4TrajectoryContainer& right) const;
|
||||
G4bool operator==(const G4TrajectoryContainer& right) const;
|
||||
G4bool operator!=(const G4TrajectoryContainer& right) const;
|
||||
|
||||
public:
|
||||
inline size_t size() const { return vect->size(); }
|
||||
|
||||
@@ -87,12 +87,12 @@ G4Event::~G4Event()
|
||||
delete randomNumberStatusForProcessing;
|
||||
}
|
||||
|
||||
G4int G4Event::operator==(const G4Event &right) const
|
||||
G4bool G4Event::operator==(const G4Event &right) const
|
||||
{
|
||||
return ( eventID == right.eventID );
|
||||
}
|
||||
|
||||
G4int G4Event::operator!=(const G4Event &right) const
|
||||
G4bool G4Event::operator!=(const G4Event &right) const
|
||||
{
|
||||
return ( eventID != right.eventID );
|
||||
}
|
||||
|
||||
@@ -91,8 +91,8 @@ G4EventManager::~G4EventManager()
|
||||
/*
|
||||
const G4EventManager & G4EventManager::operator=(const G4EventManager &right)
|
||||
{ }
|
||||
G4int G4EventManager::operator==(const G4EventManager &right) const { }
|
||||
G4int G4EventManager::operator!=(const G4EventManager &right) const { }
|
||||
G4bool G4EventManager::operator==(const G4EventManager &right) const { }
|
||||
G4bool G4EventManager::operator!=(const G4EventManager &right) const { }
|
||||
*/
|
||||
|
||||
void G4EventManager::DoProcessing(G4Event* anEvent)
|
||||
|
||||
@@ -131,12 +131,12 @@ G4GeneralParticleSourceMessenger::G4GeneralParticleSourceMessenger
|
||||
gpsDirectory->SetGuidance("General Paricle Source control commands.");
|
||||
// gpsDirectory->SetGuidance(" The first 9 commands are the same as in G4ParticleGun ");
|
||||
|
||||
// now the commands for mutiple sources
|
||||
// now the commands for multiple sources
|
||||
sourceDirectory = new G4UIdirectory("/gps/source/");
|
||||
sourceDirectory->SetGuidance("Multiple source control sub-directory");
|
||||
|
||||
addsourceCmd = new G4UIcmdWithADouble("/gps/source/add",this);
|
||||
addsourceCmd->SetGuidance("add a new source defintion to the particle gun with the specified intensity");
|
||||
addsourceCmd->SetGuidance("add a new source definition to the particle gun with the specified intensity");
|
||||
addsourceCmd->SetParameterName("addsource",false,false);
|
||||
addsourceCmd->SetRange("addsource > 0.");
|
||||
|
||||
@@ -166,7 +166,7 @@ G4GeneralParticleSourceMessenger::G4GeneralParticleSourceMessenger
|
||||
setintensityCmd->SetRange("setintensity > 0.");
|
||||
|
||||
multiplevertexCmd = new G4UIcmdWithABool("/gps/source/multiplevertex",this);
|
||||
multiplevertexCmd->SetGuidance("true for simulaneous generation mutiple vertex");
|
||||
multiplevertexCmd->SetGuidance("true for simultaneous generation multiple vertex");
|
||||
multiplevertexCmd->SetGuidance("Default is false");
|
||||
multiplevertexCmd->SetParameterName("multiplevertex",true);
|
||||
multiplevertexCmd->SetDefaultValue(false);
|
||||
|
||||
@@ -56,23 +56,7 @@ G4HEPEvtInterface::G4HEPEvtInterface(const char* evfile, G4int vl)
|
||||
particle_time = 0.0;
|
||||
|
||||
}
|
||||
/*************************************
|
||||
G4HEPEvtInterface::G4HEPEvtInterface(G4String evfile)
|
||||
{
|
||||
const char* fn = evfile.data();
|
||||
inputFile.open((char*)fn);
|
||||
if (inputFile.is_open()) {
|
||||
fileName = evfile;
|
||||
}
|
||||
else {
|
||||
G4Exception("G4HEPEvtInterface::G4HEPEvtInterface","Event0201",FatalException,
|
||||
"G4HEPEvtInterface:: cannot open file.");
|
||||
}
|
||||
G4ThreeVector zero;
|
||||
particle_position = zero;
|
||||
particle_time = 0.0;
|
||||
}
|
||||
**************************************/
|
||||
|
||||
G4HEPEvtInterface::~G4HEPEvtInterface()
|
||||
{;}
|
||||
|
||||
@@ -89,7 +73,7 @@ void G4HEPEvtInterface::GeneratePrimaryVertex(G4Event* evt)
|
||||
if( inputFile.eof() )
|
||||
{
|
||||
G4Exception("G4HEPEvtInterface::GeneratePrimaryVertex","Event0202",
|
||||
JustWarning,"End-Of-File : HEPEvt input file");
|
||||
RunMustBeAborted,"End-Of-File : HEPEvt input file -- no more event to read!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -113,8 +97,8 @@ void G4HEPEvtInterface::GeneratePrimaryVertex(G4Event* evt)
|
||||
>> PHEP1 >> PHEP2 >> PHEP3 >> PHEP5;
|
||||
if( inputFile.eof() )
|
||||
{
|
||||
G4Exception("G4HEPEvtInterface::GeneratePrimaryVertex","Event0202",
|
||||
FatalException,"Unexpected End-Of-File : HEPEvt input file");
|
||||
G4Exception("G4HEPEvtInterface::GeneratePrimaryVertex","Event0203",
|
||||
FatalException,"Unexpected End-Of-File in the middle of an event");
|
||||
}
|
||||
if(vLevel > 1)
|
||||
{
|
||||
|
||||
@@ -55,12 +55,12 @@ G4HEPEvtParticle& G4HEPEvtParticle::operator=(const G4HEPEvtParticle &)
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4int G4HEPEvtParticle::operator==(const G4HEPEvtParticle &right) const
|
||||
G4bool G4HEPEvtParticle::operator==(const G4HEPEvtParticle &right) const
|
||||
{
|
||||
return (this==&right);
|
||||
}
|
||||
|
||||
G4int G4HEPEvtParticle::operator!=(const G4HEPEvtParticle &right) const
|
||||
G4bool G4HEPEvtParticle::operator!=(const G4HEPEvtParticle &right) const
|
||||
{
|
||||
return (this!=&right);
|
||||
}
|
||||
|
||||
@@ -85,13 +85,13 @@ G4ParticleGun::~G4ParticleGun()
|
||||
// "G4ParticleGun : Equal operator should not be used.");
|
||||
// return right; }
|
||||
//
|
||||
//G4int G4ParticleGun::operator==(const G4ParticleGun& /*right*/) const
|
||||
//G4bool G4ParticleGun::operator==(const G4ParticleGun& /*right*/) const
|
||||
//{ G4Exception(
|
||||
// "G4ParticleGun::operator==","Event0193",FatalException,
|
||||
// "G4ParticleGun : == operator should not be used.");
|
||||
// return true; }
|
||||
//
|
||||
//G4int G4ParticleGun::operator!=(const G4ParticleGun& /*right*/) const
|
||||
//G4bool G4ParticleGun::operator!=(const G4ParticleGun& /*right*/) const
|
||||
//{ G4Exception(
|
||||
// "G4ParticleGun::operator!=","Event0193",FatalException,
|
||||
// "G4ParticleGun : != operator should not be used.");
|
||||
|
||||
@@ -180,7 +180,7 @@ void G4PrimaryTransformer::GenerateSingleTrack
|
||||
primaryParticle->GetPolY(),
|
||||
primaryParticle->GetPolZ());
|
||||
}
|
||||
if(primaryParticle->GetProperTime()>0.0)
|
||||
if(primaryParticle->GetProperTime()>=0.0)
|
||||
{ DP->SetPreAssignedDecayProperTime(primaryParticle->GetProperTime()); }
|
||||
|
||||
// Set Mass if it is specified
|
||||
@@ -270,7 +270,7 @@ void G4PrimaryTransformer::SetDecayProducts
|
||||
= new G4DynamicParticle(partDef,daughter->GetMomentum());
|
||||
DP->SetPrimaryParticle(daughter);
|
||||
// Decay proper time for daughter
|
||||
if(daughter->GetProperTime()>0.0)
|
||||
if(daughter->GetProperTime()>=0.0)
|
||||
{ DP->SetPreAssignedDecayProperTime(daughter->GetProperTime()); }
|
||||
// Set Charge is specified
|
||||
if (daughter->GetCharge()<DBL_MAX) {
|
||||
|
||||
@@ -63,11 +63,11 @@ G4SmartTrackStack::operator=(const G4SmartTrackStack &) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
int G4SmartTrackStack::operator==(const G4SmartTrackStack &right) const {
|
||||
G4bool G4SmartTrackStack::operator==(const G4SmartTrackStack &right) const {
|
||||
return (this==&right);
|
||||
}
|
||||
|
||||
int G4SmartTrackStack::operator!=(const G4SmartTrackStack &right) const {
|
||||
G4bool G4SmartTrackStack::operator!=(const G4SmartTrackStack &right) const {
|
||||
return (this!=&right);
|
||||
}
|
||||
|
||||
|
||||
@@ -75,9 +75,9 @@ G4StackManager::~G4StackManager()
|
||||
|
||||
const G4StackManager & G4StackManager::operator=
|
||||
(const G4StackManager &) { return *this; }
|
||||
G4int G4StackManager::operator==(const G4StackManager &)
|
||||
G4bool G4StackManager::operator==(const G4StackManager &)
|
||||
const{ return false; }
|
||||
G4int G4StackManager::operator!=(const G4StackManager &)
|
||||
G4bool G4StackManager::operator!=(const G4StackManager &)
|
||||
const{ return true; }
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
@@ -45,12 +45,12 @@ G4TrajectoryContainer::~G4TrajectoryContainer()
|
||||
delete vect;
|
||||
}
|
||||
|
||||
G4int G4TrajectoryContainer::operator==(const G4TrajectoryContainer& right) const
|
||||
G4bool G4TrajectoryContainer::operator==(const G4TrajectoryContainer& right) const
|
||||
{
|
||||
return (this==&right);
|
||||
}
|
||||
|
||||
G4int G4TrajectoryContainer::operator!=(const G4TrajectoryContainer& right) const
|
||||
G4bool G4TrajectoryContainer::operator!=(const G4TrajectoryContainer& right) const
|
||||
{
|
||||
return (this!=&right);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
G3toG4 Modification History (reverse chronological order, please !)
|
||||
--------------------------------------------------------------------
|
||||
|
||||
g3tog4-V10-04-01 31-January-2019 I.Hrivnacova
|
||||
- Merged GitHub PR #4: all Boolean operators now return G4bool.
|
||||
|
||||
19-December-2018 G.Cosmo
|
||||
- Fixed shadowing compilation warning in G3toG4MakeSolid.
|
||||
|
||||
g3tog4-V10-04-00 9-November-2018 G.Cosmo
|
||||
- G3Division: fixed printout typo.
|
||||
|
||||
|
||||
@@ -52,8 +52,8 @@ class G3MatTableEntry
|
||||
|
||||
// operators
|
||||
G3MatTableEntry& operator=(const G3MatTableEntry& right);
|
||||
G4int operator==(const G3MatTableEntry& right) const;
|
||||
G4int operator!=(const G3MatTableEntry& right) const;
|
||||
G4bool operator==(const G3MatTableEntry& right) const;
|
||||
G4bool operator!=(const G3MatTableEntry& right) const;
|
||||
|
||||
// get methods
|
||||
G4int GetID() const;
|
||||
|
||||
@@ -56,8 +56,8 @@ class G3MedTableEntry
|
||||
|
||||
// operators
|
||||
G3MedTableEntry& operator=(const G3MedTableEntry& right);
|
||||
G4int operator==(const G3MedTableEntry& right) const;
|
||||
G4int operator!=(const G3MedTableEntry& right) const;
|
||||
G4bool operator==(const G3MedTableEntry& right) const;
|
||||
G4bool operator!=(const G3MedTableEntry& right) const;
|
||||
|
||||
// set methods
|
||||
void SetMaterial(G4Material* material);
|
||||
|
||||
@@ -53,8 +53,8 @@ class G3RotTableEntry
|
||||
|
||||
// operators
|
||||
G3RotTableEntry& operator=(const G3RotTableEntry& right);
|
||||
G4int operator==(const G3RotTableEntry& right) const;
|
||||
G4int operator!=(const G3RotTableEntry& right) const;
|
||||
G4bool operator==(const G3RotTableEntry& right) const;
|
||||
G4bool operator!=(const G3RotTableEntry& right) const;
|
||||
|
||||
// get methods
|
||||
G4int GetID() const;
|
||||
|
||||
@@ -52,19 +52,19 @@ G3MatTableEntry& G3MatTableEntry::operator=(const G3MatTableEntry& right)
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4int G3MatTableEntry::operator==(const G3MatTableEntry& right) const
|
||||
G4bool G3MatTableEntry::operator==(const G3MatTableEntry& right) const
|
||||
{
|
||||
if (fID == right.GetID())
|
||||
return 1;
|
||||
return true;
|
||||
else
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
G4int G3MatTableEntry::operator!=(const G3MatTableEntry& right) const
|
||||
G4bool G3MatTableEntry::operator!=(const G3MatTableEntry& right) const
|
||||
{
|
||||
if (*this == right)
|
||||
return 0;
|
||||
return false;
|
||||
else
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,19 +64,19 @@ G3MedTableEntry& G3MedTableEntry::operator=(const G3MedTableEntry& right)
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4int G3MedTableEntry::operator==(const G3MedTableEntry& right) const
|
||||
G4bool G3MedTableEntry::operator==(const G3MedTableEntry& right) const
|
||||
{
|
||||
if (fID == right.GetID())
|
||||
return 1;
|
||||
return true;
|
||||
else
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
G4int G3MedTableEntry::operator!=(const G3MedTableEntry& right) const
|
||||
G4bool G3MedTableEntry::operator!=(const G3MedTableEntry& right) const
|
||||
{
|
||||
if (*this == right)
|
||||
return 0;
|
||||
return false;
|
||||
else
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,19 +52,19 @@ G3RotTableEntry& G3RotTableEntry::operator=(const G3RotTableEntry& right)
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4int G3RotTableEntry::operator==(const G3RotTableEntry& right) const
|
||||
G4bool G3RotTableEntry::operator==(const G3RotTableEntry& right) const
|
||||
{
|
||||
if (fID == right.GetID())
|
||||
return 1;
|
||||
return true;
|
||||
else
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
G4int G3RotTableEntry::operator!=(const G3RotTableEntry& right) const
|
||||
G4bool G3RotTableEntry::operator!=(const G3RotTableEntry& right) const
|
||||
{
|
||||
if (*this == right)
|
||||
return 0;
|
||||
return false;
|
||||
else
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
// modified by I.Hrivnacova, V.Berejnoi 27 Sep 99
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4Trd.hh"
|
||||
@@ -42,7 +41,8 @@
|
||||
#include "G4Hype.hh"
|
||||
#include "G4EllipticalTube.hh"
|
||||
#include "G3toG4MakeSolid.hh"
|
||||
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
G4VSolid* G3toG4MakeSolid(const G4String& vname, const G4String& shape,
|
||||
const G4double* rpar, const G4int npar,
|
||||
G4bool& NegVolPars, G4bool& Deferred,
|
||||
|
||||
@@ -16,6 +16,10 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Jan 31, 2019 Ivana Hrivnacova geometry-V10-04-00
|
||||
----------------------------
|
||||
- Merged GitHub PR #4: all Boolean operators now return G4bool.
|
||||
|
||||
Oct 31, 2014 Gabriele Cosmo geometry-V10-00-02
|
||||
----------------------------
|
||||
- Fixed internal link dependency on USolids module in CMake scripts.
|
||||
|
||||
@@ -16,6 +16,16 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
|
||||
April 8, 2019 H.Burkhardt - field-V10-04-18
|
||||
-------------------------
|
||||
- Correcting transformation to local system in G4QuadrupoleMagField.cc
|
||||
|
||||
March 20, 2019 G.Cosmo
|
||||
----------------------
|
||||
- Corrected 'RegularStepperName' in G4ChordFinder to refer to the actual
|
||||
default stepper G4DormandPrince745 rather than G4NystromRK4...
|
||||
|
||||
November 9, 2018 J.Apostolakis - field-V10-04-17
|
||||
------------------------------
|
||||
- Small fixes for warnings in compilation.
|
||||
@@ -2035,4 +2045,3 @@ May 7th, 1998 J. Apostolakis - magfield-06-01
|
||||
* G4ChordFinder: methods to get/set IntegratorDriver
|
||||
* G4MagIntegratorDriver: made OneGoodStep method public
|
||||
- created the file.
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
// New FSAL type driver / steppers -----
|
||||
#include "G4IntegrationDriver.hh"
|
||||
#include "G4FSALBogackiShampine45.hh"
|
||||
// #include "G4FSALBogackiShampine45.hh"
|
||||
// #include "G4FSALDormandPrince745.hh"
|
||||
|
||||
#include <cassert>
|
||||
@@ -88,17 +88,19 @@ G4ChordFinder::G4ChordFinder( G4MagneticField* theMagField,
|
||||
// by creating in inverse order the Driver, the Stepper and EqRhs ...
|
||||
|
||||
using NewFsalStepperType = G4RK547FEq1; // or 2 or 3
|
||||
const char* NewFSALStepperName = "G4RK574FEq1> FSAL 4th/5th order 7-stage 'Equilibrium-type' #1.";
|
||||
const char* NewFSALStepperName =
|
||||
"G4RK574FEq1> FSAL 4th/5th order 7-stage 'Equilibrium-type' #1.";
|
||||
using RegularStepperType =
|
||||
G4DormandPrince745; //
|
||||
G4DormandPrince745; // DOPRI5 (MatLab) 5th order embedded method. High efficiency.
|
||||
// G4ClassicalRK4; // The old default
|
||||
// G4CashKarpRKF45; // First embedded method in G4
|
||||
// G4BogackiShampine45; // High efficiency 5th order embedded method
|
||||
// G4DormandPrince745 // Famous DOPRI5 (MatLab) 5th order embedded method. High efficiency.
|
||||
// G4NystromRK4; // Nystrom stepper 4th order
|
||||
// G4RK547FEq1; // or 2 or 3
|
||||
const char* RegularStepperName = "Nystrom stepper 4th order";
|
||||
//"G4DormandPrince745 (aka DOPRI5): 5th/4th Order 7-stage embedded stepper";
|
||||
const char* RegularStepperName =
|
||||
"G4DormandPrince745 (aka DOPRI5): 5th/4th Order 7-stage embedded stepper";
|
||||
// "BogackiShampine 45 (Embedded 5th/4th Order, 7-stage)";
|
||||
// "Nystrom stepper 4th order";
|
||||
|
||||
// Configurable
|
||||
G4bool forceFSALstepper= false; // Choice - true to enable !!
|
||||
@@ -118,10 +120,10 @@ G4ChordFinder::G4ChordFinder( G4MagneticField* theMagField,
|
||||
G4Mag_EqRhs *pEquation = new G4Mag_UsualEqRhs(theMagField);
|
||||
fEquation = pEquation;
|
||||
|
||||
// G4MagIntegratorStepper* regularStepper = nullptr;
|
||||
// G4VFSALIntegrationStepper* fsalSepper = nullptr; // for new-type FSAL steppers only
|
||||
// NewFsalStepperType* fsalStepper =nullptr;
|
||||
// G4MagIntegratorStepper* oldFSALStepper =nullptr;
|
||||
// G4MagIntegratorStepper* regularStepper = nullptr;
|
||||
// G4VFSALIntegrationStepper* fsalSepper = nullptr; // for new-type FSAL steppers only
|
||||
// NewFsalStepperType* fsalStepper = nullptr;
|
||||
// G4MagIntegratorStepper* oldFSALStepper = nullptr;
|
||||
|
||||
G4bool errorInStepperCreation = false;
|
||||
|
||||
|
||||
@@ -62,32 +62,18 @@ G4QuadrupoleMagField::~G4QuadrupoleMagField()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Allow displaced origin and rotation
|
||||
// Extensions by Björn Riese (GSI)
|
||||
|
||||
void G4QuadrupoleMagField::GetFieldValue( const G4double y[7],
|
||||
G4double B[3] ) const
|
||||
G4double B[3] ) const
|
||||
// with displaced origin and rotation
|
||||
{
|
||||
G4ThreeVector r_global = G4ThreeVector(
|
||||
y[0] - fOrigin.x(),
|
||||
y[1] - fOrigin.y(),
|
||||
y[2] - fOrigin.z());
|
||||
|
||||
G4ThreeVector r_local = G4ThreeVector(
|
||||
fpMatrix->colX() * r_global,
|
||||
fpMatrix->colY() * r_global,
|
||||
fpMatrix->colZ() * r_global);
|
||||
|
||||
G4ThreeVector B_local = G4ThreeVector(
|
||||
fGradient * r_local.y(),
|
||||
fGradient * r_local.x(),
|
||||
0);
|
||||
|
||||
G4ThreeVector B_global = G4ThreeVector(
|
||||
fpMatrix->inverse().rowX() * B_local,
|
||||
fpMatrix->inverse().rowY() * B_local,
|
||||
fpMatrix->inverse().rowZ() * B_local);
|
||||
G4ThreeVector r_global = G4ThreeVector(
|
||||
y[0] - fOrigin.x(),
|
||||
y[1] - fOrigin.y(),
|
||||
y[2] - fOrigin.z());
|
||||
|
||||
const G4ThreeVector r_local = (*fpMatrix) * r_global;
|
||||
const G4ThreeVector B_local( fGradient * r_local.y(),fGradient * r_local.x(),0);
|
||||
const G4ThreeVector B_global = fpMatrix->inverse() * B_local;
|
||||
|
||||
B[0] = B_global.x() ;
|
||||
B[1] = B_global.y() ;
|
||||
|
||||
@@ -16,6 +16,16 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
March 8, 2019 G.Cosmo (geommng-V10-04-09)
|
||||
- G4LogicalVolume: in AddDaughter() avoid propagating pointer to field-manager
|
||||
if this is null. Addressing problem report #2145.
|
||||
|
||||
January 30, 2019 A.Dotti, G.Cosmo
|
||||
- Use reverse_iterator in G4SolidStore::DeRegister() in order to speedup
|
||||
partial deregistration on setups with many solids instances.
|
||||
- G4Region: added possibility to disable search in the tree in
|
||||
AddRootLogicalVolume() for speeding up process in complex flat geometries.
|
||||
|
||||
October 18, 2018 E.Tcherniaev (geommng-V10-04-08)
|
||||
- G4VSolid: improved setting of surface thickness in EstimateSurfaceArea().
|
||||
|
||||
|
||||
@@ -93,8 +93,8 @@ class G4LogicalSurface
|
||||
|
||||
virtual ~G4LogicalSurface();
|
||||
|
||||
inline G4int operator==(const G4LogicalSurface &right) const;
|
||||
inline G4int operator!=(const G4LogicalSurface &right) const;
|
||||
inline G4bool operator==(const G4LogicalSurface &right) const;
|
||||
inline G4bool operator!=(const G4LogicalSurface &right) const;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -88,13 +88,13 @@ G4LogicalSurface::operator=(const G4LogicalSurface &right)
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline G4int
|
||||
inline G4bool
|
||||
G4LogicalSurface::operator==(const G4LogicalSurface &right) const
|
||||
{
|
||||
return (this == (G4LogicalSurface *) &right);
|
||||
}
|
||||
|
||||
inline G4int
|
||||
inline G4bool
|
||||
G4LogicalSurface::operator!=(const G4LogicalSurface &right) const
|
||||
{
|
||||
return (this != (G4LogicalSurface *) &right);
|
||||
|
||||
@@ -110,11 +110,15 @@ class G4Region
|
||||
inline G4bool operator==(const G4Region& rg) const;
|
||||
// Equality defined by address only.
|
||||
|
||||
void AddRootLogicalVolume(G4LogicalVolume* lv);
|
||||
void AddRootLogicalVolume(G4LogicalVolume* lv, G4bool search=true);
|
||||
void RemoveRootLogicalVolume(G4LogicalVolume* lv, G4bool scan=true);
|
||||
// Add/remove root logical volumes and set/reset their
|
||||
// daughters flags as regions. They also recompute the
|
||||
// materials list for the region.
|
||||
// materials list for the region. Flag for scanning the subtree
|
||||
// always enabled by default. Search in the tree can be turned off
|
||||
// when adding, assuming the user guarantees the logical volume is
|
||||
// NOT already inserted, in which case significant speedup can be
|
||||
// achieved in very complex flat geometry setups.
|
||||
|
||||
inline void SetName(const G4String& name);
|
||||
inline const G4String& GetName() const;
|
||||
|
||||
@@ -85,14 +85,14 @@ G4LogicalVolume::G4LogicalVolume( G4VSolid* pSolid,
|
||||
fSmartless(2.), fVisAttributes(0), fRegion(0), fBiasWeight(1.)
|
||||
{
|
||||
// Initialize 'Shadow'/master pointers - for use in copying to workers
|
||||
//
|
||||
fSolid = pSolid;
|
||||
fSensitiveDetector = pSDetector;
|
||||
fFieldManager = pFieldMgr;
|
||||
|
||||
instanceID = subInstanceManager.CreateSubInstance();
|
||||
AssignFieldManager(pFieldMgr); // G4MT_fmanager = pFieldMgr;
|
||||
AssignFieldManager(pFieldMgr);
|
||||
|
||||
// fMasterFieldMgr= pFieldMgr;
|
||||
G4MT_mass = 0.;
|
||||
G4MT_ccouple = 0;
|
||||
|
||||
@@ -103,6 +103,7 @@ G4LogicalVolume::G4LogicalVolume( G4VSolid* pSolid,
|
||||
SetUserLimits(pULimits);
|
||||
|
||||
// Initialize 'Shadow' data structure - for use by object persistency
|
||||
//
|
||||
lvdata = new G4LVData();
|
||||
lvdata->fSolid = pSolid;
|
||||
lvdata->fMaterial = pMaterial;
|
||||
@@ -172,18 +173,22 @@ InitialiseWorker( G4LogicalVolume* /*pMasterObject*/,
|
||||
|
||||
SetSolid(pSolid);
|
||||
SetSensitiveDetector(pSDetector); // How this object is available now ?
|
||||
AssignFieldManager(fFieldManager); // Should be set - but a per-thread copy is not available yet
|
||||
// G4MT_fmanager= fFieldManager;
|
||||
// Must not call SetFieldManager(fFieldManager, false); which propagates FieldMgr
|
||||
AssignFieldManager(fFieldManager);
|
||||
// Should be set - but a per-thread copy is not available yet
|
||||
// Must not call SetFieldManager(), which propagates FieldMgr
|
||||
|
||||
#ifdef CLONE_FIELD_MGR
|
||||
// Create a field FieldManager by cloning
|
||||
//
|
||||
G4FieldManager workerFldMgr= fFieldManager->GetWorkerClone(G4bool* created);
|
||||
if( created || (GetFieldManager()!=workerFldMgr) )
|
||||
if( created || (GetFieldManager() != workerFldMgr) )
|
||||
{
|
||||
SetFieldManager(fFieldManager, false); // which propagates FieldMgr
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
// Field manager existed and is equal to current one
|
||||
//
|
||||
AssignFieldManager(workerFldMgr);
|
||||
}
|
||||
#endif
|
||||
@@ -238,7 +243,7 @@ G4FieldManager* G4LogicalVolume::GetFieldManager() const
|
||||
void G4LogicalVolume::AssignFieldManager( G4FieldManager *fldMgr)
|
||||
{
|
||||
G4MT_fmanager= fldMgr;
|
||||
if(G4Threading::IsMasterThread()) fFieldManager = fldMgr;
|
||||
if(G4Threading::IsMasterThread()) { fFieldManager = fldMgr; }
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
@@ -258,7 +263,6 @@ void
|
||||
G4LogicalVolume::SetFieldManager(G4FieldManager* pNewFieldMgr,
|
||||
G4bool forceAllDaughters)
|
||||
{
|
||||
// G4MT_fmanager = pNewFieldMgr;
|
||||
AssignFieldManager(pNewFieldMgr);
|
||||
|
||||
G4int NoDaughters = GetNoDaughters();
|
||||
@@ -294,17 +298,20 @@ void G4LogicalVolume::AddDaughter(G4VPhysicalVolume* pNewDaughter)
|
||||
}
|
||||
|
||||
// Invalidate previous calculation of mass - if any - for all threads
|
||||
//
|
||||
G4MT_mass = 0.;
|
||||
// SignalVolumeChange(); // fVolumeChanged= true;
|
||||
fDaughters.push_back(pNewDaughter);
|
||||
|
||||
G4LogicalVolume* pDaughterLogical = pNewDaughter->GetLogicalVolume();
|
||||
|
||||
// Propagate the Field Manager, if the daughter has no field Manager.
|
||||
// Propagate the Field Manager, if the daughter has no field Manager
|
||||
//
|
||||
G4FieldManager* pDaughterFieldManager = pDaughterLogical->GetFieldManager();
|
||||
|
||||
if( pDaughterFieldManager == 0 )
|
||||
// Avoid propagating the fieldManager pointer if null
|
||||
// and daughter's one is null as well...
|
||||
//
|
||||
if( (G4MT_fmanager !=0 ) && (pDaughterFieldManager == 0) )
|
||||
{
|
||||
pDaughterLogical->SetFieldManager(G4MT_fmanager, false);
|
||||
}
|
||||
@@ -371,8 +378,6 @@ G4VSolid* G4LogicalVolume::GetSolid(G4LVData &instLVdata) // const
|
||||
|
||||
G4VSolid* G4LogicalVolume::GetSolid() const
|
||||
{
|
||||
// return G4MT_solid;
|
||||
// return ((subInstanceManager.offset[instanceID]).fSolid);
|
||||
return this->GetSolid( subInstanceManager.offset[instanceID] );
|
||||
}
|
||||
|
||||
@@ -383,18 +388,15 @@ G4VSolid* G4LogicalVolume::GetSolid() const
|
||||
void G4LogicalVolume::SetSolid(G4VSolid *pSolid)
|
||||
{
|
||||
|
||||
// ((subInstanceManager.offset[instanceID]).fSolid) = pSolid;
|
||||
G4MT_solid=pSolid;
|
||||
// G4MT_mass = 0.;
|
||||
G4MT_solid = pSolid;
|
||||
this->ResetMass();
|
||||
}
|
||||
|
||||
void G4LogicalVolume::SetSolid(G4LVData &instLVdata, G4VSolid *pSolid)
|
||||
{
|
||||
instLVdata.fSolid = pSolid;
|
||||
// G4MT_solid=pSolid;
|
||||
instLVdata.fMass= 0;
|
||||
// A fast way to reset the mass ... ie G4MT_mass = 0.;
|
||||
// A fast way to reset the mass... i.e. G4MT_mass = 0.;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
@@ -412,7 +414,7 @@ G4Material* G4LogicalVolume::GetMaterial() const
|
||||
//
|
||||
void G4LogicalVolume::SetMaterial(G4Material *pMaterial)
|
||||
{
|
||||
G4MT_material=pMaterial;
|
||||
G4MT_material = pMaterial;
|
||||
G4MT_mass = 0.;
|
||||
}
|
||||
|
||||
@@ -423,7 +425,7 @@ void G4LogicalVolume::SetMaterial(G4Material *pMaterial)
|
||||
void G4LogicalVolume::UpdateMaterial(G4Material *pMaterial)
|
||||
{
|
||||
G4MT_material=pMaterial;
|
||||
if(fRegion) { G4MT_ccouple = fRegion->FindCouple(pMaterial); }
|
||||
if (fRegion) { G4MT_ccouple = fRegion->FindCouple(pMaterial); }
|
||||
G4MT_mass = 0.;
|
||||
}
|
||||
|
||||
@@ -443,7 +445,7 @@ G4VSensitiveDetector* G4LogicalVolume::GetSensitiveDetector() const
|
||||
void G4LogicalVolume::SetSensitiveDetector(G4VSensitiveDetector* pSDetector)
|
||||
{
|
||||
G4MT_sdetector = pSDetector;
|
||||
if(G4Threading::IsMasterThread()) fSensitiveDetector = pSDetector;
|
||||
if (G4Threading::IsMasterThread()) { fSensitiveDetector = pSDetector; }
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
@@ -532,27 +534,27 @@ G4double G4LogicalVolume::GetMass(G4bool forced,
|
||||
{
|
||||
// Return the cached non-zero value, if not forced
|
||||
//
|
||||
if ( (G4MT_mass) && (!forced) ) return G4MT_mass;
|
||||
if ( (G4MT_mass) && (!forced) ) { return G4MT_mass; }
|
||||
|
||||
// Global density and computed mass associated to the logical
|
||||
// volume without considering its daughters
|
||||
//
|
||||
G4Material* logMaterial = parMaterial ? parMaterial : GetMaterial(); // G4MT_material;
|
||||
G4Material* logMaterial = parMaterial ? parMaterial : GetMaterial();
|
||||
if (!logMaterial)
|
||||
{
|
||||
std::ostringstream message;
|
||||
message << "No material associated to the logical volume: " << fName << " !"
|
||||
<< G4endl
|
||||
message << "No material associated to the logical volume: "
|
||||
<< fName << " !" << G4endl
|
||||
<< "Sorry, cannot compute the mass ...";
|
||||
G4Exception("G4LogicalVolume::GetMass()", "GeomMgt0002",
|
||||
FatalException, message);
|
||||
return 0;
|
||||
}
|
||||
if (! GetSolid() ) // !G4MT_solid)
|
||||
if ( !GetSolid() )
|
||||
{
|
||||
std::ostringstream message;
|
||||
message << "No solid is associated to the logical volume: " << fName << " !"
|
||||
<< G4endl
|
||||
message << "No solid is associated to the logical volume: "
|
||||
<< fName << " !" << G4endl
|
||||
<< "Sorry, cannot compute the mass ...";
|
||||
G4Exception("G4LogicalVolume::GetMass()", "GeomMgt0002",
|
||||
FatalException, message);
|
||||
@@ -560,10 +562,7 @@ G4double G4LogicalVolume::GetMass(G4bool forced,
|
||||
}
|
||||
G4double globalDensity = logMaterial->GetDensity();
|
||||
G4double motherMass= GetSolid()->GetCubicVolume() * globalDensity;
|
||||
|
||||
// G4MT_mass =
|
||||
// SetMass( motherMmass );
|
||||
G4double massSum= motherMass;
|
||||
G4double massSum = motherMass;
|
||||
|
||||
// For each daughter in the tree, subtract the mass occupied
|
||||
// and if required by the propagate flag, add the real daughter's
|
||||
@@ -584,8 +583,7 @@ G4double G4LogicalVolume::GetMass(G4bool forced,
|
||||
//
|
||||
for (G4int i=0; i<physDaughter->GetMultiplicity(); i++)
|
||||
{
|
||||
G4VPVParameterisation*
|
||||
physParam = physDaughter->GetParameterisation();
|
||||
G4VPVParameterisation* physParam = physDaughter->GetParameterisation();
|
||||
if (physParam)
|
||||
{
|
||||
daughterSolid = physParam->ComputeSolid(i, physDaughter);
|
||||
@@ -617,4 +615,3 @@ void G4LogicalVolume::SetVisAttributes (const G4VisAttributes& VA)
|
||||
{
|
||||
fVisAttributes = new G4VisAttributes(VA);
|
||||
}
|
||||
|
||||
|
||||
@@ -286,20 +286,27 @@ void G4Region::ScanVolumeTree(G4LogicalVolume* lv, G4bool region)
|
||||
// regions. It also recomputes the materials list for the region.
|
||||
// *******************************************************************
|
||||
//
|
||||
void G4Region::AddRootLogicalVolume(G4LogicalVolume* lv)
|
||||
void G4Region::AddRootLogicalVolume(G4LogicalVolume* lv, G4bool search)
|
||||
{
|
||||
// Check the logical volume is not already in the list
|
||||
//
|
||||
G4RootLVList::iterator pos;
|
||||
pos = std::find(fRootVolumes.begin(),fRootVolumes.end(),lv);
|
||||
if (pos == fRootVolumes.end())
|
||||
if (search)
|
||||
{
|
||||
// Insert the root volume in the list and set it as root region
|
||||
//
|
||||
G4RootLVList::iterator pos;
|
||||
pos = std::find(fRootVolumes.begin(),fRootVolumes.end(),lv);
|
||||
if (pos == fRootVolumes.end())
|
||||
{
|
||||
// Insert the root volume in the list and set it as root region
|
||||
//
|
||||
fRootVolumes.push_back(lv);
|
||||
lv->SetRegionRootFlag(true);
|
||||
}
|
||||
}
|
||||
else // WARNING: user *MUST* guarantee lv is not already inserted.
|
||||
{ // Providing speedup for very complex flat geometries
|
||||
fRootVolumes.push_back(lv);
|
||||
lv->SetRegionRootFlag(true);
|
||||
}
|
||||
|
||||
// Scan recursively the tree of daugther volumes and set regions
|
||||
//
|
||||
ScanVolumeTree(lv, true);
|
||||
|
||||
@@ -139,11 +139,12 @@ void G4SolidStore::DeRegister(G4VSolid* pSolid)
|
||||
if (!locked) // Do not de-register if locked !
|
||||
{
|
||||
if (fgNotifier) { fgNotifier->NotifyDeRegistration(); }
|
||||
for (iterator i=GetInstance()->begin(); i!=GetInstance()->end(); i++)
|
||||
for (reverse_iterator i=GetInstance()->rbegin();
|
||||
i!=GetInstance()->rend(); i++)
|
||||
{
|
||||
if (**i==*pSolid)
|
||||
{
|
||||
GetInstance()->erase(i);
|
||||
GetInstance()->erase(std::next(i).base());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,9 +16,17 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
April 1, 2019 - G.Cosmo (geomnav-V10-04-13)
|
||||
------------------------
|
||||
- Protected report for looping particles under verbosity flag.
|
||||
|
||||
March 11, 2019 - G.Cosmo
|
||||
------------------------
|
||||
- Fixed typos in printouts in G4NavigationLogger.
|
||||
|
||||
September 26, 2018 - D.Sorokin (geomnav-V10-04-12)
|
||||
-----------------------
|
||||
- Notify G4ChordFinder at the beginning of each ComputeStep call.
|
||||
------------------------------
|
||||
- Notify G4ChordFinder at the beginning of each ComputeStep() call.
|
||||
|
||||
June 15, 2018 - G.Cosmo (geomnav-V10-04-11)
|
||||
-----------------------
|
||||
|
||||
@@ -381,7 +381,7 @@ G4NavigationLogger::CheckDaughterEntryPoint(const G4VSolid* sampleSolid,
|
||||
{
|
||||
msg << "NearMiss> Intersection to Daughter volume is in extension past the"
|
||||
<< " current exit point of the mother volume." << G4endl;
|
||||
msg << " This is not an error - just an unusual occurence,"
|
||||
msg << " This is not an error - just an unusual occurrence,"
|
||||
<< " possible in the case of concave volume. " << G4endl;
|
||||
}
|
||||
msg << "---- Information about intersection with daughter, mother: "
|
||||
|
||||
@@ -243,8 +243,10 @@ G4PropagatorInField::ComputeStep(
|
||||
G4double stepTrial;
|
||||
|
||||
stepTrial= fFull_CurveLen_of_LastAttempt;
|
||||
if( (stepTrial <= 0.0) && (fLast_ProposedStepLength > 0.0) )
|
||||
if( (stepTrial <= 0.0) && (fLast_ProposedStepLength > 0.0) )
|
||||
{
|
||||
stepTrial= fLast_ProposedStepLength;
|
||||
}
|
||||
|
||||
G4double decreaseFactor = 0.9; // Unused default
|
||||
if( (fNoZeroStep < fSevereActionThreshold_NoZeroSteps)
|
||||
@@ -302,7 +304,9 @@ G4PropagatorInField::ComputeStep(
|
||||
return 0; // = stepTrial;
|
||||
}
|
||||
if( stepTrial < CurrentProposedStepLength )
|
||||
{
|
||||
CurrentProposedStepLength = stepTrial;
|
||||
}
|
||||
}
|
||||
fLast_ProposedStepLength = CurrentProposedStepLength;
|
||||
|
||||
@@ -406,9 +410,10 @@ G4PropagatorInField::ComputeStep(
|
||||
}
|
||||
if( !intersects )
|
||||
{
|
||||
StepTaken += s_length_taken;
|
||||
// For smooth trajectory display (jacek 01/11/2002)
|
||||
if (fpTrajectoryFilter) {
|
||||
StepTaken += s_length_taken;
|
||||
|
||||
if (fpTrajectoryFilter) // For smooth trajectory display (jacek 1/11/2002)
|
||||
{
|
||||
fpTrajectoryFilter->TakeIntermediatePoint(CurrentState.GetPosition());
|
||||
}
|
||||
}
|
||||
@@ -453,7 +458,7 @@ G4PropagatorInField::ComputeStep(
|
||||
{
|
||||
fParticleIsLooping = true;
|
||||
}
|
||||
if ( fParticleIsLooping ) // && (fVerboseLevel > 0) )
|
||||
if ( ( fParticleIsLooping ) && (fVerboseLevel > 0) )
|
||||
{
|
||||
ReportLoopingParticle( do_loop_count, StepTaken,
|
||||
CurrentProposedStepLength, methodName,
|
||||
@@ -512,7 +517,8 @@ G4PropagatorInField::ComputeStep(
|
||||
{
|
||||
fNoZeroStep++;
|
||||
}
|
||||
else{
|
||||
else
|
||||
{
|
||||
fNoZeroStep = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ committal in the CVS repository !
|
||||
|
||||
Aug 13 2001 Vladimir Grichine geom-solid-bool-V03-02-00
|
||||
- Introduced G4BOOLDEBUG flag and replaced G4Exception statements with
|
||||
simple warnings to G4cerr for rare occurences of anomalous conditions.
|
||||
simple warnings to G4cerr for rare occurrences of anomalous conditions.
|
||||
|
||||
May 30 2001 Vladimir Grichine geom-solid-bool-V03-01-00
|
||||
- G4IntersectionSolid: fix in DistanceToIn(p,v) resolving bug observed
|
||||
|
||||
@@ -16,6 +16,24 @@ committal in the source repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
15-February-2019 E.Tcherniaev (geom-specific-V10-04-16)
|
||||
- Accurate calculation of radical in G4IntersectingCone.
|
||||
It addresses the problem report #2111.
|
||||
|
||||
4-February-2019 G.Cosmo
|
||||
- Fix in G4EllipticalTube::CheckParameters() for typo in condition.
|
||||
|
||||
30-January-2019 G.Cosmo
|
||||
- Disabled precise computation of extent and use simple bounding-box
|
||||
in CalculateExtent() for G4Tet and G4TessellatedSolid, to speed up
|
||||
intialisation in setups with relatively complex meshes.
|
||||
- Apply bounding-box calculation for extent also for corresponding
|
||||
VecGeom wrappers.
|
||||
|
||||
24-January-2019 E.Tcherniaev
|
||||
- Completely revised, more robust and performant G4EllipticalTube;
|
||||
new exhaustive test/testEllipticalTube.cc based on Shape Conventions.
|
||||
|
||||
20-September-2018 G.Cosmo (geom-specific-V10-04-15)
|
||||
- Make G4UPolycone wrapper inheriting from vecgeom::GenericUnplacedPolycone,
|
||||
following the latest changes in VecGeom.
|
||||
|
||||
@@ -34,16 +34,20 @@
|
||||
//
|
||||
// Declaration of a CSG volume representing a tube with elliptical
|
||||
// cross section (geant3 solid 'ELTU'):
|
||||
//
|
||||
// G4EllipticalTube( const G4String& name,
|
||||
//
|
||||
// G4EllipticalTube( const G4String& name,
|
||||
// G4double Dx,
|
||||
// G4double Dy,
|
||||
// G4double Dz )
|
||||
//
|
||||
// The equation of the surface in x/y is 1.0 = (x/dx)**2 + (y/dy)**2
|
||||
// The equation of the lateral surface : (x/dx)^2 + (y/dy)^2 = 1
|
||||
|
||||
// Author:
|
||||
// First implementation:
|
||||
// David C. Williams (davidw@scipp.ucsc.edu)
|
||||
//
|
||||
// Revision:
|
||||
// Evgueni Tcherniaev (evgueni.tcherniaev@cern.ch), 23.12.2019
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef G4EllipticalTube_hh
|
||||
@@ -56,34 +60,37 @@ class G4EllipticalTube : public G4VSolid
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4EllipticalTube( const G4String &name,
|
||||
G4double theDx,
|
||||
G4double theDy,
|
||||
G4double theDz );
|
||||
G4EllipticalTube( const G4String &name,
|
||||
G4double Dx,
|
||||
G4double Dy,
|
||||
G4double Dz );
|
||||
|
||||
virtual ~G4EllipticalTube();
|
||||
|
||||
// Standard solid methods
|
||||
|
||||
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
|
||||
// Standard methods
|
||||
//
|
||||
void BoundingLimits( G4ThreeVector& pMin, G4ThreeVector& pMax ) const;
|
||||
|
||||
G4bool CalculateExtent( const EAxis pAxis,
|
||||
const G4VoxelLimits& pVoxelLimit,
|
||||
const G4AffineTransform& pTransform,
|
||||
G4double& pmin, G4double& pmax ) const;
|
||||
|
||||
|
||||
EInside Inside( const G4ThreeVector& p ) const;
|
||||
|
||||
G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const;
|
||||
|
||||
G4double DistanceToIn( const G4ThreeVector& p,
|
||||
const G4ThreeVector& v ) const;
|
||||
|
||||
G4double DistanceToIn( const G4ThreeVector& p ) const;
|
||||
|
||||
G4double DistanceToOut( const G4ThreeVector& p,
|
||||
const G4ThreeVector& v,
|
||||
const G4bool calcNorm=false,
|
||||
G4bool *validNorm=0,
|
||||
G4ThreeVector *n=0 ) const;
|
||||
|
||||
G4double DistanceToOut( const G4ThreeVector& p ) const;
|
||||
|
||||
G4GeometryType GetEntityType() const;
|
||||
@@ -98,57 +105,67 @@ class G4EllipticalTube : public G4VSolid
|
||||
G4ThreeVector GetPointOnSurface() const;
|
||||
|
||||
// Visualisation methods
|
||||
|
||||
//
|
||||
G4Polyhedron* CreatePolyhedron() const;
|
||||
G4Polyhedron* GetPolyhedron () const;
|
||||
void DescribeYourselfTo( G4VGraphicsScene& scene ) const;
|
||||
G4VisExtent GetExtent() const;
|
||||
|
||||
// Accessors
|
||||
|
||||
//
|
||||
inline G4double GetDx() const;
|
||||
inline G4double GetDy() const;
|
||||
inline G4double GetDz() const;
|
||||
|
||||
inline void SetDx( const G4double newDx );
|
||||
inline void SetDy( const G4double newDy );
|
||||
inline void SetDz( const G4double newDz );
|
||||
inline void SetDx( G4double Dx );
|
||||
inline void SetDy( G4double Dy );
|
||||
inline void SetDz( G4double Dz );
|
||||
|
||||
public: // without description
|
||||
|
||||
G4EllipticalTube(__void__&);
|
||||
// Fake default constructor for usage restricted to direct object
|
||||
// persistency for clients requiring preallocation of memory for
|
||||
// persistifiable objects.
|
||||
// persistifiable objects
|
||||
|
||||
G4EllipticalTube(const G4EllipticalTube& rhs);
|
||||
G4EllipticalTube& operator=(const G4EllipticalTube& rhs);
|
||||
// Copy constructor and assignment operator.
|
||||
|
||||
protected: // without description
|
||||
|
||||
G4double dx, dy, dz;
|
||||
|
||||
// Utility
|
||||
|
||||
inline G4double CheckXY( const G4double x,
|
||||
const G4double y,
|
||||
const G4double toler ) const;
|
||||
inline G4double CheckXY( const G4double x, const G4double y ) const;
|
||||
|
||||
G4int IntersectXY( const G4ThreeVector &p,
|
||||
const G4ThreeVector &v, G4double s[2] ) const;
|
||||
G4EllipticalTube& operator=(const G4EllipticalTube& rhs);
|
||||
// Copy constructor and assignment operator
|
||||
|
||||
private:
|
||||
|
||||
void CheckParameters();
|
||||
// Check parameters and set pre-calculated values
|
||||
|
||||
G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p ) const;
|
||||
// Algorithm for SurfaceNormal() following the original
|
||||
// specification for points not on the surface.
|
||||
// specification for points not on the surface
|
||||
|
||||
G4double halfTol;
|
||||
G4double GetCachedSurfaceArea() const;
|
||||
// Calculate surface area and cache it
|
||||
|
||||
private:
|
||||
|
||||
G4double halfTolerance;
|
||||
|
||||
G4double fDx; // semi-axis in X
|
||||
G4double fDy; // semi-axis in Y
|
||||
G4double fDz; // half length in Z
|
||||
|
||||
G4double fCubicVolume; // volume
|
||||
G4double fSurfaceArea; // surface area
|
||||
|
||||
// Cached pre-calculated values
|
||||
G4double fRsph; // R of bounding sphere
|
||||
G4double fDDx; // Dx squared
|
||||
G4double fDDy; // Dy squared
|
||||
G4double fSx; // X scale factor
|
||||
G4double fSy; // Y scale factor
|
||||
G4double fR; // resulting Radius, after scaling elipse to circle
|
||||
G4double fQ1; // distance approximation : dist = Q1*(x^2 + y^2) - Q2
|
||||
G4double fQ2; // distance approximation : dist = Q1*(x^2 + y^2) - Q2
|
||||
G4double fScratch; // half length of scratching segment squared
|
||||
|
||||
G4double fCubicVolume;
|
||||
G4double fSurfaceArea;
|
||||
mutable G4bool fRebuildPolyhedron;
|
||||
mutable G4Polyhedron* fpPolyhedron;
|
||||
};
|
||||
|
||||
@@ -36,57 +36,47 @@
|
||||
inline
|
||||
G4double G4EllipticalTube::GetDx() const
|
||||
{
|
||||
return dx;
|
||||
return fDx;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4EllipticalTube::GetDy() const
|
||||
{
|
||||
return dy;
|
||||
return fDy;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4EllipticalTube::GetDz() const
|
||||
{
|
||||
return dz;
|
||||
return fDz;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4EllipticalTube::SetDx( const G4double newDx )
|
||||
inline
|
||||
void G4EllipticalTube::SetDx(G4double Dx)
|
||||
{
|
||||
dx = newDx;
|
||||
fDx = Dx;
|
||||
CheckParameters();
|
||||
fCubicVolume = 0.;
|
||||
fSurfaceArea = 0.;
|
||||
fRebuildPolyhedron = true;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4EllipticalTube::SetDy( const G4double newDy )
|
||||
void G4EllipticalTube::SetDy( G4double Dy )
|
||||
{
|
||||
dy = newDy;
|
||||
fDy = Dy;
|
||||
CheckParameters();
|
||||
fCubicVolume = 0.;
|
||||
fSurfaceArea = 0.;
|
||||
fRebuildPolyhedron = true;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4EllipticalTube::SetDz( const G4double newDz )
|
||||
void G4EllipticalTube::SetDz( G4double Dz )
|
||||
{
|
||||
dz = newDz;
|
||||
fDz = Dz;
|
||||
CheckParameters();
|
||||
fCubicVolume = 0.;
|
||||
fSurfaceArea = 0.;
|
||||
fRebuildPolyhedron = true;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4EllipticalTube::CheckXY( const G4double x,
|
||||
const G4double y,
|
||||
const G4double toler ) const
|
||||
{
|
||||
G4double rx = x/(dx+toler), ry = y/(dy+toler);
|
||||
return rx*rx + ry*ry;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4EllipticalTube::CheckXY( const G4double x, const G4double y ) const
|
||||
{
|
||||
G4double rx = x/dx, ry = y/dy;
|
||||
return rx*rx + ry*ry;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ class G4Tet : public G4VSolid
|
||||
// Copy constructor and assignment operator.
|
||||
|
||||
const char* CVSHeaderVers()
|
||||
{ return "$Id: G4Tet.hh 113723 2018-12-06 14:12:07Z gunter $"; }
|
||||
{ return "$Id$"; }
|
||||
const char* CVSFileVers()
|
||||
{ return CVSVers; }
|
||||
void PrintWarnings(G4bool flag)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
@@ -44,45 +44,31 @@
|
||||
//
|
||||
G4IntersectingCone::G4IntersectingCone( const G4double r[2],
|
||||
const G4double z[2] )
|
||||
{
|
||||
{
|
||||
const G4double halfCarTolerance
|
||||
= 0.5 * G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
|
||||
|
||||
//
|
||||
// What type of cone are we?
|
||||
//
|
||||
type1 = (std::fabs(z[1]-z[0]) > std::fabs(r[1]-r[0]));
|
||||
|
||||
if (type1)
|
||||
type1 = (std::abs(z[1]-z[0]) > std::abs(r[1]-r[0]));
|
||||
|
||||
if (type1) // tube like
|
||||
{
|
||||
B = (r[1]-r[0])/(z[1]-z[0]); // tube like
|
||||
A = 0.5*( r[1]+r[0] - B*(z[1]+z[0]) );
|
||||
B = (r[1] - r[0]) / (z[1] - z[0]);
|
||||
A = (r[0]*z[1] - r[1]*z[0]) / (z[1] -z[0]);
|
||||
}
|
||||
else
|
||||
else // disk like
|
||||
{
|
||||
B = (z[1]-z[0])/(r[1]-r[0]); // disk like
|
||||
A = 0.5*( z[1]+z[0] - B*(r[1]+r[0]) );
|
||||
B = (z[1] - z[0]) / (r[1] - r[0]);
|
||||
A = (z[0]*r[1] - z[1]*r[0]) / (r[1] - r[0]);
|
||||
}
|
||||
//
|
||||
|
||||
// Calculate extent
|
||||
//
|
||||
if (r[0] < r[1])
|
||||
{
|
||||
rLo = r[0]-halfCarTolerance; rHi = r[1]+halfCarTolerance;
|
||||
}
|
||||
else
|
||||
{
|
||||
rLo = r[1]-halfCarTolerance; rHi = r[0]+halfCarTolerance;
|
||||
}
|
||||
|
||||
if (z[0] < z[1])
|
||||
{
|
||||
zLo = z[0]-halfCarTolerance; zHi = z[1]+halfCarTolerance;
|
||||
}
|
||||
else
|
||||
{
|
||||
zLo = z[1]-halfCarTolerance; zHi = z[0]+halfCarTolerance;
|
||||
}
|
||||
rLo = std::min(r[0], r[1]) - halfCarTolerance;
|
||||
rHi = std::max(r[0], r[1]) + halfCarTolerance;
|
||||
zLo = std::min(z[0], z[1]) - halfCarTolerance;
|
||||
zHi = std::max(z[0], z[1]) + halfCarTolerance;
|
||||
}
|
||||
|
||||
|
||||
@@ -171,11 +157,11 @@ G4int G4IntersectingCone::LineHitsCone( const G4ThreeVector &p,
|
||||
//
|
||||
// where:
|
||||
//
|
||||
// a = x0**2 + y0**2 - (A + B*z0)**2
|
||||
// a = tx**2 + ty**2 - (B*tz)**2
|
||||
//
|
||||
// b = 2*( x0*tx + y0*ty - (A*B - B*B*z0)*tz)
|
||||
// b = 2*( px*vx + py*vy - B*(A + B*pz)*vz )
|
||||
//
|
||||
// c = tx**2 + ty**2 - (B*tz)**2
|
||||
// c = x0**2 + y0**2 - (A + B*z0)**2
|
||||
//
|
||||
// Notice, that if a < 0, this indicates that the two solutions (assuming
|
||||
// they exist) are in opposite cones (that is, given z0 = -A/B, one z < z0
|
||||
@@ -191,7 +177,7 @@ G4int G4IntersectingCone::LineHitsCone( const G4ThreeVector &p,
|
||||
// This should be rare.
|
||||
//
|
||||
// For b*b - 4*a*c = 0, we also have one solution, which is almost always
|
||||
// a line just grazing the surface of a the cone, which we want to ignore.
|
||||
// a line just grazing the surface of a the cone, which we want to ignore.
|
||||
// However, there are two other, very rare, possibilities:
|
||||
// a line intersecting the z axis and either:
|
||||
// 1. At the same angle std::atan(B) to just miss one side of the cone, or
|
||||
@@ -204,12 +190,12 @@ G4int G4IntersectingCone::LineHitsCone( const G4ThreeVector &p,
|
||||
//
|
||||
// Now: x0*tx + y0*ty = 0 in terms of roundoff error. We can write:
|
||||
// Delta = x0*tx + y0*ty
|
||||
// b = 2*( Delta - (A*B + B*B*z0)*tz )
|
||||
// b = 2*( Delta - B*(A + B*z0)*tz )
|
||||
// For:
|
||||
// b*b - 4*a*c = epsilon
|
||||
// where epsilon is small, then:
|
||||
// Delta = epsilon/2/B
|
||||
//
|
||||
//
|
||||
G4int G4IntersectingCone::LineHitsCone1( const G4ThreeVector &p,
|
||||
const G4ThreeVector &v,
|
||||
G4double *s1, G4double *s2 )
|
||||
@@ -219,14 +205,34 @@ G4int G4IntersectingCone::LineHitsCone1( const G4ThreeVector &p,
|
||||
G4double x0 = p.x(), y0 = p.y(), z0 = p.z();
|
||||
G4double tx = v.x(), ty = v.y(), tz = v.z();
|
||||
|
||||
G4double a = tx*tx + ty*ty - sqr(B*tz);
|
||||
G4double b = 2*( x0*tx + y0*ty - (A*B + B*B*z0)*tz);
|
||||
G4double c = x0*x0 + y0*y0 - sqr(A + B*z0);
|
||||
|
||||
G4double radical = b*b - 4*a*c;
|
||||
|
||||
if (radical < -EPS*std::fabs(b)) { return 0; } // No solution
|
||||
|
||||
// Value of radical can be inaccurate due to loss of precision
|
||||
// if to calculate the coefficiets a,b,c like the following:
|
||||
// G4double a = tx*tx + ty*ty - sqr(B*tz);
|
||||
// G4double b = 2*( x0*tx + y0*ty - B*(A + B*z0)*tz);
|
||||
// G4double c = x0*x0 + y0*y0 - sqr(A + B*z0);
|
||||
//
|
||||
// For more accurate calculation of radical the coefficients
|
||||
// are splitted in two components, radial and along z-axis
|
||||
//
|
||||
G4double ar = tx*tx + ty*ty;
|
||||
G4double az = sqr(B*tz);
|
||||
G4double br = 2*(x0*tx + y0*ty);
|
||||
G4double bz = 2*B*(A + B*z0)*tz;
|
||||
G4double cr = x0*x0 + y0*y0;
|
||||
G4double cz = sqr(A + B*z0);
|
||||
|
||||
// Instead radical = b*b - 4*a*c
|
||||
G4double arcz = 4*ar*cz;
|
||||
G4double azcr = 4*az*cr;
|
||||
G4double radical = (br*br - 4*ar*cr) + ((std::max(arcz,azcr) - 2*bz*br) + std::min(arcz,azcr));
|
||||
|
||||
// Find the coefficients
|
||||
G4double a = ar - az;
|
||||
G4double b = br - bz;
|
||||
G4double c = cr - cz;
|
||||
|
||||
if (radical < -EPS*std::fabs(b)) { return 0; } // No solution
|
||||
|
||||
if (radical < EPS*std::fabs(b))
|
||||
{
|
||||
//
|
||||
@@ -247,7 +253,7 @@ G4int G4IntersectingCone::LineHitsCone1( const G4ThreeVector &p,
|
||||
{
|
||||
radical = std::sqrt(radical);
|
||||
}
|
||||
|
||||
|
||||
if (a > 1/kInfinity)
|
||||
{
|
||||
G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
|
||||
@@ -277,7 +283,7 @@ G4int G4IntersectingCone::LineHitsCone1( const G4ThreeVector &p,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// LineHitsCone2
|
||||
//
|
||||
@@ -297,7 +303,7 @@ G4int G4IntersectingCone::LineHitsCone1( const G4ThreeVector &p,
|
||||
//
|
||||
// a > 0 now means we intersect only once in the correct hemisphere.
|
||||
//
|
||||
// a > 0 ? We only want solution which produces R > 0.
|
||||
// a > 0 ? We only want solution which produces R > 0.
|
||||
// since R = (z0+s*tz-A)/B, for tz/B > 0, this is the largest s
|
||||
// for tz/B < 0, this is the smallest s
|
||||
// thus, same as in case 1 ( since sign(tz/B) = sign(tz*B) )
|
||||
@@ -310,27 +316,47 @@ G4int G4IntersectingCone::LineHitsCone2( const G4ThreeVector &p,
|
||||
// originally it was 1E-6
|
||||
G4double x0 = p.x(), y0 = p.y(), z0 = p.z();
|
||||
G4double tx = v.x(), ty = v.y(), tz = v.z();
|
||||
|
||||
|
||||
// Special case which might not be so rare: B = 0 (precisely)
|
||||
//
|
||||
if (B==0)
|
||||
{
|
||||
if (std::fabs(tz) < 1/kInfinity) { return 0; }
|
||||
|
||||
|
||||
*s1 = (A-z0)/tz;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Value of radical can be inaccurate due to loss of precision
|
||||
// if to calculate the coefficiets a,b,c like the following:
|
||||
// G4double a = tz*tz - B2*(tx*tx + ty*ty);
|
||||
// G4double b = 2*( (z0-A)*tz - B2*(x0*tx + y0*ty) );
|
||||
// G4double c = sqr(z0-A) - B2*( x0*x0 + y0*y0 );
|
||||
//
|
||||
// For more accurate calculation of radical the coefficients
|
||||
// are splitted in two components, radial and along z-axis
|
||||
//
|
||||
G4double B2 = B*B;
|
||||
|
||||
G4double a = tz*tz - B2*(tx*tx + ty*ty);
|
||||
G4double b = 2*( (z0-A)*tz - B2*(x0*tx + y0*ty) );
|
||||
G4double c = sqr(z0-A) - B2*( x0*x0 + y0*y0 );
|
||||
|
||||
G4double radical = b*b - 4*a*c;
|
||||
|
||||
if (radical < -EPS*std::fabs(b)) { return 0; } // No solution
|
||||
|
||||
G4double az = tz*tz;
|
||||
G4double ar = B2*(tx*tx + ty*ty);
|
||||
G4double bz = 2*(z0-A)*tz;
|
||||
G4double br = 2*B2*(x0*tx + y0*ty);
|
||||
G4double cz = sqr(z0-A);
|
||||
G4double cr = B2*(x0*x0 + y0*y0);
|
||||
|
||||
// Instead radical = b*b - 4*a*c
|
||||
G4double arcz = 4*ar*cz;
|
||||
G4double azcr = 4*az*cr;
|
||||
G4double radical = (br*br - 4*ar*cr) + ((std::max(arcz,azcr) - 2*bz*br) + std::min(arcz,azcr));
|
||||
|
||||
// Find the coefficients
|
||||
G4double a = az - ar;
|
||||
G4double b = bz - br;
|
||||
G4double c = cz - cr;
|
||||
|
||||
if (radical < -EPS*std::fabs(b)) { return 0; } // No solution
|
||||
|
||||
if (radical < EPS*std::fabs(b))
|
||||
{
|
||||
//
|
||||
@@ -350,7 +376,7 @@ G4int G4IntersectingCone::LineHitsCone2( const G4ThreeVector &p,
|
||||
{
|
||||
radical = std::sqrt(radical);
|
||||
}
|
||||
|
||||
|
||||
if (a < -1/kInfinity)
|
||||
{
|
||||
G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
|
||||
|
||||
@@ -1859,18 +1859,22 @@ G4TessellatedSolid::CalculateExtent(const EAxis pAxis,
|
||||
G4double& pMin, G4double& pMax) const
|
||||
{
|
||||
G4ThreeVector bmin, bmax;
|
||||
G4bool exist;
|
||||
|
||||
// Check bounding box (bbox)
|
||||
//
|
||||
BoundingLimits(bmin,bmax);
|
||||
G4BoundingEnvelope bbox(bmin,bmax);
|
||||
#ifdef G4BBOX_EXTENT
|
||||
if (true) return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
|
||||
#endif
|
||||
|
||||
// Use simple bounding-box to help in the case of complex meshes
|
||||
//
|
||||
return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
|
||||
|
||||
#if 0
|
||||
// Precise extent computation (disabled by default for this shape)
|
||||
//
|
||||
if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
|
||||
{
|
||||
return exist = (pMin < pMax) ? true : false;
|
||||
return (pMin < pMax) ? true : false;
|
||||
}
|
||||
|
||||
// The extent is calculated as cumulative extent of the pyramids
|
||||
@@ -1907,6 +1911,7 @@ G4TessellatedSolid::CalculateExtent(const EAxis pAxis,
|
||||
if (eminlim > pMin && emaxlim < pMax) break; // max possible extent
|
||||
}
|
||||
return (pMin < pMax);
|
||||
#endif
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
//#if !defined(G4GEOM_USE_UTET)
|
||||
|
||||
const char G4Tet::CVSVers[]="$Id: G4Tet.cc 113723 2018-12-06 14:12:07Z gunter $";
|
||||
const char G4Tet::CVSVers[]="$Id$";
|
||||
|
||||
#include "G4VoxelLimits.hh"
|
||||
#include "G4AffineTransform.hh"
|
||||
@@ -328,15 +328,20 @@ G4bool G4Tet::CalculateExtent(const EAxis pAxis,
|
||||
G4double& pMin, G4double& pMax) const
|
||||
{
|
||||
G4ThreeVector bmin, bmax;
|
||||
G4bool exist;
|
||||
|
||||
// Check bounding box (bbox)
|
||||
//
|
||||
BoundingLimits(bmin,bmax);
|
||||
G4BoundingEnvelope bbox(bmin,bmax);
|
||||
#ifdef G4BBOX_EXTENT
|
||||
if (true) return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
|
||||
#endif
|
||||
|
||||
// Use simple bounding-box to help in the case of complex 3D meshes
|
||||
//
|
||||
return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
|
||||
|
||||
#if 0
|
||||
// Precise extent computation (disabled by default for this shape)
|
||||
//
|
||||
G4bool exist;
|
||||
if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
|
||||
{
|
||||
return exist = (pMin < pMax) ? true : false;
|
||||
@@ -359,8 +364,8 @@ G4bool G4Tet::CalculateExtent(const EAxis pAxis,
|
||||
polygons[1] = &base;
|
||||
|
||||
G4BoundingEnvelope benv(bmin,bmax,polygons);
|
||||
exist = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
|
||||
return exist;
|
||||
return exists = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
|
||||
#endif
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -326,19 +326,23 @@ G4UTessellatedSolid::CalculateExtent(const EAxis pAxis,
|
||||
G4double& pMin, G4double& pMax) const
|
||||
{
|
||||
G4ThreeVector bmin, bmax;
|
||||
G4bool exist;
|
||||
G4double kCarToleranceHalf = 0.5*kCarTolerance;
|
||||
|
||||
// Check bounding box (bbox)
|
||||
//
|
||||
BoundingLimits(bmin,bmax);
|
||||
G4BoundingEnvelope bbox(bmin,bmax);
|
||||
#ifdef G4BBOX_EXTENT
|
||||
if (true) return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
|
||||
#endif
|
||||
|
||||
// Use simple bounding-box to help in the case of complex meshes
|
||||
//
|
||||
return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
|
||||
|
||||
#if 0
|
||||
// Precise extent computation (disabled by default for this shape)
|
||||
//
|
||||
G4double kCarToleranceHalf = 0.5*kCarTolerance;
|
||||
if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
|
||||
{
|
||||
return exist = (pMin < pMax) ? true : false;
|
||||
return (pMin < pMax) ? true : false;
|
||||
}
|
||||
|
||||
// The extent is calculated as cumulative extent of the pyramids
|
||||
@@ -373,6 +377,7 @@ G4UTessellatedSolid::CalculateExtent(const EAxis pAxis,
|
||||
if (eminlim > pMin && emaxlim < pMax) break; // max possible extent
|
||||
}
|
||||
return (pMin < pMax);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -188,15 +188,20 @@ G4UTet::CalculateExtent(const EAxis pAxis,
|
||||
G4double& pMin, G4double& pMax) const
|
||||
{
|
||||
G4ThreeVector bmin, bmax;
|
||||
G4bool exist;
|
||||
|
||||
// Check bounding box (bbox)
|
||||
//
|
||||
BoundingLimits(bmin,bmax);
|
||||
G4BoundingEnvelope bbox(bmin,bmax);
|
||||
#ifdef G4BBOX_EXTENT
|
||||
if (true) return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
|
||||
#endif
|
||||
|
||||
// Use simple bounding-box to help in the case of complex 3D meshes
|
||||
//
|
||||
return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
|
||||
|
||||
#if 0
|
||||
// Precise extent computation (disabled by default for this shape)
|
||||
//
|
||||
G4bool exist;
|
||||
if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
|
||||
{
|
||||
return exist = (pMin < pMax) ? true : false;
|
||||
@@ -219,8 +224,8 @@ G4UTet::CalculateExtent(const EAxis pAxis,
|
||||
polygons[1] = &base;
|
||||
|
||||
G4BoundingEnvelope benv(bmin,bmax,polygons);
|
||||
exist = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
|
||||
return exist;
|
||||
return exists = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
|
||||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -16,6 +16,11 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
March 1st, 2019 G.Cosmo - geomvol-V10-04-06
|
||||
- Correction in G4AssemblyVolume destructor to avoid deletion of internal
|
||||
physical volumes, as cleanup is taken care by G4PhysicalVolumeStore.
|
||||
Addressing problem report #2140.
|
||||
|
||||
October 9th, 2018 G.Cosmo - geomvol-V10-04-05, 04
|
||||
- Added G4AssemblyStore singleton class for assembly structures bookeeping,
|
||||
to address the specific use-case of allowing identification of assembly
|
||||
|
||||
@@ -260,7 +260,7 @@ _Tp* G4EnhancedVecAllocator<_Tp>::allocate(size_t _Count)
|
||||
// ************************************************************
|
||||
//
|
||||
template<typename _T1, typename _T2>
|
||||
inline bool operator==(const G4EnhancedVecAllocator<_T1>&,
|
||||
inline G4bool operator==(const G4EnhancedVecAllocator<_T1>&,
|
||||
const G4EnhancedVecAllocator<_T2>&)
|
||||
{ return true; }
|
||||
|
||||
@@ -269,7 +269,7 @@ inline bool operator==(const G4EnhancedVecAllocator<_T1>&,
|
||||
// ************************************************************
|
||||
//
|
||||
template<typename _T1, typename _T2>
|
||||
inline bool operator!=(const G4EnhancedVecAllocator<_T1>&,
|
||||
inline G4bool operator!=(const G4EnhancedVecAllocator<_T1>&,
|
||||
const G4EnhancedVecAllocator<_T2>&)
|
||||
{ return false; }
|
||||
|
||||
|
||||
@@ -81,8 +81,8 @@ class G4LogicalBorderSurface : public G4LogicalSurface
|
||||
static void DumpInfo();
|
||||
// To handle the table of surfaces.
|
||||
|
||||
G4int operator==( const G4LogicalBorderSurface &right ) const;
|
||||
G4int operator!=( const G4LogicalBorderSurface &right ) const;
|
||||
G4bool operator==( const G4LogicalBorderSurface &right ) const;
|
||||
G4bool operator!=( const G4LogicalBorderSurface &right ) const;
|
||||
// Operators.
|
||||
|
||||
private:
|
||||
|
||||
@@ -72,8 +72,8 @@ class G4LogicalSkinSurface : public G4LogicalSurface
|
||||
static void DumpInfo(); // const
|
||||
// To handle with the table of surfaces.
|
||||
|
||||
G4int operator==(const G4LogicalSkinSurface &right) const;
|
||||
G4int operator!=(const G4LogicalSkinSurface &right) const;
|
||||
G4bool operator==(const G4LogicalSkinSurface &right) const;
|
||||
G4bool operator!=(const G4LogicalSkinSurface &right) const;
|
||||
// Operators.
|
||||
|
||||
private:
|
||||
|
||||
@@ -101,7 +101,7 @@ G4AssemblyVolume::~G4AssemblyVolume()
|
||||
unsigned int howmany = fTriplets.size();
|
||||
if( howmany != 0 )
|
||||
{
|
||||
for( unsigned int i = 0; i < howmany; i++ )
|
||||
for( unsigned int i = 0; i < howmany; ++i )
|
||||
{
|
||||
G4RotationMatrix* pRotToClean = fTriplets[i].GetRotation();
|
||||
if( pRotToClean != 0 )
|
||||
@@ -112,14 +112,9 @@ G4AssemblyVolume::~G4AssemblyVolume()
|
||||
}
|
||||
fTriplets.clear();
|
||||
|
||||
howmany = fPVStore.size();
|
||||
if( howmany != 0 )
|
||||
{
|
||||
for( unsigned int j = 0; j < howmany; j++ )
|
||||
{
|
||||
delete fPVStore[j];
|
||||
}
|
||||
}
|
||||
// No need to delete physical volumes, as these are deleted
|
||||
// by physical-volumes store.
|
||||
//
|
||||
fPVStore.clear();
|
||||
InstanceCountMinus();
|
||||
G4AssemblyStore::GetInstance()->DeRegister(this);
|
||||
|
||||
@@ -102,13 +102,13 @@ G4LogicalBorderSurface::operator=(const G4LogicalBorderSurface &right)
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4int
|
||||
G4bool
|
||||
G4LogicalBorderSurface::operator==(const G4LogicalBorderSurface &right) const
|
||||
{
|
||||
return (this == (G4LogicalBorderSurface *) &right);
|
||||
}
|
||||
|
||||
G4int
|
||||
G4bool
|
||||
G4LogicalBorderSurface::operator!=(const G4LogicalBorderSurface &right) const
|
||||
{
|
||||
return (this != (G4LogicalBorderSurface *) &right);
|
||||
|
||||
@@ -96,13 +96,13 @@ G4LogicalSkinSurface::operator=(const G4LogicalSkinSurface& right)
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4int
|
||||
G4bool
|
||||
G4LogicalSkinSurface::operator==(const G4LogicalSkinSurface& right) const
|
||||
{
|
||||
return (this == (G4LogicalSkinSurface *) &right);
|
||||
}
|
||||
|
||||
G4int
|
||||
G4bool
|
||||
G4LogicalSkinSurface::operator!=(const G4LogicalSkinSurface& right) const
|
||||
{
|
||||
return (this != (G4LogicalSkinSurface *) &right);
|
||||
|
||||
@@ -16,6 +16,14 @@ committal in the SVN repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
March 13, 2019 Gabriele Cosmo (global-V10-04-32)
|
||||
- Enable FPE detection on MacOS with clang.
|
||||
Addressing problem report #2147.
|
||||
- Changed ID for release 10.5.p01.
|
||||
|
||||
January 31, 2019 Ivana Hrivnacova
|
||||
- Merged GitHub PR #4: all Boolean operators now return G4bool.
|
||||
|
||||
November 26, 2018 Gabriele Cosmo (global-V10-04-31)
|
||||
- G4Cache, G4CacheDetails: minor code cleanup and formatting.
|
||||
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// This global method should be used on LINUX or MacOSX platforms with gcc
|
||||
// compiler for activating NaN detection and FPE signals, and forcing
|
||||
// abortion of the application at the time these are detected.
|
||||
// This global method should be used on LINUX/gcc or MacOS/clang platforms
|
||||
// for activating NaN detection and FPE signals, and forcing abortion of
|
||||
// the application at the time these are detected.
|
||||
// Meant to be used for debug purposes, can be activated by compiling the
|
||||
// "run" module with the flag G4FPE_DEBUG set in the environment.
|
||||
// -----------------------------------------------------------------------
|
||||
@@ -42,104 +42,107 @@
|
||||
#include <iostream>
|
||||
#include <stdlib.h> /* abort(), exit() */
|
||||
|
||||
#if (defined(__GNUC__) && !defined(__clang__))
|
||||
#ifdef __linux__
|
||||
#include <features.h>
|
||||
#include <fenv.h>
|
||||
#include <csignal>
|
||||
// for G4StackBacktrace()
|
||||
#include <execinfo.h>
|
||||
#include <cxxabi.h>
|
||||
#if (defined(__GNUC__) && !defined(__clang__))
|
||||
#include <features.h>
|
||||
#include <fenv.h>
|
||||
#include <csignal>
|
||||
// for G4StackBacktrace()
|
||||
#include <execinfo.h>
|
||||
#include <cxxabi.h>
|
||||
|
||||
struct sigaction termaction, oldaction;
|
||||
struct sigaction termaction, oldaction;
|
||||
|
||||
static void G4StackBackTrace()
|
||||
{
|
||||
|
||||
// from http://linux.die.net/man/3/backtrace_symbols_fd
|
||||
#define BSIZE 50
|
||||
void * buffer[ BSIZE ];
|
||||
int nptrs = backtrace( buffer, BSIZE );
|
||||
//std::cerr << "nptrs=" << nptrs << std::endl;
|
||||
char ** strings = backtrace_symbols( buffer, nptrs );
|
||||
if ( strings == NULL ) {
|
||||
perror( "backtrace_symbols" );
|
||||
return;
|
||||
}
|
||||
std::cerr << std::endl<< "Call Stack:" << std::endl;
|
||||
for ( int j = 0; j < nptrs; j++ ){
|
||||
//printf("%s\n", strings[j]);
|
||||
std::cerr << nptrs-j-1 <<": ";
|
||||
//std::cerr << strings[j] << std::endl;
|
||||
char * mangled_start = strchr( strings[j], '(' ) + 1;
|
||||
if (mangled_start) *(mangled_start-1) = '\0';
|
||||
char * mangled_end = strchr( mangled_start,'+' );
|
||||
if ( mangled_end ) *mangled_end = '\0';
|
||||
//std::cerr << "mangled .. " << mangled_start << ", len:" << strlen(mangled_start)<< std::endl;
|
||||
int status = 0;
|
||||
char *realname=0;
|
||||
if ( mangled_end && strlen(mangled_start) )
|
||||
realname = abi::__cxa_demangle( mangled_start, 0, 0, &status );
|
||||
if ( realname ) {
|
||||
std::cerr << strings[j]<< " : " << realname << std::endl;
|
||||
free( realname );
|
||||
} else {
|
||||
std::cerr << strings[j] << std::endl;
|
||||
}
|
||||
}
|
||||
free( strings );
|
||||
// c++filt can demangle: http://gcc.gnu.org/onlinedocs/libstdc++/manual/ext_demangling.html
|
||||
//-------------------------------------------------------------
|
||||
|
||||
}
|
||||
static void TerminationSignalHandler(int sig, siginfo_t* sinfo, void* /* context */)
|
||||
{
|
||||
std::cerr << "ERROR: " << sig;
|
||||
std::string message = "Floating-point exception (FPE).";
|
||||
|
||||
if (sinfo) {
|
||||
switch (sinfo->si_code) {
|
||||
#ifdef FPE_NOOP /* BUG: MacOSX uses this instead of INTDIV */
|
||||
case FPE_NOOP:
|
||||
#endif
|
||||
case FPE_INTDIV:
|
||||
message = "Integer divide by zero.";
|
||||
break;
|
||||
case FPE_INTOVF:
|
||||
message = "Integer overflow.";
|
||||
break;
|
||||
case FPE_FLTDIV:
|
||||
message = "Floating point divide by zero.";
|
||||
break;
|
||||
case FPE_FLTOVF:
|
||||
message = "Floating point overflow.";
|
||||
break;
|
||||
case FPE_FLTUND:
|
||||
message = "Floating point underflow.";
|
||||
break;
|
||||
case FPE_FLTRES:
|
||||
message = "Floating point inexact result.";
|
||||
break;
|
||||
case FPE_FLTINV:
|
||||
message = "Floating point invalid operation.";
|
||||
break;
|
||||
case FPE_FLTSUB:
|
||||
message = "Subscript out of range.";
|
||||
break;
|
||||
default:
|
||||
message = "Unknown error.";
|
||||
break;
|
||||
static void G4StackBackTrace()
|
||||
{
|
||||
// from http://linux.die.net/man/3/backtrace_symbols_fd
|
||||
#define BSIZE 50
|
||||
void * buffer[ BSIZE ];
|
||||
int nptrs = backtrace( buffer, BSIZE );
|
||||
char ** strings = backtrace_symbols( buffer, nptrs );
|
||||
if ( strings == NULL )
|
||||
{
|
||||
perror( "backtrace_symbols" );
|
||||
return;
|
||||
}
|
||||
std::cerr << std::endl<< "Call Stack:" << std::endl;
|
||||
for ( int j = 0; j < nptrs; j++ )
|
||||
{
|
||||
std::cerr << nptrs-j-1 <<": ";
|
||||
char * mangled_start = strchr( strings[j], '(' ) + 1;
|
||||
if (mangled_start) *(mangled_start-1) = '\0';
|
||||
char * mangled_end = strchr( mangled_start,'+' );
|
||||
if ( mangled_end ) *mangled_end = '\0';
|
||||
int status = 0;
|
||||
char *realname=0;
|
||||
if ( mangled_end && strlen(mangled_start) )
|
||||
realname = abi::__cxa_demangle( mangled_start, 0, 0, &status );
|
||||
if ( realname )
|
||||
{
|
||||
std::cerr << strings[j]<< " : " << realname << std::endl;
|
||||
free( realname );
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << strings[j] << std::endl;
|
||||
}
|
||||
}
|
||||
free( strings );
|
||||
// c++filt can demangle:
|
||||
// http://gcc.gnu.org/onlinedocs/libstdc++/manual/ext_demangling.html
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
std::cerr << " - " << message << std::endl;
|
||||
G4StackBackTrace();
|
||||
::abort();
|
||||
}
|
||||
static void TerminationSignalHandler(int sig, siginfo_t* sinfo,
|
||||
void* /* context */)
|
||||
{
|
||||
std::cerr << "ERROR: " << sig;
|
||||
std::string message = "Floating-point exception (FPE).";
|
||||
|
||||
static void InvalidOperationDetection()
|
||||
{
|
||||
std::cout << std::endl
|
||||
if (sinfo)
|
||||
{
|
||||
switch (sinfo->si_code)
|
||||
{
|
||||
#ifdef FPE_NOOP /* BUG: MacOS uses this instead of INTDIV */
|
||||
case FPE_NOOP:
|
||||
#endif
|
||||
case FPE_INTDIV:
|
||||
message = "Integer divide by zero.";
|
||||
break;
|
||||
case FPE_INTOVF:
|
||||
message = "Integer overflow.";
|
||||
break;
|
||||
case FPE_FLTDIV:
|
||||
message = "Floating point divide by zero.";
|
||||
break;
|
||||
case FPE_FLTOVF:
|
||||
message = "Floating point overflow.";
|
||||
break;
|
||||
case FPE_FLTUND:
|
||||
message = "Floating point underflow.";
|
||||
break;
|
||||
case FPE_FLTRES:
|
||||
message = "Floating point inexact result.";
|
||||
break;
|
||||
case FPE_FLTINV:
|
||||
message = "Floating point invalid operation.";
|
||||
break;
|
||||
case FPE_FLTSUB:
|
||||
message = "Subscript out of range.";
|
||||
break;
|
||||
default:
|
||||
message = "Unknown error.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
std::cerr << " - " << message << std::endl;
|
||||
G4StackBackTrace();
|
||||
::abort();
|
||||
}
|
||||
|
||||
static void InvalidOperationDetection()
|
||||
{
|
||||
std::cout << std::endl
|
||||
<< " "
|
||||
<< "############################################" << std::endl
|
||||
<< " "
|
||||
@@ -147,19 +150,26 @@
|
||||
<< " "
|
||||
<< "############################################" << std::endl;
|
||||
|
||||
(void) feenableexcept( FE_DIVBYZERO );
|
||||
(void) feenableexcept( FE_INVALID );
|
||||
//(void) feenableexcept( FE_OVERFLOW );
|
||||
//(void) feenableexcept( FE_UNDERFLOW );
|
||||
(void) feenableexcept( FE_DIVBYZERO );
|
||||
(void) feenableexcept( FE_INVALID );
|
||||
//(void) feenableexcept( FE_OVERFLOW );
|
||||
//(void) feenableexcept( FE_UNDERFLOW );
|
||||
|
||||
sigfillset(&termaction.sa_mask);
|
||||
sigdelset(&termaction.sa_mask,SIGFPE);
|
||||
termaction.sa_sigaction=TerminationSignalHandler;
|
||||
termaction.sa_flags=SA_SIGINFO;
|
||||
sigaction(SIGFPE, &termaction, &oldaction);
|
||||
}
|
||||
sigfillset(&termaction.sa_mask);
|
||||
sigdelset(&termaction.sa_mask,SIGFPE);
|
||||
termaction.sa_sigaction=TerminationSignalHandler;
|
||||
termaction.sa_flags=SA_SIGINFO;
|
||||
sigaction(SIGFPE, &termaction, &oldaction);
|
||||
}
|
||||
|
||||
#else /* Not GCC */
|
||||
|
||||
static void InvalidOperationDetection() {;}
|
||||
|
||||
#endif
|
||||
|
||||
#elif defined(__MACH__) /* MacOS */
|
||||
|
||||
#elif defined(__MACH__) /* MacOSX */
|
||||
#include <fenv.h>
|
||||
#include <signal.h>
|
||||
|
||||
@@ -242,7 +252,7 @@
|
||||
|
||||
if (sinfo) {
|
||||
switch (sinfo->si_code) {
|
||||
#ifdef FPE_NOOP /* BUG: MacOSX uses this instead of INTDIV */
|
||||
#ifdef FPE_NOOP /* BUG: MacOS uses this instead of INTDIV */
|
||||
case FPE_NOOP:
|
||||
#endif
|
||||
case FPE_INTDIV:
|
||||
@@ -303,13 +313,11 @@
|
||||
termaction.sa_flags=SA_SIGINFO;
|
||||
sigaction(SIGFPE, &termaction, &oldaction);
|
||||
}
|
||||
#else /* Not Linux, nor MacOSX ... */
|
||||
|
||||
#else /* Not Linux, nor MacOS ... */
|
||||
|
||||
static void InvalidOperationDetection() {;}
|
||||
|
||||
#endif /* Linus or MacOSX */
|
||||
#else /* Not GCC */
|
||||
#endif /* Linux or MacOS */
|
||||
|
||||
static void InvalidOperationDetection() {;}
|
||||
#endif
|
||||
#endif /* G4FPEDetection_h */
|
||||
|
||||
@@ -157,8 +157,8 @@ private:
|
||||
inline G4double DerivativeXY(size_t idx, size_t idy, G4double fac) const;
|
||||
// computation of derivatives
|
||||
|
||||
G4int operator==(const G4Physics2DVector &right) const = delete;
|
||||
G4int operator!=(const G4Physics2DVector &right) const = delete;
|
||||
G4bool operator==(const G4Physics2DVector &right) const = delete;
|
||||
G4bool operator!=(const G4Physics2DVector &right) const = delete;
|
||||
|
||||
G4PhysicsVectorType type; // The type of PhysicsVector (enumerator)
|
||||
|
||||
|
||||
@@ -102,8 +102,8 @@ class G4PhysicsVector
|
||||
// Obsolete method to get value, isOutRange is not used anymore.
|
||||
// This method is kept for the compatibility reason.
|
||||
|
||||
G4int operator==(const G4PhysicsVector &right) const ;
|
||||
G4int operator!=(const G4PhysicsVector &right) const ;
|
||||
G4bool operator==(const G4PhysicsVector &right) const ;
|
||||
G4bool operator!=(const G4PhysicsVector &right) const ;
|
||||
|
||||
inline G4double operator[](const size_t index) const ;
|
||||
// Returns the value for the specified index of the dataVector
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user