6 #include "CLHEP/Units/GlobalSystemOfUnits.h" 7 #include "CLHEP/Units/SystemOfUnits.h" 21 #include "Math/GenVector/AxisAngle.h" 22 #include "Math/GenVector/Cartesian3D.h" 23 #include "Math/GenVector/DisplacementVector3D.h" 24 #include "Math/GenVector/Rotation3D.h" 25 #include "Math/GenVector/RotationZ.h" 45 eval.
set(ns,
"length",
"20.*m");
48 eval.
set(ns,
"corner",
"[length]/4.");
51 DDName worldName(
"world",ns);
53 DDName nitrogenName(
"Nitrogen",
"elements");
54 DDName oxygenName(
"Oxygen",
"elements");
57 eval.
eval(ns,
"[length]/2."),
58 eval.
eval(ns,
"[length]/2."));
73 eval.
eval(ns,
"14.007*g/mole"),
74 eval.
eval(ns,
"0.808*g/cm3") );
78 eval.
eval(ns,
"15.999*g/mole"),
79 eval.
eval(ns,
"1.43*g/cm3") );
116 cout <<
"main::initialize DDL parser" << endl;
119 cout <<
"main::about to set configuration" << endl;
123 eval.
eval(ns,
"[setup:corner]/4."),
124 eval.
eval(ns,
"[setup:corner]/8."),
125 eval.
eval(ns,
"[setup:corner]/4.")
128 eval.
eval(ns,
"[setup:corner]/16."),
129 eval.
eval(ns,
"[setup:corner]/16."),
130 eval.
eval(ns,
"[setup:corner]/16.")
134 DDName(
"Oxygen",
"elements"),
138 DDName(
"Nitrogen",
"elements"),
152 eval.
eval(ns,
"[setup:corner]/16."),
153 eval.
eval(ns,
"[setup:corner]/8.")
156 eval.
eval(ns,
"[setup:corner]*1.25*sin(0.)"),
159 eval.
eval(ns,
"[setup:corner]*1.25*sin(30.*deg)"),
162 eval.
eval(ns,
"[setup:corner]*1.25*sin(60.*deg)"),
165 eval.
eval(ns,
"[setup:corner]*1.25*sin(90.*deg)"),
185 os <<
"Starting Regressiontest Output" << endl;
188 cout <<
"main::initialize DDL parser" << endl;
191 cout <<
"main::about to set configuration" << endl;
193 cf.
readConfig(
"DetectorDescription/RegressionTest/test/configuration.xml");
195 cout <<
"main::about to start parsing" << endl;
199 cout <<
"main::completed Parser" << endl;
202 vector<DDTranslation> tvec;
204 std::cout <<
"Before the loop..." << std::endl;
206 ROOT::Math::AxisAngle ra(exv.
rotation());
211 os <<
" " << ra.Axis() << ra.Angle()/deg << endl;
216 vector<DDTranslation>::iterator it = tvec.begin();
217 os << endl <<
"center points of all solids" << endl;
218 for (; it != tvec.end(); ++it) {
219 os << (*it).x() <<
" " << (*it).y() <<
" " << (*it).z() << endl;
226 cout <<
"main:: initialize" << endl;
228 cout <<
"main::initialize DDL parser" << endl;
231 cout <<
"main::about to set configuration" << endl;
234 cf.
readConfig(
"DetectorDescription/RegressionTest/test/configuration.xml");
236 cout <<
"main::about to start parsing" << endl;
240 cout <<
"main::completed Parser" << endl;
242 cout << endl << endl <<
"main::Start checking!" << endl << endl;
247 cout <<
"main::PROBLEM:" << endl
253 std::cout <<
"rot asis\n" << rot << std::endl;
255 rot.GetComponents(x,y,z);
260 cout <<
"phiX=" << x.phi() <<
" or in degrees = " 261 << x.phi()/deg << endl;
262 cout <<
"thetaX=" << x.theta() <<
" or in degrees = " 263 << x.theta()/deg << endl;
264 cout <<
"phiY=" << y.phi() <<
" or in degrees = " 265 << y.phi()/deg << endl;
266 cout <<
"thetaY=" << y.theta() <<
" or in degrees = " 267 << y.theta()/deg << endl;
268 cout <<
"phiZ=" << z.phi() <<
" or in degrees = " 269 << z.phi()/deg << endl;
270 cout <<
"thetaZ=" << z.theta() <<
" or in degrees = " 271 << z.theta()/deg << endl;
273 cout <<
"some factor/equations..." << endl;
274 cout <<
" sin(thetaX()) * cos(phiX()) = " 275 <<
sin(x.theta()) *
cos(x.phi()) << endl;
282 ROOT::Math::AxisAngle aa(
DD3Vector(1.,1.,1.), 20.*deg);
284 cout <<
"DD3Vector was " <<
DD3Vector(1.,1.,1.) <<
" and the rotation was 20*deg around that axis." << endl;
289 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)
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.
int readConfig(const std::string &filename) override
Read in the configuration file.
Compact representation of the geometrical detector hierarchy.
A DDSolid represents the shape of a part.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
void regressionTest_setup(ClhepEvaluator &eval)
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()
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.
void regressionTest_first(ClhepEvaluator &eval)
DDLParser is the main class of Detector Description Language Parser.
FIPConfiguration reads in the configuration file for the DDParser.
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
void output(string filename)
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.