Print

Print


Commit in lcdd on MAIN
include/BoxDipoleType.hh+127added 1.1
       /G4BoxDipole.hh+44added 1.1
       /G4BoxField.hh+4added 1.1
       /box_dipole.hh+32added 1.1
schemas/lcdd/1.0/lcdd_fields.xsd+199-1691.11 -> 1.12
src/G4BoxDipole.cc+41added 1.1
   /box_dipoleProcess.cc+65added 1.1
   /box_dipoleSubscriber.cc+92added 1.1
   /LCDDLibLoad.cc+21.27 -> 1.28
+606-169
7 added + 2 modified, total 9 files
add box dipole type to LCDD

lcdd/include
BoxDipoleType.hh added at 1.1
diff -N BoxDipoleType.hh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ BoxDipoleType.hh	23 Jun 2011 21:04:09 -0000	1.1
@@ -0,0 +1,127 @@
+#ifndef LCDD_BOXDIPOLETYPE_HH
+#define LCDD_BOXDIPOLETYPE_HH 1
+
+#include "FieldType.hh"
+
+/**
+ * @class BoxDipoleType
+ * @brief This is a representation of the BoxDipoleType from the LCDD schema.
+ */
+class BoxDipoleType : public FieldType
+{
+
+    public:
+        
+        BoxDipoleType()
+        {}
+
+        virtual ~BoxDipoleType()
+        {}
+
+
+    public:
+
+        void set_x(const std::string& s)
+        {
+            _x = s;
+        }
+
+        void set_y(const std::string& s)
+        {
+            _y = s;
+        }
+
+        void set_z(const std::string& s)
+        {
+            _z = s;
+        }
+
+        void set_dx(const std::string& s)
+        {
+            _dx = s;
+        }
+
+        void set_dy(const std::string& s)
+        {
+            _dy = s;
+        }
+
+        void set_dz(const std::string& s)
+        {
+            _dz = s;
+        }
+
+        void set_bx(const std::string& s)
+        {
+            _bx = s;
+        }
+
+        void set_by(const std::string& s)
+        {
+            _by = s;
+        }
+
+        void set_bz(const std::string& s)
+        {
+            _bz = s;
+        }
+
+        const std::string& get_x() const
+        {
+            return _x;
+        }
+
+        const std::string& get_y() const
+        {
+            return _y;
+        }
+
+        const std::string& get_z() const
+        {
+            return _z;
+        }
+
+        const std::string& get_dx() const
+        {
+            return _dx;
+        }
+
+        const std::string& get_dy() const
+        {
+            return _dy;
+        }
+
+        const std::string& get_dz() const
+        {
+            return _dz;
+        }
+
+        const std::string& get_bx() const
+        {
+            return _bx;
+        }
+
+        const std::string& get_by() const
+        {
+            return _by;
+        }
+
+        const std::string& get_bz() const
+        {
+            return _bz;
+        }        
+
+    private:
+
+        std::string _x;
+        std::string _y;
+        std::string _z;
+        std::string _dx;
+        std::string _dy;
+        std::string _dz;
+        std::string _bx;
+        std::string _by;
+        std::string _bz;
+};
+
+#endif

lcdd/include
G4BoxDipole.hh added at 1.1
diff -N G4BoxDipole.hh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ G4BoxDipole.hh	23 Jun 2011 21:04:10 -0000	1.1
@@ -0,0 +1,44 @@
+#ifndef LCDD_G4BOXDIPOLE_HH
+#define LCDD_G4BOXDIPOLE_HH 1
+
+#include "G4MagneticField.hh"
+
+class G4BoxDipole : public G4MagneticField
+{
+    public:
+
+        G4BoxDipole(double x, 
+                    double y, 
+                    double z, 
+                    double dx,
+                    double dy,
+                    double dz,
+                    double bx,
+                    double by,
+                    double bz);
+
+        virtual ~G4BoxDipole() {;}
+
+        void GetFieldValue(const double point[3], double *bfield) const;
+
+    private:
+
+        double _x;
+        double _y;
+        double _z;
+        double _dx;
+        double _dy;
+        double _dz;
+        double _bx;
+        double _by;
+        double _bz;
+
+        double _maxx;
+        double _maxy;
+        double _maxz;
+        double _minx;
+        double _miny;
+        double _minz;
+};
+
+#endif

lcdd/include
G4BoxField.hh added at 1.1
diff -N G4BoxField.hh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ G4BoxField.hh	23 Jun 2011 21:04:10 -0000	1.1
@@ -0,0 +1,4 @@
+class G4BoxField
+{
+
+};

