Import Geant4 8.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:44:26 +02:00
parent 8a51e0bc40
commit 216a75eeb1
8717 changed files with 360418 additions and 141343 deletions
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the 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. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4AssemblyVolume.hh,v 1.2 2003/11/02 16:06:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4AssemblyVolume.hh,v 1.7 2006/06/29 18:56:51 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// Class G4AssemblyVolume
@@ -36,17 +39,20 @@
// The resulting objects are independent copies of each of the assembled
// logical volumes. The placements are not, however, bound one to each other
// when placement is done. They are seen as independent physical volumes in
// space. This is the main difference when compared to the boolean solids or
// parametrised physical volumes.
// space.
// Author: Radovan Chytracek, John Apostolakis, Gabriele Cosmo
// Version: 1.0
// Date: November 2000
//
// History:
// March 2006, I.Hrivnacova - Extended to support assembly of assemblies
// of volumes and reflections
// ----------------------------------------------------------------------
#ifndef G4_ASSEMBLYVOLUME_H
#define G4_ASSEMBLYVOLUME_H
#include <vector>
#include "G4Transform3D.hh"
#include "G4AssemblyTriplet.hh"
@@ -66,15 +72,12 @@ class G4AssemblyVolume
// At destruction all the generated physical volumes and associated
// rotation matrices of the imprints will be destroyed.
//
// The rotation matrix passed in can be 0 = identity or an address even of an object
// on the upper stack frame. During assembly imprint, it creates anyway a new matrix
// and keeps track of it so it can delete it later at destruction time.
// This new policy has been adopted since user has no control on the way the rotations
// are combined it's safer doing it this way.
//
// WARNING! This interface will likely change in the next major release of Geant4 from
// a pointer to a reference due to the reason above
//
// The rotation matrix passed as argument can be 0 (identity) or an address
// even of an object on the upper stack frame. During assembly imprint, a
// new matrix is created anyway and it is kept track of it so it can be
// automatically deleted later at the end of the application.
// This policy is adopted since user has no control on the way the
// rotations are combined.
void AddPlacedVolume( G4LogicalVolume* pPlacedVolume,
G4ThreeVector& translation,
@@ -82,7 +85,7 @@ class G4AssemblyVolume
//
// Place the given volume 'pPlacedVolume' inside the assembly.
//
// The taken approach:
// The adopted approach:
//
// - Place it w.r.t. the assembly coordinate system.
// This step is applied to each of the participating volumes.
@@ -101,38 +104,93 @@ class G4AssemblyVolume
// Every next volume being added into the assembly will be placed
// w.r.t to the previous one.
//
// The rotation matrix passed in can be 0 = identity or an address even of an object
// on the upper stack frame. During assembly imprint, it creates anyway a new matrix
// and keeps track of it so it can delete it later at destruction time.
// This new policy has been adopted since user has no control on the way the rotations
// are combined it's safer doing it this way.
//
// WARNING! This interface will likely change in the next major release of Geant4 from
// a pointer to a reference due to the reason above
//
// The rotation matrix passed as argument can be 0 (identity) or an address
// even of an object on the upper stack frame. During assembly imprint, a
// new matrix is created anyway and it is kept track of it so it can be
// automatically deleted later at the end of the application.
// This policy is adopted since user has no control on the way the
// rotations are combined.
void AddPlacedVolume( G4LogicalVolume* pPlacedVolume,
G4Transform3D& transformation);
//
// The same as previous but takes complete 3D transformation in space
// The same as previous, but takes complete 3D transformation in space
// as its argument.
void AddPlacedAssembly( G4AssemblyVolume* pAssembly,
G4Transform3D& transformation);
//
// The same as previous AddPlacedVolume(), but takes an assembly volume
// as its argument.
void AddPlacedAssembly( G4AssemblyVolume* pAssembly,
G4ThreeVector& translation,
G4RotationMatrix* rotation);
//
// The same as above AddPlacedVolume(), but takes an assembly volume
// as its argument with translation and rotation.
void MakeImprint( G4LogicalVolume* pMotherLV,
G4ThreeVector& translationInMother,
G4RotationMatrix* pRotationInMother,
G4int copyNumBase = 0 );
G4int copyNumBase = 0,
G4bool surfCheck = false );
//
// Creates instance of an assembly volume inside the given mother volume.
void MakeImprint( G4LogicalVolume* pMotherLV,
G4Transform3D& transformation,
G4int copyNumBase = 0 );
G4int copyNumBase = 0,
G4bool surfCheck = false );
//
// The same as previous but takes complete 3D transformation in space
// as its argument.
// The same as previous Imprint() method, but takes complete 3D
// transformation in space as its argument.
inline std::vector<G4VPhysicalVolume*>::iterator GetVolumesIterator();
inline unsigned int TotalImprintedVolumes() const;
//
// Methods to access the physical volumes imprinted with the assembly.
unsigned int GetImprintsCount() const;
//
// Return the number of made imprints.
unsigned int GetInstanceCount() const;
//
// Return the number of existing instance of G4AssemblyVolume class.
unsigned int GetAssemblyID() const;
//
// Return instance number of this concrete object.
protected:
void SetInstanceCount( unsigned int value );
void SetAssemblyID( unsigned int value );
void InstanceCountPlus();
void InstanceCountMinus();
void SetImprintsCount( unsigned int value );
void ImprintsCountPlus();
void ImprintsCountMinus();
//
// Internal counting mechanism, used to compute unique the names of
// physical volumes created by MakeImprint() methods.
private:
void MakeImprint( G4AssemblyVolume* pAssembly,
G4LogicalVolume* pMotherLV,
G4Transform3D& transformation,
G4int copyNumBase = 0,
G4bool surfCheck = false );
//
// Function for placement of the given assembly in the given mother
// (called recursively if the assembly contains an assembly).
private:
std::vector<G4AssemblyTriplet> fTriplets;
//
// Participating volumes represented as a vector of
@@ -143,57 +201,26 @@ class G4AssemblyVolume
// We need to keep list of physical volumes created by MakeImprint() method
// in order to be able to cleanup the objects when not needed anymore.
// This requires the user to keep assembly objects in memory during the
// whole job or during the life-time of G4Navigator, log. vol store
// and phys. vol. store may keep pointers to physical volumes generated by
// whole job or during the life-time of G4Navigator, logical volume store
// and physical volume store keep pointers to physical volumes generated by
// the assembly volume.
// When an assembly object is about to die it will destroy all its
// generated physical volumes and rotation matrices as well !
// This may affect validity of detector contruction !
public:
unsigned int GetImprintsCount() const;
protected:
void SetImprintsCount( unsigned int value );
void ImprintsCountPlus();
void ImprintsCountMinus();
//
// Internal counting mechanism, used to compute unique the names of
// phys. volumes created by MakeImprint(...) method(s).
private:
unsigned int fImprintsCounter;
//
// Number of imprints of the given assembly volume.
public:
unsigned int GetInstanceCount() const;
// Return the number of existing instance of G4AssemblyVolume class
unsigned int GetAssemblyID() const;
// Return instance number of this concrete object
protected:
void SetInstanceCount( unsigned int value );
void SetAssemblyID( unsigned int value );
void InstanceCountPlus();
void InstanceCountMinus();
private:
static unsigned int fsInstanceCounter;
// Class instance counter
unsigned int fAssemblyID;
// Assembly object ID derived from instance counter at construction time
//
// Class instance counter.
unsigned int fAssemblyID;
//
// Assembly object ID derived from instance counter at construction time.
};
#include "G4AssemblyVolume.icc"
#endif // G4_ASSEMBLYVOLUME_H