Import Geant4 4.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:39:52 +02:00
parent 921d3b1cda
commit 330b82b769
4524 changed files with 178689 additions and 43575 deletions
@@ -0,0 +1,73 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: BooleanSolidTypeProcess.hh,v 1.3 2002/06/03 12:09:31 radoone Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// --------------------------------------------------------------
// Comments
//
// --------------------------------------------------------------
//
#ifndef BOOLEANSOLIDTYPEPROCESS_H
#define BOOLEANSOLIDTYPEPROCESS_H 1
#include "BooleanSolidType.hh"
#include "SolidTypeProcess.hh"
class BooleanSolidTypeProcess : public SolidTypeProcess
{
public:
BooleanSolidTypeProcess( const ProcessingContext* context = 0 )
: SolidTypeProcess( context ) {
}
virtual ~BooleanSolidTypeProcess() {
}
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
// The name passed-in as the argument is the name of the XML element for which that's been done
virtual void StackPopNotify( const std::string& name ) {
SAXObject** so = Context()->GetTopObject();
BooleanSolidType* bsobj = dynamic_cast<BooleanSolidType*>( m_obj );
if( name == "first" || name == "second" ) {
// Add the first and second elements into content model
bsobj->add_content( name, *so );
} else {
// Add either choice of position or rotation elements and their references
ContentChoice* choice = new ContentChoice;
ContentGroup::ContentItem ci = { name, *so };
choice->set_content( ci );
//std::cout << "BOOLEAN SOLID PROCESS adding choice " << name << std::endl;
bsobj->add_content( "choice", choice );
}
SolidTypeProcess::StackPopNotify( name );
}
};
#endif // BOOLEANSOLIDTYPEPROCESS_H
@@ -0,0 +1,130 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: MaterialTypeProcess.hh,v 1.3 2002/06/03 12:09:31 radoone Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// --------------------------------------------------------------
// Comments
//
// --------------------------------------------------------------
//
#ifndef MATERIALTYPEPROCESS_H
#define MATERIALTYPEPROCESS_H 1
#include "ProcessingConfigurator.hh"
#include "ProcessingContext.hh"
#include "SAXProcessor.hh"
#include "StateStack.hh"
#include "SAXProcessingState.hh"
#include "SAXStateProcess.hh"
#include "SAXObjectHandle.hh"
#include "SAXComponentFactory.hh"
#include "MaterialType.hh"
#include <cstdlib>
#include <iostream>
class MaterialTypeProcess : public SAXStateProcess, virtual public SAXComponentObject
{
public:
MaterialTypeProcess( const ProcessingContext* context = 0 )
: SAXStateProcess( context ), m_obj( 0 )
{
// This is not a real process, it's a base class for a real process instead
// The final inheriting class should set it to a correct value
//m_tag = "";
}
virtual ~MaterialTypeProcess()
{
}
virtual const SAXComponentObject* Build() const
{
return this;
}
// Analogical to SAX startElement callback
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
}
// Analogical to SAX endElement callback
virtual void EndElement( const std::string& name ) {
}
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
virtual void Characters( const std::string& name ) {
}
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
// The name passed-in as the argument is the name of the XML element for which that's been done
virtual void StackPopNotify( const std::string& name ) {
MaterialType* mt_obj = dynamic_cast<MaterialType*>(m_obj);
if( mt_obj == 0 ) {
// Whoops, fatal problem!
std::cerr << "MaterialType PROCESS:: bad_cast trouble at: "
<< __FILE__ << ":" << __LINE__ << "\a" << std::endl;
// Some exception would fit here...
return;
}
//std::cout << "MaterialType PROCESS:: : " << name << std::endl;
SAXObject** obj = Context()->GetTopObject();
if( name == "RL" || name == "RLref" ) {
mt_obj->set_RLorRLref( name, *obj );
} else if( name == "AL" || name == "ALref" ) {
mt_obj->set_ALorALref( name, *obj );
} else if( name == "T" || name == "Tref" ) {
mt_obj->set_TorTref( name, *obj );
} else if( name == "P" || name == "Pref" ) {
mt_obj->set_PorPref( name, *obj );
} else {
// Invalid input
std::cerr << "MaterialType PROCESS:: invalid tag "
<< name << " on input at: "
<< __FILE__ << ":" << __LINE__ << "\a" << std::endl;
}
}
// The name of the state this object will process
// virtual const std::string& State() const
// {
// return m_tag;
// }
protected:
// Resulting object, one of isotope, element or material
SAXObject* m_obj;
};
// This is going to be a base class, so no factory is needed
//DECLARE_PROCESS_FACTORY(MaterialTypeProcess)
#endif // MATERIALTYPEPROCESS_H
@@ -0,0 +1,119 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: QuantityTypeProcess.hh,v 1.2 2002/06/03 12:09:31 radoone Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// --------------------------------------------------------------
// Comments
//
// --------------------------------------------------------------
//
#ifndef QUANTITYTYPEPROCESS_H
#define QUANTITYTYPEPROCESS_H 1
#include "ProcessingConfigurator.hh"
#include "ProcessingContext.hh"
#include "SAXProcessor.hh"
#include "StateStack.hh"
#include "SAXProcessingState.hh"
#include "SAXStateProcess.hh"
#include "SAXObjectHandle.hh"
#include "SAXComponentFactory.hh"
#include "QuantityType.hh"
#include <cstdlib>
#include <iostream>
class QuantityTypeProcess : public SAXStateProcess, virtual public SAXComponentObject
{
public:
QuantityTypeProcess( const ProcessingContext* context = 0 )
: SAXStateProcess( context ) {
}
virtual ~QuantityTypeProcess() {
}
virtual const SAXComponentObject* Build() const {
return this;
}
// Analogical to SAX startElement callback
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
QuantityType* qobj = dynamic_cast<QuantityType*>( m_obj );
//std::cout << "PROCESS::START OF TAG : " << name << std::endl;
std::string qunit = attrs.getValue( "unit" );
std::string qtype = attrs.getValue( "type" );
std::string qvalue = attrs.getValue( "value" );
qobj->set_unit( qunit );
qobj->set_type( qtype );
qobj->set_value( qvalue );
}
// Analogical to SAX endElement callback
virtual void EndElement( const std::string& name )
{
//std::cout << "PROCESS::END OF TAG : " << name << std::endl;
try {
QuantityType* saxobj = dynamic_cast<QuantityType*>( m_obj );
if( saxobj != 0 )
{
// std::cout << "PROCESS END OF TAG:: " << name
// << saxobj->get_type() << ": "
// << saxobj->get_value() << "["
// << saxobj->get_unit() << "]"
// << " looks OK" << std::endl;
}
else
{
std::cerr << "PROCESS END OF TAG:: GOT ZERO DATA POINTER! " << std::endl;
}
} catch( ... ) {
std::cerr << "PROCESS END OF TAG " << name << " ERROR: "
<< " Cannot cast properly the data object!" << std::endl;
}
}
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
virtual void Characters( const std::string& name )
{
}
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
// The name passed-in as the argument is the name of the XML element for which that's been done
virtual void StackPopNotify( const std::string& name )
{
}
protected:
SAXObject* m_obj;
};
#endif // QUANTITYTYPEPROCESS_H
@@ -0,0 +1,108 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: ReferenceTypeProcess.hh,v 1.2 2002/06/03 12:09:31 radoone Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// --------------------------------------------------------------
// Comments
//
// --------------------------------------------------------------
//
#ifndef REFERENCETYPEPROCESS_H
#define REFERENCETYPEPROCESS_H 1
#include "ProcessingConfigurator.hh"
#include "ProcessingContext.hh"
#include "SAXProcessor.hh"
#include "StateStack.hh"
#include "SAXProcessingState.hh"
#include "SAXStateProcess.hh"
#include "SAXObjectHandle.hh"
#include "SAXComponentFactory.hh"
#include "ReferenceType.hh"
#include <cstdlib>
#include <iostream>
class ReferenceTypeProcess : public SAXStateProcess, virtual public SAXComponentObject
{
public:
ReferenceTypeProcess( const ProcessingContext* context = 0 )
: SAXStateProcess( context ), m_obj( 0 ) {
}
virtual ~ReferenceTypeProcess() {
}
virtual const SAXComponentObject* Build() const {
return this;
}
// Analogical to SAX startElement callback
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
//std::cout << "ReferenceTypeProcess PROCESS::START OF TAG : " << name << std::endl;
std::string ref = attrs.getValue( "ref" );
ReferenceType* refobj = dynamic_cast<ReferenceType*>(m_obj);
refobj->set_ref( ref );
}
// Analogical to SAX endElement callback
virtual void EndElement( const std::string& name )
{
//std::cout << "ReferenceTypeProcess PROCESS::END OF TAG : " << name << std::endl;
try {
ReferenceType* saxobj = dynamic_cast<ReferenceType*>( m_obj );
if( saxobj != 0 ) {
//std::cout << "PROCESS END OF TAG:: "
// << name << " ref: " << saxobj->get_ref()
// << " looks OK" << std::endl;
} else {
std::cerr << "PROCESS END OF TAG:: GOT ZERO DATA POINTER! " << std::endl;
}
} catch( ... ) {
std::cerr << "PROCESS END OF TAG " << name << " ERROR: "
<< " Cannot cast properly the data object!" << std::endl;
}
}
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
virtual void Characters( const std::string& name )
{
}
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
// The name passed-in as the argument is the name of the XML element for which that's been done
virtual void StackPopNotify( const std::string& name )
{
}
protected:
SAXObject* m_obj;
};
#endif // REFERENCETYPEPROCESS_H
@@ -0,0 +1,84 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: SinglePlacementTypeProcess.hh,v 1.2 2002/06/03 12:09:31 radoone Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// --------------------------------------------------------------
// Comments
//
// --------------------------------------------------------------
//
#ifndef SINGLEPLACEMENTTYPEPROCESS_H
#define SINGLEPLACEMENTTYPEPROCESS_H 1
#include "ProcessingConfigurator.hh"
#include "ProcessingContext.hh"
#include "SAXProcessor.hh"
#include "StateStack.hh"
#include "SAXProcessingState.hh"
#include "SAXStateProcess.hh"
#include "SAXComponentFactory.hh"
#include "SinglePlacementType.hh"
class SinglePlacementTypeProcess : public SAXStateProcess, virtual public SAXComponentObject
{
public:
SinglePlacementTypeProcess( const ProcessingContext* context = 0 )
: SAXStateProcess( context ) {
}
virtual ~SinglePlacementTypeProcess() {
}
virtual const SAXComponentObject* Build() const {
return this;
}
// Analogical to SAX startElement callback
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
}
// Analogical to SAX endElement callback
virtual void EndElement( const std::string& name ) {
}
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
virtual void Characters( const std::string& name ) {
}
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
// The name passed-in as the argument is the name of the XML element for which that's been done
virtual void StackPopNotify( const std::string& name ) {
SAXObject** so = Context()->GetTopObject();
SinglePlacementType* sptobj = dynamic_cast<SinglePlacementType*>( m_obj );
sptobj->add_content( name, *so );
}
protected:
SAXObject* m_obj;
};
#endif // SINGLEPLACEMENTTYPEPROCESS_H
@@ -0,0 +1,98 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: SolidTypeProcess.hh,v 1.2 2002/06/03 12:09:31 radoone Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// --------------------------------------------------------------
// Comments
//
// --------------------------------------------------------------
//
#ifndef SOLIDTYPEPROCESS_H
#define SOLIDTYPEPROCESS_H 1
#include "ProcessingConfigurator.hh"
#include "ProcessingContext.hh"
#include "SAXProcessor.hh"
#include "StateStack.hh"
#include "SAXProcessingState.hh"
#include "SAXStateProcess.hh"
#include "SAXObjectHandle.hh"
#include "SAXComponentFactory.hh"
#include "SolidType.hh"
#include <cstdlib>
#include <iostream>
class SolidTypeProcess : public SAXStateProcess, virtual public SAXComponentObject
{
public:
SolidTypeProcess( const ProcessingContext* context = 0 )
: SAXStateProcess( context ), m_obj( 0 ) {
}
virtual ~SolidTypeProcess() {
}
virtual const SAXComponentObject* Build() const {
return this;
}
// Analogical to SAX startElement callback
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs )
{
std::string lunit = attrs.getValue( "lunit" );
std::string aunit = attrs.getValue( "aunit" );
std::string sname = attrs.getValue( "name" );
SolidType* sobj = dynamic_cast<SolidType*>( m_obj );
sobj->set_lunit( lunit );
sobj->set_aunit( aunit );
sobj->set_name( sname );
}
// Analogical to SAX endElement callback
virtual void EndElement( const std::string& name )
{
}
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
virtual void Characters( const std::string& name )
{
}
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
// The name passed-in as the argument is the name of the XML element for which that's been done
virtual void StackPopNotify( const std::string& name )
{
}
protected:
SAXObject* m_obj;
};
#endif // SOLIDTYPEPROCESS_H