lcdd/include
box_dipole.hh added at 1.1
diff -N box_dipole.hh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ box_dipole.hh	23 Jun 2011 21:04:10 -0000	1.1
@@ -0,0 +1,32 @@
+// $Id: box_dipole.hh,v 1.1 2011/06/23 21:04:10 jeremy Exp $
+#ifndef LCDD_BOX_DIPOLE_HH
+#define LCDD_BOX_DIPOLE_HH 1
+
+// LCDD
+#include "BoxDipoleType.hh"
+
+// GDML
+#include "Saxana/SAXObject.h"
+
+/**
+ * @class box_dipole
+ * @brief A representation of the box_dipole class from the LCDD schema.
+ */
+class box_dipole : public SAXObject, public BoxDipoleType
+{
+
+    public:
+
+        box_dipole()
+        {}
+
+        virtual ~box_dipole()
+        {}
+
+        virtual SAXObject::Type type()
+        {
+            return SAXObject::element;
+        }
+};
+
+#endif

lcdd/schemas/lcdd/1.0
lcdd_fields.xsd 1.11 -> 1.12
diff -u -r1.11 -r1.12
--- lcdd_fields.xsd	5 May 2006 23:29:15 -0000	1.11
+++ lcdd_fields.xsd	23 Jun 2011 21:04:10 -0000	1.12
@@ -7,173 +7,203 @@
 	   xmlns:lcdd="http://www.lcsim.org/schemas/lcdd/1.0/"
 	   xmlns:xs="http://www.w3.org/2001/XMLSchema">
 
-  <xs:complexType name="FieldsType">
-    <xs:annotation>
-      <xs:documentation>
-      </xs:documentation>
-    </xs:annotation>
-    <xs:sequence>
-      <xs:element minOccurs="0" maxOccurs="unbounded" ref="field" />
-      <xs:element name="global_field" minOccurs="0" maxOccurs="1" type="GlobalFieldType" />
-    </xs:sequence>
-  </xs:complexType>
-
-  <xs:element name="fields" type="FieldsType">
-  </xs:element>
-
-  <xs:complexType name="GlobalFieldType">
-    <xs:annotation>
-      <xs:documentation>
-      </xs:documentation>
-    </xs:annotation>
-    <xs:sequence>
-      <xs:element name="fieldref" minOccurs="1" maxOccurs="unbounded" type="ReferenceType" />
-    </xs:sequence>
-  </xs:complexType>
-
-  <xs:complexType name="FieldType">
-    <xs:attribute name="name" type="xs:ID"/>
-    <xs:attribute default="tesla" name="funit" type="xs:string"/>
-    <xs:attribute default="mm" name="lunit" type="xs:string" />
-  </xs:complexType>
-
-  <xs:element name="field" type="FieldType">
-  </xs:element>
-
-  <xs:complexType name="SolenoidType">
-    <xs:annotation>
-      <xs:documentation>
-	Solenoid with z min/max, radius min/max, strength
-	and units.  lunit is for z and radius (mm). funit is
-	the unit for the field strength (Tesla).
-      </xs:documentation>
-    </xs:annotation>
-    <xs:complexContent>
-      <xs:extension base="FieldType">
-	<xs:attribute name="inner_field" type="xs:string" />
-	<xs:attribute name="outer_field" type="xs:string" />
-	<xs:attribute name="zmin" type="xs:string" />
-	<xs:attribute name="zmax" type="xs:string" />
-	<xs:attribute name="inner_radius" type="xs:string" />
-	<xs:attribute name="outer_radius" type="xs:string" />
-      </xs:extension>
-    </xs:complexContent>
-  </xs:complexType>
-
-  <xs:element name="solenoid" substitutionGroup="field" type="SolenoidType">
-    <xs:annotation>
-      <xs:documentation>
-	Solenoidal field element
-      </xs:documentation>
-    </xs:annotation>
-  </xs:element>
-
-  <xs:complexType name="DipoleType">
-   <xs:annotation>
-      <xs:documentation>
-	Dipole field using simple polynomial fit with a variable number of coefficients.
-      </xs:documentation>
-    </xs:annotation>
-    <xs:complexContent>
-      <xs:extension base="FieldType">
-	<xs:sequence>
-	  <xs:element name="dipole_coeff" minOccurs="1" maxOccurs="unbounded">
-	    <xs:complexType>
-	      <xs:attribute name="value" type="xs:double" use="required"/>
-	    </xs:complexType>
-	  </xs:element>
-	</xs:sequence>
-	<xs:attribute name="zmin" type="xs:double" />
-	<xs:attribute name="zmax" type="xs:double" />
-	<xs:attribute name="rmax" type="xs:double" />
-      </xs:extension>
-    </xs:complexContent>
-  </xs:complexType>
-
-  <xs:element name="dipole" substitutionGroup="field" type="DipoleType">
-    <xs:annotation>
-      <xs:documentation>
-	Dipole field element.
-      </xs:documentation>
-    </xs:annotation>
-  </xs:element>
-
-  <xs:complexType name="FieldMapType">
-    <xs:annotation>
-      <xs:documentation>
-      </xs:documentation>
-    </xs:annotation>
-    <xs:complexContent>
-      <xs:extension base="FieldType">
-      </xs:extension>
-    </xs:complexContent>
-  </xs:complexType>
-
-  <xs:complexType name="RZBType">
-    <xs:annotation>
-      <xs:documentation>
-      </xs:documentation>
-    </xs:annotation>
-    <xs:attribute name="r" type="xs:double"/>
-    <xs:attribute name="z" type="xs:double"/>
-    <xs:attribute name="Br" type="xs:double"/>
-    <xs:attribute name="Bz" type="xs:double"/>
-  </xs:complexType>
-
-  <xs:complexType name="RZFieldMapType">
-    <xs:annotation>
-      <xs:documentation>
-      </xs:documentation>
-    </xs:annotation>
-    <xs:complexContent>
-      <xs:extension base="FieldMapType">
-
-	<xs:sequence>
-	  <xs:element name="rzB" type="RZBType" minOccurs="2" maxOccurs="unbounded" />
-	</xs:sequence>
-
-	<xs:attribute name="num_bins_r">
-	  <xs:simpleType>
-	    <xs:restriction base="xs:integer">
-	      <xs:minInclusive value="2"/>
-	    </xs:restriction>
-	  </xs:simpleType>
-	</xs:attribute>
-
-	<xs:attribute name="num_bins_z">
-	  <xs:simpleType>
-	    <xs:restriction base="xs:integer">
-	      <xs:minInclusive value="2"/>
-	    </xs:restriction>
-	  </xs:simpleType>
-	</xs:attribute>
-
-	<xs:attribute name="grid_size_r">
-	  <xs:simpleType>
-	    <xs:restriction base="xs:double">
-	      <xs:minExclusive value="0"/>
-	    </xs:restriction>
-	  </xs:simpleType>
-	</xs:attribute>
-
-	<xs:attribute name="grid_size_z">
-	  <xs:simpleType>
-	    <xs:restriction base="xs:double">
-	      <xs:minExclusive value="0"/>
-	    </xs:restriction>
-	  </xs:simpleType>
-	</xs:attribute>
-
-      </xs:extension>
-    </xs:complexContent>
-  </xs:complexType>
-
-  <xs:element name="rz_field_map" substitutionGroup="field" type="RZFieldMapType">
-    <xs:annotation>
-      <xs:documentation>
-	An RZ field map element.
-      </xs:documentation>
-    </xs:annotation>
-  </xs:element>
-
+    <xs:complexType name="FieldsType">
+        <xs:annotation>
+            <xs:documentation>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="field" />
+            <xs:element name="global_field" minOccurs="0" maxOccurs="1" type="GlobalFieldType" />
+        </xs:sequence>
+    </xs:complexType>
+    
+    <xs:element name="fields" type="FieldsType">
+    </xs:element>
+    
+    <xs:complexType name="GlobalFieldType">
+        <xs:annotation>
+            <xs:documentation>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="fieldref" minOccurs="1" maxOccurs="unbounded" type="ReferenceType" />
+        </xs:sequence>
+    </xs:complexType>
+    
+    <xs:complexType name="FieldType">
+        <xs:attribute name="name" type="xs:ID"/>
+        <xs:attribute default="tesla" name="funit" type="xs:string"/>
+        <xs:attribute default="mm" name="lunit" type="xs:string" />
+    </xs:complexType>
+    
+    <xs:element name="field" type="FieldType">
+    </xs:element>
+    
+    <xs:complexType name="SolenoidType">
+        <xs:annotation>
+            <xs:documentation>
+                Solenoid with z min/max, radius min/max, strength
+                and units.  lunit is for z and radius (mm). funit is
+                the unit for the field strength (Tesla).
+            </xs:documentation>
+        </xs:annotation>
+        <xs:complexContent>
+            <xs:extension base="FieldType">
+                <xs:attribute name="inner_field" type="xs:string" />
+                <xs:attribute name="outer_field" type="xs:string" />
+                <xs:attribute name="zmin" type="xs:string" />
+                <xs:attribute name="zmax" type="xs:string" />
+                <xs:attribute name="inner_radius" type="xs:string" />
+                <xs:attribute name="outer_radius" type="xs:string" />
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+    
+    <xs:element name="solenoid" substitutionGroup="field" type="SolenoidType">
+        <xs:annotation>
+            <xs:documentation>
+                Solenoidal field element
+            </xs:documentation>
+        </xs:annotation>
+    </xs:element>
+    
+    <xs:complexType name="DipoleType">
+        <xs:annotation>
+            <xs:documentation>
+                Dipole field using simple polynomial fit with a variable number of coefficients.
+            </xs:documentation>
+        </xs:annotation>
+        <xs:complexContent>
+            <xs:extension base="FieldType">
+                <xs:sequence>
+                    <xs:element name="dipole_coeff" minOccurs="1" maxOccurs="unbounded">
+                        <xs:complexType>
+                            <xs:attribute name="value" type="xs:double" use="required"/>
+                        </xs:complexType>
+                    </xs:element>
+                </xs:sequence>
+                <xs:attribute name="zmin" type="xs:double" />
+                <xs:attribute name="zmax" type="xs:double" />
+                <xs:attribute name="rmax" type="xs:double" />
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+    
+    <xs:element name="dipole" substitutionGroup="field" type="DipoleType">
+        <xs:annotation>
+            <xs:documentation>
+                Dipole field element.
+            </xs:documentation>
+        </xs:annotation>
+    </xs:element>
+    
+    <xs:complexType name="FieldMapType">
+        <xs:annotation>
+            <xs:documentation>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:complexContent>
+            <xs:extension base="FieldType">
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+    
+    <xs:complexType name="RZBType">
+        <xs:annotation>
+            <xs:documentation>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="r" type="xs:double"/>
+        <xs:attribute name="z" type="xs:double"/>
+        <xs:attribute name="Br" type="xs:double"/>
+        <xs:attribute name="Bz" type="xs:double"/>
+    </xs:complexType>
+
+    <xs:complexType name="RZFieldMapType">
+        <xs:annotation>
+            <xs:documentation>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:complexContent>
+            <xs:extension base="FieldMapType">
+
+                <xs:sequence>
+                    <xs:element name="rzB" type="RZBType" minOccurs="2" maxOccurs="unbounded" />
+                </xs:sequence>
+                
+                <xs:attribute name="num_bins_r">
+                    <xs:simpleType>
+                        <xs:restriction base="xs:integer">
+                            <xs:minInclusive value="2"/>
+                        </xs:restriction>
+                    </xs:simpleType>
+                </xs:attribute>
+                
+                <xs:attribute name="num_bins_z">
+                    <xs:simpleType>
+                        <xs:restriction base="xs:integer">
+                            <xs:minInclusive value="2"/>
+                        </xs:restriction>
+                    </xs:simpleType>
+                </xs:attribute>
+                
+                <xs:attribute name="grid_size_r">
+                    <xs:simpleType>
+                        <xs:restriction base="xs:double">
+                            <xs:minExclusive value="0"/>
+                        </xs:restriction>
+                    </xs:simpleType>
+                </xs:attribute>
+                
+                <xs:attribute name="grid_size_z">
+                    <xs:simpleType>
+                        <xs:restriction base="xs:double">
+                            <xs:minExclusive value="0"/>
+                        </xs:restriction>
+                    </xs:simpleType>
+                </xs:attribute>
+                
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+    
+    <xs:element name="rz_field_map" substitutionGroup="field" type="RZFieldMapType">
+        <xs:annotation>
+            <xs:documentation>
+                An RZ field map element.
+            </xs:documentation>
+        </xs:annotation>
+    </xs:element>
+
+
+    <xs:complexType name="BoxDipoleType">
+        <xs:annotation>
+            <xs:documentation>
+                A simple generic dipole field with settable B-field in x, y, and z, within a positioned box region.
+            </xs:documentation>
+        </xs:annotation>
+        <xs:complexContent>
+            <xs:extension base="FieldType">
+                <xs:attribute name="dx" type="xs:double" use="required" />
+                <xs:attribute name="dy" type="xs:double" use="required" />
+                <xs:attribute name="dz" type="xs:double" use="required" />
+                <xs:attribute name="x" type="xs:double" use="optional" default="0.0" />
+                <xs:attribute name="y" type="xs:double" use="optional" default="0.0" />
+                <xs:attribute name="z" type="xs:double" use="optional" default="0.0" />
+                <xs:attribute name="bx" type="xs:double" use="optional" default="0.0" />
+                <xs:attribute name="by" type="xs:double" use="optional" default="0.0" />
+                <xs:attribute name="bz" type="xs:double" use="optional" default="0.0" />
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+
+    <xs:element name="box_dipole" substitutionGroup="field" type="BoxDipoleType">
+        <xs:annotation>
+            <xs:documentation>
+                A box dipole element.
+            </xs:documentation>
+        </xs:annotation>
+    </xs:element>    
+    
 </xs:schema>
