CMS 3D CMS Logo

List of all members | Public Member Functions | Static Private Attributes
HcalTB02ParametersFromDD Class Reference

#include <HcalTB02ParametersFromDD.h>

Public Member Functions

bool build (const cms::DDCompactView *cpv, HcalTB02Parameters &php, const std::string &name)
 
bool build (const DDCompactView *cpv, HcalTB02Parameters &php, const std::string &name)
 
 HcalTB02ParametersFromDD ()=default
 

Static Private Attributes

static constexpr double k_ScaleFromDD4HepToG4 = 10.0
 
static constexpr double k_ScaleFromDDDToG4 = 1.0
 

Detailed Description

Definition at line 12 of file HcalTB02ParametersFromDD.h.

Constructor & Destructor Documentation

◆ HcalTB02ParametersFromDD()

HcalTB02ParametersFromDD::HcalTB02ParametersFromDD ( )
default

Member Function Documentation

◆ build() [1/2]

bool HcalTB02ParametersFromDD::build ( const cms::DDCompactView cpv,
HcalTB02Parameters php,
const std::string &  name 
)

Definition at line 37 of file HcalTB02ParametersFromDD.cc.

37  {
38  const cms::DDFilter filter("ReadOutName", name);
39  cms::DDFilteredView fv(*cpv, filter);
40  while (fv.firstChild()) {
41  std::string namx = static_cast<std::string>(cms::dd::noNamespace(fv.name()));
42  const std::vector<double>& paras = fv.parameters();
43  edm::LogVerbatim("HcalTBSim") << "HcalTB02ParametersFromDD (for " << name << "): Solid " << namx << " Shape "
44  << cms::dd::name(cms::DDSolidShapeMap, fv.shape()) << " Parameter 0 = " << paras[0];
45  if (fv.isATrapezoid()) {
46  double dz = 2 * k_ScaleFromDD4HepToG4 * paras[0];
47  php.lengthMap_.insert(std::pair<std::string, double>(namx, dz));
48  }
49  }
50  edm::LogVerbatim("HcalTBSim") << "HcalTB02ParametersFromDD: Length Table for ReadOutName = " << name << ":";
51  std::map<std::string, double>::const_iterator it = php.lengthMap_.begin();
52  int i = 0;
53  for (; it != php.lengthMap_.end(); it++, i++) {
54  edm::LogVerbatim("HcalTBSim") << " " << i << " " << it->first << " L = " << it->second;
55  }
56  return true;
57 }

References cms::DDSolidShapeMap, PVValHelper::dz, ALCARECOTkAlBeamHalo_cff::filter, cms::DDFilteredView::firstChild(), mps_fire::i, cms::DDFilteredView::isATrapezoid(), k_ScaleFromDD4HepToG4, HcalTB02Parameters::lengthMap_, Skims_PA_cff::name, cms::dd::name(), cms::DDFilteredView::name(), cms::dd::noNamespace(), cms::DDFilteredView::parameters(), cms::DDFilteredView::shape(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ build() [2/2]

bool HcalTB02ParametersFromDD::build ( const DDCompactView cpv,
HcalTB02Parameters php,
const std::string &  name 
)

Definition at line 12 of file HcalTB02ParametersFromDD.cc.

12  {
14  DDFilteredView fv(*cpv, filter);
15  bool dodet = fv.firstChild();
16  while (dodet) {
17  const DDSolid& sol = fv.logicalPart().solid();
18  const std::vector<double>& paras = sol.parameters();
19  std::string namx = static_cast<std::string>(sol.name().name());
20  edm::LogVerbatim("HcalTBSim") << "HcalTB02ParametersFromDD (for " << name << "): Solid " << namx << " Shape "
21  << sol.shape() << " Parameter 0 = " << paras[0];
22  if (sol.shape() == DDSolidShape::ddtrap) {
23  double dz = 2 * k_ScaleFromDDDToG4 * paras[0];
24  php.lengthMap_.insert(std::pair<std::string, double>(namx, dz));
25  }
26  dodet = fv.next();
27  }
28  edm::LogVerbatim("HcalTBSim") << "HcalTB02ParametersFromDD: Length Table for ReadOutName = " << name << ":";
29  std::map<std::string, double>::const_iterator it = php.lengthMap_.begin();
30  int i = 0;
31  for (; it != php.lengthMap_.end(); it++, i++) {
32  edm::LogVerbatim("HcalTBSim") << " " << i << " " << it->first << " L = " << it->second;
33  }
34  return true;
35 }

References ddtrap, PVValHelper::dz, ALCARECOTkAlBeamHalo_cff::filter, DDFilteredView::firstChild(), mps_fire::i, k_ScaleFromDDDToG4, HcalTB02Parameters::lengthMap_, DDFilteredView::logicalPart(), Skims_PA_cff::name, DDName::name(), DDBase< N, C >::name(), DDFilteredView::next(), DDSolid::parameters(), DDSolid::shape(), DDLogicalPart::solid(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by HcalTB02ParametersESModule::produce().

Member Data Documentation

◆ k_ScaleFromDD4HepToG4

constexpr double HcalTB02ParametersFromDD::k_ScaleFromDD4HepToG4 = 10.0
staticconstexprprivate

Definition at line 21 of file HcalTB02ParametersFromDD.h.

Referenced by build().

◆ k_ScaleFromDDDToG4

constexpr double HcalTB02ParametersFromDD::k_ScaleFromDDDToG4 = 1.0
staticconstexprprivate

Definition at line 20 of file HcalTB02ParametersFromDD.h.

Referenced by build().

mps_fire.i
i
Definition: mps_fire.py:355
DDSolidShape::ddtrap
cms::DDFilteredView
Definition: DDFilteredView.h:65
DDSolid::shape
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:119
HcalTB02ParametersFromDD::k_ScaleFromDD4HepToG4
static constexpr double k_ScaleFromDD4HepToG4
Definition: HcalTB02ParametersFromDD.h:21
cms::DDFilter
Definition: DDFilteredView.h:54
cms::dd::name
std::string name(Mapping a, V value)
Definition: DDSolidShapes.h:31
DDBase::name
const N & name() const
Definition: DDBase.h:59
cms::dd::noNamespace
std::string_view noNamespace(std::string_view)
Definition: Filter.cc:63
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cms::DDSolidShapeMap
const std::array< const cms::dd::NameValuePair< DDSolidShape >, 19 > DDSolidShapeMap
Definition: DDSolidShapes.h:84
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:40
edm::LogVerbatim
Definition: MessageLogger.h:297
HcalTB02Parameters::lengthMap_
std::map< std::string, double > lengthMap_
Definition: HcalTB02Parameters.h:14
PVValHelper::dz
Definition: PVValidationHelpers.h:50
DDValue
Definition: DDValue.h:21
DDSolid::parameters
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:121
HcalTB02ParametersFromDD::k_ScaleFromDDDToG4
static constexpr double k_ScaleFromDDDToG4
Definition: HcalTB02ParametersFromDD.h:20
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDSpecificsMatchesValueFilter
Definition: DDFilter.h:70
DDFilteredView
Definition: DDFilteredView.h:20