CMS 3D CMS Logo

Functions
angle_units::operators Namespace Reference

Functions

template<class NumType >
std::enable_if<!std::numeric_limits< NumType >::is_integer, bool >::type almostEqual (NumType x, NumType y, int ulp)
 
template<class NumType >
constexpr NumType convertCm2ToMm2 (NumType centimeters)
 
template<class NumType >
constexpr NumType convertCmToMm (NumType centimeters)
 
template<class NumType >
constexpr double convertDegToRad (NumType degrees)
 
template<class NumType >
constexpr NumType convertGeVToKeV (NumType gev)
 
template<class NumType >
constexpr NumType convertGeVToMeV (NumType gev)
 
template<class NumType >
constexpr NumType convertMeVToGeV (NumType mev)
 
template<class NumType >
constexpr NumType convertMm3ToM3 (NumType mm3)
 
template<class NumType >
constexpr NumType convertMmToCm (NumType millimeters)
 
template<class NumType >
constexpr NumType convertRadToDeg (NumType radians)
 
constexpr double operator"" _deg (long double deg)
 
constexpr double operator"" _deg (unsigned long long int deg)
 
constexpr double operator"" _pi (long double x)
 
constexpr double operator"" _pi (unsigned long long int x)
 
constexpr double operator"" _rad (long double rad)
 

Function Documentation

◆ almostEqual()

template<class NumType >
std::enable_if<!std::numeric_limits<NumType>::is_integer, bool>::type angle_units::operators::almostEqual ( NumType  x,
NumType  y,
int  ulp 
)

Definition at line 33 of file angle_units.h.

References geometryDiff::epsilon, SiStripPI::min, and x.

Referenced by GeometricDet::GeometricDet().

35  {
36  return std::fabs(x - y) <= std::numeric_limits<NumType>::epsilon() * std::fabs(x + y) * ulp ||
37  std::fabs(x - y) < std::numeric_limits<NumType>::min();
38  }
float x

◆ convertCm2ToMm2()

template<class NumType >
constexpr NumType angle_units::operators::convertCm2ToMm2 ( NumType  centimeters)
inline

Definition at line 56 of file angle_units.h.

57  {
58  return (centimeters * 100.);
59  }

◆ convertCmToMm()

template<class NumType >
constexpr NumType angle_units::operators::convertCmToMm ( NumType  centimeters)
inline

Definition at line 50 of file angle_units.h.

51  {
52  return (centimeters * 10.);
53  }

◆ convertDegToRad()

template<class NumType >
constexpr double angle_units::operators::convertDegToRad ( NumType  degrees)
inline

◆ convertGeVToKeV()

template<class NumType >
constexpr NumType angle_units::operators::convertGeVToKeV ( NumType  gev)
inline

Definition at line 80 of file angle_units.h.

81  {
82  return (gev * 1.e6);
83  }

◆ convertGeVToMeV()

template<class NumType >
constexpr NumType angle_units::operators::convertGeVToMeV ( NumType  gev)
inline

Definition at line 74 of file angle_units.h.

Referenced by ETLDeviceSim::getHitsResponse(), and BTLDeviceSim::getHitsResponse().

75  {
76  return (gev * 1000.);
77  }

◆ convertMeVToGeV()

template<class NumType >
constexpr NumType angle_units::operators::convertMeVToGeV ( NumType  mev)
inline

Definition at line 68 of file angle_units.h.

69  {
70  return (mev * 0.001);
71  }

◆ convertMm3ToM3()

template<class NumType >
constexpr NumType angle_units::operators::convertMm3ToM3 ( NumType  mm3)
inline

Definition at line 62 of file angle_units.h.

63  {
64  return (mm3 / 1.e9);
65  }

◆ convertMmToCm()

template<class NumType >
constexpr NumType angle_units::operators::convertMmToCm ( NumType  millimeters)
inline

Definition at line 44 of file angle_units.h.