\ No newline at end of file

lcdd/src
G4BoxDipole.cc added at 1.1
diff -N G4BoxDipole.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ G4BoxDipole.cc	23 Jun 2011 21:04:10 -0000	1.1
@@ -0,0 +1,41 @@
+// $Id: G4BoxDipole.cc,v 1.1 2011/06/23 21:04:10 jeremy Exp $
+
+#include "G4BoxDipole.hh"
+
+//#include <iostream>
+
+G4BoxDipole::G4BoxDipole(double x, 
+                         double y, 
+                         double z, 
+                         double dx,
+                         double dy,
+                         double dz,
+                         double bx,
+                         double by,
+                         double bz)
+    : _x(x), _y(y), _z(z), _dx(dx), _dy(dy), _dz(dz), _bx(bx), _by(by), _bz(bz)
+{
+    _maxx = x + dx;
+    _maxy = y + dy;
+    _maxz = z + dz;
+  
+    _minx = x - dx;
+    _miny = y - dy;
+    _minz = z - dz;
+}
+
+void G4BoxDipole::GetFieldValue(const double point[3], double* bfield) const
+{
+    if (point[0] < _minx || point[0] > _maxx)
+        return;
+    if (point[1] < _miny || point[1] > _maxy)
+        return;
+    if (point[2] < _minz || point[2] > _maxz)
+        return;
+
+    bfield[0] += _bx;
+    bfield[1] += _by;
+    bfield[2] += _bz;
+
+    //std::cout << point[0] << ", " << point[1] << ", " << point[2] << " --> " << bfield[0] << ", " << bfield[1] << ", " << bfield[2] << std::endl;
+}

lcdd/src
box_dipoleProcess.cc added at 1.1
diff -N box_dipoleProcess.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ box_dipoleProcess.cc	23 Jun 2011 21:04:10 -0000	1.1
@@ -0,0 +1,65 @@
+#include "Saxana/ProcessingConfigurator.h"
+#include "Saxana/ProcessingContext.h"
+#include "Saxana/SAXProcessor.h"
+#include "Saxana/StateStack.h"
+#include "Saxana/SAXProcessingState.h"
+#include "Saxana/SAXStateProcess.h"
+#include "Saxana/SAXComponentFactory.h"
+
+#include "box_dipole.hh"
+#include "FieldTypeProcess.hh"
+
+#include <iostream>
+
+class box_dipoleProcess : public FieldTypeProcess
+{
+    public:
+
+        box_dipoleProcess(const ProcessingContext* context = 0)
+            : FieldTypeProcess(context)
+        {}
+
+        virtual ~box_dipoleProcess()
+        {}
+
+        void StartElement(const std::string& name, const ASCIIAttributeList& attrs)
+        {
+            SAXObject** obj = Context()->GetTopObject();
+
+            box_dipole* x = new box_dipole;
+
+            x->set_x(attrs.getValue("x"));
+            x->set_y(attrs.getValue("y"));
+            x->set_z(attrs.getValue("z"));
+            x->set_dx(attrs.getValue("dx"));
+            x->set_dy(attrs.getValue("dy"));
+            x->set_dz(attrs.getValue("dz"));
+            x->set_bx(attrs.getValue("bx"));
+            x->set_by(attrs.getValue("by"));
+            x->set_bz(attrs.getValue("bz"));
+
+            m_obj = x;
+            *obj = x;
+
+            FieldTypeProcess::StartElement(name, attrs);
+        }
+
+        void EndElement(const std::string&)
+        {}
+
+        void Characters(const std::string&)
+        {}
+
+        void StackPopNotify(const std::string&)
+        {}
+
+        const std::string& State() const
+        {
+            static std::string tag = "box_dipole";
+            return tag;
+        }                
+};
+
+DECLARE_PROCESS_FACTORY(box_dipoleProcess)
+
+

