CMS 3D CMS Logo

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

#include <HcalSimParametersFromDD.h>

Public Member Functions

bool build (const DDCompactView *, HcalSimulationParameters &)
 
bool build (const cms::DDCompactView &, HcalSimulationParameters &)
 
 HcalSimParametersFromDD ()=default
 

Private Member Functions

bool buildParameters (const HcalSimulationParameters &)
 
void fillNameVector (const DDCompactView *, const std::string &, const std::string &, std::vector< std::string > &)
 
void fillNameVector (const cms::DDCompactView &, const std::string &, std::vector< std::string > &)
 
void fillPMTs (const std::vector< double > &, bool, HcalSimulationParameters &)
 
std::vector< double > getDDDArray (const std::string &str, const DDsvalues_type &sv, int &nmin)
 
std::vector< std::string > getNames (DDFilteredView &fv)
 
std::vector< std::string > getNames (cms::DDFilteredView &fv)
 
bool isItHF (const std::string &, const HcalSimulationParameters &)
 

Static Private Attributes

static constexpr double k_ScaleFromDD4hep = (1.0 / dd4hep::mm)
 
static constexpr double k_ScaleFromDD4hepInv = dd4hep::mm
 

Detailed Description

Definition at line 13 of file HcalSimParametersFromDD.h.

Constructor & Destructor Documentation

◆ HcalSimParametersFromDD()

HcalSimParametersFromDD::HcalSimParametersFromDD ( )
default

Member Function Documentation

◆ build() [1/2]

bool HcalSimParametersFromDD::build ( const DDCompactView cpv,
HcalSimulationParameters php 
)

Definition at line 18 of file HcalSimParametersFromDD.cc.

References HcalSimulationParameters::attenuationLength_, dbl_to_int(), Exception, DDFilteredView::firstChild(), MsgTools::getNames(), HcalSimulationParameters::hcalMaterialNames_, HcalSimulationParameters::hfFibreConicalNames_, HcalSimulationParameters::hfFibreNames_, HcalSimulationParameters::hfFibreStraightNames_, HcalSimulationParameters::hfLevels_, HcalSimulationParameters::hfNames_, HcalSimulationParameters::hfPMTNames_, mps_fire::i, HcalSimulationParameters::lambdaLimits_, dqm-mbProfile::log, DDFilteredView::logicalPart(), HcalSimulationParameters::longFiberLength_, DDFilteredView::mergedSpecifics(), neta, DDFilteredView::next(), HcalSimulationParameters::shortFiberLength_, AlCaHLTBitMon_QueryRunRegistry::string, and pfDeepBoostedJetPreprocessParams_cfi::sv.

