CMS 3D CMS Logo

EcalRecHitParametersGPUESProducer.cc
Go to the documentation of this file.
1 #include <array>
2 #include <tuple>
3 #include <utility>
4 
21 
23 public:
25  ~EcalRecHitParametersGPUESProducer() override = default;
26 
28  std::unique_ptr<EcalRecHitParametersGPU> produce(JobConfigurationGPURecord const&);
29 
30 protected:
32  const edm::IOVSyncValue&,
33  edm::ValidityInterval&) override;
34 
35 private:
37 };
38 
40  setWhatProduced(this);
41  findingRecord<JobConfigurationGPURecord>();
42 }
43 
45  const edm::IOVSyncValue& iTime,
46  edm::ValidityInterval& oInterval) {
48 }
49 
52 
53  //---- db statuses to be exluded from reconstruction
54  d.add<std::vector<std::string>>("ChannelStatusToBeExcluded",
55  {
56  "kDAC",
57  "kNoisy",
58  "kNNoisy",
59  "kFixedG6",
60  "kFixedG1",
61  "kFixedG0",
62  "kNonRespondingIsolated",
63  "kDeadVFE",
64  "kDeadFE",
65  "kNoDataNoTP",
66  });
67 
68  // reco flags association to DB flag
69  edm::ParameterSetDescription desc_list_flagsMapDBReco;
70  desc_list_flagsMapDBReco.add<std::vector<std::string>>("kGood", {"kOk", "kDAC", "kNoLaser", "kNoisy"});
71  desc_list_flagsMapDBReco.add<std::vector<std::string>>("kNoisy", {"kNNoisy", "kFixedG6", "kFixedG1"});
72  desc_list_flagsMapDBReco.add<std::vector<std::string>>("kNeighboursRecovered",
73  {"kFixedG0", "kNonRespondingIsolated", "kDeadVFE"});
74  desc_list_flagsMapDBReco.add<std::vector<std::string>>("kTowerRecovered", {"kDeadFE"});
75  desc_list_flagsMapDBReco.add<std::vector<std::string>>("kDead", {"kNoDataNoTP"});
76 
77  d.add<edm::ParameterSetDescription>("flagsMapDBReco", desc_list_flagsMapDBReco);
78 
79  desc.addWithDefaultLabel(d);
80 }
81 
82 std::unique_ptr<EcalRecHitParametersGPU> EcalRecHitParametersGPUESProducer::produce(JobConfigurationGPURecord const&) {
83  auto const& channelStatusToBeExcluded = StringToEnumValue<EcalChannelStatusCode::Code>(
84  pset_.getParameter<std::vector<std::string>>("ChannelStatusToBeExcluded"));
85 
86  // https://github.com/cms-sw/cmssw/blob/266e21cfc9eb409b093e4cf064f4c0a24c6ac293/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerSimple.cc
87 
88  // Translate string representation of flagsMapDBReco into enum values
89  const edm::ParameterSet& p = pset_.getParameter<edm::ParameterSet>("flagsMapDBReco");
90  std::vector<std::string> recoflagbitsStrings = p.getParameterNames();
91 
92  std::vector<EcalRecHitParametersGPU::DBStatus> status;
93  status.reserve(recoflagbitsStrings.size());
94  for (auto const& recoflagbitsString : recoflagbitsStrings) {
95  EcalRecHit::Flags recoflagbit = (EcalRecHit::Flags)StringToEnumValue<EcalRecHit::Flags>(recoflagbitsString);
96  std::vector<std::string> dbstatus_s = p.getParameter<std::vector<std::string>>(recoflagbitsString);
97 
98  std::vector<uint32_t> db_reco_flags;
99  db_reco_flags.reserve(dbstatus_s.size());
100  for (auto const& dbstatusString : dbstatus_s) {
101  EcalChannelStatusCode::Code dbstatus =
102  (EcalChannelStatusCode::Code)StringToEnumValue<EcalChannelStatusCode::Code>(dbstatusString);
103  db_reco_flags.push_back(dbstatus);
104  }
105  status.emplace_back(static_cast<int>(recoflagbit), db_reco_flags);
106  }
107 
108  return std::make_unique<EcalRecHitParametersGPU>(channelStatusToBeExcluded, status);
109 }
110 
EcalRecHitParametersGPUESProducer::pset_
const edm::ParameterSet pset_
Definition: EcalRecHitParametersGPUESProducer.cc:36
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
EcalRecHitParametersGPUESProducer::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
Definition: EcalRecHitParametersGPUESProducer.cc:44
ESTransientHandle.h
mps_update.status
status
Definition: mps_update.py:68
eventsetuprecord_registration_macro.h
EcalRecHit::Flags
Flags
Definition: EcalRecHit.h:20
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::ValidityInterval
Definition: ValidityInterval.h:28
ESProducer.h
typelookup.h
edm::EventSetupRecordIntervalFinder
Definition: EventSetupRecordIntervalFinder.h:33
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
EcalRecHitParametersGPUESProducer
Definition: EcalRecHitParametersGPUESProducer.cc:22
MakerMacros.h
ReusableObjectHolder.h
EcalRecHit.h
StringToEnumValue.h
JobConfigurationGPURecord
Definition: JobConfigurationGPURecord.h:6
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
DEFINE_FWK_EVENTSETUP_SOURCE
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:91
EventSetupRecordIntervalFinder.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
JobConfigurationGPURecord.h
SourceFactory.h
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
EcalRecHitParametersGPUESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: EcalRecHitParametersGPUESProducer.cc:50
EcalRecHitParametersGPUESProducer::~EcalRecHitParametersGPUESProducer
~EcalRecHitParametersGPUESProducer() override=default
EcalRecHitParametersGPU.h
EcalRechitChannelStatusGPU.h
ModuleFactory.h
EcalChannelStatusCode::Code
Code
Definition: EcalChannelStatusCode.h:20
cond::ValidityInterval
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
EcalRecHitParametersGPUESProducer::EcalRecHitParametersGPUESProducer
EcalRecHitParametersGPUESProducer(edm::ParameterSet const &)
Definition: EcalRecHitParametersGPUESProducer.cc:39
edm::IOVSyncValue::beginOfTime
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESProducer
Definition: ESProducer.h:104
ESProductHost.h
ztail.d
d
Definition: ztail.py:151
ParameterSet.h
EcalRecHitParametersGPUESProducer::produce
std::unique_ptr< EcalRecHitParametersGPU > produce(JobConfigurationGPURecord const &)
Definition: EcalRecHitParametersGPUESProducer.cc:82
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27