Referenced by algorithm(), EtlSimHitsValidation::analyze(), BtlSimHitsValidation::analyze(), EtlLocalRecoValidation::analyze(), MtdTracksValidation::analyze(), BtlLocalRecoValidation::analyze(), GEMGeometryBuilderFromCondDB::boundPlane(), ME0GeometryBuilder::boundPlane(), GEMGeometryBuilder::boundPlane(), HcalParametersFromDD::build(), ME0GeometryBuilderFromCondDB::build(), CSCGeometryParsFromDD::build(), ME0GeometryBuilder::buildChamber(), GEMGeometryBuilder::buildChamber(), GEMGeometryBuilderFromCondDB::buildEtaPartition(), ME0GeometryBuilder::buildEtaPartition(), GEMGeometryBuilder::buildEtaPartition(), RPCGeometryBuilder::buildGeometry(), ME0GeometryBuilder::buildGeometry(), ME0GeometryBuilder::buildLayer(), DTGeometryBuilderFromDDD::buildLayer(), DTGeometryBuilderFromCondDB::buildLayer(), HcalSimParametersFromDD::buildParameters(), GEMGeometryBuilder::buildSuperChamber(), CSCLayerGeometry::CSCLayerGeometry(), CSCWireTopology::CSCWireTopology(), ETLDeviceSim::getHitsResponse(), BTLDeviceSim::getHitsResponse(), dtGeometryBuilder::getRecPlaneBounds(), DDBHMAngular::initialize(), DTGeometryBuilderFromDDD::plane(), DTGeometryParsFromDD::plane(), GeometricDet::positionBounds(), GeometricTimingDet::positionBounds(), DDI::Sphere::stream(), DDI::Torus::stream(), DDI::Tubs::stream(), DDI::Cons::stream(), DDI::Box::stream(), DDI::TruncTubs::stream(), DDI::Polycone::stream(), DDI::Polyhedra::stream(), DDI::ExtrudedPolygon::stream(), DDI::EllipticalTube::stream(), DDI::Trap::stream(), DDI::CutTubs::stream(), and DDI::PseudoTrap::stream().

45  {
46  return (millimeters / 10.);
47  }

◆ convertRadToDeg()

template<class NumType >
constexpr NumType angle_units::operators::convertRadToDeg ( NumType  radians)
inline

Definition at line 21 of file angle_units.h.

References angle_units::degPerRad.

