16 using namespace geant_units::operators;
53 throw cms::Exception(
"HcalSimParametersFromDD") <<
"Not found " << value <<
" for " << attribute <<
" but needed.";
63 std::vector<double>
neta = getDDDArray(
"indexPMTR", sv, nb);
64 fillPMTs(neta,
false, php);
66 neta = getDDDArray(
"indexPMTL", sv, nb);
67 fillPMTs(neta,
true, php);
69 throw cms::Exception(
"HcalSimParametersFromDD") <<
"Not found " << value <<
" for " << attribute <<
" but needed.";
74 fillNameVector(cpv, attribute,
"HFPMT", php.
hfPMTNames_);
79 attribute =
"OnlyForHcalSimNumbering";
86 if (!isItHF(log.
name().
name(), php)) {
100 return buildParameters(php);
106 <<
"Inside HcalSimParametersFromDD::build(const cms::DDCompactView*, HcalSimulationParameters&)";
117 php.
hfLevels_ = fv.
get<std::vector<int> >(
"hf",
"Levels");
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);
141 fillNameVector(cpv,
"HF", php.
hfNames_);
150 BenchmarkGrd counter(
"HcalSimParametersFromDD HCal materials OnlyForHcalSimNumbering, HCAL");
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());
166 return buildParameters(php);
171 std::stringstream ss0;
172 for (
unsigned int it = 0; it < php.
hfNames_.size(); it++) {
173 if (it / 10 * 10 == it)
175 ss0 <<
" [" << it <<
"] " << php.
hfNames_[it];
179 std::stringstream ss1;
180 for (
unsigned int it = 0; it < php.
hfLevels_.size(); it++) {
181 if (it / 10 * 10 == it)
183 ss1 <<
" [" << it <<
"] " << php.
hfLevels_[it];
187 std::stringstream ss2;
189 if (it / 10 * 10 == it)
194 <<
" attL(1/cm): " << ss2.str();
196 std::stringstream ss3;
197 for (
unsigned int it = 0; it < php.
lambdaLimits_.size(); it++) {
198 if (it / 10 * 10 == it)
204 std::stringstream ss4;
206 if (it / 10 * 10 == it)
212 std::stringstream ss5;
214 if (it / 10 * 10 == it)
235 <<
" names of HFFibreBundleStraight";
240 <<
" names of FibreBundleConical";
255 std::vector<std::string>& lvnames) {
263 std::vector<std::string>& lvnames) {
275 for (
unsigned int ii = 0;
ii < neta.size();
ii++) {
276 int index =
static_cast<int>(neta[
ii]);
277 int ir = -1, ifib = -1;
311 std::vector<std::string>
tmp;
317 for (
unsigned int i = 0;
i < tmp.size(); ++
i) {
318 if (!strcmp(tmp[
i].c_str(), log.
name().
name().c_str())) {
331 std::vector<std::string>
tmp;
334 tmp.emplace_back(fv.
name());
341 edm::LogVerbatim(
"HCalGeom") <<
"HcalSimParametersFromDD::getDDDArray called for " << str <<
" with nMin " <<
nmin;
348 const std::vector<double>& fvec = value.
doubles();
349 int nval = fvec.size();
352 edm::LogError(
"HCalGeom") <<
"# of " << str <<
" bins " << nval <<
" < " << nmin <<
" ==> illegal";
353 throw cms::Exception(
"HcalSimParametersFromDD") <<
"nval < nmin for array " << str <<
"\n";
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";
366 throw cms::Exception(
"HcalSimParametersFromDD") <<
"cannot get array " << str <<
"\n";
368 std::vector<double> fvec;
Log< level::Info, true > LogVerbatim
std::vector< std::string > getNames(DDFilteredView &fv)
std::vector< int > pmtLeft_
std::vector< double > getDDDArray(const std::string &str, const DDsvalues_type &sv, int &nmin)
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const std::vector< double > & doubles() const
a reference to the double-valued values stored in the given instance of DDValue
static std::vector< std::string > checklist log
std::vector< int > pmtRight_
std::vector< double > shortFiberLength_
std::vector< double > longFiberLength_
std::string_view materialName() const
std::vector< std::string > hfNames_
std::vector< std::string > hfFibreNames_
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Compact representation of the geometrical detector hierarchy.
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
bool isItHF(const std::string &, const HcalSimulationParameters &)
std::vector< int > lambdaLimits_
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::vector< int > pmtFiberLeft_
bool next()
set current node to the next node in the filtered tree
bool buildParameters(const HcalSimulationParameters &)
std::vector< std::string > hfFibreConicalNames_
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
std::string_view name() const
Quality *__restrict__ uint16_t nmin
bool firstChild()
set the current node to the first child
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
const std::vector< int > copyNos() const
The list of the volume copy numbers.
T get(const std::string &)
extract attribute value
constexpr NumType convertMmToCm(NumType millimeters)
std::vector< std::string > hcalMaterialNames_
std::vector< int > pmtFiberRight_
bool build(const DDCompactView *, HcalSimulationParameters &)
std::vector< std::string > hfPMTNames_
DDsvalues_type mergedSpecifics() const
static std::atomic< unsigned int > counter
void fillNameVector(const DDCompactView *, const std::string &, const std::string &, std::vector< std::string > &)
bool firstChild()
set the current node to the first child ...
std::vector< std::string > hfFibreStraightNames_
std::vector< double > attenuationLength_
const std::string & name() const
Returns the name.
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
std::vector< int > hfLevels_
void fillPMTs(const std::vector< double > &, bool, HcalSimulationParameters &)