|
|
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");
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++) {
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())) {
324 tmp.push_back(
log.name().name());
331 std::vector<std::string>
tmp;
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;
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_
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_
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_
const HitContainer *__restrict__ const TkSoA *__restrict__ Quality *__restrict__ uint16_t nmin
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< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
std::vector< std::string > hfNames_
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::vector< double > attenuationLength_