|
|
Go to the documentation of this file.
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");
120 static const double cminv2mminv = 0.1;
134 std::vector<double>
neta = fv.
get<std::vector<double> >(
"hfpmt",
"indexPMTR");
135 fillPMTs(
neta,
false, php);
136 neta = fv.
get<std::vector<double> >(
"hfpmt",
"indexPMTL");
137 fillPMTs(
neta,
true, php);
140 fillNameVector(cpv,
"HF", php.
hfNames_);
149 BenchmarkGrd counter(
"HcalSimParametersFromDD HCal materials OnlyForHcalSimNumbering, HCAL");
154 int idet = (
copy.size() > 1) ? (
copy[1] / 1000) : 0;
155 if ((idet == 3) || (idet == 4)) {
156 std::string_view matName = dd4hep::dd::noNamespace(fv.
materialName());
165 return buildParameters(php);
170 std::stringstream ss0;
171 for (
unsigned int it = 0; it < php.
hfNames_.size(); it++) {
172 if (it / 10 * 10 == it)
174 ss0 <<
" [" << it <<
"] " << php.
hfNames_[it];
178 std::stringstream ss1;
179 for (
unsigned int it = 0; it < php.
hfLevels_.size(); it++) {
180 if (it / 10 * 10 == it)
182 ss1 <<
" [" << it <<
"] " << php.
hfLevels_[it];
186 std::stringstream ss2;
188 if (it / 10 * 10 == it)
193 <<
" attL(1/cm): " << ss2.str();
195 std::stringstream ss3;
196 for (
unsigned int it = 0; it < php.
lambdaLimits_.size(); it++) {
197 if (it / 10 * 10 == it)
203 std::stringstream ss4;
205 if (it / 10 * 10 == it)
211 std::stringstream ss5;
213 if (it / 10 * 10 == it)
234 <<
" names of HFFibreBundleStraight";
239 <<
" names of FibreBundleConical";
254 std::vector<std::string>& lvnames) {
262 std::vector<std::string>& lvnames) {
274 for (
unsigned int ii = 0;
ii <
neta.size();
ii++) {
276 int ir = -1, ifib = -1;
310 std::vector<std::string>
tmp;
316 for (
unsigned int i = 0;
i <
tmp.size(); ++
i) {
317 if (!strcmp(
tmp[
i].c_str(),
log.name().name().c_str())) {
323 tmp.push_back(
log.name().name());
330 std::vector<std::string>
tmp;
340 edm::LogVerbatim(
"HCalGeom") <<
"HcalSimParametersFromDD::getDDDArray called for " <<
str <<
" with nMin " << nmin;
347 const std::vector<double>& fvec =
value.doubles();
348 int nval = fvec.size();
351 edm::LogError(
"HCalGeom") <<
"# of " <<
str <<
" bins " << nval <<
" < " << nmin <<
" ==> illegal";
352 throw cms::Exception(
"HcalSimParametersFromDD") <<
"nval < nmin for array " <<
str <<
"\n";
355 if (nval < 1 && nmin != 0) {
356 edm::LogError(
"HCalGeom") <<
"# of " <<
str <<
" bins " << nval <<
" < 1 ==> illegal (nmin=" << nmin <<
")";
357 throw cms::Exception(
"HcalSimParametersFromDD") <<
"nval < 1 for array " <<
str <<
"\n";
365 throw cms::Exception(
"HcalSimParametersFromDD") <<
"cannot get array " <<
str <<
"\n";
367 std::vector<double> fvec;
std::vector< double > longFiberLength_
void fillPMTs(const std::vector< double > &, bool, HcalSimulationParameters &)
std::vector< std::string > getNames(DDFilteredView &fv)
std::vector< std::string > hfPMTNames_
std::vector< double > getDDDArray(const std::string &str, const DDsvalues_type &sv, int &nmin)
DDsvalues_type mergedSpecifics() const
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
std::vector< int > hfLevels_
std::vector< int > pmtLeft_
std::vector< int > lambdaLimits_
std::vector< std::string > hfFibreStraightNames_
std::vector< int > pmtFiberRight_
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< std::string > hfFibreNames_
std::string_view name() const
T get(const std::string &)
extract attribute value
bool firstChild()
set the current node to the first child ...
bool next()
set current node to the next node in the filtered tree
Compact representation of the geometrical detector hierarchy.
const std::vector< int > copyNos() const
The list of the volume copy numbers.
bool firstChild()
set the current node to the first child
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
std::vector< int > pmtFiberLeft_
std::vector< int > pmtRight_
bool isItHF(const std::string &, const HcalSimulationParameters &)
bool buildParameters(const HcalSimulationParameters &)
std::vector< std::string > hfFibreConicalNames_
constexpr NumType convertCmToMm(NumType centimeters)
std::vector< std::string > hcalMaterialNames_
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
static std::atomic< unsigned int > counter
Log< level::Error, false > LogError
std::vector< double > shortFiberLength_
bool build(const DDCompactView *, HcalSimulationParameters &)
Log< level::Info, true > LogVerbatim
std::string_view materialName() const
constexpr NumType convertMmToCm(NumType millimeters)
void fillNameVector(const DDCompactView *, const std::string &, const std::string &, std::vector< std::string > &)
std::vector< std::string > hfNames_
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::vector< double > attenuationLength_