20 #include "Math/GenVector/AxisAngle.h" 21 #include "Math/GenVector/Cartesian3D.h" 22 #include "Math/GenVector/DisplacementVector3D.h" 23 #include "Math/GenVector/Rotation3D.h" 24 #include "Math/GenVector/RotationZ.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 worldName, eval.
eval(ns,
"[length]/2."), eval.
eval(ns,
"[length]/2."), 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"));
82 std::unique_ptr<DDRotationMatrix> r0 = std::make_unique<DDRotationMatrix>();
83 std::unique_ptr<DDRotationMatrix> r30 = std::make_unique<DDRotationMatrix>(ROOT::Math::RotationZ(30._deg));
84 std::unique_ptr<DDRotationMatrix> r60 = std::make_unique<DDRotationMatrix>(ROOT::Math::RotationZ(60._deg));
85 std::unique_ptr<DDRotationMatrix> r90 = std::make_unique<DDRotationMatrix>(ROOT::Math::RotationZ(90._deg));
114 cout <<
"main::initialize DDL parser" << endl;
117 cout <<
"main::about to set configuration" << endl;
121 eval.
eval(ns,
"[setup:corner]/4."),
122 eval.
eval(ns,
"[setup:corner]/8."),
123 eval.
eval(ns,
"[setup:corner]/4."));
125 eval.
eval(ns,
"[setup:corner]/16."),
126 eval.
eval(ns,
"[setup:corner]/16."),
127 eval.
eval(ns,
"[setup:corner]/16."));
130 DDName(
"Oxygen",
"elements"),
143 eval.
eval(ns,
"[setup:corner]/8."), eval.
eval(ns,
"[setup:corner]/16."), eval.
eval(ns,
"[setup:corner]/8."));
145 eval.
eval(ns,
"[setup:corner]*1.25*cos(0.)"), eval.
eval(ns,
"[setup:corner]*1.25*sin(0.)"), eval.
eval(ns,
"0."));
147 eval.
eval(ns,
"[setup:corner]*1.25*sin(30.*deg)"),
148 eval.
eval(ns,
"0."));
150 eval.
eval(ns,
"[setup:corner]*1.25*sin(60.*deg)"),
151 eval.
eval(ns,
"0."));
153 eval.
eval(ns,
"[setup:corner]*1.25*sin(90.*deg)"),
154 eval.
eval(ns,
"0."));
162 std::unique_ptr<DDRotationMatrix>
rm =
163 std::make_unique<DDRotationMatrix>(ROOT::Math::AxisAngle(
DD3Vector(1., 1., 1.), 20._deg));
172 os <<
"Starting Regressiontest Output" << endl;
175 cout <<
"main::initialize DDL parser" << endl;
178 cout <<
"main::about to set configuration" << endl;
180 cf.
readConfig(
"DetectorDescription/RegressionTest/test/configuration.xml");
182 cout <<
"main::about to start parsing" << endl;
186 cout <<
"main::completed Parser" << endl;
189 vector<DDTranslation> tvec;
191 std::cout <<
"Before the loop..." << std::endl;
193 ROOT::Math::AxisAngle ra(exv.
rotation());
203 vector<DDTranslation>::iterator
it = tvec.begin();
204 os << endl <<
"center points of all solids" << endl;
205 for (;
it != tvec.end(); ++
it) {
206 os << (*it).x() <<
" " << (*it).y() <<
" " << (*it).z() << endl;
212 cout <<
"main:: initialize" << endl;
214 cout <<
"main::initialize DDL parser" << endl;
217 cout <<
"main::about to set configuration" << endl;
220 cf.
readConfig(
"DetectorDescription/RegressionTest/test/configuration.xml");
222 cout <<
"main::about to start parsing" << endl;
226 cout <<
"main::completed Parser" << endl;
228 cout << endl << endl <<
"main::Start checking!" << endl << endl;
231 cout <<
"main::PROBLEM:" << endl <<
" " <<
e << endl;
238 rot.GetComponents(
x, y, z);
239 std::cout <<
"components\n" <<
x <<
"\n" << y <<
"\n" << z << std::endl;
243 cout <<
"thetaY=" << y.theta() <<
" or in degrees = " <<
convertRadToDeg(y.theta()) << endl;
245 cout <<
"thetaZ=" << z.theta() <<
" or in degrees = " <<
convertRadToDeg(z.theta()) << endl;
247 cout <<
"some factor/equations..." << endl;
248 cout <<
" sin(thetaX()) * cos(phiX()) = " <<
sin(
x.theta()) *
cos(
x.phi()) << endl;
253 ROOT::Math::AxisAngle aa(
DD3Vector(1., 1., 1.), 20._deg);
255 cout <<
"DD3Vector was " <<
DD3Vector(1., 1., 1.) <<
" and the rotation was 20*deg around that axis." << endl;
260 cout <<
"(1,0,0, 0,-1,0, 0,0,1)" << endl;
bool next()
set current node to the next node in the expanded tree
int parse(const DDLDocumentProvider &dp)
Parse all files. Return is meaningless.
const DDTranslation & translation() const
The absolute translation of the current node.
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
DDMaterial is used to define and access material information.
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
DDName is used to identify DDD entities uniquely.
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.
void regressionTest_setup(ClhepEvaluator &eval)
Represents a uniquely identifyable rotation matrix.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
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::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
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.
Basic3DVector unit() const
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
void regressionTest_first(ClhepEvaluator &eval)
DDLParser is the main class of Detector Description Language Parser.
FIPConfiguration reads in the configuration file for the DDParser.
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
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)
Provides an exploded view of the detector (tree-view)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation