CMS 3D CMS Logo

Functions
cms::rotation_utils Namespace Reference

Functions

static void addRotWithNewName (cms::DDNamespace &ns, std::string &name, const dd4hep::Rotation3D &rot)
 
static void addRotWithNewName (cms::DDNamespace &ns, std::string &name, const Double_t *rot)
 
static const std::string identityHash ("1.00000000.00000000.00000000.00000001.00000000.00000000.00000000.00000001.0000000")
 
std::string rotHash (const dd4hep::Rotation3D &rot)
 
std::string rotHash (const Double_t *rot)
 
template<typename T >
static const std::string & rotName (const T &rot, const cms::DDParsingContext &context)
 
double roundBinary (double value)
 

Function Documentation

◆ addRotWithNewName() [1/2]

static void cms::rotation_utils::addRotWithNewName ( cms::DDNamespace ns,
std::string &  name,
const dd4hep::Rotation3D &  rot 
)
static

Definition at line 60 of file DDCoreToDDXMLOutput.cc.

60  {
61  const dd4hep::Rotation3D& rot2 = rot;
62  name = name + "_DdNoNa"; // Name used by old DD to indicate an unnamed rotation
63  ns.addRotation(name, rot2);
64  }

References cms::DDNamespace::addRotation(), Skims_PA_cff::name, and makeMuonMisalignmentScenario::rot.

Referenced by DDCoreToDDXMLOutput::position().

◆ addRotWithNewName() [2/2]

static void cms::rotation_utils::addRotWithNewName ( cms::DDNamespace ns,
std::string &  name,
const Double_t *  rot 
)
static

Definition at line 66 of file DDCoreToDDXMLOutput.cc.

66  {
67  using namespace cms_rounding;
68  dd4hep::Rotation3D rot2(roundIfNear0(rot[0], tol0),
69  roundIfNear0(rot[1], tol0),
70  roundIfNear0(rot[2], tol0),
71  roundIfNear0(rot[3], tol0),
72  roundIfNear0(rot[4], tol0),
73  roundIfNear0(rot[5], tol0),
74  roundIfNear0(rot[6], tol0),
75  roundIfNear0(rot[7], tol0),
76  roundIfNear0(rot[8], tol0));
77  addRotWithNewName(ns, name, rot2);
78  }

References Skims_PA_cff::name, makeMuonMisalignmentScenario::rot, cms_rounding::roundIfNear0(), and tol0.

◆ identityHash()

static const std::string cms::rotation_utils::identityHash ( "1.00000000.00000000.00000000.00000001.00000000.00000000.00000000.00000001.0000000"  )
static

◆ rotHash() [1/2]

std::string cms::rotation_utils::rotHash ( const dd4hep::Rotation3D &  rot)

Definition at line 38 of file DDNamespace.cc.

38  {
39  std::string hashVal;
40  std::vector<double> matrix;
41  matrix.assign(9, 0.);
42  rot.GetComponents(matrix.begin());
43  for (double val : matrix) {
44  std::ostringstream numStream;
45  numStream << std::fixed << std::setprecision(7);
46  numStream << roundBinary(val);
47  hashVal += numStream.str();
48  }
49  return (hashVal);
50 }

References alignBH_cfg::fixed, makeMuonMisalignmentScenario::matrix, makeMuonMisalignmentScenario::rot, roundBinary(), AlCaHLTBitMon_QueryRunRegistry::string, and heppy_batch::val.

◆ rotHash() [2/2]

std::string cms::rotation_utils::rotHash ( const Double_t *  rot)

Definition at line 25 of file DDNamespace.cc.

25  {
26  std::string hashVal;
27  for (int row = 0; row <= 2; ++row) {
28  for (int col = 0; col <= 2; ++col) {
29  std::ostringstream numStream;
30  numStream << std::fixed << std::setprecision(7);
31  numStream << roundBinary(rot[(3 * row) + col]);
32  hashVal += numStream.str();
33  }
34  }
35  return (hashVal);
36 }

References cuy::col, alignBH_cfg::fixed, makeMuonMisalignmentScenario::rot, roundBinary(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by cms::DDNamespace::addRotation(), DDCoreToDDXMLOutput::position(), rotName(), and DDCoreToDDXMLOutput::solid().

◆ rotName()

template<typename T >
static const std::string& cms::rotation_utils::rotName ( const T rot,
const cms::DDParsingContext context 
)
static

◆ roundBinary()

double cms::rotation_utils::roundBinary ( double  value)

Definition at line 17 of file DDNamespace.cc.

17  {
19  static constexpr double roundingVal = 1 << 24;
20  value = (round(value * roundingVal) / roundingVal);
21  // Set -0 to 0
23 }

References cms_rounding::roundIfNear0().

Referenced by rotHash().

alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
cms::rotation_utils::rotHash
std::string rotHash(const Double_t *rot)
Definition: DDNamespace.cc:25
cms::DDNamespace::addRotation
void addRotation(const std::string &name, const dd4hep::Rotation3D &rot) const
Definition: DDNamespace.cc:158
makeMuonMisalignmentScenario.matrix
list matrix
Definition: makeMuonMisalignmentScenario.py:141
cms::rotation_utils::addRotWithNewName
static void addRotWithNewName(cms::DDNamespace &ns, std::string &name, const Double_t *rot)
Definition: DDCoreToDDXMLOutput.cc:66
cuy.col
col
Definition: cuy.py:1009
visDQMUpload.context
context
Definition: visDQMUpload.py:37
cms::rotation_utils::roundBinary
double roundBinary(double value)
Definition: DDNamespace.cc:17
tol0
static constexpr double tol0
Definition: DDCoreToDDXMLOutput.cc:42
value
Definition: value.py:1
cms_rounding
Definition: Rounding.h:8
cms_rounding::roundIfNear0
constexpr valType roundIfNear0(valType value, double tolerance=1.e-7)
Definition: Rounding.h:11
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
heppy_batch.val
val
Definition: heppy_batch.py:351
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17