18  {
19  // Parameters for the fibers
20  std::string attribute = "Volume";
21  std::string value = "HF";
22  DDSpecificsMatchesValueFilter filter1{DDValue(attribute, value, 0)};
23  DDFilteredView fv1(*cpv, filter1);
24 
25  // Names of sensitive volumes for HF
26  php.hfNames_ = getNames(fv1);
27  int nb(-1);
28 
29  bool dodet = fv1.firstChild();
30  if (dodet) {
31  DDsvalues_type sv(fv1.mergedSpecifics());
32 
33  // The level positions
34  nb = -1;
35  php.hfLevels_ = dbl_to_int(getDDDArray("Levels", sv, nb));
36 
37  // Attenuation length
38  nb = -1;
39  php.attenuationLength_ = getDDDArray("attl", sv, nb);
40 
41  // Limits on Lambda
42  nb = 2;
43  php.lambdaLimits_ = dbl_to_int(getDDDArray("lambLim", sv, nb));
44 
45  // Fibre Lengths
46  nb = 0;
47  php.longFiberLength_ = getDDDArray("LongFL", sv, nb);
48 
49  nb = 0;
50  php.shortFiberLength_ = getDDDArray("ShortFL", sv, nb);
51 
52  } else {
53  throw cms::Exception("HcalSimParametersFromDD") << "Not found " << value << " for " << attribute << " but needed.";
54  }
55 
56  //Parameters for the PMT
57  value = "HFPMT";
58  DDSpecificsMatchesValueFilter filter2{DDValue(attribute, value, 0)};
59  DDFilteredView fv2(*cpv, filter2);
60  if (fv2.firstChild()) {
61  DDsvalues_type sv(fv2.mergedSpecifics());
62  int nb = -1;
63  std::vector<double> neta = getDDDArray("indexPMTR", sv, nb);
64  fillPMTs(neta, false, php);
65  nb = -1;
66  neta = getDDDArray("indexPMTL", sv, nb);
67  fillPMTs(neta, true, php);
68  } else {
69  throw cms::Exception("HcalSimParametersFromDD") << "Not found " << value << " for " << attribute << " but needed.";
70  }
71 
72  //Names of special volumes (HFFibre, HFPMT, HFFibreBundles)
73  fillNameVector(cpv, attribute, "HFFibre", php.hfFibreNames_);
74  fillNameVector(cpv, attribute, "HFPMT", php.hfPMTNames_);
75  fillNameVector(cpv, attribute, "HFFibreBundleStraight", php.hfFibreStraightNames_);
76  fillNameVector(cpv, attribute, "HFFibreBundleConical", php.hfFibreConicalNames_);
77 
78  // HCal materials
79  attribute = "OnlyForHcalSimNumbering";
80  DDSpecificsHasNamedValueFilter filter3{attribute};
81  DDFilteredView fv3(*cpv, filter3);
82  dodet = fv3.firstChild();
83 
84  while (dodet) {
85  const DDLogicalPart& log = fv3.logicalPart();
86  if (!isItHF(log.name().name(), php)) {
87  bool notIn = true;
88  for (unsigned int i = 0; i < php.hcalMaterialNames_.size(); ++i) {
89  if (!strcmp(php.hcalMaterialNames_[i].c_str(), log.material().name().name().c_str())) {
90  notIn = false;
91  break;
92  }
93  }
94  if (notIn)
95  php.hcalMaterialNames_.push_back(log.material().name().name());
96  }
97  dodet = fv2.next();
98  }
99 
100  return buildParameters(php);
101 }
std::vector< std::string > getNames(DDFilteredView &fv)
std::vector< double > getDDDArray(const std::string &str, const DDsvalues_type &sv, int &nmin)
std::vector< double > shortFiberLength_
std::vector< double > longFiberLength_
std::vector< std::string > hfNames_
std::vector< std::string > hfFibreNames_
bool isItHF(const std::string &, const HcalSimulationParameters &)
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
const int neta
bool buildParameters(const HcalSimulationParameters &)
std::vector< std::string > hfFibreConicalNames_
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
Definition: value.py:1
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.h:7
std::vector< std::string > hcalMaterialNames_
std::vector< std::string > hfPMTNames_
void fillNameVector(const DDCompactView *, const std::string &, const std::string &, std::vector< std::string > &)
std::vector< std::string > hfFibreStraightNames_
std::vector< double > attenuationLength_
void fillPMTs(const std::vector< double > &, bool, HcalSimulationParameters &)

◆ build() [2/2]

bool HcalSimParametersFromDD::build ( const cms::DDCompactView cpv,
HcalSimulationParameters php 
)

Definition at line 103 of file HcalSimParametersFromDD.cc.

References HcalSimulationParameters::attenuationLength_, filterCSVwithJSON::copy, cms::DDFilteredView::copyNos(), counter, ALCARECOTkAlBeamHalo_cff::filter, spr::find(), cms::DDFilteredView::firstChild(), cms::DDFilteredView::get(), HcalSimulationParameters::hcalMaterialNames_, HcalSimulationParameters::hfFibreConicalNames_, HcalSimulationParameters::hfFibreNames_, HcalSimulationParameters::hfFibreStraightNames_, HcalSimulationParameters::hfLevels_, HcalSimulationParameters::hfNames_, HcalSimulationParameters::hfPMTNames_, HcalSimulationParameters::lambdaLimits_, HcalSimulationParameters::longFiberLength_, cms::DDFilteredView::materialName(), dqmiodumpmetadata::n, neta, and HcalSimulationParameters::shortFiberLength_.

