Import Geant4 8.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:36:02 +02:00
parent d93e1e39a9
commit 8a51e0bc40
5471 changed files with 99628 additions and 55248 deletions
@@ -0,0 +1,47 @@
The files in this directory are the files that were used to build
../include/Marshaled*.hh . The files ../include/Marshaled*.hh contain
marshaling (serialization) routines that are used by Parallel Geantr4.
Marshalgen is a package that allows one to add a small number of annotations
to the original sequential code, in order to create marshalling or
serialization routines. Those marshalling routines are then used
by ParGeant4 to pass data between slave processes and the master process.
INPUT FILES:
1. G4*.hh : The files *.hh are taken from Geant4. They include annotations
(comments) that describe how to marshal individual fields of the
given classes. These files have additional annotations that describe
how to marshal individual fields of the given classes. For a new
application, you have to change any references to Ex* to your
own example/application include files. These files are then reused
in the new Geant4 parallel application.
2. ../include/Ex*Hit.hh : These files are the original sequential Geant4
application files that describe the application-defined hits.
They remain in the application include directory because they may
depend on other files in the include directory.
For most new parallel Geant4 applications, these files are sufficiently
simple, that one needs only to add Marshalgen begin and end comments
bracketing the class that needs to be marshalled, and a small number
of annotations specifying accessor functions to get and set fields
in the class. It may also be necessary to include marshalling
include files, if it is necessary to marshal other Geant4 data
structures.
Information on how to marshal the fields, etc., is in the Marshalgen
manual, along with the Marshalgen package:
http://www.ccs.neu.edu/home/gene/marshalgen
Marshalgen was then called on the above input files. One calls:
./marshalgen *.hh
./marshalgen ../include/Ex*Hit.hh
OUTPUT FILES:
3. *.msh : These files are intermediate files generated automatically
by marshalgen ( http://www.ccs.neu.edu/home/gene/marshalgen )
These files can be deleted if desired.
4. Marshaled*.h : These files are generated by Marshalgen. They
include of type both MarshaledEx*.h and MarshaledG4*.h .
(In addition, the file MarshaledObj.h is copied directly from
the Marshalgen distribution.) These files are all copied to
the include directory of the Geant4 parallel application.
They provide the marshalling functions that are then used by Geant4.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4HCofThisEvent.hh,v 1.1 2004/11/22 17:39:47 cooperma Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4HCofThisEvent.hh,v 1.2 2005/11/26 09:47:01 cooperma Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
#ifndef G4HCofThisEvent_h
@@ -31,7 +31,7 @@
#include "globals.hh"
#include "G4Allocator.hh"
#include "G4VHitsCollection.hh"
#include "g4std/vector"
#include <vector>
// class description:
//
@@ -68,7 +68,7 @@ class G4HCofThisEvent
void AddHitsCollection(G4int HCID,G4VHitsCollection * aHC);
private:
G4std::vector<G4VHitsCollection*> * HC; /*MSH: ptr_as_array
std::vector<G4VHitsCollection*> * HC; /*MSH: ptr_as_array
[elementType: G4VHitsCollection*]
[elementCount: { $ELE_COUNT = $THIS->GetNumberOfCollections(); }]
[elementGet: { $ELEMENT = $THIS->GetHC($ELE_INDEX); }]
@@ -101,7 +101,11 @@ class G4HCofThisEvent
};
//MSH_END
extern G4Allocator<G4HCofThisEvent> anHCoTHAllocator;
#if defined G4DIGI_ALLOC_EXPORT
extern G4DLLEXPORT G4Allocator<G4HCofThisEvent> anHCoTHAllocator;
#else
extern G4DLLIMPORT G4Allocator<G4HCofThisEvent> anHCoTHAllocator;
#endif
inline void* G4HCofThisEvent::operator new(size_t)
{
@@ -10,9 +10,12 @@
//MSH_include_end
%}
// This file is generated automatically from G4HCofThisEvent.hh . It is an
// intermediate file useful for debugging, but otherwise may be deleted.
marshaling class MarshaledG4HCofThisEvent (G4HCofThisEvent* param) {
G4std::vector<G4VHitsCollection*> * HC;
std::vector<G4VHitsCollection*> * HC;
//FIELDMARSHAL:
{
int copy_off = 0;
@@ -32,11 +32,12 @@
vietha 2003.05.08
*/
#ifndef G4String_h
#define G4String_h
#ifndef __G4String
#define __G4String
//MSH_BEGIN
class G4String{
class G4String : public std::string
{
int dummy; /*MSH: manual
{ memcpy($$, param->c_str(), param->size());
*($$+param->size()) = '\0';
@@ -3,6 +3,9 @@
%}
// This file is generated automatically from G4String.hh . It is an
// intermediate file useful for debugging, but otherwise may be deleted.
marshaling class MarshaledG4String (G4String* param) {
int dummy;
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4THitsCollection.hh,v 1.1 2004/11/22 17:39:47 cooperma Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4THitsCollection.hh,v 1.2 2005/11/26 09:47:01 cooperma Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
#ifndef G4THitsCollection_h
@@ -32,7 +32,7 @@
#include "G4Allocator.hh"
#include "globals.hh"
//#include "g4rw/tpordvec.h"
#include "g4std/vector"
#include <vector>
// class description:
//
@@ -64,7 +64,11 @@ class G4HitsCollection : public G4VHitsCollection
};
//MSH_END
extern G4Allocator<G4HitsCollection> anHCAllocator;
#if defined G4DIGI_ALLOC_EXPORT
extern G4DLLEXPORT G4Allocator<G4HitsCollection> anHCAllocator;
#else
extern G4DLLIMPORT G4Allocator<G4HitsCollection> anHCAllocator;
#endif
//MSH_BEGIN
template <class T> class G4THitsCollection : public G4HitsCollection
@@ -88,15 +92,15 @@ template <class T> class G4THitsCollection : public G4HitsCollection
public: // with description
inline T* operator[](size_t i) const
{ return (*((G4std::vector<T*>*)theCollection))[i]; }
{ return (*((std::vector<T*>*)theCollection))[i]; }
// Returns a pointer to a concrete hit object.
inline G4std::vector<T*>* GetVector() const
{ return (G4std::vector<T*>*)theCollection; }
inline std::vector<T*>* GetVector() const
{ return (std::vector<T*>*)theCollection; }
// Returns a collection vector.
inline G4int insert(T* aHit)
{
G4std::vector<T*>*theHitsCollection
= (G4std::vector<T*>*)theCollection;
std::vector<T*>*theHitsCollection
= (std::vector<T*>*)theCollection;
theHitsCollection->push_back(aHit);
return theHitsCollection->size();
}
@@ -104,17 +108,17 @@ template <class T> class G4THitsCollection : public G4HitsCollection
// collection is returned.
inline G4int entries() const
{
G4std::vector<T*>*theHitsCollection
= (G4std::vector<T*>*)theCollection;
std::vector<T*>*theHitsCollection
= (std::vector<T*>*)theCollection;
return theHitsCollection->size();
}
// Returns the number of hit objects stored in this collection
public:
virtual G4VHit* GetHit(size_t i) const
{ return (*((G4std::vector<T*>*)theCollection))[i]; }
{ return (*((std::vector<T*>*)theCollection))[i]; }
virtual size_t GetSize() const
{ return ((G4std::vector<T*>*)theCollection)->size(); }
{ return ((std::vector<T*>*)theCollection)->size(); }
// MSH_superclass : G4HitsCollection
@@ -135,23 +139,23 @@ template <class T> inline void G4THitsCollection<T>::operator delete(void* anHC)
template <class T> G4THitsCollection<T>::G4THitsCollection()
{
G4std::vector<T*> * theHitsCollection
= new G4std::vector<T*>;
std::vector<T*> * theHitsCollection
= new std::vector<T*>;
theCollection = (void*)theHitsCollection;
}
template <class T> G4THitsCollection<T>::G4THitsCollection(G4String detName,G4String colNam)
: G4HitsCollection(detName,colNam)
{
G4std::vector<T*> * theHitsCollection
= new G4std::vector<T*>;
std::vector<T*> * theHitsCollection
= new std::vector<T*>;
theCollection = (void*)theHitsCollection;
}
template <class T> G4THitsCollection<T>::~G4THitsCollection()
{
G4std::vector<T*> * theHitsCollection
= (G4std::vector<T*>*)theCollection;
std::vector<T*> * theHitsCollection
= (std::vector<T*>*)theCollection;
//theHitsCollection->clearAndDestroy();
for(size_t i=0;i<theHitsCollection->size();i++)
{ delete (*theHitsCollection)[i]; }
@@ -164,8 +168,8 @@ template <class T> G4int G4THitsCollection<T>::operator==(const G4THitsCollectio
template <class T> void G4THitsCollection<T>::DrawAllHits()
{
G4std::vector<T*> * theHitsCollection
= (G4std::vector<T*>*)theCollection;
std::vector<T*> * theHitsCollection
= (std::vector<T*>*)theCollection;
size_t n = theHitsCollection->size();
for(size_t i=0;i<n;i++)
{ (*theHitsCollection)[i]->Draw(); }
@@ -173,8 +177,8 @@ template <class T> void G4THitsCollection<T>::DrawAllHits()
template <class T> void G4THitsCollection<T>::PrintAllHits()
{
G4std::vector<T*> * theHitsCollection
= (G4std::vector<T*>*)theCollection;
std::vector<T*> * theHitsCollection
= (std::vector<T*>*)theCollection;
size_t n = theHitsCollection->size();
for(size_t i=0;i<n;i++)
{ (*theHitsCollection)[i]->Print(); }
@@ -3,6 +3,9 @@
%}
// This file is generated automatically from G4THitsCollection.hh . It is an
// intermediate file useful for debugging, but otherwise may be deleted.
marshaling class MarshaledG4HitsCollection (G4HitsCollection* param) {
void* theCollection;
@@ -48,7 +51,7 @@
}
template <class T> marshaling class MarshaledG4THitsCollection<T> (G4THitsCollection<T>* param) : public G4HitsCollection {
int __dummy848; // marshaling code for MSH_superclass
int __dummy569; // marshaling code for MSH_superclass
//FIELDMARSHAL:
{
MarshaledG4HitsCollection marParent($THIS);
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VHitsCollection.hh,v 1.1 2004/11/22 17:39:48 cooperma Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4VHitsCollection.hh,v 1.2 2005/11/26 09:47:01 cooperma Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
#ifndef G4VHitsCollection_h
@@ -55,9 +55,9 @@ class G4VHitsCollection
protected:
// Collection name
G4String collectionName; /*MSH: predefined
[elementGet: { $ELEMENT = $THIS->GetName(); }]
[elementSet: { Shadowed_param->collectionName=$ELEMENT; }]
G4String collectionName; /*MSH: predefined
[elementGet: { $ELEMENT = $THIS->GetName(); }]
[elementSet: { Shadowed_param->collectionName=$ELEMENT; }]
*/
G4String SDname; /* MSH: predefined
@@ -77,7 +77,7 @@ class G4VHitsCollection
// GetHit and GetSize are given a default implementation here so
// that the template G4THitsCollection can be used, but they
// are re-implemented G4THitsCollection.
virtual G4VHit* GetHit(size_t i) const { return 0; }
virtual G4VHit* GetHit(size_t) const { return 0; }
virtual size_t GetSize() const { return 0; };
};
@@ -3,9 +3,12 @@
%}
// This file is generated automatically from G4VHitsCollection.hh . It is an
// intermediate file useful for debugging, but otherwise may be deleted.
marshaling class MarshaledG4VHitsCollection (G4VHitsCollection* param) {
G4String collectionName;
G4String collectionName;
//FIELDMARSHAL:
{
G4String $ELEMENT;
@@ -52,11 +55,11 @@
// no need to declare size since $SIZE is already assigned in the MARSHAL field
}
int __dummy100; // marshaling code for MSH_derivedclass
int __dummy630; // marshaling code for MSH_derivedclass
//FIELDMARSHAL:
{
G4THitsCollection<ExN02TrackerHit> *aObj100 = (G4THitsCollection<ExN02TrackerHit>*)$THIS;
MarshaledG4THitsCollection<ExN02TrackerHit> marChild(aObj100);
G4THitsCollection<ExN02TrackerHit> *aObj630 = (G4THitsCollection<ExN02TrackerHit>*)$THIS;
MarshaledG4THitsCollection<ExN02TrackerHit> marChild(aObj630);
EXTEND_BUFFER(marChild.getBufferSize());
memcpy($$,marChild.getBuffer(), marChild.getBufferSize());
$SIZE = marChild.getBufferSize();
@@ -222,8 +222,8 @@ void marshal3() {
//Now just copy "get" functions here
{
G4THitsCollection<ExN02TrackerHit> *aObj100 = (G4THitsCollection<ExN02TrackerHit>*)param;
MarshaledG4THitsCollection<ExN02TrackerHit> marChild(aObj100);
G4THitsCollection<ExN02TrackerHit> *aObj630 = (G4THitsCollection<ExN02TrackerHit>*)param;
MarshaledG4THitsCollection<ExN02TrackerHit> marChild(aObj630);
EXTEND_BUFFER(marChild.getBufferSize());
memcpy(msh_cursor,marChild.getBuffer(), marChild.getBufferSize());
msh_currentSize = marChild.getBufferSize();