8 #define MAX_DOUBLE DBL_MAX
15 #include "CLHEP/Units/GlobalSystemOfUnits.h"
16 #include <Math/RotationZ.h>
42 if (
ParE_[
"delta"][0] == 0.) {
43 err_ +=
"\tdelta can not be zero\n";
64 radius *
sin(offset + delta * (
count_ - 1)),
73 std::cout <<
"ParS_[\"rotate\"][0] = " <<
ParS_[
"rotate"][0] << std::endl;
74 if (
ParS_[
"rotate"][0] ==
"T" ||
ParS_[
"rotate"][0] ==
"1"
75 ||
ParS_[
"rotate"][0] ==
"True")
82 size_t foundColon = 0;
85 while (foundColon < name.size() && name[foundColon] !=
':')
87 if (foundColon != name.size())
89 for (
size_t j = foundColon + 1;
j < name.size(); ++
j)
91 for (
size_t i = 0;
i < foundColon; ++
i)
94 if (rn !=
"" && ns !=
"")
100 std::cout <<
"MAJOR PROBLEM: expected a fully qualified DDName but got :"
101 << name << std::endl;
103 ROOT::Math::RotationZ
rm(angle);
108 else if (
ParS_[
"orientation"].
size() != 0)
111 std::string
name=
ParS_[
"orientation"][0];
112 size_t foundColon = 0;
115 while (foundColon < name.size() && name[foundColon] !=
':')
117 if (foundColon != name.size())
119 for (
size_t j = foundColon + 1;
j < name.size(); ++
j)
121 for (
size_t i = 0;
i < foundColon; ++
i)
124 if (rn !=
"" && ns !=
"")
128 std::cout <<
"about to return *(myDDRotation.rotation())" << std::endl;
133 std::cout <<
"MAJOR PROBLEM: expected a fully qualified DDName but got "
134 << name <<
" therefore could not look up the rotation." << std::endl;
161 os <<
"global_simplesimpleAngular_0::stream(): not implemented.";
185 if (
ParE_[
"number"][0] == 0.) {
186 err_ +=
"\tnumber must not be 0\n";
206 double number =
ParE_[
"number"][0];
207 double delta = (360.0 / number) * deg;
211 radius *
sin(offset + delta * (
count_ - 1)),
220 double number =
ParE_[
"number"][0];
221 double delta = (360.0 / number) * deg;
222 if (
ParS_[
"rotate"][0] ==
"T" ||
ParS_[
"rotate"][0] ==
"1"
223 ||
ParS_[
"rotate"][0] ==
"True")
230 std::string
name=
ParS_[
"orientation"][0];
231 size_t foundColon = 0;
234 while (foundColon < name.size() && name[foundColon] !=
':')
236 if (foundColon != name.size())
238 for (
size_t j = foundColon + 1;
j < name.size(); ++
j)
240 for (
size_t i = 0;
i < foundColon; ++
i)
243 if (rn !=
"" && ns !=
"")
249 std::cout <<
"MAJOR PROBLEM: expected a fully qualified DDName but got :"
250 << name <<
" therefore could not look up the rotation." << std::endl;
252 ROOT::Math::RotationZ
rm(angle);
257 else if (
ParS_[
"orientation"].
size() != 0)
259 std::string
name=
ParS_[
"orientation"][0];
260 size_t foundColon = 0;
263 while (foundColon < name.size() && name[foundColon] !=
':')
265 if (foundColon != name.size())
267 for (
size_t j = foundColon + 1;
j < name.size(); ++
j)
269 for (
size_t i = 0;
i < foundColon; ++
i)
272 if (rn !=
"" && ns !=
"")
279 std::cout <<
"MAJOR PROBLEM: expected a fully qualified DDName but got "
280 << name <<
" therefore could not look up the rotation." << std::endl;
306 os <<
"global_simpleAngular_0::stream(): not implemented.";
330 if (
ParE_[
"number"][0] == 0.) {
331 err_ +=
"\tnumber must not be 0\n";
342 if (
ParE_[
"delta"][0] == 0.) {
343 err_ +=
"\tdelta must not be 0\n";
349 double number =
ParE_[
"number"][0];
350 if (delta * number > 360. * deg) {
351 err_ +=
"\tat this time delta * number can not be greater than 360 degrees\n";
368 radius *
sin(offset + delta * (
count_ - 1)),
380 if (
ParS_[
"rotate"][0] ==
"T" ||
ParS_[
"rotate"][0] ==
"1"
381 ||
ParS_[
"rotate"][0] ==
"True")
387 std::string
name=
ParS_[
"orientation"][0];
388 size_t foundColon = 0;
391 while (foundColon < name.size() && name[foundColon] !=
':')
393 if (foundColon != name.size())
395 for (
size_t j = foundColon + 1;
j < name.size(); ++
j)
397 for (
size_t i = 0;
i < foundColon; ++
i)
400 if (rn !=
"" && ns !=
"")
406 std::cout <<
"MAJOR PROBLEM: expected a fully qualified DDName but got :"
407 << name << std::endl;
409 ROOT::Math::RotationZ
rm(angle);
414 else if (
ParS_[
"orientation"].
size() != 0)
417 std::string
name=
ParS_[
"orientation"][0];
418 size_t foundColon = 0;
421 while (foundColon < name.size() && name[foundColon] !=
':')
423 if (foundColon != name.size())
425 for (
size_t j = foundColon + 1;
j < name.size(); ++
j)
427 for (
size_t i = 0;
i < foundColon; ++
i)
430 if (rn !=
"" && ns !=
"")
437 std::cout <<
"MAJOR PROBLEM: expected a fully qualified DDName but got "
438 << name <<
" therefore could not look up the rotation." << std::endl;
463 os <<
"global_simpleAngular_0::stream(): not implemented.";
const DDRotationMatrix * rotation() const
Returns the read-only rotation-matrix.
global_simpleAngular_Check()
void stream(std::ostream &) const
~global_simpleAngular_2()
class for algorithmic positioning, represents an algorithm
void stream(std::ostream &) const
Sin< T >::type sin(const T &t)
void checkTermination()
for algorithms with incr_==0 the algorithm must check whether to terminate
DDTranslation translation()
subclass must calculate a translation std::vector
DDName is used to identify DDD entities uniquely.
void stream(std::ostream &) const
constraints as defined for algorithm-parameters in the XML schema Algorithm.xsd, strings ...
constraints as defined for algorithm-parameters in the XML schema Algorithm.xsd, expressions ...
DDTranslation translation()
subclass must calculate a translation std::vector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
bool checkParameters()
subclass must check the supplied parameters ParE_, ParS_
Represents a uniquely identifyable rotation matrix.
~global_simpleAngular_1()
void checkTermination()
for algorithms with incr_==0 the algorithm must check whether to terminate
DDRotationMatrix rotation()
subclass must calculate a rotation matrix
DDTranslation translation()
subclass must calculate a translation std::vector
bool checkParameters()
subclass must check the supplied parameters ParE_, ParS_
Cos< T >::type cos(const T &t)
implementation of an algorithm, non generated checking code.
unsigned int offset(bool)
global_simpleAngular_1(AlgoPos *, std::string label)
DDRotationMatrix rotation()
subclass must calculate a rotation matrix
constraintsS_type constraintsS_
format: "ParameterName" -> ConstraintS
bool checkParameters()
subclass must check the supplied parameters ParE_, ParS_
constraintsE_type constraintsE_
format: "ParameterName" -> ConstraintE
global_simpleAngular_0(AlgoPos *, std::string label)
void checkTermination()
for algorithms with incr_==0 the algorithm must check whether to terminate
DDRotationMatrix rotation()
subclass must calculate a rotation matrix
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
tuple size
Write out results.
~global_simpleAngular_0()
void terminate()
stop the current iteration of the algorithm (for incr_==0 types of algorithms)
global_simpleAngular_2(AlgoPos *, std::string label)
T angle(T x1, T y1, T z1, T x2, T y2, T z2)