6 modified files
lcdd/include
diff -u -r1.1 -r1.2
--- DipoleType.hh 21 Apr 2006 23:50:52 -0000 1.1
+++ DipoleType.hh 5 May 2006 23:29:15 -0000 1.2
@@ -36,6 +36,11 @@
m_zmin = s;
}
+ void set_rmax(const std::string& s)
+ {
+ m_rmax = s;
+ }
+
const std::string& get_zmin() const
{
return m_zmin;
@@ -46,8 +51,10 @@
return m_zmax;
}
- void add_dipole_coeff()
- {}
+ const std::string& get_rmax() const
+ {
+ return m_rmax;
+ }
void add_content(const std::string& tag, SAXObject* so)
{
@@ -64,6 +71,7 @@
std::string m_zmax;
std::string m_zmin;
+ std::string m_rmax;
ContentSequence m_sequence;
};
lcdd/include
diff -u -r1.1 -r1.2
--- G4Dipole.hh 21 Apr 2006 23:50:52 -0000 1.1
+++ G4Dipole.hh 5 May 2006 23:29:15 -0000 1.2
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/G4Dipole.hh,v 1.1 2006/04/21 23:50:52 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/G4Dipole.hh,v 1.2 2006/05/05 23:29:15 jeremy Exp $
#ifndef G4Dipole_hh
#define G4Dipole_hh 1
@@ -23,6 +23,9 @@
void setZMax(double zmax);
double getZMax();
+ void setRMax(double rmax);
+ double getRMax();
+
void setZMin(double zmin);
double getZMin();
@@ -32,6 +35,7 @@
private:
double m_zmin;
double m_zmax;
+ double m_rmax;
std::vector<double> m_coeffs;
};
lcdd/schemas/lcdd/1.0
diff -u -r1.10 -r1.11
--- lcdd_fields.xsd 4 May 2006 21:32:53 -0000 1.10
+++ lcdd_fields.xsd 5 May 2006 23:29:15 -0000 1.11
@@ -85,6 +85,7 @@
</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>
lcdd/src
diff -u -r1.2 -r1.3
--- G4Dipole.cc 4 May 2006 22:22:18 -0000 1.2
+++ G4Dipole.cc 5 May 2006 23:29:16 -0000 1.3
@@ -1,8 +1,9 @@
-// $Header: /cvs/lcd/lcdd/src/G4Dipole.cc,v 1.2 2006/05/04 22:22:18 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/G4Dipole.cc,v 1.3 2006/05/05 23:29:16 jeremy Exp $
#include "G4Dipole.hh"
#include <iostream>
+#include <cmath>
/**
* Apply polynomial fit of dipole field, with variable number of coefficients
@@ -14,9 +15,10 @@
double bx = 0;
double z = Point[2];
+ 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) {
+ if (z > m_zmin && z < m_zmax && r < m_rmax) {
// Apply all coefficients to this z coordinate.
for (size_t i=0; i<m_coeffs.size(); ++i) {
@@ -50,6 +52,16 @@
return m_zmin;
}
+void G4Dipole::setRMax(double rmax)
+{
+ m_rmax = rmax;
+}
+
+double G4Dipole::getRMax()
+{
+ return m_rmax;
+}
+
void G4Dipole::addCoeff(double coeff)
{
m_coeffs.push_back(coeff);
lcdd/src
diff -u -r1.1 -r1.2
--- dipoleProcess.cc 21 Apr 2006 23:50:53 -0000 1.1
+++ dipoleProcess.cc 5 May 2006 23:29:16 -0000 1.2
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/dipoleProcess.cc,v 1.1 2006/04/21 23:50:53 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/dipoleProcess.cc,v 1.2 2006/05/05 23:29:16 jeremy Exp $
#ifndef dipoleProcess_hh
#define dipoleProcess_hh 1
@@ -44,6 +44,7 @@
d->set_funit(attrs.getValue("funit"));
d->set_zmax(attrs.getValue("zmax"));
d->set_zmin(attrs.getValue("zmin"));
+ d->set_rmax(attrs.getValue("rmax"));
m_obj = d;
*obj = d;
lcdd/src
diff -u -r1.1 -r1.2
--- dipoleSubscriber.cc 21 Apr 2006 23:50:53 -0000 1.1
+++ dipoleSubscriber.cc 5 May 2006 23:29:16 -0000 1.2
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/dipoleSubscriber.cc,v 1.1 2006/04/21 23:50:53 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/dipoleSubscriber.cc,v 1.2 2006/05/05 23:29:16 jeremy Exp $
#include "Saxana/SAXSubscriber.h"
#include "Saxana/SAXComponentFactory.h"
@@ -45,7 +45,7 @@
const dipole* d = dynamic_cast<const dipole*>(object);
if (d) {
- double zmin, zmax;
+ double zmin, zmax, rmax;
std::string lunit = d->get_lunit();
std::string funit = d->get_funit();
@@ -55,17 +55,23 @@
sval += "*" + lunit;
zmin = calc->Eval(sval);
- // Evalute zmax with lunit.
+ // Evaluate zmax with lunit.
sval = d->get_zmax();
sval += "*" + lunit;
zmax = calc->Eval(sval);
+ // Evaluate rmax with lunit.
+ sval = d->get_rmax();
+ sval += "*" + lunit;
+ rmax = calc->Eval(sval);
+
// Create the Geant4 dipole object.
G4Dipole* g4d = new G4Dipole();
// Set zmin and zmax.
g4d->setZMax(zmax);
g4d->setZMin(zmin);
+ g4d->setRMax(rmax);
// Add the dipole coefficients.
ContentSequence* seq = const_cast<ContentSequence*> (d->get_content());
@@ -79,7 +85,7 @@
g4d->addCoeff(calc->Eval(coeff->get_value()));
}
else {
- std::cerr << "dipoleSubscriber :: Activate - The element " << elem.tag << " is not a dipole_coeff!" << std::endl;
+ std::cerr << "dipoleSubscriber :: Activate - The child element " << elem.tag << " is not a dipole_coeff!" << std::endl;
}
}
CVSspam 0.2.8