11 #include "CLHEP/Units/GlobalSystemOfUnits.h"
21 #include <Math/RotationZ.h>
22 #include <Math/AxisAngle.h>
43 eval.
set(ns,
"length",
"20.*m");
46 eval.
set(ns,
"corner",
"[length]/4.");
49 DDName worldName(
"world",ns);
51 DDName nitrogenName(
"Nitrogen",
"elements");
52 DDName oxygenName(
"Oxygen",
"elements");
55 eval.
eval(ns,
"[length]/2."),
56 eval.
eval(ns,
"[length]/2."));
71 eval.
eval(ns,
"14.007*g/mole"),
72 eval.
eval(ns,
"0.808*g/cm3") );
76 eval.
eval(ns,
"15.999*g/mole"),
77 eval.
eval(ns,
"1.43*g/cm3") );
114 cout <<
"main::initialize DDL parser" << endl;
117 cout <<
"main::about to set configuration" << endl;
122 eval.
eval(ns,
"[setup:corner]/4."),
123 eval.
eval(ns,
"[setup:corner]/8."),
124 eval.
eval(ns,
"[setup:corner]/4.")
127 eval.
eval(ns,
"[setup:corner]/16."),
128 eval.
eval(ns,
"[setup:corner]/16."),
129 eval.
eval(ns,
"[setup:corner]/16.")
133 DDName(
"Oxygen",
"elements"),
137 DDName(
"Nitrogen",
"elements"),
151 eval.
eval(ns,
"[setup:corner]/16."),
152 eval.
eval(ns,
"[setup:corner]/8.")
155 eval.
eval(ns,
"[setup:corner]*1.25*sin(0.)"),
158 eval.
eval(ns,
"[setup:corner]*1.25*sin(30.*deg)"),
161 eval.
eval(ns,
"[setup:corner]*1.25*sin(60.*deg)"),
164 eval.
eval(ns,
"[setup:corner]*1.25*sin(90.*deg)"),
184 os <<
"Starting Regressiontest Output" << endl;
187 cout <<
"main::initialize DDL parser" << endl;
190 cout <<
"main::about to set configuration" << endl;
192 cf.
readConfig(
"DetectorDescription/RegressionTest/test/configuration.xml");
194 cout <<
"main::about to start parsing" << endl;
198 cout <<
"main::completed Parser" << endl;
201 vector<DDTranslation> tvec;
203 std::cout <<
"Before the loop..." << std::endl;
205 ROOT::Math::AxisAngle ra(exv.
rotation());
210 os <<
" " << ra.Axis() << ra.Angle()/deg << endl;
215 vector<DDTranslation>::iterator it = tvec.begin();
216 os << endl <<
"center points of all solids" << endl;
217 for (; it != tvec.end(); ++it) {
218 os << (*it).x() <<
" " << (*it).y() <<
" " << (*it).z() << endl;
225 cout <<
"main:: initialize" << endl;
227 cout <<
"main::initialize DDL parser" << endl;
230 cout <<
"main::about to set configuration" << endl;
233 cf.
readConfig(
"DetectorDescription/RegressionTest/test/configuration.xml");
235 cout <<
"main::about to start parsing" << endl;
239 cout <<
"main::completed Parser" << endl;
241 cout << endl << endl <<
"main::Start checking!" << endl << endl;
246 cout <<
"main::PROBLEM:" << endl
252 std::cout <<
"rot asis\n" << rot << std::endl;
254 rot.GetComponents(x,y,z);
259 cout <<
"phiX=" << x.phi() <<
" or in degrees = "
260 << x.phi()/deg << endl;
261 cout <<
"thetaX=" << x.theta() <<
" or in degrees = "
262 << x.theta()/deg << endl;
263 cout <<
"phiY=" << y.phi() <<
" or in degrees = "
264 << y.phi()/deg << endl;
265 cout <<
"thetaY=" << y.theta() <<
" or in degrees = "
266 << y.theta()/deg << endl;
267 cout <<
"phiZ=" << z.phi() <<
" or in degrees = "
268 << z.phi()/deg << endl;
269 cout <<
"thetaZ=" << z.theta() <<
" or in degrees = "
270 << z.theta()/deg << endl;
272 cout <<
"some factor/equations..." << endl;
273 cout <<
" sin(thetaX()) * cos(phiX()) = "
274 <<
sin(x.theta()) *
cos(x.phi()) << endl;
281 ROOT::Math::AxisAngle aa(
DD3Vector(1.,1.,1.), 20.*deg);
283 cout <<
"DD3Vector was " <<
DD3Vector(1.,1.,1.) <<
" and the rotation was 20*deg around that axis." << endl;
288 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)
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.
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
type of data representation of DDCompactView
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.
T x() const
Cartesian x coordinate.
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)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Creates a box with side length 2*xHalf, 2*yHalf, 2*zHalf.
const DDTranslation & translation() const
The absolute translation of the current node.
DDLParser is the main class of Detector Description Language Parser.
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)
void set(const std::string &ns, const std::string &name, const std::string &exprValue)
double eval(const std::string &ns, const std::string &expr)
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.
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.