Referenced by algorithm(), GEMEfficiencyAnalyzer::analyze(), HGCalDDDConstants::assignCellTrap(), PrintGeomInfoAction::beginRun(), CmsMTDConstruction< FilteredView >::btlOrderPhi(), CmsMTDConstruction< FilteredView >::btlOrderZ(), HcalParametersFromDD::build(), HGCalParametersFromDD::build(), GEMEfficiencyAnalyzer::computeDeltaPhi(), DDCmsMTDConstruction::construct(), DDHCalBarrelAlgo::constructGeneralVolume(), DDHCalEndcapAlgo::constructGeneralVolume(), HCalEndcapAlgo::constructGeneralVolume(), DDHCalEndcapModuleAlgo::constructInsideModule(), DDHCalEndcapAlgo::constructInsideModule(), HCalEndcapModuleAlgo::constructInsideModule(), HCalEndcapAlgo::constructInsideModule(), DDHCalEndcapModuleAlgo::constructInsideModule0(), DDHCalEndcapAlgo::constructInsideModule0(), HCalEndcapModuleAlgo::constructInsideModule0(), HCalEndcapAlgo::constructInsideModule0(), DDHCalBarrelAlgo::constructInsideSector(), DDHCalEndcapAlgo::constructInsideSector(), HCalEndcapAlgo::constructInsideSector(), DDHGCalModule::constructLayers(), DDHGCalModuleAlgo::constructLayers(), DDHGCalEEAlgo::constructLayers(), DDHGCalHEAlgo::constructLayers(), DDHGCalHEFileAlgo::constructLayers(), DDHGCalEEFileAlgo::constructLayers(), DDHGCalMixLayer::constructLayers(), DDHGCalSiliconModule::constructLayers(), DDHGCalMixRotatedLayer::constructLayers(), DDHGCalSiliconRotatedModule::constructLayers(), HGCalEEAlgo::ConstructLayers(), DDHCalBarrelAlgo::constructMidLayer(), HcalBarrelAlgo::constructMidLayer(), DDHCalEndcapModuleAlgo::constructScintLayer(), DDHCalEndcapAlgo::constructScintLayer(), HCalEndcapModuleAlgo::constructScintLayer(), HCalEndcapAlgo::constructScintLayer(), DDHCalBarrelAlgo::constructSideLayer(), HcalBarrelAlgo::constructSideLayer(), DDcreateRotationMatrix(), Geom::Phi< float >::degrees(), DDHtmlRoDetails::details(), PrintG4Solids::dumpSummary(), PrintGeomInfoAction::dumpTouch(), DDAngular::execute(), DDTotemAngular::execute(), DDHCalTestBeamAlgo::execute(), DDHCalXtalAlgo::execute(), DDHCalAngular::execute(), DDHCalTBZposAlgo::execute(), DDGEMAngular::execute(), DDMuonAngular::execute(), DDHCalTBCableAlgo::execute(), DDHCalFibreBundle::execute(), DDTrackerIrregularRingAlgo::execute(), SimG4HcalValidation::fill(), MaterialBudgetHcalHistos::fillPerStep(), MaterialBudgetHcalHistos::fillStartTrack(), formatAsDegrees(), formatAsDegreesInInteger(), HcalDDDRecConstants::getOneEtaBin(), HcalDDDSimConstants::getPhis(), HcalDDDRecConstants::getPhis(), HcalDDDRecConstants::getThickActive(), HcalBarrelAlgo::HcalBarrelAlgo(), HCalEndcapAlgo::HCalEndcapAlgo(), HGCalEEAlgo::HGCalEEAlgo(), HGCalEEFileAlgo::HGCalEEFileAlgo(), HGCalHEAlgo::HGCalHEAlgo(), HGCalHEFileAlgo::HGCalHEFileAlgo(), HGCalMixLayer::HGCalMixLayer(), HGCalMixRotatedLayer::HGCalMixRotatedLayer(), HGCalMouseBite::HGCalMouseBite(), HGCalSiliconModule::HGCalSiliconModule(), HGCalSiliconRotatedModule::HGCalSiliconRotatedModule(), DDLinear::initialize(), DDAngular::initialize(), DDTotemAngular::initialize(), DDMTDLinear::initialize(), DDHCalTestBeamAlgo::initialize(), DDHCalXtalAlgo::initialize(), DDHCalAngular::initialize(), DDHCalTBZposAlgo::initialize(), DDGEMAngular::initialize(), DDMuonAngular::initialize(), DDBHMAngular::initialize(), DDHCalFibreBundle::initialize(), DDHGCalEEAlgo::initialize(), DDHGCalHEAlgo::initialize(), DDHGCalHEFileAlgo::initialize(), DDHGCalEEFileAlgo::initialize(), DDHGCalMixLayer::initialize(), DDHGCalSiliconModule::initialize(), DDHGCalMixRotatedLayer::initialize(), DDHGCalSiliconRotatedModule::initialize(), DDTrackerIrregularRingAlgo::initialize(), DDHCalEndcapAlgo::initialize(), HcalDDDRecConstants::initialize(), DDLRotationAndReflection::isLeftHanded(), HGCalDDDConstants::locateCellTrap(), operator<<(), output(), DDHCalEndcapModuleAlgo::parameterLayer(), DDHCalEndcapAlgo::parameterLayer(), HCalEndcapModuleAlgo::parameterLayer(), HCalEndcapAlgo::parameterLayer(), DDHCalEndcapModuleAlgo::parameterLayer0(), DDHCalEndcapAlgo::parameterLayer0(), HCalEndcapModuleAlgo::parameterLayer0(), HCalEndcapAlgo::parameterLayer0(), DDHGCalMixLayer::positionMix(), DDHGCalMixRotatedLayer::positionMix(), HGCalMixLayer::positionMix(), HGCalMixRotatedLayer::positionMix(), DDHGCalSiliconRotatedModule::positionSensitive(), HGCalSiliconRotatedModule::positionSensitive(), printRot(), HcalDDDSimConstants::printTileHB(), HcalDDDSimConstants::printTileHE(), DDCoreToDDXMLOutput::rotation(), DDCoreToDDXMLOutput::solid(), DDI::Sphere::stream(), DDI::Tubs::stream(), DDI::Torus::stream(), DDI::Cons::stream(), DDI::Polycone::stream(), DDI::TruncTubs::stream(), DDI::Polyhedra::stream(), DDI::CutTubs::stream(), DDI::Trap::stream(), and MaterialBudgetHcalProducer::update().

22  {
23  return (radians * degPerRad);
24  }
constexpr double degPerRad
Definition: angle_units.h:9

◆ operator"" _deg() [1/2]

constexpr double angle_units::operators::operator"" _deg ( long double  deg)

Definition at line 16 of file angle_units.h.

References angle_units::degPerRad.

16 { return deg / degPerRad; }
constexpr double degPerRad
Definition: angle_units.h:9

◆ operator"" _deg() [2/2]

constexpr double angle_units::operators::operator"" _deg ( unsigned long long int  deg)

Definition at line 17 of file angle_units.h.

References angle_units::degPerRad.

17 { return deg / degPerRad; }
constexpr double degPerRad
Definition: angle_units.h:9

◆ operator"" _pi() [1/2]

constexpr double angle_units::operators::operator"" _pi ( long double  x)

Definition at line 14 of file angle_units.h.

References M_PI, and x.

14 { return double(x) * M_PI; }
#define M_PI
float x

◆ operator"" _pi() [2/2]

constexpr double angle_units::operators::operator"" _pi ( unsigned long long int  x)

Definition at line 15 of file angle_units.h.

References M_PI, and x.

15 { return double(x) * M_PI; }
#define M_PI
float x

◆ operator"" _rad()

constexpr double angle_units::operators::operator"" _rad ( long double  rad)

Definition at line 18 of file angle_units.h.

18 { return rad * 1.; }