Import Geant4 9.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:58:43 +02:00
parent 96c8bcd0af
commit b79225fb37
7544 changed files with 245407 additions and 91099 deletions
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbDetectorBuilder.hh,v 1.2 2008/12/18 12:58:00 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbDetectorBuilder
//
// Class description:
//
// Builder of transient detector.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbDetectorBuilder_hh
#define G4tgbDetectorBuilder_hh
#include "globals.hh"
#include <string>
#include <vector>
#include <map>
#include "G4VSolid.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
class G4tgbVolume;
class G4tgrVolume;
//--------------------------------------------------------------------------
class G4tgbDetectorBuilder
{
public: // with description
G4tgbDetectorBuilder();
~G4tgbDetectorBuilder();
virtual const G4tgrVolume* ReadDetector();
virtual G4VPhysicalVolume* ConstructDetector( const G4tgrVolume* tgrVoltop );
};
#endif
@@ -0,0 +1,60 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbDetectorConstruction.hh,v 1.2 2008/12/18 12:58:02 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbDetectorConstruction
//
// Class description:
//
// This class is the link between the user packages and G4RunManager
// It passes to the G4RunManager the top volume in the hierarchy
// constructed in G4tgbVolumeMgr.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbDetectorConstruction_H
#define G4tgbDetectorConstruction_H 1
#include "globals.hh"
class G4VPhysicalVolume;
class G4tgbDetectorConstruction
{
public: // with description
G4tgbDetectorConstruction();
~G4tgbDetectorConstruction();
G4VPhysicalVolume* Construct();
};
#endif
@@ -0,0 +1,84 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbElement.hh,v 1.2 2008/12/18 12:58:04 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbElement
//
// Class description:
//
// Transient class of a chemical element; builds a G4Element.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbElement_h
#define G4tgbElement_h
#include "globals.hh"
#include <vector>
#include <string>
#include "G4tgrElement.hh"
#include "G4Element.hh"
//--------------------------------------------------------------------------
class G4tgbElement
{
public: // with description
G4tgbElement(){}
~G4tgbElement(){}
G4tgbElement( G4tgrElement* hg );
// Construct the G4tgbElement from the corresponding HgElement
G4Element* BuildG4ElementSimple();
G4Element* BuildG4ElementFromIsotopes();
// Build a G4Element out of this HElement
const G4String& GetName() const
{
return theTgrElem->GetName();
}
const G4String& GetType() const
{
return theTgrElem->GetType();
}
private:
G4tgrElement* theTgrElem;
G4Element* theG4Elem;
};
#endif
@@ -0,0 +1,124 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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. *
// ********************************************************************
//
//
// class G4tgbGeometryDumper
//
// Class description:
//
// Class for dumping the whole geometry.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbGeometryDumper_HH
#define G4tgbGeometryDumper_HH
#include "globals.hh"
#include "G4RotationMatrix.hh"
#include <fstream>
#include <map>
#include <vector>
class G4Material;
class G4Element;
class G4Isotope;
class G4VSolid;
class G4LogicalVolume;
class G4VPhysicalVolume;
class G4PVParameterised;
class G4PVReplica;
class G4tgbGeometryDumper
{
public: // with description
static G4tgbGeometryDumper* GetInstance();
~G4tgbGeometryDumper();
void DumpGeometry(const G4String& fname );
G4VPhysicalVolume* GetTopPhysVol();
void DumpPhysVol( G4VPhysicalVolume* pv );
void DumpPVPlacement( G4VPhysicalVolume* pv, const G4String& lvName,
G4int copyNo = -999 );
void DumpPVParameterised( G4PVParameterised* pv );
void DumpPVReplica( G4PVReplica* pv, const G4String& lvName );
G4String DumpLogVol( G4LogicalVolume* lv, G4String extraName = "",
G4VSolid* solid = 0, G4Material* mate = 0);
G4String DumpMaterial( G4Material* mat );
void DumpElement( G4Element* ele);
void DumpIsotope( G4Isotope* ele);
G4String DumpSolid( G4VSolid* solid, const G4String& extraName = "" );
void DumpBooleanVolume( const G4String& solidType, G4VSolid* so );
void DumpSolidParams(G4VSolid * so);
std::vector<G4double> GetSolidParams( const G4VSolid * so);
void DumpPolySections(G4int zPlanes, G4double* z,
G4double *rmin, G4double *rmax);
G4String DumpRotationMatrix( G4RotationMatrix* rotm );
private:
G4tgbGeometryDumper();
private:
std::vector<G4VPhysicalVolume*> GetPVChildren( G4LogicalVolume* lv );
G4String GetTGSolidType( const G4String& solidtype );
G4double MatDeterminant(G4RotationMatrix * ro) ;
G4double approxTo0( G4double val );
G4String AddQuotes( const G4String& str );
G4String GetIsotopeName( G4Isotope* );
template< class TYP> G4String GetObjectName( TYP* obj,
std::map<G4String,TYP*> objectsDumped );
G4bool CheckIfLogVolExists( const G4String& name, G4LogicalVolume* pt );
G4bool CheckIfPhysVolExists( const G4String& name, G4VPhysicalVolume* );
G4String LookForExistingRotation( const G4RotationMatrix* rotm );
G4String SupressRefl( G4String name );
G4String SubstituteRefl( G4String name );
G4bool Same2G4Isotopes( G4Isotope* ele1, G4Isotope* ele2 );
const G4String& FindSolidName( G4VSolid* solid );
private:
static G4tgbGeometryDumper* theInstance;
std::ofstream* theFile;
std::map<G4String,G4Material*> theMaterials;
std::map<G4String,G4Element*> theElements;
std::map<G4String,G4Isotope*> theIsotopes;
std::map<G4String,G4VSolid*> theSolids;
std::map<G4String,G4LogicalVolume*> theLogVols;
std::map<G4String,G4VPhysicalVolume*> thePhysVols;
std::map<G4String,G4RotationMatrix*> theRotMats;
G4int theRotationNumber;
};
#endif
@@ -0,0 +1,76 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbIsotope.hh,v 1.2 2008/12/18 12:58:06 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbIsotope
//
// Class description:
//
// Transient class of an isotope; builds a G4Isotope.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbIsotope_h
#define G4tgbIsotope_h
#include "globals.hh"
#include <vector>
#include <string>
#include "G4tgrIsotope.hh"
#include "G4Isotope.hh"
//--------------------------------------------------------------------------
class G4tgbIsotope
{
public: // with description
G4tgbIsotope();
~G4tgbIsotope();
G4tgbIsotope( G4tgrIsotope* hg );
// Construct the G4tgbIsotope from the corresponding HgIsotope
G4Isotope* BuildG4Isotope();
// Build a G4Isotope out of this HIsotope
const G4String& GetName() const { return theTgrIsot->GetName(); }
private:
G4tgrIsotope* theTgrIsot;
G4Isotope* theG4Isot;
};
#endif
@@ -0,0 +1,108 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbMaterial.hh,v 1.5 2008/12/18 12:58:08 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbMaterial
//
// Class description:
//
// Transient class of a material; builds a G4Material.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbMaterial_h
#define G4tgbMaterial_h
#include "globals.hh"
#include <vector>
#include <string>
#include <iostream>
#include "G4tgrMaterial.hh"
#include "G4Material.hh"
class G4tgbMaterial
{
friend std::ostream& operator<<(std::ostream&, const G4tgbMaterial&);
public: // with description
G4tgbMaterial();
virtual ~G4tgbMaterial();
G4tgbMaterial( G4tgrMaterial* tgr );
virtual G4Material* BuildG4Material() = 0;
const G4String& GetName() const
{
return theTgrMate->GetName();
}
G4double GetDensity() const
{
return theTgrMate->GetDensity();
}
G4int GetNumberOfMaterials() const
{
return theTgrMate->GetNumberOfComponents();
}
G4double GetA() const
{
return theTgrMate->GetA();
}
G4double GetZ() const
{
return theTgrMate->GetZ();
}
const G4String& GetType() const
{
return theTgrMate->GetType();
}
G4tgrMaterial* GetTgrMate() const
{
return theTgrMate;
}
protected:
G4tgrMaterial* theTgrMate;
G4Material* theG4Mate;
};
#endif
@@ -0,0 +1,139 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbMaterialMgr.hh,v 1.4 2008/12/18 12:58:10 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbMaterialMgr
//
// Class description:
//
// Singleton class to manage the building of transient materials,
// as well as the construction of the corresponding G4Material's.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbMaterialMgr_h
#define G4tgbMaterialMgr_h
#include "globals.hh"
#include "G4tgbIsotope.hh"
#include "G4tgbElement.hh"
#include "G4tgbMaterial.hh"
#include "G4tgrIsotope.hh"
#include "G4tgrElement.hh"
#include "G4tgrElement.hh"
#include "G4tgrMaterial.hh"
#include "G4Isotope.hh"
#include "G4Element.hh"
#include "G4Material.hh"
typedef std::map< G4String, G4tgbIsotope* > G4mstgbisot;
typedef std::map< G4String, G4tgbElement* > G4mstgbelem;
typedef std::map< G4String, G4tgbMaterial* > G4mstgbmate;
typedef std::map< G4String, G4Isotope* > G4msg4isot;
typedef std::map< G4String, G4Element* > G4msg4elem;
typedef std::map< G4String, G4Material* > G4msg4mate;
class G4tgbMaterialMgr
{
public: // with description
~G4tgbMaterialMgr();
static G4tgbMaterialMgr* GetInstance();
// Get only instance (it it does not exists, create it)
void CopyIsotopes();
// Copy the G4tgrIsotopes into G4tgbIsotopes
void CopyElements();
// Copy the G4tgrElements into G4tgbElements
void CopyMaterials();
// Copy the G4tgrMaterials into G4tgbMaterials
G4Isotope* FindOrBuildG4Isotope(const G4String & name);
// Look for a G4Isotope that has to exists
// (if not found create it from the corresponding G4tgbIsotope)
G4Isotope* FindBuiltG4Isotope(const G4String & name) const;
// Look for a G4Isotope and if not found return 0
G4tgbIsotope* FindG4tgbIsotope(const G4String& name,
G4bool bMustExist = 0) const;
// Look for a G4Isotope and if not found return 0
G4Element* FindOrBuildG4Element(const G4String & name,
G4bool bMustExist = 1);
// Look for a G4Element that has to exists by default
// (if not found create it from the corresponding G4tgbElement)
G4Element* FindBuiltG4Element(const G4String& name) const;
// Look for a G4Element and if not found return 0
G4tgbElement* FindG4tgbElement(const G4String& name,
G4bool bMustExist = 0) const;
// Look for a G4Element and if not found return 0
G4Material* FindOrBuildG4Material(const G4String& name,
G4bool bMustExist = 1);
// Look for a G4Material that has to exists by default
// (if not found create it from the corresponding G4tgbMaterial)
G4Material* FindBuiltG4Material(const G4String& name) const;
// Look for a G4Material and if not found return 0
G4tgbMaterial* FindG4tgbMaterial(const G4String& name,
G4bool bMustExist = 0) const;
// Look for a G4tgbMaterial and if not found return 0
const G4msg4isot GetG4IsotopeList() const { return theG4Isotopes; }
const G4msg4elem GetG4ElementList() const { return theG4Elements; }
const G4msg4mate GetG4MaterialList() const { return theG4Materials; }
private:
G4tgbMaterialMgr();
// Private Constructor
private:
static G4tgbMaterialMgr* theInstance;
G4mstgbisot theG4tgbIsotopes;
// List of all tgbIsotopes created
G4mstgbelem theG4tgbElements;
// List of all tgbElements created
G4mstgbmate theG4tgbMaterials;
// List of all G4tgbMaterials created
G4msg4isot theG4Isotopes;
// Container of all G4Isotopes created
G4msg4elem theG4Elements;
// Container of all G4Elements created
G4msg4mate theG4Materials;
// Container of all G4Materials created
};
#endif
@@ -0,0 +1,71 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbMaterialMixture.hh,v 1.2 2008/12/18 12:58:12 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbMaterialMixture
//
// Class description:
//
// Transient class of a material mixture; builds a G4Material mixture.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbMaterialMixture_h
#define G4tgbMaterialMixture_h
#include "globals.hh"
#include <vector>
#include <string>
#include "G4tgbMaterial.hh"
class G4tgbMaterialMixture : public G4tgbMaterial
{
public: // with description
G4tgbMaterialMixture();
virtual ~G4tgbMaterialMixture();
// Get methods
virtual const G4String& GetComponent(G4int i) const;
virtual G4double GetFraction(G4int i) const;
//Operators
G4tgbMaterialMixture& operator=(const G4tgbMaterialMixture&);
protected:
virtual void TransformToFractionsByWeight();
};
#endif
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbMaterialMixtureByNoAtoms.hh,v 1.3 2008/12/18 12:58:14 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbMaterialMixtureByNoAtoms
//
// Class description:
//
// Class to represent a material whose components are given by number of atoms.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbMaterialMixtureByNoAtoms_h
#define G4tgbMaterialMixtureByNoAtoms_h
#include "globals.hh"
#include <vector>
#include <string>
#include "G4tgbMaterialMixture.hh"
class G4tgbMaterialMixtureByNoAtoms : public G4tgbMaterialMixture
{
public: // with description
G4tgbMaterialMixtureByNoAtoms( G4tgrMaterial* tgr );
G4tgbMaterialMixtureByNoAtoms();
~G4tgbMaterialMixtureByNoAtoms();
G4Material* BuildG4Material();
// Return the associated G4Material and if does not exist build it
void TransformToFractionsByWeight();
};
#endif
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbMaterialMixtureByVolume.hh,v 1.4 2008/12/18 12:58:16 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbMaterialMixtureByVolume
//
// Class description:
//
// Class to represent a material whose components are given by volume.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbMaterialMixtureByVolume_h
#define G4tgbMaterialMixtureByVolume_h
#include "globals.hh"
#include <vector>
#include <string>
#include "G4tgbMaterialMixture.hh"
class G4tgbMaterialMixtureByVolume : public G4tgbMaterialMixture
{
public: // with description
G4tgbMaterialMixtureByVolume();
G4tgbMaterialMixtureByVolume( G4tgrMaterial* tgr );
~G4tgbMaterialMixtureByVolume();
G4Material* BuildG4Material();
// Return the associated G4Material and if does not exist build it
void TransformToFractionsByWeight();
private:
std::vector<G4double> theFractionsByWeight;
};
#endif
@@ -0,0 +1,63 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbMaterialMixtureByWeight.hh,v 1.2 2008/12/18 12:58:18 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbMaterialMixtureByWeight
//
// Class description:
//
// Class to represent a material whose components are given by weight fractions.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbMaterialMixtureByWeight_h
#define G4tgbMaterialMixtureByWeight_h
#include "globals.hh"
#include <vector>
#include <string>
#include "G4tgbMaterialMixture.hh"
class G4tgbMaterialMixtureByWeight : public G4tgbMaterialMixture
{
public: // with description
G4tgbMaterialMixtureByWeight();
G4tgbMaterialMixtureByWeight( G4tgrMaterial* tgr );
~G4tgbMaterialMixtureByWeight();
G4Material* BuildG4Material();
// Return the associated G4Material and if does not exist build it
};
#endif
@@ -0,0 +1,77 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbMaterialSimple.hh,v 1.2 2008/12/18 12:58:20 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbMaterialSimple
//
// Class description:
//
// Class to represent a simple material definition.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbMaterialSimple_h
#define G4tgbMaterialSimple_h
#include "globals.hh"
#include <vector>
#include <string>
#include <iostream>
#include "G4tgbMaterial.hh"
class G4tgbMaterialSimple : public G4tgbMaterial
{
public: // with description
G4tgbMaterialSimple();
~G4tgbMaterialSimple();
G4tgbMaterialSimple( G4tgrMaterial* tgr );
// Fill the data interpreting the list of words read 'wl'
friend std::ostream& operator<<(std::ostream&, const G4tgbMaterialSimple&);
G4Material* BuildG4Material();
// Return the associated G4Material and if does not exist build it
G4double GetZ() const {return theZ;}
G4double GetA() const {return theA;}
private:
G4double theZ;
G4double theA;
};
#endif
@@ -0,0 +1,77 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbPlaceParamCircle.hh,v 1.1 2008/10/23 14:43:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbPlaceParamCircle
//
// Class description:
//
// Class to represent simple Cartesian parameterisations along a circle.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbPlaceParamCircle_H
#define G4tgbPlaceParamCircle_H 1
#include "globals.hh"
#include "G4VPVParameterisation.hh"
#include "G4tgbPlaceParameterisation.hh"
#include "G4ThreeVector.hh"
class G4tgrPlaceParameterisation;
class G4VPhysicalVolume;
class G4tgbPlaceParamCircle : public G4tgbPlaceParameterisation
{
public: // with description
G4tgbPlaceParamCircle( G4tgrPlaceParameterisation* );
~G4tgbPlaceParamCircle();
void ComputeTransformation(const G4int copyNo,
G4VPhysicalVolume *physVol) const;
private:
void GetNormalToAxis();
private:
G4double theRadius;
G4ThreeVector theCircleAxis;
G4ThreeVector theDirInPlane;
G4double theStep;
G4double theOffset;
};
#endif
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbPlaceParamLinear.hh,v 1.1 2008/10/23 14:43:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbPlaceParamLinear
//
// Class description:
//
// Class to represent simple Cartesian parameterisations along a line.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbPlaceParamLinear_H
#define G4tgbPlaceParamLinear_H 1
#include "globals.hh"
#include "G4tgbPlaceParameterisation.hh"
#include "G4ThreeVector.hh"
class G4VPhysicalVolume;
class G4tgrPlaceParameterisation;
class G4tgbPlaceParamLinear : public G4tgbPlaceParameterisation
{
public: // with description
G4tgbPlaceParamLinear( G4tgrPlaceParameterisation* );
~G4tgbPlaceParamLinear();
void ComputeTransformation(const G4int copyNo,
G4VPhysicalVolume *physVol) const;
private:
G4ThreeVector theDirection;
G4double theStep;
G4double theOffset;
};
#endif
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbPlaceParamSquare.hh,v 1.1 2008/10/23 14:43:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbPlaceParamSquare
//
// Class description:
//
// Class to represent simple Cartesian parameterisations along a square.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbPlaceParamSquare_H
#define G4tgbPlaceParamSquare_H 1
#include "globals.hh"
#include "G4tgbPlaceParameterisation.hh"
#include "G4ThreeVector.hh"
class G4VPhysicalVolume;
class G4tgbPlaceParamSquare : public G4tgbPlaceParameterisation
{
public: // with description
G4tgbPlaceParamSquare( G4tgrPlaceParameterisation* );
~G4tgbPlaceParamSquare();
void ComputeTransformation(const G4int copyNo,
G4VPhysicalVolume *physVol) const;
private:
G4int theNCopies1;
G4int theNCopies2;
G4ThreeVector theDirection1;
G4ThreeVector theDirection2;
G4double theStep1;
G4double theStep2;
G4double theOffset1;
G4double theOffset2;
};
#endif
@@ -0,0 +1,79 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbPlaceParameterisation.hh,v 1.4 2008/11/21 15:37:18 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbPlaceParamSquare
//
// Class description:
//
// Class to represent parameterisations of placements.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbPlaceParameterisation_H
#define G4tgbPlaceParameterisation_H 1
#include "globals.hh"
#include "geomdefs.hh"
#include "G4VPVParameterisation.hh"
#include "G4ThreeVector.hh"
#include "G4RotationMatrix.hh"
#include "G4tgrUtils.hh"
class G4VPhysicalVolume;
class G4tgrPlaceParameterisation;
class G4tgbPlaceParameterisation : public G4VPVParameterisation
{
public: // with description
G4tgbPlaceParameterisation( G4tgrPlaceParameterisation* tgrParam );
virtual ~G4tgbPlaceParameterisation();
virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const;
void CheckNExtraData( G4tgrPlaceParameterisation* tgrParam,
G4int nWcheck, WLSIZEtype st,
const G4String& methodName );
G4int GetNCopies() const { return theNCopies; }
EAxis GetAxis() const { return theAxis; }
protected:
G4int theNCopies;
EAxis theAxis;
G4ThreeVector theTranslation;
G4RotationMatrix* theRotationMatrix;
};
#endif
@@ -0,0 +1,79 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbRotationMatrix.hh,v 1.2 2008/12/18 12:58:22 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbRotationMatrix
//
// Class description:
//
// Transient class of a rotation matrix; builds a G4RotationMatrix,
// of each rotation matrix.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbRotationMatrix_h
#define G4tgbRotationMatrix_h
#include "globals.hh"
#include <vector>
#include <string>
#include "G4tgrRotationMatrix.hh"
#include "G4RotationMatrix.hh"
class G4tgbRotationMatrix
{
public: // with description
G4tgbRotationMatrix();
~G4tgbRotationMatrix();
G4tgbRotationMatrix( G4tgrRotationMatrix* tgr );
// Construct the G4tgbRotationMatrix (fill its data members)
// interpreting the data in the list of words 'wl'
G4RotationMatrix* BuildG4RotMatrix( );
G4RotationMatrix* BuildG4RotMatrixFrom3( std::vector<G4double>& values );
G4RotationMatrix* BuildG4RotMatrixFrom6( std::vector<G4double>& values );
G4RotationMatrix* BuildG4RotMatrixFrom9( std::vector<G4double>& values );
// Build a G4RotationMatrix transforming theValues
G4String GetName() { return theTgrRM->GetName(); }
private:
G4tgrRotationMatrix* theTgrRM;
G4RotationMatrix* theG4RM;
};
#endif
@@ -0,0 +1,97 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbRotationMatrixMgr.hh,v 1.2 2008/12/18 12:58:24 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbRotationMatrixMgr
//
// Class description:
//
// Singleton class to manage the building of transient rotation matrix,
// as well as the construction of the corresponding G4RotationMatrix's.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbRotationMatrixMgr_h
#define G4tgbRotationMatrixMgr_h
#include "globals.hh"
#include <iostream>
#include <map>
#include "G4tgbRotationMatrix.hh"
typedef std::map< G4String, G4tgbRotationMatrix*,
std::less<G4String> > G4mstgbrotm;
typedef std::map< G4String, G4RotationMatrix*,
std::less<G4String> > G4msg4rotm;
class G4tgbRotationMatrixMgr
{
public: // with description
~G4tgbRotationMatrixMgr();
static G4tgbRotationMatrixMgr* GetInstance();
// Get only instance (if it does not exists, create it)
G4RotationMatrix* FindOrBuildG4RotMatrix(const G4String& name);
// Look for a G4RotationMatrix and if not found create it
// from the corresponding G4tgbRotationMatrix
G4RotationMatrix* FindG4RotMatrix(const G4String& name);
// Look for a G4RotationMatrix and if not found return 0
G4tgbRotationMatrix* FindOrBuildTgbRotMatrix(const G4String& name);
// Look for an G4tgbRotationMatrix and if not found exit
G4tgbRotationMatrix* FindTgbRotMatrix(const G4String& name);
// Look for an G4tgbRotationMatrix and if not found return 0
public: // without description
const G4mstgbrotm GetTgbRotMatList() const { return theTgbRotMats; }
const G4msg4rotm& GetG4RotMatList() const { return theG4RotMats; }
private:
G4tgbRotationMatrixMgr();
void CopyRotMats();
static G4tgbRotationMatrixMgr* theInstance;
private:
G4mstgbrotm theTgbRotMats;
G4msg4rotm theG4RotMats;
};
std::ostream& operator<<(std::ostream&, const G4RotationMatrix &);
#endif
@@ -0,0 +1,121 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbVolume.hh,v 1.4 2008/12/18 12:58:26 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbVolume
//
// Class description:
//
// Class to manage the geometry info of any detector unit. The detector units
// created in this class are essentially transient copies of Geant4 physical
// volumes. Thus, they are characterized by a name and the parameters of a
// Geant4 physical volume.
// They have associated several detector positions, that can be instances of
// G4tgrPlace, G4tgrPlaceDivRep or G4tgrPlaceParameterisation.
// Each detector positioning is done inside a parent. As there can be several
// parents, we will write one parent for each detector position, even if that
// means that parents are repeated.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbVolume_h
#define G4tgbVolume_h
#include "globals.hh"
#include <vector>
#include <map>
#include "G4tgrVolume.hh"
#include "geomdefs.hh"
class G4tgrPlace;
class G4tgrSolid;
class G4VSolid;
class G4LogicalVolume;
class G4VPhysicalVolume;
class G4AssemblyVolume;
class G4tgbVolume
{
public: // with description
G4tgbVolume();
~G4tgbVolume();
G4tgbVolume( G4tgrVolume* vol);
void ConstructG4Volumes( const G4tgrPlace* place,
const G4LogicalVolume* parentLV );
// Construct the G4VSolid, G4LogicalVolume and the G4VPhysicalVolume
// of copy 'copyNo'
G4VSolid* FindOrConstructG4Solid( const G4tgrSolid* vol);
// Construct the G4VSolid from the data of the corresponding G4tgrVolume.
// Allow to use data from another G4tgrVolume, needed by Boolean solids
// (that have to construct two solids and then do the Boolean operation)
G4LogicalVolume* ConstructG4LogVol( const G4VSolid* solid );
// Construct the G4LogicalVolume and then call the construction of
// volumes that are positioned inside this LV
G4VPhysicalVolume* ConstructG4PhysVol( const G4tgrPlace* place,
const G4LogicalVolume* currentLV,
const G4LogicalVolume* parentLV );
// Construct the G4VPhysicalVolume placing 'curentLV' with position
// given by the G4tgrPlace 'copyNo' inside 'parentLV'
void SetCutsInRange( G4LogicalVolume* logvol,
std::map<G4String,G4double> cuts );
void SetCutsInEnergy( G4LogicalVolume* logvol,
std::map<G4String,G4double> cuts );
void CheckNoSolidParams( const G4String& solidType,
const unsigned int NoParamExpected,
const unsigned int NoParam );
// Before building a solid of type 'solydType', check if the number
// of paramenters is the expected one
G4VSolid* BuildSolidForDivision( G4VSolid* parentSolid, EAxis axis );
const G4String& GetName() const { return theTgrVolume->GetName(); }
G4bool GetVisibility() const { return theTgrVolume->GetVisibility(); }
const G4double* GetColour() const { return theTgrVolume->GetColour(); }
private:
G4tgrVolume* theTgrVolume;
// The G4tgrVolume to which it corresponds
G4AssemblyVolume* theG4AssemblyVolume;
};
#endif
@@ -0,0 +1,172 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgbVolumeMgr.hh,v 1.3 2008/12/18 12:58:28 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgbVolume
//
// Class description:
//
// Class to manage volumes: G4VSolids, G4LogicalVolumes, G4VPhysicalVolumes.
// It is a singleton, accesed always through calls to GetInstance().
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgbVolumeMgr_h
#define G4tgbVolumeMgr_h
#include "globals.hh"
#include <string>
#include <vector>
#include <map>
#include "G4VSolid.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
class G4tgbVolume;
class G4tgrVolume;
class G4tgbDetectorBuilder;
typedef std::map< G4String, G4tgbVolume* > G4mssvol;
typedef std::multimap< G4String, G4VSolid* > G4mmssol;
typedef std::multimap< G4String, G4LogicalVolume* > G4mmslv;
typedef std::multimap< G4String, G4VPhysicalVolume* > G4mmspv;
typedef std::map< G4LogicalVolume*, G4LogicalVolume* > G4mlvlv;
typedef std::map< G4VPhysicalVolume*, G4VPhysicalVolume* > G4mpvpv;
//----------------------------------------------------------------------------
class G4tgbVolumeMgr
{
public: // with description
G4tgbVolumeMgr();
~G4tgbVolumeMgr();
static G4tgbVolumeMgr* GetInstance();
// Get the only instance
void AddTextFile( const G4String& fname );
G4VPhysicalVolume* ReadAndConstructDetector();
void CopyVolumes();
// Build a G4tgbVolume per each G4tgbVolume
G4tgbVolume* FindVolume( const G4String& volname);
// Find a G4tgbVolume by name
void RegisterMe( const G4tgbVolume* vol );
// Register a G4tgbVolume
void RegisterMe( const G4VSolid* solid );
// Register a G4VSolid
void RegisterMe( const G4LogicalVolume* lv );
// Register a G4LogicalVolume
void RegisterMe( const G4VPhysicalVolume* pv );
// Register a G4VPhysicalVolume
void RegisterChildParentLVs( const G4LogicalVolume* logvol,
const G4LogicalVolume* parentLV );
// Register a child and its parent LV
G4VSolid* FindG4Solid( const G4String& name );
// Find if solid already exists, comparing the name and all parameters
// (could be checked before creating it, but it would be quite
// complicated, because it would have to compare the parameters, and
// they depend on the type of solid)
G4LogicalVolume* FindG4LogVol( const G4String& theName,
const G4bool bExists = 0 );
// Find a G4LogicalVolume if it already exists
G4VPhysicalVolume* FindG4PhysVol( const G4String& theName,
const G4bool bExists = 0 );
// Find a G4VPhysicalVolume if it already exists
G4VPhysicalVolume* GetTopPhysVol();
// Get the top PV in the hierarchy tree: calls topLV, because
// physicalvolumes are not placed until geometry is initialized
G4LogicalVolume* GetTopLogVol();
// Get the top LV in the hierarchy tree
void BuildPhysVolTree();
// Dumping methods
void DumpSummary();
void DumpG4LogVolTree();
void DumpG4LogVolLeaf(const G4LogicalVolume* lv, unsigned int leafDepth);
void DumpG4PhysVolTree();
void DumpG4PhysVolLeaf(const G4VPhysicalVolume* pv, unsigned int leafDepth);
void DumpG4SolidList();
public: // without description
const std::multimap< G4String, G4VSolid* >& GetSolids() const
{ return theSolids; }
void SetDetectorBuilder( G4tgbDetectorBuilder* db )
{ theDetectorBuilder = db; }
G4tgbDetectorBuilder* GetDetectorBuilder() const
{ return theDetectorBuilder; }
private:
static G4tgbVolumeMgr* theInstance;
G4mssvol theVolumeList;
// Map of G4tgbVolume's: G4String is the G4tgbVolume name,
// G4tgbVolume* the pointer to it.
G4mmssol theSolids;
// Solids container
G4mmslv theLVs;
// Logical volume container
G4mmspv thePVs;
// Physical volume container
G4mlvlv theLVTree;
// Logical volume tree for navigation (from parent to children):
// first is parent, then child
G4mlvlv theLVInvTree;
// Logical volume tree for inverse navigation (from children to parent):
// first is child, then parent
G4mpvpv thePVTree;
// Physical volume tree for navigation (from parent to children):
// first is parent, then child
G4mpvpv thePVInvTree;
// Physical volume tree for inverse navigation (from children to parents):
// first is child, then parent
G4tgbDetectorBuilder* theDetectorBuilder;
};
#endif
@@ -0,0 +1,64 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrElement.hh,v 1.2 2008/12/18 12:58:30 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrElement
//
// Class description:
//
// Transient class of a chemical element.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrElement_h
#define G4tgrElement_h
#include "globals.hh"
class G4tgrElement
{
public: // with description
G4tgrElement();
virtual ~G4tgrElement();
const G4String& GetName() const { return theName; }
const G4String& GetSymbol() const { return theSymbol; }
const G4String& GetType() const { return theType; }
protected:
G4String theName;
G4String theSymbol;
G4String theType;
};
#endif
@@ -0,0 +1,75 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrElementFromIsotopes.hh,v 1.6 2008/12/18 12:58:32 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrElementFromIsotopes
//
// Class description:
//
// Transient class of a chemical element.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrElementFromIsotopes_h
#define G4tgrElementFromIsotopes_h
#include "globals.hh"
#include <vector>
#include "G4tgrElement.hh"
class G4tgrElementFromIsotopes : public G4tgrElement
{
public: // with description
G4tgrElementFromIsotopes();
~G4tgrElementFromIsotopes();
G4tgrElementFromIsotopes( const std::vector<G4String>& wl );
// Construct the G4tgrElementFromIsotopes (fill its data members)
// interpreting the data in the list of words 'wl'
G4int GetNumberOfIsotopes() const { return theNoIsotopes; }
const G4String& GetComponent( G4int n ) const { return theComponents[n]; }
G4double GetAbundance( G4int n ) const { return theAbundances[n]; }
friend std::ostream& operator<<(std::ostream&,
const G4tgrElementFromIsotopes& );
private:
G4int theNoIsotopes;
std::vector<G4String> theComponents;
std::vector<G4double> theAbundances;
};
#endif
@@ -0,0 +1,73 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrElementSimple.hh,v 1.6 2008/12/18 12:58:34 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrElementSimple
//
// Class description:
//
// Transient class of a chemical element.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrElementSimple_h
#define G4tgrElementSimple_h
#include "globals.hh"
#include <vector>
#include "G4tgrElement.hh"
class G4tgrElementSimple : public G4tgrElement
{
public: // with description
G4tgrElementSimple();
~G4tgrElementSimple();
G4tgrElementSimple( const std::vector<G4String>& wl );
// Construct the G4tgrElementSimple (fill its data members)
// interpreting the data in the list of words 'wl'
G4double GetZ() const { return theZ; }
G4double GetA() const { return theA; }
friend std::ostream& operator<<(std::ostream& os,
const G4tgrElementSimple& obj);
private:
G4double theZ;
G4double theA;
};
#endif
@@ -0,0 +1,63 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrEvaluator.hh,v 1.1 2008/10/23 14:43:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrEvaluator
//
// Class description:
//
// Simple customised evaluator utility class.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrEvaluator_HH
#define G4tgrEvaluator_HH
#include "G4ThreeVector.hh"
#include <CLHEP/Evaluator/Evaluator.h>
class G4tgrEvaluator : public HepTool::Evaluator
{
public: // with description
G4tgrEvaluator();
~G4tgrEvaluator();
// Constructor & destructor.
void print_error( G4int status ) const;
// Overwritten ERROR_SYNTAX_ERROR message
private:
void AddCommonFunctions();
};
#endif
@@ -0,0 +1,100 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrFileIn.hh,v 1.3 2008/12/18 12:58:36 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrFileIn
//
// Class description:
//
// Singleton for importing file descriptions.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrFileIn_HH
#define G4tgrFileIn_HH
#include "globals.hh"
#include <vector>
class G4tgrFileIn
{
public: // with description
G4tgrFileIn();
~G4tgrFileIn();
static G4tgrFileIn& GetInstance( const G4String& name );
// Get the only instance opening the file
static G4tgrFileIn& GetInstanceOpened( const G4String& name );
// Get the only instance when file should be already opened
G4int GetWordsInLine( std::vector<G4String>& wl );
// Read a line and transform it to a vector of words
void ErrorInLine();
// Print out an error message indicating the line being read
// Access data members
G4int Nline() { return theLineNo[theCurrentFile]; }
const G4String& GetName() { return theName; }
void OpenNewFile( const char* filename );
G4bool EndOfFile();
void Close();
void DumpException( const G4String& sent );
private:
G4tgrFileIn( const G4String& name ) : theName(name) {}
private:
std::vector< std::ifstream* > theFiles;
std::vector<G4int> theLineNo;
// Number of line being read
std::vector<G4String> theNames;
G4int theCurrentFile;
// Index of file being read in theFiles
static std::vector<G4tgrFileIn*> theInstances;
// Vector of class instances (each one identified by its name)
G4String theName;
// Name of file
};
#endif
@@ -0,0 +1,71 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrFileOut.hh,v 1.1 2008/10/23 14:43:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrFileOut
//
// Class description:
//
// ostream class for handling the output.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrFILEOUT_H
#define G4tgrFILEOUT_H
#include <fstream>
#include <vector>
class G4tgrFileOut : public std::ofstream
{
public: // with description
G4tgrFileOut();
G4tgrFileOut( const G4String& name ) : std::ofstream(), theName(name) {}
~G4tgrFileOut();
static G4tgrFileOut& GetInstance( const G4String& filename );
// Get the instance of file with name filename
// Access data members
const G4String& GetName() { return theName; }
private:
static std::vector<G4tgrFileOut*> theInstances;
// Class only instance
G4String theName;
// Name of file
};
#endif
@@ -0,0 +1,80 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrFileReader.hh,v 1.2 2008/11/12 08:41:19 arce Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrFileReader
//
// Class description:
//
// This service provides access to detector description data.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrFileReader_H
#define G4tgrFileReader_H 1
#include "globals.hh"
#include <vector>
class G4tgrVolume;
class G4tgrVolumeMgr;
class G4tgrLineProcessor;
class G4tgrFileReader
{
public: // with description
static G4tgrFileReader* GetInstance();
// Get the only instance
virtual ~G4tgrFileReader();
G4bool ReadFiles();
void AddTextFile(const G4String& fname) { theTextFiles.push_back( fname ); }
void SetLineProcessor( G4tgrLineProcessor* lp ) { theLineProcessor = lp; }
G4tgrLineProcessor* GetLineProcessor() const { return theLineProcessor; }
protected:
G4tgrFileReader();
private:
static G4tgrFileReader* theInstance;
std::vector<G4String> theTextFiles;
G4tgrLineProcessor* theLineProcessor;
};
# endif
@@ -0,0 +1,76 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrIsotope.hh,v 1.4 2008/12/18 12:58:38 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrIsotope
//
// Class description:
//
// Transient class of a chemical element.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrIsotope_h
#define G4tgrIsotope_h
#include "globals.hh"
#include <vector>
class G4tgrIsotope
{
public: // with description
G4tgrIsotope();
~G4tgrIsotope();
G4tgrIsotope( const std::vector<G4String>& wl );
// Construct the G4tgrIsotope (fill its data members)
// interpreting the data in the list of words 'wl'
// Retrieval methods
const G4String& GetName() const { return theName; }
G4int GetZ() const { return theZ; }
G4int GetN() const { return theN; }
G4double GetA() const { return theA; }
friend std::ostream& operator<<(std::ostream& os, const G4tgrIsotope& obj);
private:
G4String theName; // name of the Isotope
G4int theZ; // atomic number
G4int theN; // number of nucleons
G4double theA; // mass
};
#endif
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrLineProcessor.hh,v 1.1 2008/10/23 14:43:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrIsotope
//
// Class description:
//
// This service provides access to detector description data.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrLineProcessor_H
#define G4tgrLineProcessor_H 1
#include "globals.hh"
#include <vector>
class G4tgrVolume;
class G4tgrVolumeMgr;
class G4tgrLineProcessor
{
public: // with description
G4tgrLineProcessor();
virtual ~G4tgrLineProcessor();
virtual G4bool ProcessLine( const std::vector<G4String>& wl );
protected:
G4tgrVolume* FindVolume( const G4String& volname );
private:
G4tgrVolumeMgr* volmgr;
};
# endif
@@ -0,0 +1,82 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrMaterial.hh,v 1.5 2008/12/18 12:58:40 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrMaterial
//
// Class description:
//
// Class to represent a transient material.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrMaterial_h
#define G4tgrMaterial_h
#include "globals.hh"
class G4tgrMaterial
{
public: // with description
G4tgrMaterial();
virtual ~G4tgrMaterial();
// Get methods
const G4String& GetName() const { return theName; }
G4double GetDensity() const { return theDensity; }
// Density in g/cm3
G4int GetNumberOfComponents() const { return theNoComponents; }
const G4String& GetType() const { return theMateType; }
virtual G4double GetA() const = 0;
virtual G4double GetZ() const = 0;
virtual const G4String& GetComponent(G4int i) const = 0;
virtual G4double GetFraction(G4int i) = 0;
G4double GetIonisationMeanExcitationEnergy() const
{ return theIonisationMeanExcitationEnergy; }
void SetIonisationMeanExcitationEnergy( G4double mee )
{ theIonisationMeanExcitationEnergy = mee; }
protected:
G4String theName;
G4double theDensity;
G4int theNoComponents;
G4String theMateType;
G4double theIonisationMeanExcitationEnergy;
};
#endif
@@ -0,0 +1,125 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrMaterialFactory.hh,v 1.2 2008/12/18 12:58:42 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrMaterialFactory
//
// Class description:
//
// Singleton class to manage the building of transient materials.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrMaterialFactory_h
#define G4tgrMaterialFactory_h
#include "globals.hh"
#include <map>
#include "G4tgrIsotope.hh"
#include "G4tgrElementSimple.hh"
#include "G4tgrElementFromIsotopes.hh"
#include "G4tgrMaterial.hh"
#include "G4tgrMaterialSimple.hh"
#include "G4tgrMaterialMixture.hh"
typedef std::map< G4String, G4tgrIsotope* > G4mstgrisot;
typedef std::map< G4String, G4tgrElement* > G4mstgrelem;
typedef std::map< G4String, G4tgrMaterial* > G4mstgrmate;
class G4tgrMaterialFactory
{
public: // with decription
~G4tgrMaterialFactory();
static G4tgrMaterialFactory* GetInstance();
// Get only instance (it it does not exist, create it)
G4tgrIsotope* AddIsotope( const std::vector<G4String>& wl );
// Build a G4tgrIsotope
G4tgrElementSimple* AddElementSimple( const std::vector<G4String>& wl );
// Build a G4tgrElementSimple
G4tgrElementFromIsotopes* AddElementFromIsotopes( const std::vector<G4String>& wl );
// Build a G4tgrElementFromIsotopes
G4tgrMaterialSimple* AddMaterialSimple( const std::vector<G4String>& wl );
// Build a G4tgrMaterialSimple and add it to the Materials list
G4tgrMaterialMixture* AddMaterialMixture( const std::vector<G4String>& wl, const G4String& mixtType );
// Build a G4tgrMaterialByWeight or G4tgrMaterialByNoAtoms
// or G4tgrMaterialByVolume and add it to the Materials list
G4tgrIsotope* FindIsotope(const G4String& name) const;
// Look for a G4tgrIsotope and if not found return 0
G4tgrElement* FindElement(const G4String& name) const;
// Look for an G4tgrElement and if not found return 0
G4tgrMaterial* FindMaterial(const G4String& name) const;
// Look for an G4tgrMaterial and if not found return 0
void DumpIsotopeList() const;
// Dump detailed list of isotopes
void DumpElementList() const;
// Dump detailed list of elements
void DumpMaterialList() const;
// Dump detailed list of materials
public: // without description
const G4mstgrisot& GetIsotopeList() const {return theG4tgrIsotopes; }
const G4mstgrelem& GetElementList() const {return theG4tgrElements; }
const G4mstgrmate& GetMaterialList() const {return theG4tgrMaterials;}
private:
G4tgrMaterialFactory();
// Constructor
void ErrorAlreadyExists(const G4String& object,
const std::vector<G4String>& wl,
const G4bool bNoRepeating = true );
private:
static G4tgrMaterialFactory* theInstance;
G4mstgrisot theG4tgrIsotopes;
// List of all G4tgrIsotopes created
G4mstgrelem theG4tgrElements;
// List of all G4tgrElements created
G4mstgrmate theG4tgrMaterials;
// List of all G4tgrMaterials created
};
#endif
@@ -0,0 +1,85 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrMaterialMixture.hh,v 1.2 2008/12/18 12:58:44 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrMaterialMixture
//
// Class description:
//
// Class to represent a material mixture.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrMaterialMixture_h
#define G4tgrMaterialMixture_h
#include "globals.hh"
#include <iostream>
#include <vector>
#include "G4tgrMaterial.hh"
class G4tgrMaterialMixture : public G4tgrMaterial
{
public: // with description
G4tgrMaterialMixture(const G4String& matType,
const std::vector<G4String>& wl);
// Fill the data interpreting the list of words read 'wl'
friend std::ostream& operator<<(std::ostream&, const G4tgrMaterialMixture&);
// Get methods
G4double GetA() const { return 0.; }
G4double GetZ() const { return 0.; }
const G4String& GetComponent(G4int i) const { return theComponents[i]; }
G4double GetFraction(G4int i) { return theFractions[i]; }
G4tgrMaterialMixture operator= (const G4tgrMaterialMixture&);
public: // without description
G4tgrMaterialMixture();
~G4tgrMaterialMixture();
protected:
void TransformToFractionsByWeight(){};
protected:
std::vector<G4String> theComponents;
std::vector<G4double> theFractions;
};
#endif
@@ -0,0 +1,81 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrMaterialSimple.hh,v 1.2 2008/12/18 12:58:46 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrMaterialSimple
//
// Class description:
//
// Class to represent a simple material, i.e. made of a single element.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrMaterialSimple_h
#define G4tgrMaterialSimple_h
#include "globals.hh"
#include <vector>
#include <iostream>
#include "G4tgrMaterial.hh"
class G4tgrMaterialSimple : public G4tgrMaterial
{
public: // with description
G4tgrMaterialSimple(const G4String& matType,
const std::vector<G4String>& wl);
// Fill the data interpreting the list of words read 'wl'
friend std::ostream& operator<<(std::ostream&, const G4tgrMaterialSimple&);
G4tgrMaterialSimple& operator= (const G4tgrMaterialSimple&);
G4double GetA() const { return theA; }
G4double GetZ() const { return theZ; }
const G4String& GetComponent(G4int i) const;
G4double GetFraction(G4int i);
public: // without description
G4tgrMaterialSimple();
~G4tgrMaterialSimple();
private:
G4String name;
G4double theA;
G4double theZ;
};
#endif
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrMessenger.hh,v 1.1 2008/10/23 14:43:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrMessenger
//
// Class description:
//
// Concrete class of G4UImessenger which takes care of commands for
// the geometry generation from text file.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrMessenger_h
#define G4tgrMessenger_h 1
#include "G4UImessenger.hh"
class G4UIdirectory;
class G4UIcmdWithAnInteger;
class G4tgrMessenger : public G4UImessenger
{
public: // with description
G4tgrMessenger();
~G4tgrMessenger();
void SetNewValue(G4UIcommand * command,G4String newValues);
G4String GetCurrentValue(G4UIcommand * command);
static G4int GetVerboseLevel();
static void SetVerboseLevel( G4int verb );
private:
G4UIdirectory* tgDirectory;
G4UIcmdWithAnInteger* verboseCmd;
static G4int theVerboseLevel;
};
#endif
@@ -0,0 +1,88 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrParameterMgr.hh,v 1.2 2008/12/18 12:58:48 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrParameterMgr
//
// Class description:
//
// Class to manage parameters. It is a singleton.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrParameterMgr_h
#define G4tgrParameterMgr_h
#include "globals.hh"
#include <map>
#include <vector>
typedef std::map< G4String, G4String > G4mapss;
class G4tgrParameterMgr
{
public: // with description
static G4tgrParameterMgr* GetInstance();
// Get the only instance
void AddParameterNumber( const std::vector<G4String>& wl,
G4bool mustBeNew = 0 );
void AddParameterString( const std::vector<G4String>& wl,
G4bool mustBeNew = 0 );
// Add to theParameterList
void CheckIfNewParameter( const std::vector<G4String>& wl,
G4bool mustBeNew );
// Check if it is new and that there are 3 words
G4String FindParameter( const G4String& name, G4bool exists = true );
// Find a Parameter with name 'name'.
void DumpList();
// Dump list of parameters
private:
G4tgrParameterMgr();
~G4tgrParameterMgr();
private:
G4mapss theParameterList;
// Map of Parameter's: G4String is the Parameter name,
// double is its value
static G4tgrParameterMgr* theInstance;
};
#endif
@@ -0,0 +1,84 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrPlace.hh,v 1.4 2008/12/18 12:58:50 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrPlace
//
// Class description:
//
// Abstract base class to describe the position of a G4tgrVolume inside
// another G4tgrVolume.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrPlace_h
#define G4tgrPlace_h
#include "globals.hh"
#include "G4ThreeVector.hh"
class G4tgrVolume;
class G4tgrPlace
{
public: // with description
G4tgrPlace();
virtual ~G4tgrPlace();
// Accessors
const G4String& GetParentName() const { return theParentName; }
G4tgrVolume* GetVolume() const { return theVolume; }
unsigned int GetCopyNo() const { return theCopyNo; }
const G4String& GetType() const { return theType; }
void SetVolume( G4tgrVolume* vol ) { theVolume = vol; }
void SetType( const G4String& typ ){ theType = typ; }
virtual G4ThreeVector GetPlacement() const;
protected:
G4tgrVolume* theVolume;
// The detunit to which it belongs
G4String theParentName;
// The parent (by name, as we will allow that a child
// is placed in the file before the parent is created)
unsigned int theCopyNo;
// The copy number
G4String theType;
// The type (simple/replica/param)
};
#endif
@@ -0,0 +1,94 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrPlaceDivRep.hh,v 1.5 2008/12/18 12:58:52 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrPlaceDivRep
//
// Class description:
//
// Class to descripe the position of a G4tgrVolume inside another
// G4tgrVolume as a replica, i.e. filling the whole parent volume.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrPlaceDivRep_h
#define G4tgrPlaceDivRep_h
#include "globals.hh"
#include "geomdefs.hh"
#include <vector>
#include "G4tgrPlace.hh"
enum G4DivType { DivByNdiv, DivByWidth, DivByNdivAndWidth };
class G4tgrPlaceDivRep : public G4tgrPlace
{
public: // with description
G4tgrPlaceDivRep();
~G4tgrPlaceDivRep();
G4tgrPlaceDivRep( const std::vector<G4String>& wl );
// Creates an object passing the only data that is fixed
// (ndiv, width, offset may be have to be recalculated)
EAxis BuildAxis( const G4String& axisName );
// Access functions
EAxis GetAxis() const { return theAxis; }
G4int GetNDiv() const { return theNDiv; }
G4double GetWidth() const { return theWidth; }
G4double GetOffset() const { return theOffset; }
G4DivType GetDivType() const { return theDivType; }
void SetParentName(const G4String& parentName) { theParentName=parentName; }
void SetNDiv( G4int ndiv ) { theNDiv = ndiv; }
void SetWidth( G4double width ) { theWidth = width; }
void SetAxis( EAxis axis ) { theAxis = axis; }
void SetOffset( G4double offset ) { theOffset = offset; }
void SetDivType( G4DivType typ ) { theDivType = typ; }
friend std::ostream& operator<<(std::ostream& os,
const G4tgrPlaceDivRep& obj);
private:
G4int theNDiv;
G4double theWidth;
EAxis theAxis;
G4double theOffset;
G4DivType theDivType;
};
#endif
@@ -0,0 +1,88 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrPlaceParameterisation.hh,v 1.7 2008/12/18 12:58:54 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrPlaceParameterisation
//
// Class description:
//
// Class to descripe the positioning of a G4tgrVolume inside another
// G4tgrVolume as a parameterised volume. Several types are possible:
// - Parameterisation of the position and rotation for each copy
// - Parameterisation also of the dimensions
// - Parameterisation of the solid type
// Data is just stored in this class, without any calculation of the
// positions of each copy
// :POS_PARAM "volu_name" copyNo "parent_name" "parametrisation_type"
// number_copies step offset extra_data(n words).
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrPlaceParameterisation_h
#define G4tgrPlaceParameterisation_h
#include "globals.hh"
#include <vector>
#include "G4tgrPlace.hh"
class G4tgrPlaceParameterisation : public G4tgrPlace
{
public: // with description
G4tgrPlaceParameterisation();
~G4tgrPlaceParameterisation();
G4tgrPlaceParameterisation( const std::vector<G4String>& p);
// Creates an object passing the parameters
// Access functions
const G4String& GetParamType() const { return theParamType; }
// GetType returns placement type
std::vector<G4double> GetExtraData() const { return theExtraData; }
const G4String& GetRotMatName() const { return theRotMatName; }
friend std::ostream& operator<<(std::ostream& os,
const G4tgrPlaceParameterisation& obj);
private:
G4String theParamType;
std::vector<G4double> theExtraData;
// Extra data not common to all parameterisations
G4String theRotMatName;
// The rotation matrix (by name, as the rotations
// matrices are not yet created)
};
#endif
@@ -0,0 +1,78 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrPlaceSimple.hh,v 1.5 2008/12/18 12:58:56 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrPlaceSimple
//
// Class description:
//
// Class to describe a simple positioning of a G4tgrVolume inside
// another G4tgrVolume.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrPlaceSimple_h
#define G4tgrPlaceSimple_h
#include "globals.hh"
#include <vector>
#include "G4ThreeVector.hh"
#include "G4tgrPlace.hh"
class G4tgrPlaceSimple : public G4tgrPlace
{
public: // with description
G4tgrPlaceSimple();
~G4tgrPlaceSimple();
G4tgrPlaceSimple( const std::vector<G4String>& wl );
// Accessors
const G4String& GetRotMatName() const { return theRotMatName; }
G4ThreeVector GetPlacement() const { return thePlace; }
friend std::ostream& operator<<(std::ostream& os,
const G4tgrPlaceSimple& obj);
protected:
G4ThreeVector thePlace;
// The position with respect to parent
G4String theRotMatName;
// The rotation matrix (by name, as the rotations
// matrices are not yet created)
};
#endif
@@ -0,0 +1,75 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrRotationMatrix.hh,v 1.5 2008/12/18 12:58:58 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrRotationMatrix
//
// Class description:
//
// Transient class of a rotation matrix.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrRotationMatrix_h
#define G4tgrRotationMatrix_h
#include "globals.hh"
#include <vector>
enum G4RotMatInputType { rm3, rm6, rm9 };
class G4tgrRotationMatrix
{
public: // with description
G4tgrRotationMatrix();
~G4tgrRotationMatrix();
G4tgrRotationMatrix( const std::vector<G4String>& wl );
// Construct the G4tgrRotationMatrix (fill its data members)
// interpreting the data in the list of words 'wl'
const G4String& GetName() { return theName; }
std::vector<G4double>& GetValues() { return theValues; }
friend std::ostream& operator<<(std::ostream& os,
const G4tgrRotationMatrix& obj);
private:
G4String theName;
std::vector<G4double> theValues;
// thetaX,phiX,thetaY,phiY,thetaZ,phiZ;
G4RotMatInputType theInputType;
};
#endif
@@ -0,0 +1,86 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrRotationMatrixFactory.hh,v 1.2 2008/12/18 12:59:00 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrRotationMatrixFactory
//
// Class description:
//
// Singleton class to manage the building of transient rotation matrix.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrRotationMatrixFactory_h
#define G4tgrRotationMatrixFactory_h
#include "globals.hh"
#include "G4tgrRotationMatrix.hh"
#include <vector>
#include <map>
typedef std::map< G4String, G4tgrRotationMatrix* > G4mstgrrotm;
class G4tgrRotationMatrixFactory
{
public: // with desctiption
static G4tgrRotationMatrixFactory* GetInstance();
// Get the only instance (it it does not exists, create it)
G4tgrRotationMatrix* AddRotMatrix( const std::vector<G4String>& wl );
// Build a G4tgrRotationMatrix and add it to theTgrRotMats
G4tgrRotationMatrix* FindRotMatrix(const G4String& rotm);
// Look for an G4tgrRotationMatrix and if not found return 0
const G4mstgrrotm& GetRotMatMap() const
{ return theTgrRotMats; }
std::vector<G4tgrRotationMatrix*> GetRotMatList() const
{ return theTgrRotMatList; }
void DumpRotmList();
// Dump list of rotation matrices
private:
G4tgrRotationMatrixFactory();
~G4tgrRotationMatrixFactory();
private:
static G4tgrRotationMatrixFactory* theInstance;
std::vector<G4tgrRotationMatrix*> theTgrRotMatList;
G4mstgrrotm theTgrRotMats;
};
#endif
@@ -0,0 +1,82 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrSolid.hh,v 1.2 2008/12/18 12:59:02 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrSolid
//
// Class description:
//
// Base class for management of transient solids.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrSolid_h
#define G4tgrSolid_h
#include "globals.hh"
#include <vector>
#include "G4ThreeVector.hh"
class G4tgrSolid
{
public: // with description
G4tgrSolid();
G4tgrSolid( const std::vector<G4String>& wl);
virtual ~G4tgrSolid();
friend std::ostream& operator<<(std::ostream&, const G4tgrSolid&);
// Accessors
const G4String& GetName() const { return theName; }
const G4String& GetType() const { return theType; }
const std::vector< std::vector<G4double>* > GetSolidParams() const;
virtual const G4String& GetRelativeRotMatName() const;
virtual G4ThreeVector GetRelativePlace() const;
private:
void FillSolidParams( const std::vector<G4String>& wl );
protected:
G4String theName;
// Name of the solid
G4String theType;
// Type of the solid (Simple, Boolean, Box, Tube, ...)
std::vector< std::vector<G4double>* > theSolidParams;
// Vectors of parameters
};
#endif
@@ -0,0 +1,95 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrSolidBoolean.hh,v 1.2 2008/12/18 12:59:04 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrSolidBoolean
//
// Class description:
//
// A G4tgrSolidBoolean is an G4tgrSolid object with a solid made out of
// the Boolean operation of two solids. The type of operation can be:
// Union, Substraction, Intersection.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrSolidBoolean_h
#define G4tgrSolidBoolean_h
#include "globals.hh"
#include <vector>
#include "G4tgrSolid.hh"
class G4tgrSolidBoolean : public G4tgrSolid
{
public: // with description
G4tgrSolidBoolean(const std::vector<G4String>& wl);
~G4tgrSolidBoolean();
friend std::ostream& operator<<(std::ostream&, const G4tgrSolidBoolean&);
// Accessors
inline const G4tgrSolid* GetSolid(G4int ii) const;
const G4String& GetRelativeRotMatName() const;
G4ThreeVector GetRelativePlace() const;
private:
// Solid types (Box, Tube, etc) of the solids composing the Boolean solid
std::vector< std::vector<G4double>* > theSolidParams;
// Vectors of parameters.
G4String theRelativeRotMatName;
G4ThreeVector theRelativePlace;
// Relative placement and rotation of solid 2 w.r.t. solid 1
std::vector<const G4tgrSolid*> theSolids;
// The two G4tgrSolid's that combine to make this one
};
inline const G4tgrSolid* G4tgrSolidBoolean::GetSolid( G4int ii ) const
{
if((ii != 0) && (ii != 1))
{
G4String ErrMessage = "Only two G4tgrSolids (0,1) possible ! Asking for... "
+ ii;
G4Exception("G4tgrSolidBoolean::GetSolid()", "InvalidInput",
FatalException, ErrMessage);
}
return theSolids[ii];
}
#endif
@@ -0,0 +1,112 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrUtils.hh,v 1.6 2008/12/18 12:59:06 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrUtils
//
// Class description:
//
// Utility class for managing of strings.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrUtils_h
#define G4tgrUtils_h
#include "globals.hh"
#include <iostream>
#include <vector>
#include "G4ThreeVector.hh"
#include "G4RotationMatrix.hh"
#include "G4tgrEvaluator.hh"
enum WLSIZEtype {WLSIZE_EQ,WLSIZE_NE,WLSIZE_LE,WLSIZE_LT,WLSIZE_GE,WLSIZE_GT};
class G4tgrUtils
{
public: // with description
G4tgrUtils();
~G4tgrUtils();
static G4bool IsSeparator(char);
static G4bool IsNumber( const G4String& str);
static G4bool IsInteger( const G4double val,
const G4double precision = 1.e-6 );
static G4bool WordIsUnit( const G4String& word );
static G4bool WordIsFunction( const G4String& word );
// Checks that every character in a G4String is a number
// (also '.' or exponencial notation: 'E')
static void Dump3v( const G4ThreeVector& vec, const char* msg);
// Dumps a three-vector with a message
static void Dumprm( const G4RotationMatrix& rm, const char* msg);
// Dumps a rotation matrix with a message
static void DumpVS( const std::vector<G4String>& wl , const char* msg);
// Dumps a vector of G4Strings with a message to cout
static void DumpVS( const std::vector<G4String>& wl , const char* msg,
std::ostream& outs) ;
// Dumps a vector of G4Strings with a message to outs
static void CheckWLsize( const std::vector<G4String>& wl,
unsigned int nWCheck, WLSIZEtype st,
const G4String& methodName );
static G4bool CheckListSize( unsigned int nWreal,
unsigned int nWcheck, WLSIZEtype st,
G4String& outstr );
static G4String SubColon( const G4String& str );
// Return the str without leading ':'
static G4String GetString( const G4String& str );
// Return the str without leading and trailing '"' and ' '
static G4double GetDouble( const G4String& str, G4double unitval = 1. );
// Convert a G4String to a double, checking that it is really a number
static G4int GetInt( const G4String& str );
// Convert a G4String to an integer, checking that it is really an int
static G4bool GetBool( const G4String& str );
// Convert a bool to an integer, checking that it is really a bool
static G4RotationMatrix GetRotationFromDirection( G4ThreeVector dir );
static G4bool AreWordsEquivalent( const G4String& word1,
const G4String& word2 );
// Looks if word1 and word2 are equivalent, considering that
// word1 may have '*', meaning 'any character'
private:
static G4tgrEvaluator* theEvaluator;
};
#endif
@@ -0,0 +1,121 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrVolume.hh,v 1.7 2008/12/18 12:59:08 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrVolume
//
// Class description:
//
// Abstract base class to manage the geometry info of any volume.
// Volumes created in this class contain the information of a detector volume.
// They have associated several detector placements that can be instances of
// G4tgrPlace, G4tgrPlaceDivision, G4tgrPlaceDivRep or
// G4tgrPlaceParameterisation.
// Each detector positioning is done inside a parent. As there can be several
// parents, one parent for each volume placement will be written, even if that
// means that parents are repeated...
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrVolume_h
#define G4tgrVolume_h
#include "globals.hh"
#include <vector>
#include <map>
class G4tgrSolid;
class G4tgrPlace;
class G4tgrPlaceDivRep;
class G4tgrPlaceParameterisation;
class G4tgrVolume
{
public: // with description
G4tgrVolume();
G4tgrVolume( const std::vector<G4String>& wl );
virtual ~G4tgrVolume();
virtual G4tgrPlace* AddPlace( const std::vector<G4String>& wl );
// Add a position with the data read from a ':place' tag
G4tgrPlaceDivRep* AddPlaceReplica( const std::vector<G4String>& wl );
// Add a replicated position
G4tgrPlaceParameterisation* AddPlaceParam(const std::vector<G4String>& wl);
// Add a parameterised position
void AddVisibility( const std::vector<G4String>& wl );
// Add visibility flag
void AddRGBColour( const std::vector<G4String>& wl );
// Add colour
void AddCheckOverlaps( const std::vector<G4String>& wl );
// Add check overlaps flag
// Accessors
const G4String& GetName() const {return theName;}
const G4String& GetType() const {return theType;}
const G4tgrSolid* GetSolid() const {return theSolid;}
const G4String& GetMaterialName() const {return theMaterialName;}
const std::vector<G4tgrPlace*> GetPlacements() const {return thePlacements;}
G4bool GetVisibility() const {return theVisibility;}
const G4double* GetColour() const {return theRGBColour;}
G4bool GetCheckOverlaps() const {return theCheckOverlaps;}
virtual G4tgrVolume* GetVolume( G4int ii ) const;
friend std::ostream& operator<<(std::ostream& os, const G4tgrVolume& obj);
protected:
G4String theName;
// Name of the volume
G4String theType;
// Type of the volume
G4String theMaterialName;
// Material of which the corresponding PV will be made of
G4tgrSolid* theSolid;
// Solid
std::vector<G4tgrPlace*> thePlacements;
// Vector of placements
G4bool theVisibility;
G4double* theRGBColour;
G4bool theCheckOverlaps;
};
#endif
@@ -0,0 +1,77 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrVolumeAssembly.hh,v 1.5 2008/12/18 12:59:10 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrVolumeAssembly
//
// Class description:
//
// Class for keeping the information of assembly volumes.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrVolumeAssembly_h
#define G4tgrVolumeAssembly_h
#include "globals.hh"
#include "G4tgrVolume.hh"
#include "G4ThreeVector.hh"
class G4tgrVolumeAssembly : public G4tgrVolume
{
public: // with description
G4tgrVolumeAssembly();
G4tgrVolumeAssembly( const std::vector<G4String>& wl );
~G4tgrVolumeAssembly();
virtual G4tgrPlace* AddPlace( const std::vector<G4String>& wl );
// Add a position with the data read from a ':place_assembly' tag
const G4String& GetComponentName(G4int ii) const
{ return theComponentNames[ii]; }
const G4String& GetComponentRM(G4int ii) const
{ return theComponentRMs[ii]; }
G4ThreeVector GetComponentPos(G4int ii) const
{ return theComponentPos[ii]; }
G4int GetNoComponents() const
{ return theComponentNames.size(); }
friend std::ostream& operator<<(std::ostream& os,
const G4tgrVolumeAssembly& obj);
protected:
std::vector<G4String> theComponentNames;
std::vector<G4String> theComponentRMs;
std::vector<G4ThreeVector> theComponentPos;
};
#endif
@@ -0,0 +1,84 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrVolumeDivision.hh,v 1.5 2008/12/18 12:59:12 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrVolumeDivision
//
// Class description:
//
// Class to manage the geometry info of detector unit made by dividing
// a mother detector unit.
// Construct a volume with the data read from a ':DIV_...' tag:
// :DIV_NUM "volu_name" "parent_name" "material" number_divisions
// "replica_axis_name" offset
// :DIV_STEP "volu_name" "parent_name" "material" step
// "replica_axis_name" offset
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrVolumeDivision_h
#define G4tgrVolumeDivision_h
#include "globals.hh"
#include <map>
#include "G4tgrVolume.hh"
#include "G4tgrPlaceDivRep.hh"
typedef std::multimap< G4String, G4String > G4mmss;
//----------------------------------------------------------------------------
class G4tgrVolumeDivision : public G4tgrVolume
{
public: // with description
G4tgrVolumeDivision( const std::vector<G4String>& wl );
~G4tgrVolumeDivision();
G4bool SetSolid(G4tgrVolume* parentDU, G4bool byStep,
EAxis axis, G4double div_step, G4double offset);
// Set the solid type and parameters dividing the mother volune
static void SetSupportedAxis();
// Set the list of supported axis for each solid types
G4tgrPlaceDivRep* GetPlaceDivision() { return thePlaceDiv; }
friend std::ostream& operator<<(std::ostream& os,
const G4tgrVolumeDivision& obj);
private:
G4tgrPlaceDivRep* thePlaceDiv;
static G4mmss theSupportedAxis;
};
#endif
@@ -0,0 +1,154 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * 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. 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 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: G4tgrVolumeMgr.hh,v 1.5 2008/12/18 12:59:14 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// class G4tgrVolumeMgr
//
// Class description:
//
// Class to manage the detector units. It is a singleton.
// History:
// - Created. P.Arce, CIEMAT (November 2007)
// -------------------------------------------------------------------------
#ifndef G4tgrVolumeMgr_h
#define G4tgrVolumeMgr_h
#include "globals.hh"
#include "G4tgrSolid.hh"
#include "G4tgrVolume.hh"
#include "G4tgrPlace.hh"
#include "G4tgrIsotope.hh"
#include "G4tgrElement.hh"
#include "G4tgrMaterial.hh"
#include "G4tgrRotationMatrix.hh"
#include <map>
typedef std::map< const G4String, const G4tgrSolid* > G4mapssol;
typedef std::map< const G4String, const G4tgrVolume* > G4mapsvol;
typedef std::multimap< const G4String, const G4tgrPlace* > G4mmapspl;
//----------------------------------------------------------------------------
class G4tgrVolumeMgr
{
public: // with description
static G4tgrVolumeMgr* GetInstance();
// Get the only instance
G4tgrSolid* CreateSolid( const std::vector<G4String>& wl, G4bool bVOLUtag );
void RegisterParentChild( const G4String& parentName,
const G4tgrPlace* pl );
// Add to theG4tgrVolumeTree
G4tgrSolid* FindSolid( const G4String& name, G4bool exists = false );
// Find a G4tgrSolid with name 'name'. If it is not found:
// if exists is true, exit; if exists is false, return 0
G4tgrVolume* FindVolume( const G4String& volname, G4bool exists = false );
// Find a G4tgrVolume with name 'volname'. If it is not found:
// if exists is true, exit; if exists is false, return 0
std::vector<G4tgrVolume*> FindVolumes( const G4String& volname,
G4bool exists );
// Find all G4tgrVolume's with name 'volname'. '*' can be used in the
// name to mean 'any character' or 'any substring'. If it is not found:
// if exists is true, exit; if exists is false, return 0
const G4tgrVolume* GetTopVolume();
// Find the top of the volume tree
std::pair<G4mmapspl::iterator, G4mmapspl::iterator>
GetChildren( const G4String& name );
// Find the list of G4tgrPlace children of G4tgrVolume 'name'
void DumpSummary();
// Dump summary
void DumpVolumeTree();
// Dump to cout the tree of G4tgrVolume's
void DumpVolumeLeaf( const G4tgrVolume* vol, unsigned int copyNo,
unsigned int leafDepth);
// Dump a G4tgrVolume indicating its copy no
// and its depth (number of ancestors)
void RegisterMe( G4tgrSolid* vol);
void UnRegisterMe( G4tgrSolid* vol );
void RegisterMe( G4tgrVolume* vol);
void UnRegisterMe( G4tgrVolume* vol );
void RegisterMe( G4tgrPlace* pl ) { theG4tgrPlaceList.push_back( pl ); }
void RegisterMe( G4tgrIsotope* iso ) { theHgIsotList.push_back( iso ); }
void RegisterMe( G4tgrElement* ele ) { theHgElemList.push_back( ele ); }
void RegisterMe( G4tgrMaterial* mat ) { theHgMateList.push_back( mat ); }
void RegisterMe( G4tgrRotationMatrix* rm ) { theHgRotMList.push_back(rm); }
// Accessors
const G4mapssol& GetSolidMap() {return theG4tgrSolidMap;}
const G4mapsvol& GetVolumeMap() {return theG4tgrVolumeMap;}
const G4mmapspl& GetVolumeTree() {return theG4tgrVolumeTree;}
std::vector<G4tgrVolume*> GetVolumeList() {return theG4tgrVolumeList;}
std::vector<G4tgrPlace*> GetDetPlaceList() {return theG4tgrPlaceList;}
std::vector<G4tgrIsotope*> GetIsotopeList() {return theHgIsotList;}
std::vector<G4tgrElement*> GetElementList() {return theHgElemList;}
std::vector<G4tgrMaterial*> GetMaterialList() {return theHgMateList;}
std::vector<G4tgrRotationMatrix*> GetRotMList() {return theHgRotMList;}
private:
G4tgrVolumeMgr();
~G4tgrVolumeMgr();
private:
G4mapssol theG4tgrSolidMap;
// Map of G4tgrSolid's: G4String is the G4tgrSolid name,
// G4tgrSolid* the pointer to it
G4mapsvol theG4tgrVolumeMap;
// Map of G4tgrVolume's: G4String is the G4tgrVolume name,
// G4tgrVolume* the pointer to it
G4mmapspl theG4tgrVolumeTree;
// Hierarchy tree of G4tgrVolume's: G4String is the name
// of the parent G4tgrVolume, G4tgrPlace* the pointers to children
static G4tgrVolumeMgr* theInstance;
std::vector<G4tgrVolume*> theG4tgrVolumeList;
std::vector<G4tgrPlace*> theG4tgrPlaceList;
std::vector<G4tgrIsotope*> theHgIsotList;
std::vector<G4tgrElement*> theHgElemList;
std::vector<G4tgrMaterial*> theHgMateList;
std::vector<G4tgrRotationMatrix*> theHgRotMList;
};
#endif