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),
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");
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();
151 foo.add<
int>(
"nNeighbours", 4);
155 validator.
add<std::vector<double>>(
"seedingThreshold", {});
156 validator.
add<
double>(
"seedingThresholdPt", 0.);
157 std::vector<edm::ParameterSet> vDefaults(2);
158 vDefaults[0].addParameter<
std::string>(
"detector",
"HCAL_BARREL1");
159 vDefaults[0].addParameter<std::vector<double>>(
"seedingThreshold", {0.125, 0.25, 0.35, 0.35});
160 vDefaults[0].addParameter<
double>(
"seedingThresholdPt", 0.);
161 vDefaults[1].addParameter<
std::string>(
"detector",
"HCAL_ENDCAP");
162 vDefaults[1].addParameter<std::vector<double>>(
"seedingThreshold",
163 {0.1375, 0.275, 0.275, 0.275, 0.275, 0.275, 0.275});
164 vDefaults[1].addParameter<
double>(
"seedingThresholdPt", 0.);
165 foo.addVPSet(
"thresholdsByDetector", validator, vDefaults);
170 auto const psetName =
"initialClusteringStep";
175 validator.
add<std::vector<double>>(
"gatheringThreshold", {});
176 std::vector<edm::ParameterSet> vDefaults(2);
177 vDefaults[0].addParameter<
std::string>(
"detector",
"HCAL_BARREL1");
178 vDefaults[0].addParameter<std::vector<double>>(
"gatheringThreshold", {0.1, 0.2, 0.3, 0.3});
179 vDefaults[1].addParameter<
std::string>(
"detector",
"HCAL_ENDCAP");
180 vDefaults[1].addParameter<std::vector<double>>(
"gatheringThreshold", {0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2});
181 foo.addVPSet(
"thresholdsByDetector", validator, vDefaults);
186 auto const psetName =
"pfClusterBuilder";
188 foo.add<
unsigned int>(
"maxIterations", 50);
189 foo.add<
double>(
"minFracTot", 1
e-20);
190 foo.add<
double>(
"minFractionToKeep", 1
e-7);
191 foo.add<
bool>(
"excludeOtherSeeds",
true);
192 foo.add<
double>(
"showerSigma", 10.);
193 foo.add<
double>(
"stoppingTolerance", 1
e-8);
197 validator.
add<std::vector<double>>(
"recHitEnergyNorm", {});
198 std::vector<edm::ParameterSet> vDefaults(2);
199 vDefaults[0].addParameter<
std::string>(
"detector",
"HCAL_BARREL1");
200 vDefaults[0].addParameter<std::vector<double>>(
"recHitEnergyNorm", {0.1, 0.2, 0.3, 0.3});
201 vDefaults[1].addParameter<
std::string>(
"detector",
"HCAL_ENDCAP");
202 vDefaults[1].addParameter<std::vector<double>>(
"recHitEnergyNorm", {0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2});
203 foo.addVPSet(
"recHitEnergyNorms", validator, vDefaults);
207 bar.add<
double>(
"minFractionInCalc", 1
e-9);
208 bar.add<
double>(
"minAllowedNormalization", 1
e-9);
209 foo.add(
"positionCalc", bar);
213 bar.add<
double>(
"corrTermLowE", 0.);
214 bar.add<
double>(
"threshLowE", 6.);
215 bar.add<
double>(
"noiseTerm", 21.86);
216 bar.add<
double>(
"constantTermLowE", 4.24);
217 bar.add<
double>(
"noiseTermLowE", 8.);
218 bar.add<
double>(
"threshHighE", 15.);
219 bar.add<
double>(
"constantTerm", 2.82);
220 foo.add(
"timeResolutionCalcBarrel", bar);
224 bar.add<
double>(
"corrTermLowE", 0.);
225 bar.add<
double>(
"threshLowE", 6.);
226 bar.add<
double>(
"noiseTerm", 21.86);
227 bar.add<
double>(
"constantTermLowE", 4.24);
228 bar.add<
double>(
"noiseTermLowE", 8.);
229 bar.add<
double>(
"threshHighE", 15.);
230 bar.add<
double>(
"constantTerm", 2.82);
231 foo.add(
"timeResolutionCalcEndcap", bar);
244 std::shared_ptr<reco::PFClusterParamsHostCollection>
product;
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
std::shared_ptr< reco::PFClusterParamsHostCollection > produce(JobConfigurationGPURecord const &iRecord)
ParameterSet const & getParameterSet(std::string const &) const
std::shared_ptr< reco::PFClusterParamsHostCollection > product
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
VParameterSet const & getParameterSetVector(std::string const &name) const
#define DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(type)
PFClusterParamsESProducer(edm::ParameterSet const &iConfig)
Power< A, B >::type pow(const A &a, const B &b)