CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DDAlgoArguments.h
Go to the documentation of this file.
1 #ifndef DetectorDescription_DDCMS_DDAlgoArguments_h
2 #define DetectorDescription_DDCMS_DDAlgoArguments_h
3 
4 #include "XML/XML.h"
10 
11 #include <map>
12 #include <sstream>
13 
14 namespace cms {
15 
16  static constexpr long s_executed = 1l;
17 
18  constexpr unsigned int hash(const char* str, int h = 0) { return !str[h] ? 5381 : (hash(str, h + 1) * 33) ^ str[h]; }
19 
20  inline unsigned int hash(const std::string& str) { return hash(str.c_str()); }
21 
22  DDRotationMatrix makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ);
23 
24  DDRotationMatrix makeRotReflect(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ);
25 
27 
29  public:
31 
32  DDAlgoArguments() = delete;
33  DDAlgoArguments(const DDAlgoArguments& copy) = delete;
34  DDAlgoArguments& operator=(const DDAlgoArguments& copy) = delete;
35  ~DDAlgoArguments() = default;
36 
39  xml_h element;
40 
41  std::string parentName() const;
42  std::string childName() const;
43  bool find(const std::string& name) const;
44  template <typename T>
45  T value(const std::string& name) const;
46  std::string str(const std::string& nam) const;
47  double dble(const std::string& nam) const;
48  int integer(const std::string& nam) const;
49  std::vector<double> vecDble(const std::string& nam) const;
50  std::vector<float> vecFloat(const std::string& nam) const;
51  std::vector<int> vecInt(const std::string& nam) const;
52  std::vector<std::string> vecStr(const std::string& nam) const;
54 
55  private:
56  xml_h rawArgument(const std::string& name) const;
58  };
59 } // namespace cms
60 
61 #endif
std::string childName() const
Access value of child&#39;name from the xml element.
T value(const std::string &name) const
int integer(const std::string &nam) const
Shortcut to access integer arguments.
DDRotationMatrix makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
xml_h rawArgument(const std::string &name) const
Access raw argument as a string by name.
static constexpr long s_executed
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
~DDAlgoArguments()=default
DDRotationMatrix makeRotReflect(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
constexpr unsigned int hash(const char *str, int h=0)
std::string resolveValue(const std::string &value) const
DDAlgoArguments & operator=(const DDAlgoArguments &copy)=delete
std::vector< double > vecDble(const std::string &nam) const
Shortcut to access vector&lt;double&gt; arguments.
double dble(const std::string &nam) const
Shortcut to access double arguments.
cms::DDParsingContext & context
std::vector< std::string > vecStr(const std::string &nam) const
Shortcut to access vector&lt;string&gt; arguments.
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
#define str(s)
bool find(const std::string &name) const
Check the existence of an argument by name.
long double T
std::vector< int > vecInt(const std::string &nam) const
Shortcut to access vector&lt;int&gt; arguments.
std::vector< float > vecFloat(const std::string &nam) const
Shortcut to access vector&lt;float&gt; arguments.
std::string resolved_scalar_arg(const std::string &name) const
Access namespace resolved argument as a string by name.
std::string parentName() const
Access value of rParent child node.
std::string str(const std::string &nam) const
Shortcut to access string arguments.
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11