103  {
104 #ifdef EDM_ML_DEBUG
105  edm::LogVerbatim("HCalGeom")
106  << "Inside HcalSimParametersFromDD::build(const cms::DDCompactView*, HcalSimulationParameters&)";
107 #endif
108 
109  // HCal materials
110  const cms::DDFilter filter("OnlyForHcalSimNumbering", "HCAL");
111  cms::DDFilteredView fv(cpv, filter);
112 
113  {
114  BenchmarkGrd counter("HcalSimParametersFromDD get all vectors\n");
115 
116  // The level positions
117  php.hfLevels_ = fv.get<std::vector<int> >("hf", "Levels");
118 
119  // Attenuation length
120  php.attenuationLength_ = fv.get<std::vector<double> >("hf", "attl");
121  std::for_each(
122  php.attenuationLength_.begin(), php.attenuationLength_.end(), [](double& n) { n *= k_ScaleFromDD4hepInv; });
123 
124  // Limits on Lambda
125  php.lambdaLimits_ = fv.get<std::vector<int> >("hf", "lambLim");
126 
127  // Fibre Lengths
128  php.longFiberLength_ = fv.get<std::vector<double> >("hf", "LongFL");
129  std::for_each(php.longFiberLength_.begin(), php.longFiberLength_.end(), [](double& n) { n *= k_ScaleFromDD4hep; });
130  php.shortFiberLength_ = fv.get<std::vector<double> >("hf", "ShortFL");
131  std::for_each(
132  php.shortFiberLength_.begin(), php.shortFiberLength_.end(), [](double& n) { n *= k_ScaleFromDD4hep; });
133 
134  //Parameters for the PMT
135  std::vector<double> neta = fv.get<std::vector<double> >("hfpmt", "indexPMTR");
136  fillPMTs(neta, false, php);
137  neta = fv.get<std::vector<double> >("hfpmt", "indexPMTL");
138  fillPMTs(neta, true, php);
139 
140  // Parameters for the fibers
141  fillNameVector(cpv, "HF", php.hfNames_);
142 
143  //Names of special volumes (HFFibre, HFPMT, HFFibreBundles)
144  fillNameVector(cpv, "HFFibre", php.hfFibreNames_);
145  fillNameVector(cpv, "HFPMT", php.hfPMTNames_);
146  fillNameVector(cpv, "HFFibreBundleStraight", php.hfFibreStraightNames_);
147  fillNameVector(cpv, "HFFibreBundleConical", php.hfFibreConicalNames_);
148  }
149  {
150  BenchmarkGrd counter("HcalSimParametersFromDD HCal materials OnlyForHcalSimNumbering, HCAL");
151 
152  while (fv.firstChild()) {
153  std::vector<int> copy = fv.copyNos();
154  // idet = 3 for HB and 4 for HE (convention in the ddalgo code for HB/HE)
155  int idet = (copy.size() > 1) ? (copy[1] / 1000) : 0;
156  if ((idet == 3) || (idet == 4)) {
157  std::string_view matName = dd4hep::dd::noNamespace(fv.materialName());
158  if (std::find(std::begin(php.hcalMaterialNames_), std::end(php.hcalMaterialNames_), matName) ==
159  std::end(php.hcalMaterialNames_)) {
160  php.hcalMaterialNames_.emplace_back(matName);
161  }
162  }
163  }
164  }
165 
166  return buildParameters(php);
167 }
Log< level::Info, true > LogVerbatim
std::vector< double > shortFiberLength_
std::vector< double > longFiberLength_
static constexpr double k_ScaleFromDD4hep
std::vector< std::string > hfNames_
std::vector< std::string > hfFibreNames_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
const int neta
bool buildParameters(const HcalSimulationParameters &)
std::vector< std::string > hfFibreConicalNames_
static constexpr double k_ScaleFromDD4hepInv
std::vector< std::string > hcalMaterialNames_
std::vector< std::string > hfPMTNames_
static std::atomic< unsigned int > counter
void fillNameVector(const DDCompactView *, const std::string &, const std::string &, std::vector< std::string > &)
std::vector< std::string > hfFibreStraightNames_
std::vector< double > attenuationLength_
void fillPMTs(const std::vector< double > &, bool, HcalSimulationParameters &)

