24 modified files
lcdd/include/lcdd/bfield
diff -u -r1.3 -r1.4
--- BoxDipole.hh 2 Jul 2013 01:46:54 -0000 1.3
+++ BoxDipole.hh 2 Jul 2013 21:19:43 -0000 1.4
@@ -5,7 +5,8 @@
#include "G4MagneticField.hh"
/**
- * This is a G4MagneticField implementation that assigns fixed B-field components to a box-like region in world coordinates.
+ * This is a G4MagneticField implementation that assigns fixed B-field components to a box-like
+ * region with a possible offset in world coordinates.
*/
class BoxDipole: public G4MagneticField
{
lcdd/include/lcdd/bfield
diff -u -r1.4 -r1.5
--- Cartesian3DMagneticFieldMap.hh 2 Jul 2013 01:46:54 -0000 1.4
+++ Cartesian3DMagneticFieldMap.hh 2 Jul 2013 21:19:43 -0000 1.5
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Cartesian3DMagneticFieldMap.hh,v 1.4 2013/07/02 01:46:54 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Cartesian3DMagneticFieldMap.hh,v 1.5 2013/07/02 21:19:43 jeremy Exp $
#ifndef LCDD_BFIELD_CARTESIAN3DMAGNETICFIELDMAP_HH
#define LCDD_BFIELD_CARTESIAN3DMAGNETICFIELDMAP_HH 1
@@ -51,7 +51,7 @@
Cartesian3DMagneticFieldMap(const char* filename, double xOffset, double yOffset, double zOffset);
/**
- * Implementation of primary virtual method from G4MagneticField intercace.
+ * Implementation of primary virtual method from G4MagneticField interface.
* @param[in] Point The point in 3D space.
* @param[out] Bfield The output B-field data at the point.
*/
lcdd/include/lcdd/bfield
diff -u -r1.2 -r1.3
--- Dipole.hh 2 Jul 2013 01:46:54 -0000 1.2
+++ Dipole.hh 2 Jul 2013 21:19:43 -0000 1.3
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Dipole.hh,v 1.2 2013/07/02 01:46:54 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Dipole.hh,v 1.3 2013/07/02 21:19:43 jeremy Exp $
#ifndef LCDD_BFIELD_DIPOLE_HH
#define LCDD_BFIELD_DIPOLE_HH 1
@@ -32,33 +32,40 @@
}
public:
+
void GetFieldValue(const double Point[3], double *Bfield) const;
void setZMax(double zmax);
+
double getZMax();
void setRMax(double rmax);
+
double getRMax();
void setZMin(double zmin);
+
double getZMin();
void addCoeff(double coeff);
+
const std::vector<double>& getCoeffs();
void setFieldUnit(double unit);
+
double getFieldUnit();
void setLengthUnit(double unit);
+
double getLengthUnit();
private:
- double m_zmin;
- double m_zmax;
- double m_rmax;
- double m_lunit;
- double m_funit;
- std::vector<double> m_coeffs;
+ double _zmin;
+ double _zmax;
+ double _rmax;
+ double _lunit;
+ double _funit;
+ std::vector<double> _coeffs;
};
#endif
lcdd/include/lcdd/bfield
diff -u -r1.3 -r1.4
--- FieldManager.hh 2 Jul 2013 01:46:54 -0000 1.3
+++ FieldManager.hh 2 Jul 2013 21:19:43 -0000 1.4
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/FieldManager.hh,v 1.3 2013/07/02 01:46:54 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/FieldManager.hh,v 1.4 2013/07/02 21:19:43 jeremy Exp $
#ifndef LCDD_BFIELD_FIELDMANAGER_HH
#define LCDD_BFIELD_FIELDMANAGER_HH 1
@@ -34,6 +34,12 @@
*/
void setup();
+ /**
+ * Add a global magnetic field.
+ * @param[in] f The magnetic field.
+ */
+ void addGlobalField(G4MagneticField* f);
+
private:
/**
@@ -57,12 +63,6 @@
void initialize(G4MagneticField* field);
/**
- * Add a global magnetic field.
- * @param[in] f The magnetic field.
- */
- void addGlobalField(G4MagneticField* f);
-
- /**
* Add a magnetic field.
* @param[in] f The magnetic field.
*/
@@ -74,10 +74,10 @@
private:
- std::vector<G4MagneticField*> m_globalfields;
- std::vector<G4MagneticField*> m_allfields;
+ std::vector<G4MagneticField*> _globalfields;
+ std::vector<G4MagneticField*> _allfields;
- static FieldManager* m_instance;
+ static FieldManager* _instance;
};
#endif
lcdd/include/lcdd/bfield
diff -u -r1.4 -r1.5
--- MagneticFieldOverlay.hh 2 Jul 2013 01:46:54 -0000 1.4
+++ MagneticFieldOverlay.hh 2 Jul 2013 21:19:43 -0000 1.5
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/MagneticFieldOverlay.hh,v 1.4 2013/07/02 01:46:54 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/MagneticFieldOverlay.hh,v 1.5 2013/07/02 21:19:43 jeremy Exp $
#ifndef LCDD_BFIELD_MAGNETICFIELDOVERLAY_HH
#define LCDD_BFIELD_MAGNETICFIELDOVERLAY_HH 1
@@ -34,7 +34,7 @@
void GetFieldValue(const double Point[3], double *Bfield) const;
private:
- std::vector<G4MagneticField*> m_fields;
+ std::vector<G4MagneticField*> _fields;
};
#endif
lcdd/include/lcdd/bfield
diff -u -r1.3 -r1.4
--- RZBData.hh 1 Jul 2013 22:10:34 -0000 1.3
+++ RZBData.hh 2 Jul 2013 21:19:43 -0000 1.4
@@ -1,17 +1,20 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/RZBData.hh,v 1.3 2013/07/01 22:10:34 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/RZBData.hh,v 1.4 2013/07/02 21:19:43 jeremy Exp $
#ifndef LCDD_BFIELD_RZBDATA_HH
#define LCDD_BFIELD_RZBDATA_HH 1
/**
- * @brief Represents a single row of a magnetic field defined by radius, z dimension, radial B-field strength, and z dimension B-field strength.
+ * This class represents a single data row of a B-field defined by
+ * radius, z dimension, radial B-field component, and z dimension B-field component.
* @note Double values are multiplied by the field unit from the rz_field_map before they are inserted using this class.
+ * @todo Move code to source file.
*/
class RZBData
{
public:
/**
+ * Class constructor.
* @param r Radius
* @param z Z dimension
* @param Br Radial field strength
@@ -22,27 +25,46 @@
{
}
+ /**
+ * Class destructor.
+ */
virtual ~RZBData()
{
}
public:
+ /**
+ * Get the radial coordinate.
+ * @return The radial coordinate.
+ */
double r() const
{
return _r;
}
+ /**
+ * Get the Z coordinate.
+ * @return The Z coordinate.
+ */
double z() const
{
return _z;
}
+ /**
+ * Get the BR field component.
+ * @return The BR field component.
+ */
double Br() const
{
return _Br;
}
+ /**
+ * Get BZ field component.
+ * @return The BZ field component.
+ */
double Bz() const
{
return _Bz;
lcdd/include/lcdd/bfield
diff -u -r1.2 -r1.3
--- RZFieldMap.hh 1 Jul 2013 22:10:34 -0000 1.2
+++ RZFieldMap.hh 2 Jul 2013 21:19:43 -0000 1.3
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/RZFieldMap.hh,v 1.2 2013/07/01 22:10:34 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/RZFieldMap.hh,v 1.3 2013/07/02 21:19:43 jeremy Exp $
#ifndef LCDD_BFIELD_RZFIELDMAP_HH
#define LCDD_BFIELD_RZFIELDMAP_HH 1
@@ -21,35 +21,61 @@
public:
+ /**
+ * Class constructor.
+ * @param[in] numBinsR The number of bins in R.
+ * @param[in] numBinsZ The number of bins in Z.
+ * @param[in] gridSizeR The size of a cell in R.
+ * @param[in] gridSizeZ The size of a cell in Z.
+ * @param[in] fieldData A list of RZBData forming the B-field grid.
+ */
RZFieldMap(int numBinsR, int numBinsZ, double gridSizeR, double gridSizeZ, std::vector<RZBData> fieldData);
+ /**
+ * Class destructor.
+ */
virtual ~RZFieldMap();
public:
+
+ /**
+ * Implementation of G4MagneticField::Initialize.
+ * @param[in] Point A point in global coordinates.
+ * @param[out] Bfield The B-field values at the point.
+ */
void GetFieldValue(const double Point[3], double *Bfield) const;
private:
+
+ /**
+ * Initialize the data arrays.
+ */
void initializeArrays();
- void fillArrays(std::vector<RZBData> fieldData);
- void deleteArrays();
-private:
+ /**
+ * Fill the internal data arrays from the list of RZBData objects.
+ * @param[in] fieldData The list of RZBData points.
+ */
+ void fillArrays(std::vector<RZBData> fieldData);
- void computeNumBins();
+ /**
+ * Delete the arrays containg the field data.
+ */
+ void deleteArrays();
private:
- int m_numBinsR;
- int m_numBinsZ;
+ int _numBinsR;
+ int _numBinsZ;
- double m_gridSizeR;
- double m_gridSizeZ;
+ double _gridSizeR;
+ double _gridSizeZ;
- double m_maxR;
- double m_maxZ;
+ double _maxR;
+ double _maxZ;
- double** m_BrArray;
- double** m_BzArray;
+ double** _BrArray;
+ double** _BzArray;
};
#endif
lcdd/include/lcdd/bfield
diff -u -r1.1 -r1.2
--- Solenoid.hh 1 Jul 2013 21:00:40 -0000 1.1
+++ Solenoid.hh 2 Jul 2013 21:19:43 -0000 1.2
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Solenoid.hh,v 1.1 2013/07/01 21:00:40 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Solenoid.hh,v 1.2 2013/07/02 21:19:43 jeremy Exp $
#ifndef LCDD_BFIELD_SOLENOID_HH
#define LCDD_BFIELD_SOLENOID_HH 1
@@ -10,79 +10,113 @@
#include <iostream>
/**
- * @brief Simulation class for a simple magnetic solenoid.
+ * Geant4 implementation of a simple solenoidal field.
+ * @todo Move code to source file.
+ * @todo This class needs better documentation on the function of the inner/outer R and Z values.
*/
class Solenoid: public G4MagneticField
{
public:
+
+ /**
+ * Class constructor.
+ * @todo Add fully qualified constructor.
+ */
Solenoid();
+
+ /**
+ * Class destructor.
+ */
virtual ~Solenoid();
public:
+ /**
+ * Implementation of G4MagneticField::Initialize to get B-field values from point.
+ * @param[in] Point A 3D point in global coordinates.
+ * @param[out] Bfield The B-field values at the point.
+ * @todo Use the inner and outer Z values. They are currently ignored!
+ */
void GetFieldValue(const double Point[3], double *Bfield) const;
- void setInnerField(double d)
- {
- _innerField = d;
- }
-
- void setOuterField(double d)
- {
- _outerField = d;
- }
-
- void setInnerR(double d)
- {
- _innerR = d;
- }
-
- void setOuterR(double d)
- {
- _outerR = d;
- }
-
- void setInnerZ(double d)
- {
- _innerZ = d;
- }
-
- void setOuterZ(double d)
- {
- _outerZ = d;
- }
-
- double getInnerField() const
- {
- return _innerField;
- }
-
- double getOuterField() const
- {
- return _outerField;
- }
-
- double getInnerR() const
- {
- return _innerR;
- }
-
- double getOuterR() const
- {
- return _outerR;
- }
-
- double getInnerZ() const
- {
- return _innerZ;
- }
-
- double getOuterZ() const
- {
- return _outerZ;
- }
-
+ /**
+ * Set the inner field value.
+ * @param[in] d The inner field value.
+ */
+ void setInnerField(double d);
+
+ /**
+ * Set the outer field value.
+ * @param[in] d The outer field value.
+ */
+ void setOuterField(double d);
+
+ /**
+ * Set the inner radius.
+ * @param[in] d The inner radius.
+ */
+ void setInnerR(double d);
+
+ /**
+ * Set the outer radius.
+ * @param[in] d The outer radius.
+ */
+ void setOuterR(double d);
+
+ /**
+ * Set the inner Z value.
+ * @param[in] d The inner Z value.
+ */
+ void setInnerZ(double d);
+
+ /**
+ * Set the outer Z value.
+ * @param[in] The outer Z value.
+ */
+ void setOuterZ(double d);
+
+ /**
+ * Get the B-field Z component within the inner radius.
+ * @return The field value within the inner radius.
+ */
+ double getInnerField() const;
+
+ /**
+ * Get the B-field Z component between the inner and outer radii.
+ * @return The field value outside the inner radius.
+ */
+ double getOuterField() const;
+
+ /**
+ * Get the inner radius.
+ * @return The inner radius.
+ */
+ double getInnerR() const;
+
+ /**
+ * Get the outer radius.
+ * @return The outer radius.
+ */
+ double getOuterR() const;
+
+ /**
+ * Get the inner Z value.
+ * @return The inner Z value.
+ *
+ */
+ double getInnerZ() const;
+
+ /**
+ * Get the outer Z value.
+ * @return The outer Z value.
+ */
+ double getOuterZ() const;
+
+ /**
+ * Print the magnetic field's information to an output stream.
+ * @param[in] os The output stream.
+ */
void printOut(std::ostream &os);
private:
lcdd/include/lcdd/core
diff -u -r1.2 -r1.3
--- GeometryManager.hh 27 Jun 2013 23:42:24 -0000 1.2
+++ GeometryManager.hh 2 Jul 2013 21:19:43 -0000 1.3
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/core/GeometryManager.hh,v 1.2 2013/06/27 23:42:24 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/core/GeometryManager.hh,v 1.3 2013/07/02 21:19:43 jeremy Exp $
#ifndef LCDD_GEOMETRYMANAGER_HH
#define LCDD_GEOMETRYMANAGER_HH 1
@@ -9,45 +9,59 @@
class G4String;
/**
- * @class GeometryManager
- * @brief Singleton manager class with miscellaneous geometry utility functions.
+ * Singleton manager class with miscellaneous geometry utility and management functions.
*/
class GeometryManager
{
public:
+
+ /**
+ * Class destructor.
+ */
virtual ~GeometryManager();
+
+ /**
+ * Get the static instance of this class.
+ * @return This class's singleton instance.
+ */
static GeometryManager* instance();
protected:
+
+ /**
+ * Class constructor which is protected.
+ * @note Access an object of this class through its instance method.
+ */
GeometryManager();
public:
/**
- * Retrieve the world's logical volume from Geant4.
+ * Get the world's logical volume from Geant4.
+ * @return The current world's logical volume.
*/
G4LogicalVolume* getWorldLogicalVolume() const;
/**
- * Retrieve the world's physical volume from Geant4.
+ * Get the world's physical volume from Geant4.
+ * @return The current world's physical volume.
*/
G4VPhysicalVolume* getWorldPhysicalVolume() const;
/**
- * Hook for beginning the run.
+ * Begin of run hook for geometry setup.
+ * @param[in] run The G4Run that is starting.
*/
- void beginRun(const G4Run*);
+ void beginRun(const G4Run* run);
/**
- * Attach the RegionInformation to the world's region.
+ * Attach the RegionInformation to the world's.
*/
void setupWorldRegionInformation();
-//#ifdef HAVE_G4PVPLACEMENT_CHECKOVERLAPS
-
/**
- * Check overlaps starting with the world volume
- * and recursing to daughters.
+ * Check overlaps starting with the world volume and recursing to daughters.
+ * @note Overlaps are printed to cout by Geant4.
*/
void checkOverlaps() const;
@@ -55,20 +69,23 @@
* Check for overlaps by calling CheckOverlaps on all daughters
* of a given logical volume, with possible recursion to
* daughters.
+ * @note Overlaps are printed to cout by Geant4.
*/
void checkOverlaps(G4LogicalVolume*, bool recurse=true) const;
/**
* Check for overlaps of a named logical volume by looking it
* up in the volume store, with possible recursion to daughters.
+ * @note Overlaps are print to cout by Geant4.
*/
void checkOverlaps(const G4String&, bool recurse=true) const;
-//#endif
-
private:
+ /** The static instance of this class. */
static GeometryManager* m_instance;
+
+ /** Indicates whether world region information was added or not. */
bool m_worldRegionIsSetup;
};
lcdd/include/lcdd/core
diff -u -r1.2 -r1.3
--- LCDDDetectorConstruction.hh 1 Jul 2013 21:00:41 -0000 1.2
+++ LCDDDetectorConstruction.hh 2 Jul 2013 21:19:43 -0000 1.3
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDDetectorConstruction.hh,v 1.2 2013/07/01 21:00:41 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDDetectorConstruction.hh,v 1.3 2013/07/02 21:19:43 jeremy Exp $
#ifndef LCDD_CORE_LCDDDETECTORCONSTRUCTION_HH
#define LCDD_CORE_LCDDDETECTORCONSTRUCTION_HH 1
@@ -13,21 +13,42 @@
class LCDDObjectStoreInspector;
/**
- * @brief Implementation of G4VUserDetectorConstruction for LCDD.
- * @note Minimal functionality; mostly just hands control to other classes.
+ * Implementation of G4VUserDetectorConstruction for all LCDD geometries.
+ * @note This class has minimal functionality; it mostly hands control to other LCDD classes.
*/
class LCDDDetectorConstruction: public G4VUserDetectorConstruction
{
public:
+
+ /**
+ * Class constructor.
+ */
LCDDDetectorConstruction();
+
+ /**
+ * Class destructor.
+ */
~LCDDDetectorConstruction();
public:
+ /**
+ * Construct the geometry.
+ * @return The world physical volume.
+ */
virtual G4VPhysicalVolume* Construct();
+ /**
+ * Set the world volume of the built geometry.
+ * @param[in] pv The world's physical volume.
+ */
void setWorldVolume(G4VPhysicalVolume *pv);
+
+ /**
+ * Get the world volume of this construction.
+ * @return The world volume.
+ */
G4VPhysicalVolume* getWorldVolume();
private:
lcdd/include/lcdd/core
diff -u -r1.3 -r1.4
--- LCDDMessenger.hh 1 Jul 2013 22:10:34 -0000 1.3
+++ LCDDMessenger.hh 2 Jul 2013 21:19:43 -0000 1.4
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDMessenger.hh,v 1.3 2013/07/01 22:10:34 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDMessenger.hh,v 1.4 2013/07/02 21:19:43 jeremy Exp $
#ifndef LCDD_CORE_LCDDMESSENGER_HH
#define LCDD_CORE_LCDDMESSENGER_HH 1
@@ -11,22 +11,44 @@
class LCDDDetectorConstruction;
/**
- * @brief G4UImessenger for LCDD commands.
+ * G4UImessenger implementation for various LCDD commands.
+ * @todo This class should create the "stores" directory also.
*/
class LCDDMessenger: public G4UImessenger
{
public:
+
+ /**
+ * Class constructor.
+ */
LCDDMessenger();
+
+ /**
+ * Class destructor.
+ */
virtual ~LCDDMessenger();
public:
- virtual void SetNewValue(G4UIcommand *cmd, G4String newVals);
- virtual G4String GetCurrentValue(G4UIcommand *cmd);
+ /**
+ * Execute a command on this messner.
+ * @param[in] cmd The command to execute.
+ * @param[in] newVals The command's argument values.
+ */
+ void SetNewValue(G4UIcommand *cmd, G4String newVals);
+
+ /**
+ * Get the current value of the messenger.
+ * @warning This is not actually implemented and just returns a dummy value.
+ */
+ G4String GetCurrentValue(G4UIcommand *cmd);
private:
+ /**
+ * Define the directory and commands for this messenger.
+ */
void defineCommands();
private:
@@ -37,10 +59,8 @@
G4UIcommand* m_setSetupNameCmd;
G4UIcommand* m_setVersionCmd;
G4UIcommand* m_dumpCmd;
-#ifdef HAVE_G4PVPLACEMENT_CHECKOVERLAPS
G4UIcommand* m_checkOverlapsCmd;
G4UIcommand* m_checkOverlapsRecurseCmd;
-#endif
};
// class
#endif
lcdd/include/lcdd/core
diff -u -r1.3 -r1.4
--- LCDDObjectStoreInspector.hh 1 Jul 2013 21:00:41 -0000 1.3
+++ LCDDObjectStoreInspector.hh 2 Jul 2013 21:19:43 -0000 1.4
@@ -1,4 +1,4 @@
-// $Id: LCDDObjectStoreInspector.hh,v 1.3 2013/07/01 21:00:41 jeremy Exp $
+// $Id: LCDDObjectStoreInspector.hh,v 1.4 2013/07/02 21:19:43 jeremy Exp $
#ifndef LCDD_CORE_LCDDOBJECTSTOREINSPECTOR_HH
#define LCDD_CORE_LCDDOBJECTSTOREINSPECTOR_HH 1
@@ -8,13 +8,17 @@
#include "lcdd/core/LCDDProcessor.hh"
/**
- * @brief Creates the inspector instances for looking at Geant4 LCDD object stores.
+ * Creates specific instances of the StoreInspector for looking at information in Geant4 and LCDD object stores.
*/
class LCDDObjectStoreInspector
{
public:
+ /**
+ * Class constructor.
+ * @brief Constructor that defines instances of StoreInspector for specific types.
+ */
LCDDObjectStoreInspector()
{
m_materialInspector = new G4MaterialStoreInspector("G4Material", G4Material::GetMaterialTable());
@@ -29,6 +33,9 @@
m_visInspector = new G4VisAttributeInspector("G4VisAttributes", LCDDProcessor::instance()->getVisAttributesStore());
}
+ /**
+ * Class destructor.
+ */
virtual ~LCDDObjectStoreInspector()
{
delete m_materialInspector;
lcdd/include/lcdd/core
diff -u -r1.3 -r1.4
--- LCDDParser.hh 1 Jul 2013 22:10:34 -0000 1.3
+++ LCDDParser.hh 2 Jul 2013 21:19:43 -0000 1.4
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDParser.hh,v 1.3 2013/07/01 22:10:34 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDParser.hh,v 1.4 2013/07/02 21:19:43 jeremy Exp $
#ifndef LCDD_CORE_LCDDPARSER_HH
#define LCDD_CORE_LCDDPARSER_HH 1
@@ -10,57 +10,120 @@
class G4VPhysicalVolume;
/**
- * @brief Parser for LCDD format.
+ * Parser for reading in the LCDD XML format to Geant4 runtime.
+ * @todo See https://jira.slac.stanford.edu/browse/LCDD-11
+ * Make version and setup name supported parameters.
*/
class LCDDParser
{
+
+private:
+
+ /**
+ * Class constructor, which is private because this class
+ * is accessed as a singleton.
+ */
+ LCDDParser();
+
public:
+ /**
+ * Class destructor.
+ */
virtual ~LCDDParser();
+ /**
+ * Get the static instance of this class.
+ */
static LCDDParser* instance();
-protected:
-
- LCDDParser();
-
public:
- // initialize required XML machinery
- void initialize();
- void initializeParser();
-
- // call in G4 DetectorConstruction
+ /**
+ * Initialize the parser and build the geometry.
+ * @return The geometry's world volume.
+ */
G4VPhysicalVolume* construct();
- // cleanup
+ /**
+ * End of build hook. Calls Finalize method of the SAX processor.
+ */
void finalize();
- // set all parms
- void setupParserConfig(const std::string& URI, const std::string& setupName, const std::string& version);
-
- // set from instance vars
- void setupParserConfig();
-
- // set parms
+ /**
+ * Set the URI of the LCDD or GDML file to build.
+ * @param[in] URI The URI of the LCDD file.
+ */
void setURI(std::string URI);
+
+ /**
+ * Set the name of the GDML setup to load.
+ * @param[in] setupName The name of the setup.
+ * @warning Currently ignored by the parser.
+ */
void setSetupName(std::string setupName);
+
+ /**
+ * Set the version.
+ * @param[in[ version The version.
+ * @warning Not sure what this does!
+ */
void setVersion(std::string version);
- // get parms
+ /**
+ * Get the URI parameter value.
+ * @return The current URI.
+ */
const std::string& URI();
+
+ /**
+ * Get the current setup name.
+ * @return The current setup name.
+ */
const std::string& setupName();
- const std::string& version();
- // set world volume ptr
- void setWorld(G4VPhysicalVolume *world);
+ /**
+ * Get the current version.
+ * @return The current version.
+ */
+ const std::string& version();
+ /**
+ * Check if the current setup is valid.
+ * @return True if valid; false if not.
+ */
bool isValidSetup();
private:
+ /**
+ * Initialize the XML parser. This is just a wrapped for initializeParser.
+ */
+ void initialize();
+
+ /**
+ * Initialize the parser.
+ */
+ void initializeParser();
+
+ /**
+ * Add the subscriber for handling LCDD extension elements on the volume tags.
+ */
void addVolumeExtendedSubscriber();
+ /**
+ * Set all parser parameters.
+ * @param[in] URI The location of the geometry file.
+ * @param[in] setupName The setup name.
+ * @param[in] version The version.
+ */
+ void setupParserConfig(const std::string& URI, const std::string& setupName, const std::string& version);
+
+ /**
+ * This sets up the parser configuration from the current instance variables.
+ */
+ void setupParserConfig();
+
private:
SAXProcessor m_sxp;
lcdd/include/lcdd/core
diff -u -r1.3 -r1.4
--- LCDDProcessor.hh 1 Jul 2013 22:10:34 -0000 1.3
+++ LCDDProcessor.hh 2 Jul 2013 21:19:43 -0000 1.4
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDProcessor.hh,v 1.3 2013/07/01 22:10:34 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDProcessor.hh,v 1.4 2013/07/02 21:19:43 jeremy Exp $
#ifndef LCDD_CORE_LCDDPROCESSOR_HH
#define LCDD_CORE_LCDDPROCESSOR_HH 1
@@ -19,84 +19,261 @@
class G4Run;
/**
- * @brief Register and find LCDD elements, except idspecs which have own manager.
+ * This class is used to register LCDD objects created by subscribers when parsing the input XML.
* @note This is the LCDD equivalent of the GDMLProcessor class.
*/
class LCDDProcessor
{
-public:
+private:
+ /**
+ * Class constructor, which is private because class is accessed via singleton.
+ */
LCDDProcessor();
+
+public:
+
+ /**
+ * Class destructor.
+ */
virtual ~LCDDProcessor();
+ /**
+ * Get the static instance of this class.
+ * @return The singleton instance of this class.
+ */
static LCDDProcessor* instance();
public:
+
+ /** Name to SensitiveDetector map. */
typedef std::map<std::string, SensitiveDetector*> SensitiveDetectors;
+
+ /** Name to magnetic field map. */
typedef std::map<std::string, G4MagneticField*> MagneticFields;
+
+ /** Name to regions map. */
typedef std::map<std::string, G4Region*> Regions;
+
+ /** Name to vis attributes map. */
typedef std::map<std::string, G4VisAttributes*> VisAttributes;
+
+ /** Name to physics limit map. */
typedef std::map<std::string, PhysicsLimitSet*> LimitSets;
public:
- // header
+ /**
+ * Get the header record.
+ * @return The LCDD header record.
+ */
const LCDDHeaderRecord* getHeader() const;
+
+ /**
+ * Set the header record.
+ * @param[in] h The header record.
+ */
void setHeader(LCDDHeaderRecord* h);
- // detector name
+ /**
+ * Get the name of the detector.
+ */
std::string getDetectorName() const;
- // Sensitive Detectors
+ /**
+ * Add a named SensitiveDetector.
+ * @param[in] name The name of the detector.
+ * @param[in] sd The sensitive detector.
+ */
void addSensitiveDetector(std::string& name, SensitiveDetector* sd);
+ /**
+ * Get a SensitiveDetector by name.
+ * @param[in] The name of the detector.
+ */
SensitiveDetector* getSensitiveDetector(const std::string& name);
+
+ /**
+ * Get a SensitiveDetector by name.
+ * @param[in] The name of the detector.
+ */
SensitiveDetector* getSensitiveDetector(const char* name);
+ /**
+ * Get an iterator pointing at the beginning of the SD map.
+ * @return An iterator pointing at the first SD in the map.
+ */
LCDDProcessor::SensitiveDetectors::const_iterator getSensitiveDetectorsBegin();
+
+ /**
+ * Get an iterator pointing at the end of the SD map.
+ * @return An iterator pointing to the end of the SD map.
+ */
LCDDProcessor::SensitiveDetectors::const_iterator getSensitiveDetectorsEnd();
- // Mag Field
+ /**
+ * Add a magnetic field by name.
+ * @param[in] name The name of the magnetic field.
+ * @param[in] mag The magnetic field object.
+ */
void addMagneticField(std::string& name, G4MagneticField* mag);
+
+ /**
+ * Get a magnetic field by name.
+ * @param[in] name The name of the magnetic field.
+ */
G4MagneticField* getMagneticField(const std::string& name);
+
+ /**
+ * Get a magnetic field by name.
+ * @param[in] name The name of the magnetic field.
+ */
G4MagneticField* getMagneticField(const char* name);
+ /**
+ * Get an iterator pointing at the first magnetic field in the map.
+ * @return An iterator pointing at the first magnetic field in the map.
+ */
LCDDProcessor::MagneticFields::const_iterator getMagneticFieldsBegin();
+
+ /**
+ * Get an iterator pointing at the end of the magnetic field map.
+ * @return An iterator pointing at the end of the magnetic field map.
+ */
LCDDProcessor::MagneticFields::const_iterator getMagneticFieldsEnd();
- // Passes mag through to LCDDFieldManager.
+ /**
+ * Add a global magnetic field.
+ * @param[in] mag The magnetic field to add.
+ */
void addGlobalField(G4MagneticField* mag);
- // Regions
+ /**
+ * Add a region by name.
+ * @param[in] name The name of the region.
+ * @param[in] reg The region to add.
+ */
void addRegion(std::string& name, G4Region* reg);
+ /**
+ * Get a region by name.
+ * @param[in] name The name of the region.
+ * @return The region.
+ */
G4Region* getRegion(const std::string& name);
+
+ /**
+ * Get a region by name.
+ * @param[in] name The name of the region.
+ * @return The region.
+ */
G4Region* getRegion(const char* name);
+ /**
+ * Get an iterator pointing to the first region in the map.
+ * @return An iterator pointing to the first region in the map.
+ */
LCDDProcessor::Regions::const_iterator getRegionsBegin();
+
+ /**
+ * Get an iterator pointing to the end of the region map.
+ * @return An iterator pointing to the end of the region map.
+ */
LCDDProcessor::Regions::const_iterator getRegionsEnd();
- // user limit set
+ /**
+ * Add a PhysicsLimitSet by name.
+ * @param[in] name The name of the physics limit set.
+ * @param[in] lim The PhysicsLimitSet object to register.
+ */
void addLimitSet(std::string& name, PhysicsLimitSet* lim);
+
+ /**
+ * Get a PhysicsLimitSet by name.
+ * @param[in] name The name of the PhysicsLimitSet object.
+ * @return The matching PhysicsLimitSet object.
+ */
PhysicsLimitSet* getLimitSet(const std::string& name);
+
+ /**
+ * Get a PhysicsLimitSet by name.
+ * @param[in] name The name of the PhysicsLimitSet object.
+ * @return The matching PhysicsLimitSet object.
+ */
PhysicsLimitSet* getLimitSet(const char* name);
+
+ /**
+ * Get an iterator pointing to the first PhysicsLimitSet in the map.
+ * @return An iterator pointing to the first PhysicsLimitSet in the map.
+ */
LCDDProcessor::LimitSets::const_iterator getLimitSetsBegin();
+
+ /**
+ * Get an iterator pointing to the end of the PhysicsLimitSet map.
+ * @return An iterator pointing to the end of the PhysicsLimitSet.
+ */
LCDDProcessor::LimitSets::const_iterator getLimitSetsEnd();
- // Vis Attributes
+ /**
+ * Add VisAttributes by name.
+ * @param[in] name The name of the VisAttributes to add.
+ * @param[in] vis The VisAttributes object to add.
+ */
void addVisAttributes(std::string& name, G4VisAttributes* vis);
+ /**
+ * Get VisAttributes by name.
+ * @param[in] The name of the VisAttributes.
+ */
G4VisAttributes* getVisAttributes(const std::string& name);
+
+ /**
+ * Get VisAttributes by name.
+ * @param[in] The name of the VisAttributes.
+ */
G4VisAttributes* getVisAttributes(const char* name);
+ /**
+ * Get an iterator pointing to the first VisAttributes in the map.
+ * @return An iterator pointing to the first VisAttributes in the map.
+ */
LCDDProcessor::VisAttributes::const_iterator getVisAttributesBegin();
+
+ /**
+ * Get an iterator pointing to the end of the VisAttributes map.
+ * @return An iterator pointing to the end of the VisAttributes map.
+ */
LCDDProcessor::VisAttributes::const_iterator getVisAttributesEnd();
+ /**
+ * Get the map of VisAttributes.
+ * @return The map of VisAttributes.
+ */
const LCDDProcessor::VisAttributes* getVisAttributesStore() const;
+
+ /**
+ * Get the map of SDs.
+ * @return The map of SDs.
+ */
const LCDDProcessor::SensitiveDetectors* getSensitiveDetectorStore() const;
+
+ /**
+ * Get the map of magnetic fields.
+ * @return The map of magnetic fields.
+ */
const LCDDProcessor::MagneticFields* getMagneticFieldStore() const;
+
+ /**
+ * Get the map of regions.
+ * @return The map of regions.
+ */
const LCDDProcessor::Regions* getRegionStore() const;
+
+ /**
+ * Get the map of PhysicsLimitSets.
+ * @return The map of PhysicsLimitSets.
+ */
const LCDDProcessor::LimitSets* getLimitSetStore() const;
private:
lcdd/include/lcdd/detectors
diff -u -r1.3 -r1.4
--- CellReadout.hh 1 Jul 2013 22:10:34 -0000 1.3
+++ CellReadout.hh 2 Jul 2013 21:19:44 -0000 1.4
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/CellReadout.hh,v 1.3 2013/07/01 22:10:34 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/CellReadout.hh,v 1.4 2013/07/02 21:19:44 jeremy Exp $
#ifndef LCDD_DETECTORS_CELLREADOUT_HH
#define LCDD_DETECTORS_CELLREADOUT_HH 1
@@ -9,8 +9,7 @@
#include <string>
/**
- * @brief This is a pure virtual base class for cell readouts to implement.
- * @note Not currently usable by the SD classes.
+ * This is a pure virtual base class for calorimeter cell readouts to implement.
* @fixme Move to DDSegmentation package.
*/
class CellReadout
@@ -44,25 +43,34 @@
/**
* Compute cell ID from local position.
+ * @param[in] pos A 2D position.
+ * @return A CellId from the position.
*/
- virtual CellId cellId(Position2D) = 0;
+ virtual CellId cellId(Position2D pos) = 0;
/**
* Compute local position of a cell ID.
+ * @param[in] id The cell id.
+ * @return The position from the CellId.
*/
- virtual Position2D position(CellId) = 0;
+ virtual Position2D position(CellId id) = 0;
/**
* Create a list of neighbor cells from a cell ID.
+ * @param[in] id The cell id.
+ * @return The list of Neighbors for the given CellId.
*/
- virtual Neighbors neighbors(CellId) = 0;
+ virtual Neighbors neighbors(CellId id) = 0;
/**
* Get the list of field names.
+ * @return The list of field names defined by the readout.
*/
const FieldNames& fieldNames();
protected:
+
+ /** The list of field names. */
FieldNames m_fieldNames;
};
lcdd/src/lcdd/bfield
diff -u -r1.1 -r1.2
--- Dipole.cc 1 Jul 2013 21:00:44 -0000 1.1
+++ Dipole.cc 2 Jul 2013 21:19:44 -0000 1.2
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/Dipole.cc,v 1.1 2013/07/01 21:00:44 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/Dipole.cc,v 1.2 2013/07/02 21:19:44 jeremy Exp $
// LCDD
#include "lcdd/bfield/Dipole.hh"
@@ -23,20 +23,20 @@
double r = sqrt(Point[0] * Point[0] + Point[1] * Point[1]);
// Check if z coordinate is within dipole z bounds.
- if (z > m_zmin && z < m_zmax && r < m_rmax) {
+ if (z > _zmin && z < _zmax && r < _rmax) {
// Convert to absolute value z and apply specified length unit.
- double zc = fabs(z) / m_lunit;
+ double zc = fabs(z) / _lunit;
//std::cout << "zc = " << zc << std::endl;
// Apply all coefficients to this z coordinate.
- for (size_t i = 0; i < m_coeffs.size(); ++i) {
- bx += m_coeffs[i] * pow(zc, i);
+ for (size_t i = 0; i < _coeffs.size(); ++i) {
+ bx += _coeffs[i] * pow(zc, i);
}
// Convert to specified field unit.
- bx *= m_funit;
+ bx *= _funit;
// Flip sign for negative z.
if (z < 0) {
@@ -55,60 +55,60 @@
void Dipole::setZMax(double zmax)
{
- m_zmax = zmax;
+ _zmax = zmax;
}
double Dipole::getZMax()
{
- return m_zmax;
+ return _zmax;
}
void Dipole::setZMin(double zmin)
{
- m_zmin = zmin;
+ _zmin = zmin;
}
double Dipole::getZMin()
{
- return m_zmin;
+ return _zmin;
}
void Dipole::setRMax(double rmax)
{
- m_rmax = rmax;
+ _rmax = rmax;
}
double Dipole::getRMax()
{
- return m_rmax;
+ return _rmax;
}
void Dipole::addCoeff(double coeff)
{
- m_coeffs.push_back(coeff);
+ _coeffs.push_back(coeff);
}
const std::vector<double>& Dipole::getCoeffs()
{
- return m_coeffs;
+ return _coeffs;
}
void Dipole::setFieldUnit(double unit)
{
- m_funit = unit;
+ _funit = unit;
}
double Dipole::getFieldUnit()
{
- return m_funit;
+ return _funit;
}
void Dipole::setLengthUnit(double unit)
{
- m_lunit = unit;
+ _lunit = unit;
}
double Dipole::getLengthUnit()
{
- return m_lunit;
+ return _lunit;
}
lcdd/src/lcdd/bfield
diff -u -r1.1 -r1.2
--- FieldManager.cc 1 Jul 2013 21:00:44 -0000 1.1
+++ FieldManager.cc 2 Jul 2013 21:19:44 -0000 1.2
@@ -1,10 +1,10 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/FieldManager.cc,v 1.1 2013/07/01 21:00:44 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/FieldManager.cc,v 1.2 2013/07/02 21:19:44 jeremy Exp $
// LCDD
#include "lcdd/bfield/FieldManager.hh"
#include "lcdd/core/LCDDProcessor.hh"
-FieldManager* FieldManager::m_instance = 0;
+FieldManager* FieldManager::_instance = 0;
FieldManager::~FieldManager()
{
@@ -12,10 +12,10 @@
FieldManager* FieldManager::instance()
{
- if (m_instance == 0) {
- m_instance = new FieldManager();
+ if (_instance == 0) {
+ _instance = new FieldManager();
}
- return m_instance;
+ return _instance;
}
MagneticFieldOverlay* FieldManager::makeOverlay(std::vector<G4MagneticField*> fields)
@@ -33,9 +33,9 @@
G4MagneticField* field = 0;
// Setup only the global fields specified in global_field.
- if (m_globalfields.size() != 0) {
+ if (_globalfields.size() != 0) {
// Use specific list of global fields registered with LCDDFieldManager.
- field = setup(m_globalfields);
+ field = setup(_globalfields);
}
// No global fields, so treat all fields registered with LCDDProcessor
// as global.
@@ -82,12 +82,12 @@
void FieldManager::addGlobalField(G4MagneticField* f)
{
- m_globalfields.push_back(f);
+ _globalfields.push_back(f);
}
void FieldManager::addField(G4MagneticField* f)
{
- m_allfields.push_back(f);
+ _allfields.push_back(f);
}
FieldManager::FieldManager()
lcdd/src/lcdd/bfield
diff -u -r1.1 -r1.2
--- MagneticFieldOverlay.cc 26 Jun 2013 23:50:59 -0000 1.1
+++ MagneticFieldOverlay.cc 2 Jul 2013 21:19:44 -0000 1.2
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/MagneticFieldOverlay.cc,v 1.1 2013/06/26 23:50:59 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/MagneticFieldOverlay.cc,v 1.2 2013/07/02 21:19:44 jeremy Exp $
// LCDD
#include "lcdd/bfield/MagneticFieldOverlay.hh"
@@ -17,7 +17,7 @@
void MagneticFieldOverlay::addMagneticField(G4MagneticField* field)
{
if (field != 0) {
- m_fields.push_back(field);
+ _fields.push_back(field);
}
}
@@ -29,7 +29,7 @@
//std::cout << "MagneticFieldOverlay::GetFieldValue" << std::endl;
Bfield[0] = Bfield[1] = Bfield[2] = 0.;
- for (std::vector<G4MagneticField*>::const_iterator iter = m_fields.begin(); iter != m_fields.end(); iter++) {
+ for (std::vector<G4MagneticField*>::const_iterator iter = _fields.begin(); iter != _fields.end(); iter++) {
(*iter)->GetFieldValue(Point, Bfield);
}
lcdd/src/lcdd/bfield
diff -u -r1.1 -r1.2
--- RZFieldMap.cc 1 Jul 2013 21:00:44 -0000 1.1
+++ RZFieldMap.cc 2 Jul 2013 21:19:44 -0000 1.2
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/RZFieldMap.cc,v 1.1 2013/07/01 21:00:44 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/RZFieldMap.cc,v 1.2 2013/07/02 21:19:44 jeremy Exp $
// LCDD
#include "lcdd/bfield/RZFieldMap.hh"
@@ -19,7 +19,7 @@
#endif
RZFieldMap::RZFieldMap(int numBinsR, int numBinsZ, double gridSizeR, double gridSizeZ, std::vector<RZBData> fieldData) :
- m_numBinsR(numBinsR), m_numBinsZ(numBinsZ), m_gridSizeR(gridSizeR), m_gridSizeZ(gridSizeZ), m_BrArray(0), m_BzArray(0)
+ _numBinsR(numBinsR), _numBinsZ(numBinsZ), _gridSizeR(gridSizeR), _gridSizeZ(gridSizeZ), _BrArray(0), _BzArray(0)
{
#ifdef FIELD_MAP_DEBUG
@@ -45,29 +45,30 @@
G4Exception("", "", FatalException, "gridSizeZ must be >= 0");
}
- m_maxR = (numBinsR - 1) * m_gridSizeR;
- m_maxZ = (numBinsZ - 1) * m_gridSizeZ;
+ _maxR = (numBinsR - 1) * _gridSizeR;
+ _maxZ = (numBinsZ - 1) * _gridSizeZ;
initializeArrays();
+
fillArrays(fieldData);
}
void RZFieldMap::initializeArrays()
{
// Make two 2D arrays of numBinsZ x numBinsR
- m_BrArray = new double*[m_numBinsZ];
- m_BzArray = new double*[m_numBinsZ];
+ _BrArray = new double*[_numBinsZ];
+ _BzArray = new double*[_numBinsZ];
- for (int i = 0; i < m_numBinsZ; i++) {
- m_BrArray[i] = new double[m_numBinsR];
- m_BzArray[i] = new double[m_numBinsR];
+ for (int i = 0; i < _numBinsZ; i++) {
+ _BrArray[i] = new double[_numBinsR];
+ _BzArray[i] = new double[_numBinsR];
}
// Initialize arrays to all 0's.
- for (int i = 0; i < m_numBinsZ; i++) {
- for (int j = 0; j < m_numBinsR; j++) {
- m_BrArray[i][j] = 0;
- m_BzArray[i][j] = 0;
+ for (int i = 0; i < _numBinsZ; i++) {
+ for (int j = 0; j < _numBinsR; j++) {
+ _BrArray[i][j] = 0;
+ _BzArray[i][j] = 0;
}
}
}
@@ -77,15 +78,15 @@
for (std::vector<RZBData>::iterator iter = fieldData.begin(); iter != fieldData.end(); iter++) {
RZBData rzb = *iter;
- int iz = (int) ((rzb.z() + 0.0001) / m_gridSizeZ);
- int ir = (int) ((rzb.r() + 0.0001) / m_gridSizeR);
+ int iz = (int) ((rzb.z() + 0.0001) / _gridSizeZ);
+ int ir = (int) ((rzb.r() + 0.0001) / _gridSizeR);
- m_BzArray[iz][ir] = rzb.Bz();
- m_BrArray[iz][ir] = rzb.Br();
+ _BzArray[iz][ir] = rzb.Bz();
+ _BrArray[iz][ir] = rzb.Br();
#ifdef FIELD_MAP_DEBUG
cout << "ir iz = " << ir << " " << iz << endl;
- cout << "Br Bz = " << m_BrArray[iz][ir] << " " << m_BzArray[iz][ir] << endl;
+ cout << "Br Bz = " << _BrArray[iz][ir] << " " << _BzArray[iz][ir] << endl;
cout << endl;
#endif
}
@@ -98,18 +99,18 @@
void RZFieldMap::deleteArrays()
{
- for (int i = 0; i < m_numBinsZ; i++) {
- delete[] m_BrArray[i];
- delete[] m_BzArray[i];
+ for (int i = 0; i < _numBinsZ; i++) {
+ delete[] _BrArray[i];
+ delete[] _BzArray[i];
}
- delete[] m_BrArray;
- delete[] m_BzArray;
+ delete[] _BrArray;
+ delete[] _BzArray;
}
/**
- * Compute B field at given point using the arrays of Br and Bz field strengths.
+ * Compute B-field at given point using the arrays of Br and Bz field components.
*
- * This function is based on Takashi's FORTRAN code at
+ * This function is based on Takashi's FORTRAN code:
*
* /afs/slac/www/accel/nlc/local/systems/beamdelivery/geant/SDNEW/solenoid.f
*
@@ -129,19 +130,19 @@
double hr = 0;
// Check for z or r out of range.
- if (fabs(z) >= m_maxZ || r >= m_maxR) {
+ if (fabs(z) >= _maxZ || r >= _maxR) {
#ifdef FIELD_MAP_DEBUG
cout << "OUT OF RANGE: z r = " << fabs(z) << " " << r << endl;
- cout << "MAX: maxZ maxR " << m_maxZ << " " << m_maxR << endl;
+ cout << "MAX: maxZ maxR " << _maxZ << " " << _maxR << endl;
#endif
return;
}
// Compute z bin.
- int iz = (int) ((fabs(z) + 0.001) / m_gridSizeZ);
+ int iz = (int) ((fabs(z) + 0.001) / _gridSizeZ);
// Compute r bin.
- int ir = (int) ((r + 0.001) / m_gridSizeR);
+ int ir = (int) ((r + 0.001) / _gridSizeR);
// Adjust for iz out of range.
// int izfar = 0;
@@ -160,7 +161,7 @@
}
// Check for Z overflow on iz+1.
- if (iz + 1 >= m_numBinsZ) {
+ if (iz + 1 >= _numBinsZ) {
#ifdef FIELD_MAP_DEBUG
cout << "ERROR: iz overflow" << endl;
cout << "iz=" << iz << endl;
@@ -170,7 +171,7 @@
}
// Check for R overflow on ir+1.
- if (ir + 1 >= m_numBinsR) {
+ if (ir + 1 >= _numBinsR) {
#ifdef FIELD_MAP_DEBUG
cout << "ERROR: ir overflow" << endl;
cout << "ir=" << ir << endl;
@@ -180,13 +181,13 @@
}
#ifdef FIELD_MAP_DEBUG
- cout << "dz " << m_gridSizeZ << " dr " << m_gridSizeR << endl;
+ cout << "dz " << _gridSizeZ << " dr " << _gridSizeR << endl;
cout << "z " << z << " r " << r << endl;
cout << "iz " << iz << " ir " << ir << endl;
#endif
- double bz0 = m_BzArray[iz][ir];
- double br0 = m_BrArray[iz][ir];
+ double bz0 = _BzArray[iz][ir];
+ double br0 = _BrArray[iz][ir];
#ifdef FIELD_MAP_DEBUG
cout << "bz0 " << bz0 << " br0 " << br0 << endl;
@@ -199,14 +200,14 @@
double brdr = 0.;
if (r > 0.0) {
- delr = r - float(ir) * m_gridSizeR;
+ delr = r - float(ir) * _gridSizeR;
#ifdef FIELD_MAP_DEBUG
- if ( iz+1 == m_gridSizeZ-1 ) {
+ if ( iz+1 == _gridSizeZ-1 ) {
cout << "WARNING: iz+1 == gridSizeZ-1" << endl;
}
- if ( ir+1 == m_gridSizeR-1 ) {
+ if ( ir+1 == _gridSizeR-1 ) {
cout << "WARNING: ir+1 == gridSizeR-1" << endl;
}
#endif
@@ -215,35 +216,35 @@
cout << "checking brarray access ..." << endl;
cout << "iz+1=" << iz+1 << endl;
cout << "ir=" << ir << endl;
- cout << m_BrArray[iz+1][ir] << endl;
+ cout << _BrArray[iz+1][ir] << endl;
cout << "m_BrArray[iz+1][ir] is ok" << endl;
cout << "iz=" << iz << endl;
cout << "ir+1=" << ir+1 << endl;
- cout << m_BrArray[iz][ir+1] << endl;
+ cout << _BrArray[iz][ir+1] << endl;
cout << "m_BrArray[iz][ir+1] is ok" << endl;
cout << "done" << endl;
#endif
- brdz = (m_BrArray[iz + 1][ir] - br0) / m_gridSizeZ;
- brdr = (m_BrArray[iz][ir + 1] - br0) / m_gridSizeR;
+ brdz = (_BrArray[iz + 1][ir] - br0) / _gridSizeZ;
+ brdr = (_BrArray[iz][ir + 1] - br0) / _gridSizeR;
#ifdef FIELD_MAP_DEBUG
- cout << "br= " << m_BrArray[iz+1][ir] << " " << m_BrArray[iz][ir+1] << endl;
+ cout << "br= " << _BrArray[iz+1][ir] << " " << _BrArray[iz][ir+1] << endl;
#endif
}
- delz = fabs(z) - float(iz) * m_gridSizeZ;
+ delz = fabs(z) - float(iz) * _gridSizeZ;
#ifdef FIELD_MAP_DEBUG
cout << " z " << z << " abs(z) " << fabs(z) << " iz " << iz << endl;
- cout << " float(iz-1) " << float(iz-1) << " dz " << m_gridSizeZ << endl;
+ cout << " float(iz-1) " << float(iz-1) << " dz " << _gridSizeZ << endl;
cout << " delz " << delz << endl;
#endif
- double bzdz = (m_BzArray[iz + 1][ir] - bz0) / m_gridSizeZ;
- double bzdr = (m_BzArray[iz][ir + 1] - bz0) / m_gridSizeR;
+ double bzdz = (_BzArray[iz + 1][ir] - bz0) / _gridSizeZ;
+ double bzdr = (_BzArray[iz][ir + 1] - bz0) / _gridSizeR;
#ifdef FIELD_MAP_DEBUG
- cout << "bz= " << m_BzArray[iz+1][ir] << " " << m_BzArray[iz][ir+1] << endl;
+ cout << "bz= " << _BzArray[iz+1][ir] << " " << _BzArray[iz][ir+1] << endl;
#endif
// if(izfar==1) {
lcdd/src/lcdd/bfield
diff -u -r1.1 -r1.2
--- Solenoid.cc 1 Jul 2013 21:00:44 -0000 1.1
+++ Solenoid.cc 2 Jul 2013 21:19:44 -0000 1.2
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/Solenoid.cc,v 1.1 2013/07/01 21:00:44 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/Solenoid.cc,v 1.2 2013/07/02 21:19:44 jeremy Exp $
// LCDD
#include "lcdd/bfield/Solenoid.hh"
@@ -47,3 +47,63 @@
os << "outerZ <" << _outerZ << ">" << std::endl;
os << std::endl;
}
+
+void Solenoid::setInnerField(double d)
+{
+ _innerField = d;
+}
+
+void Solenoid::setOuterField(double d)
+{
+ _outerField = d;
+}
+
+void Solenoid::setInnerR(double d)
+{
+ _innerR = d;
+}
+
+void Solenoid::setOuterR(double d)
+{
+ _outerR = d;
+}
+
+void Solenoid::setInnerZ(double d)
+{
+ _innerZ = d;
+}
+
+void Solenoid::setOuterZ(double d)
+{
+ _outerZ = d;
+}
+
+double Solenoid::getInnerField() const
+{
+ return _innerField;
+}
+
+double Solenoid::getOuterField() const
+{
+ return _outerField;
+}
+
+double Solenoid::getInnerR() const
+{
+ return _innerR;
+}
+
+double Solenoid::getOuterR() const
+{
+ return _outerR;
+}
+
+double Solenoid::getInnerZ() const
+{
+ return _innerZ;
+}
+
+double Solenoid::getOuterZ() const
+{
+ return _outerZ;
+}
lcdd/src/lcdd/core
diff -u -r1.3 -r1.4
--- GeometryManager.cc 1 Jul 2013 22:10:34 -0000 1.3
+++ GeometryManager.cc 2 Jul 2013 21:19:44 -0000 1.4
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/core/GeometryManager.cc,v 1.3 2013/07/01 22:10:34 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/core/GeometryManager.cc,v 1.4 2013/07/02 21:19:44 jeremy Exp $
// LCDD
#include "lcdd/core/GeometryManager.hh"
@@ -72,8 +72,6 @@
m_worldRegionIsSetup = true;
}
-#ifdef HAVE_G4PVPLACEMENT_CHECKOVERLAPS
-
void GeometryManager::checkOverlaps() const
{
checkOverlaps(getWorldLogicalVolume(), true);
@@ -117,6 +115,3 @@
G4cerr << "WARNING: The logical volume named <" << name << "> was not found in the G4LogicalVolumeStore!" << std::endl;
}
}
-
-#endif
-
lcdd/src/lcdd/core
diff -u -r1.1 -r1.2
--- LCDDLibLoad.cc 26 Jun 2013 23:50:59 -0000 1.1
+++ LCDDLibLoad.cc 2 Jul 2013 21:19:44 -0000 1.2
@@ -5,6 +5,9 @@
extern "C"
{
+/**
+ * Function for loading LCDD SAX processes.
+ */
void LCDDLoadProcesses()
{
@@ -66,6 +69,9 @@
LOAD_COMPONENT(limitProcess);
}
+/**
+ * Function for loading LCDD subscribers.
+ */
void LCDDLoadSubscribers()
{
// subscribers
@@ -102,6 +108,9 @@
LOAD_COMPONENT(limitsetSubscriber);
}
+/**
+ * Function for loading LCDD processes and subscribers.
+ */
void LCDDLibLoad()
{
LCDDLoadProcesses();
lcdd/src/lcdd/core
diff -u -r1.1 -r1.2
--- LCDDMessenger.cc 26 Jun 2013 23:50:59 -0000 1.1
+++ LCDDMessenger.cc 2 Jul 2013 21:19:44 -0000 1.2
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/core/LCDDMessenger.cc,v 1.1 2013/06/26 23:50:59 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/core/LCDDMessenger.cc,v 1.2 2013/07/02 21:19:44 jeremy Exp $
// LCDD
#include "lcdd/core/LCDDMessenger.hh"
@@ -15,153 +15,142 @@
// STL
#include <cassert>
-LCDDMessenger::LCDDMessenger()
-{
- // define UI commands
- defineCommands();
+LCDDMessenger::LCDDMessenger() {
+ // define UI commands
+ defineCommands();
}
-LCDDMessenger::~LCDDMessenger()
-{
- delete m_setupCmd;
- delete m_setURICmd;
- delete m_setSetupNameCmd;
- delete m_setVersionCmd;
- delete m_lcddDir;
+LCDDMessenger::~LCDDMessenger() {
+ delete m_setupCmd;
+ delete m_setURICmd;
+ delete m_setSetupNameCmd;
+ delete m_setVersionCmd;
+ delete m_lcddDir;
}
-void LCDDMessenger::SetNewValue(G4UIcommand *cmd, G4String newVals)
-{
- LCDDParser* parser = LCDDParser::instance();
-
- G4String singleArg = newVals;
- std::istringstream is((const char*) newVals);
-
- if (cmd == m_setURICmd) {
- parser->setURI(singleArg);
- } else if (cmd == m_setSetupNameCmd) {
- parser->setSetupName(singleArg);
- } else if (cmd == m_setVersionCmd) {
- parser->setVersion(singleArg);
- } else if (cmd == m_setupCmd) {
- G4String uri, setup, version;
-
- is >> uri >> setup >> version;
-
- parser->setURI(uri);
- parser->setSetupName(setup);
- parser->setVersion(version);
- } else if (cmd == m_dumpCmd) {
- //std::cout<<"arg: "<<singleArg<<std::endl;
- NistElementsDump::writeXml(singleArg);
- }
-#ifdef HAVE_G4PVPLACEMENT_CHECKOVERLAPS
- else if (cmd==m_checkOverlapsCmd || cmd==m_checkOverlapsRecurseCmd)
- {
-
- bool recurse=false;
-
- if (cmd == m_checkOverlapsRecurseCmd)
- {
- recurse=true;
- }
-
- G4String vol("");
- is >> vol;
-
- G4cout << "vol=" << vol << G4endl;
- G4cout << "recurse=" << recurse << G4endl;
-
- if (newVals != "")
- {
- // Check the named volume with optional recursion.
- GeometryManager::instance()->checkOverlaps(vol, recurse);
- }
- else
- {
- // No volume. Check the world, which is always done recursively!
- GeometryManager::instance()->checkOverlaps();
- }
- }
-#endif
- else {
- G4cerr << "WARNING: Unknown cmd to LCDDMessenger - " << cmd << G4endl;
- }
+void LCDDMessenger::SetNewValue(G4UIcommand *cmd, G4String newVals) {
+ LCDDParser* parser = LCDDParser::instance();
+
+ G4String singleArg = newVals;
+ std::istringstream is((const char*) newVals);
+
+ if (cmd == m_setURICmd) {
+ parser->setURI(singleArg);
+ } else if (cmd == m_setSetupNameCmd) {
+ parser->setSetupName(singleArg);
+ } else if (cmd == m_setVersionCmd) {
+ parser->setVersion(singleArg);
+ } else if (cmd == m_setupCmd) {
+ G4String uri, setup, version;
+
+ is >> uri >> setup >> version;
+
+ parser->setURI(uri);
+ parser->setSetupName(setup);
+ parser->setVersion(version);
+ } else if (cmd == m_dumpCmd) {
+ //std::cout<<"arg: "<<singleArg<<std::endl;
+ NistElementsDump::writeXml(singleArg);
+ } else if (cmd == m_checkOverlapsCmd || cmd == m_checkOverlapsRecurseCmd) {
+
+ bool recurse = false;
+
+ if (cmd == m_checkOverlapsRecurseCmd) {
+ recurse = true;
+ }
+
+ G4String vol("");
+ is >> vol;
+
+ G4cout << "vol=" << vol << G4endl;
+ G4cout << "recurse=" << recurse << G4endl;
+
+ if (newVals != "") {
+ // Check the named volume with optional recursion.
+ GeometryManager::instance()->checkOverlaps(vol, recurse);
+ } else {
+ // No volume. Check the world, which is always done recursively!
+ GeometryManager::instance()->checkOverlaps();
+ }
+ } else {
+ G4cerr << "WARNING: Unknown cmd to LCDDMessenger - " << cmd << G4endl;
+ }
}
-G4String LCDDMessenger::GetCurrentValue(G4UIcommand *)
-{
- return G4String("");
+G4String LCDDMessenger::GetCurrentValue(G4UIcommand *) {
+ return G4String("");
}
-void LCDDMessenger::defineCommands()
-{
- G4UIparameter *p;
-
- // LCDD directory
- m_lcddDir = new G4UIdirectory("/lcdd/");
- m_lcddDir->SetGuidance("XML detector description and geometry commands. [LCDD]");
-
- // set URL for input geometry file
- m_setURICmd = new G4UIcommand("/lcdd/url", this);
- m_setURICmd->SetGuidance("Set the Uniform Resource Locator (URL) for the input geometry file.");
- m_setURICmd->AvailableForStates(G4State_PreInit);
-
- p = new G4UIparameter("URI", 's', false);
- m_setURICmd->SetParameter(p);
-
- // set name of GDML setup
- m_setSetupNameCmd = new G4UIcommand("/lcdd/setupName", this);
- m_setSetupNameCmd->SetGuidance("Set GDML setup name.");
- m_setSetupNameCmd->AvailableForStates(G4State_PreInit);
-
- p = new G4UIparameter("SetupName", 's', false);
- m_setSetupNameCmd->SetParameter(p);
-
- // set version of GDML setup
- m_setVersionCmd = new G4UIcommand("/lcdd/version", this);
- m_setVersionCmd->SetGuidance("Set GDML version tag.");
- m_setVersionCmd->AvailableForStates(G4State_PreInit);
-
- p = new G4UIparameter("Version", 's', false);
- m_setVersionCmd->SetParameter(p);
-
- // setup URI, Setup and Version in one command
- m_setupCmd = new G4UIcommand("/lcdd/setup", this);
- m_setupCmd->SetGuidance("Set URI, SetupName and Version with a single command.");
- m_setupCmd->AvailableForStates(G4State_PreInit);
-
- p = new G4UIparameter("URI", 's', false);
- p->SetGuidance("URI is a URL to the input file. It MUST NOT contain unescaped spaces.");
- m_setupCmd->SetParameter(p);
-
- p = new G4UIparameter("SetupName", 's', true);
- m_setupCmd->SetParameter(p);
-
- p = new G4UIparameter("Version", 's', true);
- m_setupCmd->SetParameter(p);
-
- m_dumpCmd = new G4UIcommand("/lcdd/dumpNistElements", this);
- m_dumpCmd->SetGuidance("Dump NIST elements to file as GDML fragment, including lambda and X0.");
- p = new G4UIparameter("Filename", 's', true);
- p->SetDefaultValue("NistElements.xml");
- m_dumpCmd->SetParameter(p);
-
-#ifdef HAVE_G4PVPLACEMENT_CHECKOVERLAPS
- // Check overlaps.
- m_checkOverlapsCmd = new G4UIcommand("/lcdd/checkOverlaps",this);
- m_checkOverlapsCmd->SetGuidance("Call CheckOverlaps on a given volume or the world volume (no arguments).");
-
- p = new G4UIparameter("Volume",'s',true);
- p->SetDefaultValue("");
- m_checkOverlapsCmd->SetParameter(p);
-
- // Check overlaps with recursion to daughters.
- m_checkOverlapsRecurseCmd = new G4UIcommand("/lcdd/checkOverlapsRecurse",this);
- m_checkOverlapsRecurseCmd->SetGuidance("Call CheckOverlaps on a given volume and recursively check daughters.");
-
- p = new G4UIparameter("Volume",'s',true);
- p->SetDefaultValue("");
- m_checkOverlapsRecurseCmd->SetParameter(p);
-#endif
+void LCDDMessenger::defineCommands() {
+ G4UIparameter *p;
+
+ // LCDD directory
+ m_lcddDir = new G4UIdirectory("/lcdd/");
+ m_lcddDir->SetGuidance(
+ "XML detector description and geometry commands. [LCDD]");
+
+ // set URL for input geometry file
+ m_setURICmd = new G4UIcommand("/lcdd/url", this);
+ m_setURICmd->SetGuidance(
+ "Set the Uniform Resource Locator (URL) for the input geometry file.");
+ m_setURICmd->AvailableForStates(G4State_PreInit);
+
+ p = new G4UIparameter("URI", 's', false);
+ m_setURICmd->SetParameter(p);
+
+ // set name of GDML setup
+ m_setSetupNameCmd = new G4UIcommand("/lcdd/setupName", this);
+ m_setSetupNameCmd->SetGuidance("Set GDML setup name.");
+ m_setSetupNameCmd->AvailableForStates(G4State_PreInit);
+
+ p = new G4UIparameter("SetupName", 's', false);
+ m_setSetupNameCmd->SetParameter(p);
+
+ // set version of GDML setup
+ m_setVersionCmd = new G4UIcommand("/lcdd/version", this);
+ m_setVersionCmd->SetGuidance("Set GDML version tag.");
+ m_setVersionCmd->AvailableForStates(G4State_PreInit);
+
+ p = new G4UIparameter("Version", 's', false);
+ m_setVersionCmd->SetParameter(p);
+
+ // setup URI, Setup and Version in one command
+ m_setupCmd = new G4UIcommand("/lcdd/setup", this);
+ m_setupCmd->SetGuidance(
+ "Set URI, SetupName and Version with a single command.");
+ m_setupCmd->AvailableForStates(G4State_PreInit);
+
+ p = new G4UIparameter("URI", 's', false);
+ p->SetGuidance(
+ "URI is a URL to the input file. It MUST NOT contain unescaped spaces.");
+ m_setupCmd->SetParameter(p);
+
+ p = new G4UIparameter("SetupName", 's', true);
+ m_setupCmd->SetParameter(p);
+
+ p = new G4UIparameter("Version", 's', true);
+ m_setupCmd->SetParameter(p);
+
+ m_dumpCmd = new G4UIcommand("/lcdd/dumpNistElements", this);
+ m_dumpCmd->SetGuidance(
+ "Dump NIST elements to file as GDML fragment, including lambda and X0.");
+ p = new G4UIparameter("Filename", 's', true);
+ p->SetDefaultValue("NistElements.xml");
+ m_dumpCmd->SetParameter(p);
+
+ // Check overlaps.
+ m_checkOverlapsCmd = new G4UIcommand("/lcdd/checkOverlaps",this);
+ m_checkOverlapsCmd->SetGuidance("Call CheckOverlaps on a given volume or the world volume (no arguments).");
+
+ p = new G4UIparameter("Volume",'s',true);
+ p->SetDefaultValue("");
+ m_checkOverlapsCmd->SetParameter(p);
+
+ // Check overlaps with recursion to daughters.
+ m_checkOverlapsRecurseCmd = new G4UIcommand("/lcdd/checkOverlapsRecurse",this);
+ m_checkOverlapsRecurseCmd->SetGuidance("Call CheckOverlaps on a given volume and recursively check daughters.");
+
+ p = new G4UIparameter("Volume",'s',true);
+ p->SetDefaultValue("");
+ m_checkOverlapsRecurseCmd->SetParameter(p);
}
lcdd/src/lcdd/core
diff -u -r1.2 -r1.3
--- LCDDParser.cc 1 Jul 2013 21:00:44 -0000 1.2
+++ LCDDParser.cc 2 Jul 2013 21:19:44 -0000 1.3
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/core/LCDDParser.cc,v 1.2 2013/07/01 21:00:44 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/core/LCDDParser.cc,v 1.3 2013/07/02 21:19:44 jeremy Exp $
// LCDD
#include "lcdd/core/LCDDParser.hh"
@@ -146,11 +146,6 @@
return m_version;
}
-void LCDDParser::setWorld(G4VPhysicalVolume *world)
-{
- m_world = world;
-}
-
bool LCDDParser::isValidSetup()
{
bool valid = true;
CVSspam 0.2.12