CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ALPAKA_ACCELERATOR_NAMESPACE::PFClusterParamsESProducer Class Reference
Inheritance diagram for ALPAKA_ACCELERATOR_NAMESPACE::PFClusterParamsESProducer:
edm::ESProducer edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Public Member Functions

 PFClusterParamsESProducer (edm::ParameterSet const &iConfig)
 
std::shared_ptr< reco::PFClusterParamsHostCollectionproduce (JobConfigurationGPURecord const &iRecord)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Attributes

std::shared_ptr< reco::PFClusterParamsHostCollectionproduct
 

Additional Inherited Members

- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 17 of file PFClusterParamsESProducer.cc.

Constructor & Destructor Documentation

◆ PFClusterParamsESProducer()

ALPAKA_ACCELERATOR_NAMESPACE::PFClusterParamsESProducer::PFClusterParamsESProducer ( edm::ParameterSet const &  iConfig)
inline

Definition at line 19 of file PFClusterParamsESProducer.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), Exception, edm::ParameterSet::getParameterSet(), edm::ParameterSet::getParameterSetVector(), cms::alpakatools::host(), heavyIonCSV_trainingSettings::idx, SiStripPI::max, funct::pow(), product, muonDTDigis_cfi::pset, edm::ESProducer::setWhatProduced(), AlCaHLTBitMon_QueryRunRegistry::string, and particleFlowZeroSuppressionECAL_cff::thresholds.

19  : ESProducer(iConfig) {
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),
24  auto view = product->view();
25 
26  // seedFinder
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) {
31  auto const& det = pset.getParameter<std::string>("detector");
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") {
35  if (thresholds.size() != kMaxDepth_barrel)
36  throw cms::Exception("Configuration") << "Invalid size (" << thresholds.size() << " != " << kMaxDepth_barrel
37  << ") for \"\" vector of det = \"" << det << "\"";
38  view.seedPt2ThresholdHB() = seedPt2Threshold;
39  for (size_t idx = 0; idx < thresholds.size(); ++idx) {
40  view.seedEThresholdHB_vec()[idx] = thresholds[idx];
41  }
42  } else if (det == "HCAL_ENDCAP") {
43  if (thresholds.size() != kMaxDepth_endcap)
44  throw cms::Exception("Configuration") << "Invalid size (" << thresholds.size() << " != " << kMaxDepth_endcap
45  << ") for \"\" vector of det = \"" << det << "\"";
46  view.seedPt2ThresholdHE() = seedPt2Threshold;
47  for (size_t idx = 0; idx < thresholds.size(); ++idx) {
48  view.seedEThresholdHE_vec()[idx] = thresholds[idx];
49  }
50  } else {
51  throw cms::Exception("Configuration") << "Unknown detector when parsing seedFinder: " << det;
52  }
53  }
54 
55  // initialClusteringStep
56  auto const& initConf = iConfig.getParameterSet("initialClusteringStep");
57  auto const& topoThresholdConf = initConf.getParameterSetVector("thresholdsByDetector");
58  for (auto const& pset : topoThresholdConf) {
59  auto const& det = pset.getParameter<std::string>("detector");
60  auto const& thresholds = pset.getParameter<std::vector<double>>("gatheringThreshold");
61  if (det == "HCAL_BARREL1") {
62  if (thresholds.size() != kMaxDepth_barrel)
63  throw cms::Exception("Configuration") << "Invalid size (" << thresholds.size() << " != " << kMaxDepth_barrel
64  << ") for \"\" vector of det = \"" << det << "\"";
65  for (size_t idx = 0; idx < thresholds.size(); ++idx) {
66  view.topoEThresholdHB_vec()[idx] = thresholds[idx];
67  }
68  } else if (det == "HCAL_ENDCAP") {
69  if (thresholds.size() != kMaxDepth_endcap)
70  throw cms::Exception("Configuration") << "Invalid size (" << thresholds.size() << " != " << kMaxDepth_endcap
71  << ") for \"\" vector of det = \"" << det << "\"";
72  for (size_t idx = 0; idx < thresholds.size(); ++idx) {
73  view.topoEThresholdHE_vec()[idx] = thresholds[idx];
74  }
75  } else {
76  throw cms::Exception("Configuration") << "Unknown detector when parsing initClusteringStep: " << det;
77  }
78  }
79 
80  // pfClusterBuilder
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");
91 
92  auto const& recHitEnergyNormConf = pfClusterPSet.getParameterSetVector("recHitEnergyNorms");
93  for (auto const& pset : recHitEnergyNormConf) {
94  auto const& recHitNorms = pset.getParameter<std::vector<double>>("recHitEnergyNorm");
95  auto const& det = pset.getParameter<std::string>("detector");
96  if (det == "HCAL_BARREL1") {
97  if (recHitNorms.size() != kMaxDepth_barrel)
98  throw cms::Exception("Configuration")
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];
103  }
104  } else if (det == "HCAL_ENDCAP") {
105  if (recHitNorms.size() != kMaxDepth_endcap)
106  throw cms::Exception("Configuration")
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];
111  }
112  } else {
113  throw cms::Exception("Configuration") << "Unknown detector when parsing recHitEnergyNorms: " << det;
114  }
115  }
116 
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();
129 
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();
142 
143  setWhatProduced(this);
144  }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
std::shared_ptr< reco::PFClusterParamsHostCollection > product
alpaka::DevCpu const & host()
Definition: host.h:14
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

Member Function Documentation

◆ fillDescriptions()

static void ALPAKA_ACCELERATOR_NAMESPACE::PFClusterParamsESProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 146 of file PFClusterParamsESProducer.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addWithDefaultLabel(), MillePedeFileConverter_cfg::e, custom_jme_cff::foo, crabTemplate::psetName, and AlCaHLTBitMon_QueryRunRegistry::string.

146  {
148  {
149  auto const psetName = "seedFinder";
151  foo.add<int>("nNeighbours", 4);
152  {
154  validator.add<std::string>("detector", "");
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);
166  }
167  psetDesc.add(psetName, foo);
168  }
169  {
170  auto const psetName = "initialClusteringStep";
172  {
174  validator.add<std::string>("detector", "");
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);
182  }
183  psetDesc.add(psetName, foo);
184  }
185  {
186  auto const psetName = "pfClusterBuilder";
188  foo.add<unsigned int>("maxIterations", 50);
189  foo.add<double>("minFracTot", 1e-20);
190  foo.add<double>("minFractionToKeep", 1e-7);
191  foo.add<bool>("excludeOtherSeeds", true);
192  foo.add<double>("showerSigma", 10.);
193  foo.add<double>("stoppingTolerance", 1e-8);
194  {
196  validator.add<std::string>("detector", "");
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);
204  }
205  {
207  bar.add<double>("minFractionInCalc", 1e-9);
208  bar.add<double>("minAllowedNormalization", 1e-9);
209  foo.add("positionCalc", bar);
210  }
211  {
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);
221  }
222  {
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);
232  }
233  psetDesc.add(psetName, foo);
234  }
235 
236  descriptions.addWithDefaultLabel(psetDesc);
237  }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)

◆ produce()

std::shared_ptr<reco::PFClusterParamsHostCollection> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterParamsESProducer::produce ( JobConfigurationGPURecord const &  iRecord)
inline

Definition at line 239 of file PFClusterParamsESProducer.cc.

References product.

239  {
240  return product;
241  }
std::shared_ptr< reco::PFClusterParamsHostCollection > product

Member Data Documentation

◆ product

std::shared_ptr<reco::PFClusterParamsHostCollection> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterParamsESProducer::product
private

Definition at line 244 of file PFClusterParamsESProducer.cc.

Referenced by PFClusterParamsESProducer(), and produce().