◆ buildParameters()

bool HcalSimParametersFromDD::buildParameters ( const HcalSimulationParameters php)
private

Definition at line 169 of file HcalSimParametersFromDD.cc.

References HcalSimulationParameters::attenuationLength_, angle_units::operators::convertMmToCm(), HcalSimulationParameters::hcalMaterialNames_, HcalSimulationParameters::hfFibreConicalNames_, HcalSimulationParameters::hfFibreNames_, HcalSimulationParameters::hfFibreStraightNames_, HcalSimulationParameters::hfLevels_, HcalSimulationParameters::hfNames_, HcalSimulationParameters::hfPMTNames_, cuy::ii, dqmdumpme::k, HcalSimulationParameters::lambdaLimits_, HcalSimulationParameters::longFiberLength_, HcalSimulationParameters::pmtFiberLeft_, HcalSimulationParameters::pmtFiberRight_, HcalSimulationParameters::pmtLeft_, HcalSimulationParameters::pmtRight_, and HcalSimulationParameters::shortFiberLength_.

169  {
170 #ifdef EDM_ML_DEBUG
171  std::stringstream ss0;
172  for (unsigned int it = 0; it < php.hfNames_.size(); it++) {
173  if (it / 10 * 10 == it)
174  ss0 << "\n";
175  ss0 << " [" << it << "] " << php.hfNames_[it];
176  }
177  edm::LogVerbatim("HCalGeom") << "HFNames: " << php.hfNames_.size() << ": " << ss0.str();
178 
179  std::stringstream ss1;
180  for (unsigned int it = 0; it < php.hfLevels_.size(); it++) {
181  if (it / 10 * 10 == it)
182  ss1 << "\n";
183  ss1 << " [" << it << "] " << php.hfLevels_[it];
184  }
185  edm::LogVerbatim("HCalGeom") << "HF Volume Levels: " << php.hfLevels_.size() << " hfLevels: " << ss1.str();
186 
187  std::stringstream ss2;
188  for (unsigned int it = 0; it < php.attenuationLength_.size(); it++) {
189  if (it / 10 * 10 == it)
190  ss2 << "\n";
191  ss2 << " " << convertMmToCm(php.attenuationLength_[it]);
192  }
193  edm::LogVerbatim("HCalGeom") << "AttenuationLength: " << php.attenuationLength_.size()
194  << " attL(1/cm): " << ss2.str();
195 
196  std::stringstream ss3;
197  for (unsigned int it = 0; it < php.lambdaLimits_.size(); it++) {
198  if (it / 10 * 10 == it)
199  ss3 << "\n";
200  ss3 << " " << php.lambdaLimits_[it];
201  }
202  edm::LogVerbatim("HCalGeom") << php.lambdaLimits_.size() << " Limits on lambda " << ss3.str();
203 
204  std::stringstream ss4;
205  for (unsigned int it = 0; it < php.longFiberLength_.size(); it++) {
206  if (it / 10 * 10 == it)
207  ss4 << "\n";
208  ss4 << " " << convertMmToCm(php.longFiberLength_[it]);
209  }
210  edm::LogVerbatim("HCalGeom") << php.longFiberLength_.size() << " Long Fibre Length(cm):" << ss4.str();
211 
212  std::stringstream ss5;
213  for (unsigned int it = 0; it < php.shortFiberLength_.size(); it++) {
214  if (it / 10 * 10 == it)
215  ss5 << "\n";
216  ss5 << " " << convertMmToCm(php.shortFiberLength_[it]);
217  }
218  edm::LogVerbatim("HCalGeom") << php.shortFiberLength_.size() << " Short Fibre Length(cm):" << ss5.str();
219 
220  edm::LogVerbatim("HCalGeom") << "HcalSimParameters: gets the Index matches for " << php.pmtRight_.size() << " PMTs";
221  for (unsigned int ii = 0; ii < php.pmtRight_.size(); ii++)
222  edm::LogVerbatim("HCalGeom") << "rIndexR[" << ii << "] = " << php.pmtRight_[ii] << " fibreR[" << ii
223  << "] = " << php.pmtFiberRight_[ii] << " rIndexL[" << ii << "] = " << php.pmtLeft_[ii]
224  << " fibreL[" << ii << "] = " << php.pmtFiberLeft_[ii];
225 
226  edm::LogVerbatim("HCalGeom") << "HcalSimParameters: " << php.hfFibreNames_.size() << " names of HFFibre";
227  for (unsigned int k = 0; k < php.hfFibreNames_.size(); ++k)
228  edm::LogVerbatim("HCalGeom") << "[" << k << "] " << php.hfFibreNames_[k];
229 
230  edm::LogVerbatim("HCalGeom") << "HcalSimParameters: " << php.hfPMTNames_.size() << " names of HFPMT";
231  for (unsigned int k = 0; k < php.hfPMTNames_.size(); ++k)
232  edm::LogVerbatim("HCalGeom") << "[" << k << "] " << php.hfPMTNames_[k];
233 
234  edm::LogVerbatim("HCalGeom") << "HcalSimParameters: " << php.hfFibreStraightNames_.size()
235  << " names of HFFibreBundleStraight";
236  for (unsigned int k = 0; k < php.hfFibreStraightNames_.size(); ++k)
237  edm::LogVerbatim("HCalGeom") << "[" << k << "] " << php.hfFibreStraightNames_[k];
238 
239  edm::LogVerbatim("HCalGeom") << "HcalSimParameters: " << php.hfFibreConicalNames_.size()
240  << " names of FibreBundleConical";
241  for (unsigned int k = 0; k < php.hfFibreConicalNames_.size(); ++k)
242  edm::LogVerbatim("HCalGeom") << "[" << k << "] " << php.hfFibreConicalNames_[k];
243 
244  edm::LogVerbatim("HCalGeom") << "HcalSimParameters: " << php.hcalMaterialNames_.size() << " names of HCAL materials";
245  for (unsigned int k = 0; k < php.hcalMaterialNames_.size(); ++k)
246  edm::LogVerbatim("HCalGeom") << "[" << k << "] " << php.hcalMaterialNames_[k];
247 #endif
248 
249  return true;
250 }
Log< level::Info, true > LogVerbatim
std::vector< double > shortFiberLength_
std::vector< double > longFiberLength_
std::vector< std::string > hfNames_
std::vector< std::string > hfFibreNames_
std::vector< std::string > hfFibreConicalNames_
ii
Definition: cuy.py:589
constexpr NumType convertMmToCm(NumType millimeters)
Definition: angle_units.h:44
std::vector< std::string > hcalMaterialNames_
std::vector< std::string > hfPMTNames_
std::vector< std::string > hfFibreStraightNames_
std::vector< double > attenuationLength_

