62 std::unique_ptr<OnlineDQMDigiAD> dqmadObj_HB =
nullptr;
63 std::unique_ptr<OnlineDQMDigiAD> dqmadObj_HE =
nullptr;
65 std::vector<std::vector<float>> digiHcal2DHist_depth_1{
66 std::vector<std::vector<float>>(64, std::vector<float>(72, 0))};
67 std::vector<std::vector<float>> digiHcal2DHist_depth_2{
68 std::vector<std::vector<float>>(64, std::vector<float>(72, 0))};
69 std::vector<std::vector<float>> digiHcal2DHist_depth_3{
70 std::vector<std::vector<float>>(64, std::vector<float>(72, 0))};
71 std::vector<std::vector<float>> digiHcal2DHist_depth_4{
72 std::vector<std::vector<float>>(64, std::vector<float>(72, 0))};
73 std::vector<std::vector<float>> digiHcal2DHist_depth_5{
74 std::vector<std::vector<float>>(64, std::vector<float>(72, 0))};
75 std::vector<std::vector<float>> digiHcal2DHist_depth_6{
76 std::vector<std::vector<float>>(64, std::vector<float>(72, 0))};
77 std::vector<std::vector<float>> digiHcal2DHist_depth_7{
78 std::vector<std::vector<float>>(64, std::vector<float>(72, 0))};
85 "DQM/HcalTasks/data/HB_2022/" 86 "CGAE_MultiDim_SPATIAL_vONNX_RCLv22_PIXEL_BT_BN_RIN_IPHI_MED_5218_v06_02_2023_21h01_stateful.onnx");
89 "DQM/HcalTasks/data/HE_2022/" 90 "CGAE_MultiDim_SPATIAL_vONNX_RCLv22_PIXEL_BT_BN_RIN_IPHI_MED_7763_v06_02_2023_22h55_stateful.onnx");
119 "MLBadFlagedChannelsvsLS",
135 auto const chbhe =
e.getHandle(
tokQIE11);
137 if (not(chbhe.isValid())) {
138 edm::LogWarning(
"HcalMLTask") <<
"QIE11 Collection is unavailable, will not fill this event.";
142 auto lumiCache = luminosityBlockCache(
e.getLuminosityBlock().index());
158 return DQTask::globalBeginLuminosityBlock(lb, es);
162 auto lumiCache = luminosityBlockCache(lb.
index());
168 std::fill(HistElement.begin(), HistElement.end(), 0);
170 std::fill(HistElement.begin(), HistElement.end(), 0);
172 std::fill(HistElement.begin(), HistElement.end(), 0);
174 std::fill(HistElement.begin(), HistElement.end(), 0);
176 std::fill(HistElement.begin(), HistElement.end(), 0);
178 std::fill(HistElement.begin(), HistElement.end(), 0);
180 std::fill(HistElement.begin(), HistElement.end(), 0);
184 for (std::vector<HcalGenericDetId>::const_iterator
it = dids.begin();
it != dids.end(); ++
it) {
185 if (!
it->isHcalDetId())
197 if (did.
depth() == 1)
200 if (did.
depth() == 2)
203 if (did.
depth() == 3)
206 if (did.
depth() == 4)
209 if (did.
depth() == 5)
212 if (did.
depth() == 6)
215 if (did.
depth() == 7)
240 std::vector<std::vector<std::vector<float>>> digiHcal3DHist_ANOMALY_FLAG_HB =
241 dqmadObj_HB->ONNXOutputToDQMHistMap(ad_HBmodel_output_vectors, 4, 64, 7);
242 std::vector<std::vector<std::vector<float>>> digiHcal3DHist_ANOMALY_FLAG_HE =
243 dqmadObj_HE->ONNXOutputToDQMHistMap(ad_HEmodel_output_vectors, 7, 64, 7);
245 int NHB_MLbadflags_ = 0, NHE_MLbadflags_ = 0;
246 for (
const auto& plane : digiHcal3DHist_ANOMALY_FLAG_HB)
247 for (
const auto& row : plane)
248 NHB_MLbadflags_ +=
std::count(row.begin(), row.end(), 1);
249 for (
const auto& plane : digiHcal3DHist_ANOMALY_FLAG_HE)
250 for (
const auto& row : plane)
251 NHE_MLbadflags_ +=
std::count(row.begin(), row.end(), 1);
257 DQTask::globalEndLuminosityBlock(lb, es);
264 "onnx_model_path_HB",
265 "DQM/HcalTasks/data/HB_2022/" 266 "CGAE_MultiDim_SPATIAL_vONNX_RCLv22_PIXEL_BT_BN_RIN_IPHI_MED_5218_v06_02_2023_21h01_stateful.onnx");
268 "onnx_model_path_HE",
269 "DQM/HcalTasks/data/HE_2022/" 270 "CGAE_MultiDim_SPATIAL_vONNX_RCLv22_PIXEL_BT_BN_RIN_IPHI_MED_7763_v06_02_2023_22h55_stateful.onnx");
271 desc.addUntracked<
double>(
"flagDecisionThr", 20.);
272 desc.addUntracked<
int>(
"debug", 0);
273 desc.addUntracked<
int>(
"runkeyVal", 0);
275 desc.addUntracked<
int>(
"ptype", 1);
276 desc.addUntracked<
bool>(
"mtype",
true);
std::string onnx_model_path_HB
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
virtual void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *qy=new quantity::ValueQuantity(quantity::fN), int debug=0)
virtual bool exists(HcalDetId const &)
std::vector< std::vector< float > > digiHcal2DHist_depth_5
std::string onnx_model_path_HE
hcaldqm::ContainerXXX< double > Occupancy1LS
dbs
Find files in dataset.
edm::EDGetTokenT< QIE10DigiCollection > tokQIE10
std::vector< std::vector< float > > digiHcal2DHist_depth_3
constexpr DetId detid() const
Get the detector id.
example_stream void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< OnlineDQMDigiAD > dqmadObj_HB
constexpr HcalSubdetector subdet() const
get the subdetector
virtual void fill(uint32_t)
std::vector< std::vector< float > > digiHcal2DHist_depth_4
edm::EDGetTokenT< HODigiCollection > tokHO
std::shared_ptr< hcaldqm::Cache > globalBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const override
ContainerXXX< uint32_t > _xQuality
constexpr int ieta() const
get the cell ieta
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< QIE11DigiCollection > tokQIE11
std::vector< std::vector< float > > digiHcal2DHist_depth_1
HcalElectronicsMap const * _emap
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
hcaldqm::Container1D MLFlagvsLS_Subdet
std::unique_ptr< OnlineDQMDigiAD > dqmadObj_HE
std::vector< std::vector< float > > digiHcal2DHist_depth_7
edm::ESGetToken< HcalDbService, HcalDbRecord > hcalDbServiceToken_
std::vector< std::vector< float > > digiHcal2DHist_depth_2
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void book(HcalElectronicsMap const *)
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
LuminosityBlockIndex index() const
void _process(edm::Event const &, edm::EventSetup const &) override
virtual STDTYPE & get(HcalDetId const &)
std::vector< HcalGenericDetId > allPrecisionId() const
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void initialize(hashfunctions::HashType, int debug=0)
HcalMLTask(edm::ParameterSet const &)
Log< level::Warning, false > LogWarning
void _resetMonitors(hcaldqm::UpdateFreq) override
constexpr int iphi() const
get the cell iphi
std::vector< std::vector< float > > digiHcal2DHist_depth_6
constexpr int depth() const
get the tower depth