20 constexpr static uint32_t kMaxDepth_barrel = 4;
21 constexpr static uint32_t kMaxDepth_endcap = 7;
22 product = std::make_shared<reco::PFClusterParamsHostCollection>(
std::max(kMaxDepth_barrel, kMaxDepth_endcap),
27 auto const& sfConf = iConfig.getParameterSet(
"seedFinder");
28 view.nNeigh() = sfConf.getParameter<
int>(
"nNeighbours");
29 auto const& seedFinderConfs = sfConf.getParameterSetVector(
"thresholdsByDetector");
30 for (
auto const&
pset : seedFinderConfs) {
32 auto seedPt2Threshold =
std::pow(
pset.getParameter<
double>(
"seedingThresholdPt"), 2.);
33 auto const&
thresholds =
pset.getParameter<std::vector<double>>(
"seedingThreshold");
34 if (det ==
"HCAL_BARREL1") {
37 <<
") for \"\" vector of det = \"" << det <<
"\"";
38 view.seedPt2ThresholdHB() = seedPt2Threshold;
42 }
else if (det ==
"HCAL_ENDCAP") {
45 <<
") for \"\" vector of det = \"" << det <<
"\"";
46 view.seedPt2ThresholdHE() = seedPt2Threshold;
51 throw cms::Exception(
"Configuration") <<
"Unknown detector when parsing seedFinder: " << det;
56 auto const& initConf = iConfig.getParameterSet(
"initialClusteringStep");
57 auto const& topoThresholdConf = initConf.getParameterSetVector(
"thresholdsByDetector");
58 for (
auto const&
pset : topoThresholdConf) {
60 auto const&
thresholds =
pset.getParameter<std::vector<double>>(
"gatheringThreshold");
61 if (det ==
"HCAL_BARREL1") {
64 <<
") for \"\" vector of det = \"" << det <<
"\"";
68 }
else if (det ==
"HCAL_ENDCAP") {
71 <<
") for \"\" vector of det = \"" << det <<
"\"";
76 throw cms::Exception(
"Configuration") <<
"Unknown detector when parsing initClusteringStep: " << det;
81 auto const& pfClusterPSet = iConfig.getParameterSet(
"pfClusterBuilder");
82 view.showerSigma2() =
std::pow(pfClusterPSet.getParameter<
double>(
"showerSigma"), 2.);
83 view.minFracToKeep() = pfClusterPSet.getParameter<
double>(
"minFractionToKeep");
84 view.minFracTot() = pfClusterPSet.getParameter<
double>(
"minFracTot");
85 view.maxIterations() = pfClusterPSet.getParameter<
unsigned int>(
"maxIterations");
86 view.excludeOtherSeeds() = pfClusterPSet.getParameter<
bool>(
"excludeOtherSeeds");
87 view.stoppingTolerance() = pfClusterPSet.getParameter<
double>(
"stoppingTolerance");
88 auto const& pcPSet = pfClusterPSet.getParameterSet(
"positionCalc");
89 view.minFracInCalc() = pcPSet.getParameter<
double>(
"minFractionInCalc");
90 view.minAllowedNormalization() = pcPSet.getParameter<
double>(
"minAllowedNormalization");
92 auto const& recHitEnergyNormConf = pfClusterPSet.getParameterSetVector(
"recHitEnergyNorms");
93 for (
auto const&
pset : recHitEnergyNormConf) {
94 auto const& recHitNorms =
pset.getParameter<std::vector<double>>(
"recHitEnergyNorm");
96 if (det ==
"HCAL_BARREL1") {
97 if (recHitNorms.size() != kMaxDepth_barrel)
99 <<
"Invalid size (" << recHitNorms.size() <<
" != " << kMaxDepth_barrel
100 <<
") for \"\" vector of det = \"" << det <<
"\"";
101 for (
size_t idx = 0;
idx < recHitNorms.size(); ++
idx) {
102 view.recHitEnergyNormInvHB_vec()[
idx] = 1. / recHitNorms[
idx];
104 }
else if (det ==
"HCAL_ENDCAP") {
105 if (recHitNorms.size() != kMaxDepth_endcap)
107 <<
"Invalid size (" << recHitNorms.size() <<
" != " << kMaxDepth_endcap
108 <<
") for \"\" vector of det = \"" << det <<
"\"";
109 for (
size_t idx = 0;
idx < recHitNorms.size(); ++
idx) {
110 view.recHitEnergyNormInvHE_vec()[
idx] = 1. / recHitNorms[
idx];
113 throw cms::Exception(
"Configuration") <<
"Unknown detector when parsing recHitEnergyNorms: " << det;
117 auto const& barrelTimeResConf = pfClusterPSet.getParameterSet(
"timeResolutionCalcBarrel");
118 view.barrelTimeResConsts_corrTermLowE() = barrelTimeResConf.getParameter<
double>(
"corrTermLowE");
119 view.barrelTimeResConsts_threshLowE() = barrelTimeResConf.getParameter<
double>(
"threshLowE");
120 view.barrelTimeResConsts_noiseTerm() = barrelTimeResConf.getParameter<
double>(
"noiseTerm");
121 view.barrelTimeResConsts_constantTermLowE2() =
122 std::pow(barrelTimeResConf.getParameter<
double>(
"constantTermLowE"), 2.);
123 view.barrelTimeResConsts_noiseTermLowE() = barrelTimeResConf.getParameter<
double>(
"noiseTermLowE");
124 view.barrelTimeResConsts_threshHighE() = barrelTimeResConf.getParameter<
double>(
"threshHighE");
125 view.barrelTimeResConsts_constantTerm2() =
std::pow(barrelTimeResConf.getParameter<
double>(
"constantTerm"), 2.);
126 view.barrelTimeResConsts_resHighE2() =
127 std::pow(
view.barrelTimeResConsts_noiseTerm() /
view.barrelTimeResConsts_threshHighE(), 2.) +
128 view.barrelTimeResConsts_constantTerm2();
130 auto const& endcapTimeResConf = pfClusterPSet.getParameterSet(
"timeResolutionCalcEndcap");
131 view.endcapTimeResConsts_corrTermLowE() = endcapTimeResConf.getParameter<
double>(
"corrTermLowE");
132 view.endcapTimeResConsts_threshLowE() = endcapTimeResConf.getParameter<
double>(
"threshLowE");
133 view.endcapTimeResConsts_noiseTerm() = endcapTimeResConf.getParameter<
double>(
"noiseTerm");
134 view.endcapTimeResConsts_constantTermLowE2() =
135 std::pow(endcapTimeResConf.getParameter<
double>(
"constantTermLowE"), 2.);
136 view.endcapTimeResConsts_noiseTermLowE() = endcapTimeResConf.getParameter<
double>(
"noiseTermLowE");
137 view.endcapTimeResConsts_threshHighE() = endcapTimeResConf.getParameter<
double>(
"threshHighE");
138 view.endcapTimeResConsts_constantTerm2() =
std::pow(endcapTimeResConf.getParameter<
double>(
"constantTerm"), 2.);
139 view.endcapTimeResConsts_resHighE2() =
140 std::pow(
view.endcapTimeResConsts_noiseTerm() /
view.endcapTimeResConsts_threshHighE(), 2.) +
141 view.endcapTimeResConsts_constantTerm2();
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
std::shared_ptr< reco::PFClusterParamsHostCollection > product
Power< A, B >::type pow(const A &a, const B &b)