◆ fillNameVector() [1/2]

void HcalSimParametersFromDD::fillNameVector ( const DDCompactView cpv,
const std::string &  attribute,
const std::string &  value,
std::vector< std::string > &  lvnames 
)
private

Definition at line 252 of file HcalSimParametersFromDD.cc.

References ALCARECOTkAlBeamHalo_cff::filter, and MsgTools::getNames().

255  {
257  DDFilteredView fv(*cpv, filter);
258  lvnames = getNames(fv);
259 }
std::vector< std::string > getNames(DDFilteredView &fv)
Definition: value.py:1

◆ fillNameVector() [2/2]

void HcalSimParametersFromDD::fillNameVector ( const cms::DDCompactView cpv,
const std::string &  value,
std::vector< std::string > &  lvnames 
)
private

Definition at line 261 of file HcalSimParametersFromDD.cc.

References counter, ALCARECOTkAlBeamHalo_cff::filter, and MsgTools::getNames().

263  {
264  {
265  BenchmarkGrd counter("HcalSimParametersFromDD::fillNameVector");
266  const cms::DDFilter filter("Volume", value);
267  cms::DDFilteredView fv(cpv, filter);
268  lvnames = getNames(fv);
269  }
270 }
std::vector< std::string > getNames(DDFilteredView &fv)
Definition: value.py:1
static std::atomic< unsigned int > counter

