#include <CaloSimParametersFromDD.h>
Definition at line 14 of file CaloSimParametersFromDD.h.
◆ CaloSimParametersFromDD()
CaloSimParametersFromDD::CaloSimParametersFromDD |
( |
| ) |
|
|
default |
◆ ~CaloSimParametersFromDD()
virtual CaloSimParametersFromDD::~CaloSimParametersFromDD |
( |
| ) |
|
|
inlinevirtual |
◆ build() [1/2]
Definition at line 21 of file CaloSimParametersFromDD.cc.
References buildParameters(), CaloSimulationParameters::caloNames_, CaloSimulationParameters::fCaloNames_, ALCARECOTkAlBeamHalo_cff::filter, DDFilteredView::firstChild(), CaloSimulationParameters::fLevels_, getNames(), getNumbers(), CaloSimulationParameters::insideLevel_, CaloSimulationParameters::insideNames_, CaloSimulationParameters::levels_, DDFilteredView::mergedSpecifics(), Skims_PA_cff::name, CaloSimulationParameters::neighbours_, AlCaHLTBitMon_QueryRunRegistry::string, and pfDeepBoostedJetPreprocessParams_cfi::sv.
24 <<
"Inside CaloSimParametersFromDD::build(const DDCompactView*, CaloSimulationParameters&)";
33 edm::LogVerbatim(
"HCalGeom") <<
"Filtered view " << &fv <<
" after filter with " <<
sv.size() <<
" contents";
Log< level::Info, true > LogVerbatim
std::vector< std::string > insideNames_
std::vector< int > levels_
std::vector< std::string > getNames(const std::string &, const DDsvalues_type &, bool)
std::vector< int > insideLevel_
std::vector< int > fLevels_
std::vector< std::string > fCaloNames_
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::vector< int > neighbours_
std::vector< int > getNumbers(const std::string &, const DDsvalues_type &, bool)
bool buildParameters(const CaloSimulationParameters &)
std::vector< std::string > caloNames_
◆ build() [2/2]
Definition at line 46 of file CaloSimParametersFromDD.cc.
References buildParameters(), CaloSimulationParameters::caloNames_, dbl_to_int(), cms::DDCompactView::detector(), CaloSimulationParameters::fCaloNames_, CaloSimulationParameters::fLevels_, CaloSimulationParameters::insideLevel_, CaloSimulationParameters::insideNames_, CaloSimulationParameters::levels_, CaloSimulationParameters::neighbours_, and cms::DDDetector::worldVolume().
49 <<
"Inside CaloSimParametersFromDD::build(const cms::DDCompactView*, CaloSimulationParameters&)";
53 php.
caloNames_ = fv.get<std::vector<std::string> >(
"calo",
"Calorimeter");
56 php.
insideNames_ = fv.get<std::vector<std::string> >(
"calo",
"Inside");
58 php.
fCaloNames_ = fv.get<std::vector<std::string> >(
"calo",
"FineCalorimeter");
Log< level::Info, true > LogVerbatim
std::vector< std::string > insideNames_
std::vector< int > levels_
const cms::DDDetector * detector() const
std::vector< int > insideLevel_
std::vector< int > fLevels_
std::vector< std::string > fCaloNames_
std::vector< int > neighbours_
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
dd4hep::Volume worldVolume() const
Handle to the world volume containing everything.
bool buildParameters(const CaloSimulationParameters &)
std::vector< std::string > caloNames_
◆ buildParameters()
Definition at line 64 of file CaloSimParametersFromDD.cc.
References CaloSimulationParameters::caloNames_, Exception, CaloSimulationParameters::fCaloNames_, CaloSimulationParameters::fLevels_, CaloSimulationParameters::insideLevel_, CaloSimulationParameters::insideNames_, CaloSimulationParameters::levels_, myPrint(), and CaloSimulationParameters::neighbours_.
Referenced by build().
77 <<
" does not match with " << php.
neighbours_.size() <<
" ==> illegal ";
79 <<
"Calorimeter array size does not match with size of neighbours\n";
std::vector< std::string > insideNames_
std::vector< int > levels_
std::vector< int > insideLevel_
Log< level::Error, false > LogError
std::vector< int > fLevels_
std::vector< std::string > fCaloNames_
std::vector< int > neighbours_
void myPrint(std::string value, const std::vector< T > &vec)
std::vector< std::string > caloNames_
◆ getNames()
std::vector< std::string > CaloSimParametersFromDD::getNames |
( |
const std::string & |
str, |
|
|
const DDsvalues_type & |
sv, |
|
|
bool |
ignore |
|
) |
| |
|
private |
Definition at line 85 of file CaloSimParametersFromDD.cc.
References DDfetch(), Exception, SequenceTypes::ignore(), str, pfDeepBoostedJetPreprocessParams_cfi::sv, and relativeConstraints::value.
Referenced by build().
96 const std::vector<std::string>& fvec =
value.strings();
97 int nval = fvec.size();
98 if ((nval < 1) && (!
ignore)) {
99 edm::LogError(
"HCalGeom") <<
"CaloSimParametersFromDD: # of " <<
str <<
" bins " << nval <<
" < 1 ==> illegal ";
100 throw cms::Exception(
"Unknown",
"CaloSimParametersFromDD") <<
"nval < 1 for array " <<
str <<
"\n";
105 std::vector<std::string> fvec;
108 edm::LogError(
"HCalGeom") <<
"CaloSimParametersFromDD: cannot get array " <<
str;
109 throw cms::Exception(
"Unknown",
"CaloSimParametersFromDD") <<
"cannot get array " <<
str <<
"\n";
Log< level::Info, true > LogVerbatim
Log< level::Error, false > LogError
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
◆ getNumbers()
std::vector< int > CaloSimParametersFromDD::getNumbers |
( |
const std::string & |
str, |
|
|
const DDsvalues_type & |
sv, |
|
|
bool |
ignore |
|
) |
| |
|
private |
Definition at line 113 of file CaloSimParametersFromDD.cc.
References dbl_to_int(), DDfetch(), Exception, SequenceTypes::ignore(), str, pfDeepBoostedJetPreprocessParams_cfi::sv, and relativeConstraints::value.
Referenced by build().
122 const std::vector<double>& fvec =
value.doubles();
123 int nval = fvec.size();
124 if ((nval < 1) && (!
ignore)) {
125 edm::LogError(
"HCalGeom") <<
"CaloSimParametersFromDD: # of " <<
str <<
" bins " << nval <<
" < 1 ==> illegal ";
126 throw cms::Exception(
"Unknown",
"CaloSimParametersFromDD") <<
"nval < 2 for array " <<
str <<
"\n";
130 std::vector<int> fvec;
133 edm::LogError(
"HCalGeom") <<
"CaloSimParametersFromDD: cannot get array " <<
str;
134 throw cms::Exception(
"Unknown",
"CaloSimParametersFromDD") <<
"cannot get array " <<
str <<
"\n";
Log< level::Info, true > LogVerbatim
Log< level::Error, false > LogError
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.