lcdd/src
box_dipoleSubscriber.cc added at 1.1
diff -N box_dipoleSubscriber.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ box_dipoleSubscriber.cc	23 Jun 2011 21:04:10 -0000	1.1
@@ -0,0 +1,92 @@
+#include "Saxana/SAXSubscriber.h"
+#include "Saxana/SAXComponentFactory.h"
+
+#include "G4Processor/GDMLProcessor.h"
+#include "G4Evaluator/GDMLExpressionEvaluator.h"
+
+// lcdd  
+#include "LCDDProcessor.hh"
+#include "G4BoxDipole.hh"
+
+// element 
+#include "box_dipole.hh"
+
+class box_dipoleSubscriber : virtual public SAXSubscriber
+{
+
+    public:
+
+        virtual const SAXComponentObject* Build() const
+        {
+            return this;
+        }
+
+    public:
+
+        box_dipoleSubscriber()
+        {
+            Subscribe("box_dipole");
+        }
+
+        virtual ~box_dipoleSubscriber()
+        {}
+
+        virtual void Activate(const SAXObject* object)
+        {
+            GDMLExpressionEvaluator* calc = GDMLProcessor::GetInstance()->GetEvaluator();
+
+            if (object != 0)
+            {
+                const box_dipole* dipoleElement = dynamic_cast<const box_dipole*>(object);
+
+                double x, y, z, dx, dy, dz, bx, by, bz;
+                x = y = z = dx = dy = dz = bx = by = bz = 0;
+
+                std::string lunit = dipoleElement->get_lunit();
+                std::string funit = dipoleElement->get_funit();
+
+                std::string val = dipoleElement->get_x();
+                val += "*" + lunit;
+                x = calc->Eval(val);
+
+                val = dipoleElement->get_y();
+                val += "*" + lunit;
+                y = calc->Eval(val);
+
+                val = dipoleElement->get_z();
+                val += "*" + lunit;
+                z = calc->Eval(val);
+
+                val = dipoleElement->get_dx();
+                val += "*" + lunit;
+                dx = calc->Eval(val);
+
+                val = dipoleElement->get_dy();
+                val += "*" + lunit;
+                dy = calc->Eval(val);
+
+                val = dipoleElement->get_dz();
+                val += "*" + lunit;
+                dz = calc->Eval(val);
+
+                val = dipoleElement->get_bx();
+                val += "*" + funit;
+                bx = calc->Eval(val);
+
+                val = dipoleElement->get_by();
+                val += "*" + funit;
+                by = calc->Eval(val);
+
+                val = dipoleElement->get_bz();
+                val += "*" + funit;
+                bz = calc->Eval(val);                
+                
+                G4BoxDipole* boxDipole = new G4BoxDipole(x, y, z, dx, dy, dz, bx, by, bz);
+
+                std::string fieldName = dipoleElement->get_name();
+                LCDDProcessor::instance()->addMagneticField(fieldName, boxDipole);
+            }
+        }
+};
+
+DECLARE_SUBSCRIBER_FACTORY(box_dipoleSubscriber)

lcdd/src
LCDDLibLoad.cc 1.27 -> 1.28
diff -u -r1.27 -r1.28
--- LCDDLibLoad.cc	7 Dec 2010 00:52:00 -0000	1.27
+++ LCDDLibLoad.cc	23 Jun 2011 21:04:10 -0000	1.28
@@ -45,6 +45,7 @@
     LOAD_COMPONENT(rzbProcess);
     LOAD_COMPONENT(dipoleProcess);
     LOAD_COMPONENT(dipole_coeffProcess);
+    LOAD_COMPONENT(box_dipoleProcess);
  
     // region
     LOAD_COMPONENT(regionProcess);
@@ -83,6 +84,7 @@
     LOAD_COMPONENT(solenoidSubscriber);
     LOAD_COMPONENT(rz_field_mapSubscriber);
     LOAD_COMPONENT(dipoleSubscriber);
+    LOAD_COMPONENT(box_dipoleSubscriber);
     LOAD_COMPONENT(global_fieldSubscriber);
 
     // region
CVSspam 0.2.8