◆ fillPMTs()

void HcalSimParametersFromDD::fillPMTs ( const std::vector< double > &  neta,
bool  lOrR,
HcalSimulationParameters php 
)
private

Definition at line 272 of file HcalSimParametersFromDD.cc.

References counter, cuy::ii, neta, HcalSimulationParameters::pmtFiberLeft_, HcalSimulationParameters::pmtFiberRight_, HcalSimulationParameters::pmtLeft_, and HcalSimulationParameters::pmtRight_.

272  {
273  {
274  BenchmarkGrd counter("HcalSimParametersFromDD::fillPMTs");
275  for (unsigned int ii = 0; ii < neta.size(); ii++) {
276  int index = static_cast<int>(neta[ii]);
277  int ir = -1, ifib = -1;
278  if (index >= 0) {
279  ir = index / 10;
280  ifib = index % 10;
281  }
282  if (lOrR) {
283  php.pmtLeft_.push_back(ir);
284  php.pmtFiberLeft_.push_back(ifib);
285  } else {
286  php.pmtRight_.push_back(ir);
287  php.pmtFiberRight_.push_back(ifib);
288  }
289  }
290  }
291 }
const int neta
ii
Definition: cuy.py:589
static std::atomic< unsigned int > counter

◆ getDDDArray()

std::vector< double > HcalSimParametersFromDD::getDDDArray ( const std::string &  str,
const DDsvalues_type sv,
int &  nmin 
)
private

Definition at line 339 of file HcalSimParametersFromDD.cc.

References DDfetch(), Exception, TrackingDataMCValidation_Standalone_cff::nmin, str, pfDeepBoostedJetPreprocessParams_cfi::sv, and relativeConstraints::value.

339  {
340 #ifdef EDM_ML_DEBUG
341  edm::LogVerbatim("HCalGeom") << "HcalSimParametersFromDD::getDDDArray called for " << str << " with nMin " << nmin;
342 #endif
343  DDValue value(str);
344  if (DDfetch(&sv, value)) {
345 #ifdef EDM_ML_DEBUG
346  edm::LogVerbatim("HCalGeom") << value;
347 #endif
348  const std::vector<double>& fvec = value.doubles();
349  int nval = fvec.size();
350  if (nmin > 0) {
351  if (nval < nmin) {
352  edm::LogError("HCalGeom") << "# of " << str << " bins " << nval << " < " << nmin << " ==> illegal";
353  throw cms::Exception("HcalSimParametersFromDD") << "nval < nmin for array " << str << "\n";
354  }
355  } else {
356  if (nval < 1 && nmin != 0) {
357  edm::LogError("HCalGeom") << "# of " << str << " bins " << nval << " < 1 ==> illegal (nmin=" << nmin << ")";
358  throw cms::Exception("HcalSimParametersFromDD") << "nval < 1 for array " << str << "\n";
359  }
360  }
361  nmin = nval;
362  return fvec;
363  } else {
364  if (nmin != 0) {
365  edm::LogError("HCalGeom") << "Cannot get array " << str;
366  throw cms::Exception("HcalSimParametersFromDD") << "cannot get array " << str << "\n";
367  } else {
368  std::vector<double> fvec;
369  return fvec;
370  }
371  }
372 }
Log< level::Info, true > LogVerbatim
Log< level::Error, false > LogError
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
Definition: value.py:1
#define str(s)

