13 #include "CLHEP/Units/GlobalSystemOfUnits.h"
24 #include <Math/RotationZ.h>
25 #include <Math/AxisAngle.h>
44 eval.
set(ns,
"length",
"20.*m");
47 eval.
set(ns,
"corner",
"[length]/4.");
50 DDName worldName(
"world",ns);
52 DDName nitrogenName(
"Nitrogen",
"elements");
53 DDName oxygenName(
"Oxygen",
"elements");
56 eval.
eval(ns,
"[length]/2."),
57 eval.
eval(ns,
"[length]/2."));
72 eval.
eval(ns,
"14.007*g/mole"),
73 eval.
eval(ns,
"0.808*g/cm3") );
77 eval.
eval(ns,
"15.999*g/mole"),
78 eval.
eval(ns,
"1.43*g/cm3") );
116 cout <<
"main::initialize DDL parser" << endl;
119 cout <<
"main::about to set configuration" << endl;
124 eval.
eval(ns,
"[setup:corner]/4."),
125 eval.
eval(ns,
"[setup:corner]/8."),
126 eval.
eval(ns,
"[setup:corner]/4.")
129 eval.
eval(ns,
"[setup:corner]/16."),
130 eval.
eval(ns,
"[setup:corner]/16."),
131 eval.
eval(ns,
"[setup:corner]/16.")
135 DDName(
"Oxygen",
"elements"),
139 DDName(
"Nitrogen",
"elements"),
153 eval.
eval(ns,
"[setup:corner]/16."),
154 eval.
eval(ns,
"[setup:corner]/8.")
157 eval.
eval(ns,
"[setup:corner]*1.25*sin(0.)"),
160 eval.
eval(ns,
"[setup:corner]*1.25*sin(30.*deg)"),
163 eval.
eval(ns,
"[setup:corner]*1.25*sin(60.*deg)"),
166 eval.
eval(ns,
"[setup:corner]*1.25*sin(90.*deg)"),
169 cpv.
position(sensorLP, supportLP, std::string(
"1"), t1, unit);
170 cpv.
position(supportLP, part, std::string(
"1"), t2, unit);
171 cpv.
position(supportLP, part, std::string(
"2"), t3, r30);
172 cpv.
position(supportLP, part, std::string(
"3"), t4, r60);
173 cpv.
position(supportLP, part, std::string(
"4"), t5, r90);
178 cpv.
position(part, ws, std::string(
"1"), t0, rw);
186 os <<
"Starting Regressiontest Output" << endl;
190 cout <<
"main::initialize DDL parser" << endl;
193 cout <<
"main::about to set configuration" << endl;
196 cf.
readConfig(
"DetectorDescription/RegressionTest/test/configuration.xml");
198 cout <<
"main::about to start parsing" << endl;
202 cout <<
"main::completed Parser" << endl;
205 vector<DDTranslation> tvec;
207 std::cout <<
"Before the loop..." << std::endl;
209 ROOT::Math::AxisAngle ra(exv.
rotation());
214 os <<
" " << ra.Axis() << ra.Angle()/deg << endl;
219 vector<DDTranslation>::iterator it = tvec.begin();
220 os << endl <<
"center points of all solids" << endl;
221 for (; it != tvec.end(); ++it) {
222 os << (*it).x() <<
" " << (*it).y() <<
" " << (*it).z() << endl;
229 cout <<
"main:: initialize" << endl;
232 cout <<
"main::initialize DDL parser" << endl;
235 cout <<
"main::about to set configuration" << endl;
238 cf.
readConfig(
"DetectorDescription/RegressionTest/test/configuration.xml");
240 cout <<
"main::about to start parsing" << endl;
244 cout <<
"main::completed Parser" << endl;
246 cout << endl << endl <<
"main::Start checking!" << endl << endl;
251 cout <<
"main::PROBLEM:" << endl
257 std::cout <<
"rot asis\n" << rot << std::endl;
263 cout <<
"phiX=" << x.phi() <<
" or in degrees = "
264 << x.phi()/deg << endl;
265 cout <<
"thetaX=" << x.theta() <<
" or in degrees = "
266 << x.theta()/deg << endl;
267 cout <<
"phiY=" << y.phi() <<
" or in degrees = "
268 << y.phi()/deg << endl;
269 cout <<
"thetaY=" << y.theta() <<
" or in degrees = "
270 << y.theta()/deg << endl;
271 cout <<
"phiZ=" << z.phi() <<
" or in degrees = "
272 << z.phi()/deg << endl;
273 cout <<
"thetaZ=" << z.theta() <<
" or in degrees = "
274 << z.theta()/deg << endl;
276 cout <<
"some factor/equations..." << endl;
277 cout <<
" sin(thetaX()) * cos(phiX()) = "
278 <<
sin(x.theta()) *
cos(x.phi()) << endl;
286 ROOT::Math::AxisAngle aa(
DD3Vector(1.,1.,1.), 20.*deg);
288 cout <<
"DD3Vector was " <<
DD3Vector(1.,1.,1.) <<
" and the rotation was 20*deg around that axis." << endl;
293 cout <<
"(1,0,0, 0,-1,0, 0,0,1)" << endl;
bool next()
set current node to the next node in the expanded tree
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
int parse(const DDLDocumentProvider &dp)
Parse all files. Return is meaningless.
DDMaterial is used to define and access material information.
Sin< T >::type sin(const T &t)
An exception for DDD errors.
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
virtual void set(const std::string &ns, const std::string &name, const std::string &valueExpr)=0
put a new variable named 'namespace:name' into the dictionary of the evaluator
type of data representation of DDCompactView
const DDMaterial & material() const
Returns a reference object of the material this LogicalPart is made of.
void regressionTest_first()
A DDSolid represents the shape of a part.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
void printRot(const DDRotationMatrix &rot)
int addMaterial(const DDMaterial &m, double fm)
adds a material to the mixture proportional to its fraction-mass fm.
static value_type & instance()
void regressionTest_setup()
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Cos< T >::type cos(const T &t)
Interface of an Expression Evaluator.
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
const DDTranslation & translation() const
The absolute translation of the current node.
DDLParser is the main class of Detector Description Language Parser.
virtual double eval(const std::string &ns, const std::string &expr)=0
evaluate an expression expr inside the local namespace
FIPConfiguration reads in the configuration file for the DDParser.
int readConfig(const std::string &filename)
Read in the configuration file.
static DDSolid shapeless(const DDName &name)
const DDSolid & solid() const
Returns a reference object of the solid being the shape of this LogicalPart.
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.
Provides an exploded view of the detector (tree-view)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.