◆ getNames() [1/2]

std::vector< std::string > HcalSimParametersFromDD::getNames ( DDFilteredView fv)
private

Definition at line 310 of file HcalSimParametersFromDD.cc.

References DDFilteredView::firstChild(), mps_fire::i, dqm-mbProfile::log, DDFilteredView::logicalPart(), DDFilteredView::next(), convertSQLiteXML::ok, and createJobs::tmp.

310  {
311  std::vector<std::string> tmp;
312  bool dodet = fv.firstChild();
313  while (dodet) {
314  const DDLogicalPart& log = fv.logicalPart();
315  bool ok = true;
316 
317  for (unsigned int i = 0; i < tmp.size(); ++i) {
318  if (!strcmp(tmp[i].c_str(), log.name().name().c_str())) {
319  ok = false;
320  break;
321  }
322  }
323  if (ok)
324  tmp.push_back(log.name().name());
325  dodet = fv.next();
326  }
327  return tmp;
328 }
bool next()
set current node to the next node in the filtered tree
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
bool firstChild()
set the current node to the first child ...
tmp
align.sh
Definition: createJobs.py:716

◆ getNames() [2/2]

std::vector< std::string > HcalSimParametersFromDD::getNames ( cms::DDFilteredView fv)
private

Definition at line 330 of file HcalSimParametersFromDD.cc.

References spr::find(), cms::DDFilteredView::firstChild(), cms::DDFilteredView::name(), and createJobs::tmp.

330  {
331  std::vector<std::string> tmp;
332  while (fv.firstChild()) {
333  if (std::find(std::begin(tmp), std::end(tmp), fv.name()) == std::end(tmp))
334  tmp.emplace_back(fv.name());
335  }
336  return tmp;
337 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::string_view name() const
bool firstChild()
set the current node to the first child
tmp
align.sh
Definition: createJobs.py:716

◆ isItHF()

bool HcalSimParametersFromDD::isItHF ( const std::string &  name,
const HcalSimulationParameters php 
)
private

Definition at line 293 of file HcalSimParametersFromDD.cc.

References spr::find(), HcalSimulationParameters::hfFibreConicalNames_, HcalSimulationParameters::hfFibreNames_, HcalSimulationParameters::hfFibreStraightNames_, HcalSimulationParameters::hfNames_, HcalSimulationParameters::hfPMTNames_, and Skims_PA_cff::name.

293  {
294  if (std::find(std::begin(php.hfNames_), std::end(php.hfNames_), name) != std::end(php.hfNames_))
295  return true;
296  if (std::find(std::begin(php.hfFibreNames_), std::end(php.hfFibreNames_), name) != std::end(php.hfFibreNames_))
297  return true;
298  if (std::find(std::begin(php.hfPMTNames_), std::end(php.hfPMTNames_), name) != std::end(php.hfPMTNames_))
299  return true;
300  if (std::find(std::begin(php.hfFibreStraightNames_), std::end(php.hfFibreStraightNames_), name) !=
301  std::end(php.hfFibreStraightNames_))
302  return true;
303  if (std::find(std::begin(php.hfFibreConicalNames_), std::end(php.hfFibreConicalNames_), name) !=
304  std::end(php.hfFibreConicalNames_))
305  return true;
306 
307  return false;
308 }
std::vector< std::string > hfNames_
std::vector< std::string > hfFibreNames_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< std::string > hfFibreConicalNames_
std::vector< std::string > hfPMTNames_
std::vector< std::string > hfFibreStraightNames_

Member Data Documentation

◆ k_ScaleFromDD4hep

constexpr double HcalSimParametersFromDD::k_ScaleFromDD4hep = (1.0 / dd4hep::mm)
staticprivate

Definition at line 30 of file HcalSimParametersFromDD.h.

◆ k_ScaleFromDD4hepInv

constexpr double HcalSimParametersFromDD::k_ScaleFromDD4hepInv = dd4hep::mm
staticprivate

Definition at line 31 of file HcalSimParametersFromDD.h.