CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HcalMLTask Class Reference
Inheritance diagram for HcalMLTask:
hcaldqm::DQTask DQMOneEDAnalyzer< edm::LuminosityBlockCache< hcaldqm::Cache > > hcaldqm::DQModule edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
std::shared_ptr< hcaldqm::CacheglobalBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
void globalEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 HcalMLTask (edm::ParameterSet const &)
 
 ~HcalMLTask () override=default
 
- Public Member Functions inherited from hcaldqm::DQTask
void analyze (edm::Event const &, edm::EventSetup const &) override
 
 DQTask (edm::ParameterSet const &)
 
std::shared_ptr< hcaldqm::CacheglobalBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
void globalEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 ~DQTask () override
 
- Public Member Functions inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< hcaldqm::Cache > >
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 
- Public Member Functions inherited from hcaldqm::DQModule
 DQModule (edm::ParameterSet const &)
 
virtual ~DQModule () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from hcaldqm::DQTask
static void fillPSetDescription (edm::ParameterSetDescription &des)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from hcaldqm::DQModule
static void fillPSetDescription (edm::ParameterSetDescription &desc)
 

Private Member Functions

void _process (edm::Event const &, edm::EventSetup const &) override
 
void _resetMonitors (hcaldqm::UpdateFreq) override
 

Private Attributes

std::vector< std::vector< float > > digiHcal2DHist_depth_1
 
std::vector< std::vector< float > > digiHcal2DHist_depth_2
 
std::vector< std::vector< float > > digiHcal2DHist_depth_3
 
std::vector< std::vector< float > > digiHcal2DHist_depth_4
 
std::vector< std::vector< float > > digiHcal2DHist_depth_5
 
std::vector< std::vector< float > > digiHcal2DHist_depth_6
 
std::vector< std::vector< float > > digiHcal2DHist_depth_7
 
std::unique_ptr< OnlineDQMDigiADdqmadObj_HB = nullptr
 
std::unique_ptr< OnlineDQMDigiADdqmadObj_HE = nullptr
 
double flagDecisionThr
 
edm::ESGetToken< HcalDbService, HcalDbRecordhcalDbServiceToken_
 
hcaldqm::Container1D MLFlagvsLS_Subdet
 
hcaldqm::ContainerXXX< double > Occupancy1LS
 
std::string onnx_model_path_HB
 
std::string onnx_model_path_HE
 
edm::InputTag tagHO
 
edm::InputTag tagQIE10
 
edm::InputTag tagQIE11
 
edm::EDGetTokenT< HODigiCollectiontokHO
 
edm::EDGetTokenT< QIE10DigiCollectiontokQIE10
 
edm::EDGetTokenT< QIE11DigiCollectiontokQIE11
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< hcaldqm::Cache > >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from hcaldqm::DQTask
virtual int _getCalibType (edm::Event const &)
 
virtual bool _isApplicable (edm::Event const &)
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< hcaldqm::Cache > >
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from hcaldqm::DQTask
ContainerI _cEvsPerLS
 
ContainerI _cEvsTotal
 
ContainerS _cProcessingTypeName
 
ContainerS _cRunKeyName
 
ContainerI _cRunKeyVal
 
edm::ESHandle< HcalDbService_dbService
 
HcalElectronicsMap const * _emap = nullptr
 
int _procLSs
 
edm::InputTag _tagRaw
 
edm::EDGetTokenT< FEDRawDataCollection_tokRaw
 
std::vector< uint32_t > _vcdaqEids
 
ContainerXXX< uint32_t > _xQuality
 
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcdhcalChannelQualityToken_
 
edm::ESGetToken< HcalDbService, HcalDbRecordhcalDbServiceToken_
 
edm::ESGetToken< RunInfo, RunInfoRcdrunInfoToken_
 
- Protected Attributes inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< hcaldqm::Cache > >
edm::EDPutTokenT< DQMTokenrunToken_
 
- Protected Attributes inherited from hcaldqm::DQModule
int _currentLS
 
int _debug
 
int _evsPerLS
 
int _evsTotal
 
Logger _logger
 
int _maxLS
 
ModuleType _mtype
 
std::string _name
 
ProcessingType _ptype
 
std::string _runkeyName
 
int _runkeyVal
 
std::string _subsystem
 

Detailed Description

Definition at line 33 of file HcalMLTask.cc.

Constructor & Destructor Documentation

◆ HcalMLTask()

HcalMLTask::HcalMLTask ( edm::ParameterSet const &  ps)

Definition at line 81 of file HcalMLTask.cc.

References ecalDigis_cff::cpu, dqmadObj_HB, dqmadObj_HE, flagDecisionThr, edm::ParameterSet::getUntrackedParameter(), ProducerED_cfi::InputTag, eostools::move(), onnx_model_path_HB, onnx_model_path_HE, AlCaHLTBitMon_QueryRunRegistry::string, tagHO, tagQIE10, tagQIE11, tokHO, tokQIE10, and tokQIE11.

82  : DQTask(ps), hcalDbServiceToken_(esConsumes<HcalDbService, HcalDbRecord, edm::Transition::BeginRun>()) {
83  onnx_model_path_HB = ps.getUntrackedParameter<std::string>(
84  "onnx_model_path_HB",
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");
87  onnx_model_path_HE = ps.getUntrackedParameter<std::string>(
88  "onnx_model_path_HE",
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");
91  flagDecisionThr = ps.getUntrackedParameter<double>("flagDecisionThr", 20.);
92  tagQIE11 = ps.getUntrackedParameter<edm::InputTag>("tagHBHE", edm::InputTag("hcalDigis"));
93  tagHO = ps.getUntrackedParameter<edm::InputTag>("tagHO", edm::InputTag("hcalDigis"));
94  tagQIE10 = ps.getUntrackedParameter<edm::InputTag>("tagHF", edm::InputTag("hcalDigis"));
95 
96  tokQIE11 = consumes<QIE11DigiCollection>(tagQIE11);
97  tokHO = consumes<HODigiCollection>(tagHO);
98  tokQIE10 = consumes<QIE10DigiCollection>(tagQIE10);
99 
100  auto dqmadObj_HB_ = std::make_unique<OnlineDQMDigiAD>("hb", onnx_model_path_HB, Backend::cpu);
101  auto dqmadObj_HE_ = std::make_unique<OnlineDQMDigiAD>("he", onnx_model_path_HE, Backend::cpu);
102  dqmadObj_HB = std::move(dqmadObj_HB_);
103  dqmadObj_HE = std::move(dqmadObj_HE_);
104 }
std::string onnx_model_path_HB
Definition: HcalMLTask.cc:49
DQTask(edm::ParameterSet const &)
Definition: DQTask.cc:8
std::string onnx_model_path_HE
Definition: HcalMLTask.cc:49
edm::EDGetTokenT< QIE10DigiCollection > tokQIE10
Definition: HcalMLTask.cc:56
edm::InputTag tagHO
Definition: HcalMLTask.cc:52
edm::InputTag tagQIE10
Definition: HcalMLTask.cc:53
std::unique_ptr< OnlineDQMDigiAD > dqmadObj_HB
Definition: HcalMLTask.cc:62
edm::EDGetTokenT< HODigiCollection > tokHO
Definition: HcalMLTask.cc:55
edm::EDGetTokenT< QIE11DigiCollection > tokQIE11
Definition: HcalMLTask.cc:54
std::unique_ptr< OnlineDQMDigiAD > dqmadObj_HE
Definition: HcalMLTask.cc:63
double flagDecisionThr
Definition: HcalMLTask.cc:50
edm::ESGetToken< HcalDbService, HcalDbRecord > hcalDbServiceToken_
Definition: HcalMLTask.cc:57
def move(src, dest)
Definition: eostools.py:511
edm::InputTag tagQIE11
Definition: HcalMLTask.cc:51

◆ ~HcalMLTask()

HcalMLTask::~HcalMLTask ( )
overridedefault

Member Function Documentation

◆ _process()

void HcalMLTask::_process ( edm::Event const &  e,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements hcaldqm::DQTask.

Definition at line 131 of file HcalMLTask.cc.

References hcaldqm::DQModule::_currentLS, hcaldqm::DQModule::_ptype, QIE11DataFrame::detid(), MillePedeFileConverter_cfg::e, hcaldqm::fOnline, hcaldqm::ContainerXXX< STDTYPE >::get(), HcalBarrel, HcalEndcap, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Occupancy1LS, HcalDetId::subdet(), and tokQIE11.

131  {
132  if (_ptype != fOnline)
133  return;
134 
135  auto const chbhe = e.getHandle(tokQIE11);
136 
137  if (not(chbhe.isValid())) {
138  edm::LogWarning("HcalMLTask") << "QIE11 Collection is unavailable, will not fill this event.";
139  return;
140  }
141 
142  auto lumiCache = luminosityBlockCache(e.getLuminosityBlock().index());
143  _currentLS = lumiCache->currentLS;
144 
145  for (QIE11DigiCollection::const_iterator it = chbhe->begin(); it != chbhe->end(); ++it) {
146  const QIE11DataFrame digi = static_cast<const QIE11DataFrame>(*it);
147 
148  HcalDetId const& did = digi.detid();
149  if (did.subdet() != HcalEndcap && did.subdet() != HcalBarrel)
150  continue;
151 
152  Occupancy1LS.get(did)++;
153  }
154 }
hcaldqm::ContainerXXX< double > Occupancy1LS
Definition: HcalMLTask.cc:59
constexpr DetId detid() const
Get the detector id.
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
ProcessingType _ptype
Definition: DQModule.h:44
edm::EDGetTokenT< QIE11DigiCollection > tokQIE11
Definition: HcalMLTask.cc:54
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
virtual STDTYPE & get(HcalDetId const &)
Definition: ContainerXXX.h:198
Log< level::Warning, false > LogWarning

◆ _resetMonitors()

void HcalMLTask::_resetMonitors ( hcaldqm::UpdateFreq  uf)
overrideprivatevirtual

Reimplemented from hcaldqm::DQTask.

Definition at line 129 of file HcalMLTask.cc.

129 { DQTask::_resetMonitors(uf); }

◆ bookHistograms()

void HcalMLTask::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  r,
edm::EventSetup const &  es 
)
overridevirtual

Reimplemented from hcaldqm::DQTask.

Definition at line 108 of file HcalMLTask.cc.

References hcaldqm::DQTask::_emap, hcaldqm::DQModule::_maxLS, hcaldqm::DQModule::_name, hcaldqm::DQModule::_subsystem, hcaldqm::ContainerXXX< STDTYPE >::book(), hcaldqm::Container1D::book(), bookHistograms(), createIOVlist::dbs, hcaldqm::hashfunctions::fDChannel, hcaldqm::quantity::fN, hcaldqm::hashfunctions::fSubdet, edm::EventSetup::getHandle(), hcalDbServiceToken_, cuy::ib, hcaldqm::ContainerXXX< STDTYPE >::initialize(), hcaldqm::Container1D::initialize(), MLFlagvsLS_Subdet, Occupancy1LS, and alignCSCRings::r.

108  {
110 
111  // GET WHAT YOU NEED
113  _emap = dbs->getHcalMapping();
114 
115  // Book monitoring elements
117 
119  "MLBadFlagedChannelsvsLS",
123  0);
124 
127 }
virtual void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *qy=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: Container1D.cc:33
hcaldqm::ContainerXXX< double > Occupancy1LS
Definition: HcalMLTask.cc:59
dbs
Find files in dataset.
example_stream void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::string _name
Definition: DQModule.h:42
HcalElectronicsMap const * _emap
Definition: DQTask.h:81
hcaldqm::Container1D MLFlagvsLS_Subdet
Definition: HcalMLTask.cc:60
edm::ESGetToken< HcalDbService, HcalDbRecord > hcalDbServiceToken_
Definition: HcalMLTask.cc:57
virtual void book(HcalElectronicsMap const *)
Definition: ContainerXXX.h:88
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
Definition: Container1D.cc:592
std::string _subsystem
Definition: DQModule.h:49
virtual void initialize(hashfunctions::HashType, int debug=0)
Definition: ContainerXXX.h:82
ib
Definition: cuy.py:661

◆ dqmBeginRun()

void HcalMLTask::dqmBeginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
overridevirtual

Reimplemented from hcaldqm::DQTask.

Definition at line 106 of file HcalMLTask.cc.

References alignCSCRings::r.

106 { DQTask::dqmBeginRun(r, es); }

◆ fillDescriptions()

void HcalMLTask::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 260 of file HcalMLTask.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

260  {
262  desc.addUntracked<std::string>("name", "HcalMLTask");
263  desc.addUntracked<std::string>(
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");
267  desc.addUntracked<std::string>(
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);
274  desc.addUntracked<std::string>("runkeyName", "pp_run");
275  desc.addUntracked<int>("ptype", 1);
276  desc.addUntracked<bool>("mtype", true);
277  desc.addUntracked<std::string>("subsystem", "Hcal");
278  desc.addUntracked<edm::InputTag>("tagHBHE", edm::InputTag("hcalDigis"));
279  desc.addUntracked<edm::InputTag>("tagHO", edm::InputTag("hcalDigis"));
280  desc.addUntracked<edm::InputTag>("tagHF", edm::InputTag("hcalDigis"));
281  descriptions.addWithDefaultLabel(desc);
282 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ globalBeginLuminosityBlock()

std::shared_ptr< hcaldqm::Cache > HcalMLTask::globalBeginLuminosityBlock ( edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
) const
override

Definition at line 156 of file HcalMLTask.cc.

157  {
158  return DQTask::globalBeginLuminosityBlock(lb, es);
159 }

◆ globalEndLuminosityBlock()

void HcalMLTask::globalEndLuminosityBlock ( edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)
override

Definition at line 161 of file HcalMLTask.cc.

References hcaldqm::DQModule::_currentLS, hcaldqm::DQTask::_emap, hcaldqm::DQModule::_evsPerLS, hcaldqm::DQTask::_xQuality, HcalElectronicsMap::allPrecisionId(), submitPVResolutionJobs::count, callgraph::cs, HcalDetId::depth(), digiHcal2DHist_depth_1, digiHcal2DHist_depth_2, digiHcal2DHist_depth_3, digiHcal2DHist_depth_4, digiHcal2DHist_depth_5, digiHcal2DHist_depth_6, digiHcal2DHist_depth_7, dqmadObj_HB, dqmadObj_HE, hcaldqm::ContainerXXX< STDTYPE >::exists(), hcaldqm::Container1D::fill(), ntuplemaker::fill, flagDecisionThr, nano_mu_digi_cff::float, hcaldqm::ContainerXXX< STDTYPE >::get(), HcalBarrel, HcalChannelStatus::HcalCellDead, HcalChannelStatus::HcalCellMask, HcalEndcap, HcalDetId::ieta(), edm::LuminosityBlock::index(), HcalDetId::iphi(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, MLFlagvsLS_Subdet, Occupancy1LS, hcaldqm::ContainerXXX< STDTYPE >::reset(), and HcalDetId::subdet().

161  {
162  auto lumiCache = luminosityBlockCache(lb.index());
163  _currentLS = lumiCache->currentLS;
164  _xQuality.reset();
165  _xQuality = lumiCache->xQuality;
166 
167  for (auto& HistElement : digiHcal2DHist_depth_1)
168  std::fill(HistElement.begin(), HistElement.end(), 0);
169  for (auto& HistElement : digiHcal2DHist_depth_2)
170  std::fill(HistElement.begin(), HistElement.end(), 0);
171  for (auto& HistElement : digiHcal2DHist_depth_3)
172  std::fill(HistElement.begin(), HistElement.end(), 0);
173  for (auto& HistElement : digiHcal2DHist_depth_4)
174  std::fill(HistElement.begin(), HistElement.end(), 0);
175  for (auto& HistElement : digiHcal2DHist_depth_5)
176  std::fill(HistElement.begin(), HistElement.end(), 0);
177  for (auto& HistElement : digiHcal2DHist_depth_6)
178  std::fill(HistElement.begin(), HistElement.end(), 0);
179  for (auto& HistElement : digiHcal2DHist_depth_7)
180  std::fill(HistElement.begin(), HistElement.end(), 0);
181  float LS_numEvents = (float)_evsPerLS;
182 
183  std::vector<HcalGenericDetId> dids = _emap->allPrecisionId();
184  for (std::vector<HcalGenericDetId>::const_iterator it = dids.begin(); it != dids.end(); ++it) {
185  if (!it->isHcalDetId())
186  continue;
187  if (_xQuality.exists(HcalDetId(*it))) {
190  continue;
191  }
192 
193  HcalDetId did = HcalDetId(it->rawId());
194  if (did.subdet() != HcalEndcap && did.subdet() != HcalBarrel)
195  continue;
196 
197  if (did.depth() == 1)
198  digiHcal2DHist_depth_1.at(did.ieta() < 0 ? did.ieta() + 32 : did.ieta() + 31).at(did.iphi() - 1) =
199  Occupancy1LS.get(did);
200  if (did.depth() == 2)
201  digiHcal2DHist_depth_2.at(did.ieta() < 0 ? did.ieta() + 32 : did.ieta() + 31).at(did.iphi() - 1) =
202  Occupancy1LS.get(did);
203  if (did.depth() == 3)
204  digiHcal2DHist_depth_3.at(did.ieta() < 0 ? did.ieta() + 32 : did.ieta() + 31).at(did.iphi() - 1) =
205  Occupancy1LS.get(did);
206  if (did.depth() == 4)
207  digiHcal2DHist_depth_4.at(did.ieta() < 0 ? did.ieta() + 32 : did.ieta() + 31).at(did.iphi() - 1) =
208  Occupancy1LS.get(did);
209  if (did.depth() == 5)
210  digiHcal2DHist_depth_5.at(did.ieta() < 0 ? did.ieta() + 32 : did.ieta() + 31).at(did.iphi() - 1) =
211  Occupancy1LS.get(did);
212  if (did.depth() == 6)
213  digiHcal2DHist_depth_6.at(did.ieta() < 0 ? did.ieta() + 32 : did.ieta() + 31).at(did.iphi() - 1) =
214  Occupancy1LS.get(did);
215  if (did.depth() == 7)
216  digiHcal2DHist_depth_7.at(did.ieta() < 0 ? did.ieta() + 32 : did.ieta() + 31).at(did.iphi() - 1) =
217  Occupancy1LS.get(did);
218  }
219 
220  std::vector<std::vector<float>> ad_HBmodel_output_vectors = dqmadObj_HB->Inference_CMSSW(digiHcal2DHist_depth_1,
227  LS_numEvents,
228  (float)flagDecisionThr);
229 
230  std::vector<std::vector<float>> ad_HEmodel_output_vectors = dqmadObj_HE->Inference_CMSSW(digiHcal2DHist_depth_1,
237  LS_numEvents,
238  (float)flagDecisionThr);
239 
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);
244 
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);
252 
253  MLFlagvsLS_Subdet.fill(HcalDetId(HcalBarrel, 1, 1, 1), _currentLS, NHB_MLbadflags_);
254  MLFlagvsLS_Subdet.fill(HcalDetId(HcalEndcap, 17, 1, 1), _currentLS, NHE_MLbadflags_);
255 
257  DQTask::globalEndLuminosityBlock(lb, es);
258 }
virtual bool exists(HcalDetId const &)
Definition: ContainerXXX.h:213
std::vector< std::vector< float > > digiHcal2DHist_depth_5
Definition: HcalMLTask.cc:73
hcaldqm::ContainerXXX< double > Occupancy1LS
Definition: HcalMLTask.cc:59
std::vector< std::vector< float > > digiHcal2DHist_depth_3
Definition: HcalMLTask.cc:69
virtual void reset()
Definition: ContainerXXX.h:293
std::unique_ptr< OnlineDQMDigiAD > dqmadObj_HB
Definition: HcalMLTask.cc:62
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
virtual void fill(uint32_t)
Definition: Container1D.cc:73
std::vector< std::vector< float > > digiHcal2DHist_depth_4
Definition: HcalMLTask.cc:71
ContainerXXX< uint32_t > _xQuality
Definition: DQTask.h:66
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
std::vector< std::vector< float > > digiHcal2DHist_depth_1
Definition: HcalMLTask.cc:65
HcalElectronicsMap const * _emap
Definition: DQTask.h:81
hcaldqm::Container1D MLFlagvsLS_Subdet
Definition: HcalMLTask.cc:60
std::unique_ptr< OnlineDQMDigiAD > dqmadObj_HE
Definition: HcalMLTask.cc:63
std::vector< std::vector< float > > digiHcal2DHist_depth_7
Definition: HcalMLTask.cc:77
double flagDecisionThr
Definition: HcalMLTask.cc:50
std::vector< std::vector< float > > digiHcal2DHist_depth_2
Definition: HcalMLTask.cc:67
virtual STDTYPE & get(HcalDetId const &)
Definition: ContainerXXX.h:198
std::vector< HcalGenericDetId > allPrecisionId() const
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
std::vector< std::vector< float > > digiHcal2DHist_depth_6
Definition: HcalMLTask.cc:75
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164

Member Data Documentation

◆ digiHcal2DHist_depth_1

std::vector<std::vector<float> > HcalMLTask::digiHcal2DHist_depth_1
private
Initial value:
{
std::vector<std::vector<float>>(64, std::vector<float>(72, 0))}

Definition at line 65 of file HcalMLTask.cc.

Referenced by globalEndLuminosityBlock().

◆ digiHcal2DHist_depth_2

std::vector<std::vector<float> > HcalMLTask::digiHcal2DHist_depth_2
private
Initial value:
{
std::vector<std::vector<float>>(64, std::vector<float>(72, 0))}

Definition at line 67 of file HcalMLTask.cc.

Referenced by globalEndLuminosityBlock().

◆ digiHcal2DHist_depth_3

std::vector<std::vector<float> > HcalMLTask::digiHcal2DHist_depth_3
private
Initial value:
{
std::vector<std::vector<float>>(64, std::vector<float>(72, 0))}

Definition at line 69 of file HcalMLTask.cc.

Referenced by globalEndLuminosityBlock().

◆ digiHcal2DHist_depth_4

std::vector<std::vector<float> > HcalMLTask::digiHcal2DHist_depth_4
private
Initial value:
{
std::vector<std::vector<float>>(64, std::vector<float>(72, 0))}

Definition at line 71 of file HcalMLTask.cc.

Referenced by globalEndLuminosityBlock().

◆ digiHcal2DHist_depth_5

std::vector<std::vector<float> > HcalMLTask::digiHcal2DHist_depth_5
private
Initial value:
{
std::vector<std::vector<float>>(64, std::vector<float>(72, 0))}

Definition at line 73 of file HcalMLTask.cc.

Referenced by globalEndLuminosityBlock().

◆ digiHcal2DHist_depth_6

std::vector<std::vector<float> > HcalMLTask::digiHcal2DHist_depth_6
private
Initial value:
{
std::vector<std::vector<float>>(64, std::vector<float>(72, 0))}

Definition at line 75 of file HcalMLTask.cc.

Referenced by globalEndLuminosityBlock().

◆ digiHcal2DHist_depth_7

std::vector<std::vector<float> > HcalMLTask::digiHcal2DHist_depth_7
private
Initial value:
{
std::vector<std::vector<float>>(64, std::vector<float>(72, 0))}

Definition at line 77 of file HcalMLTask.cc.

Referenced by globalEndLuminosityBlock().

◆ dqmadObj_HB

std::unique_ptr<OnlineDQMDigiAD> HcalMLTask::dqmadObj_HB = nullptr
private

Definition at line 62 of file HcalMLTask.cc.

Referenced by globalEndLuminosityBlock(), and HcalMLTask().

◆ dqmadObj_HE

std::unique_ptr<OnlineDQMDigiAD> HcalMLTask::dqmadObj_HE = nullptr
private

Definition at line 63 of file HcalMLTask.cc.

Referenced by globalEndLuminosityBlock(), and HcalMLTask().

◆ flagDecisionThr

double HcalMLTask::flagDecisionThr
private

Definition at line 50 of file HcalMLTask.cc.

Referenced by globalEndLuminosityBlock(), and HcalMLTask().

◆ hcalDbServiceToken_

edm::ESGetToken<HcalDbService, HcalDbRecord> HcalMLTask::hcalDbServiceToken_
private

Definition at line 57 of file HcalMLTask.cc.

Referenced by bookHistograms().

◆ MLFlagvsLS_Subdet

hcaldqm::Container1D HcalMLTask::MLFlagvsLS_Subdet
private

Definition at line 60 of file HcalMLTask.cc.

Referenced by bookHistograms(), and globalEndLuminosityBlock().

◆ Occupancy1LS

hcaldqm::ContainerXXX<double> HcalMLTask::Occupancy1LS
private

Definition at line 59 of file HcalMLTask.cc.

Referenced by _process(), bookHistograms(), and globalEndLuminosityBlock().

◆ onnx_model_path_HB

std::string HcalMLTask::onnx_model_path_HB
private

Definition at line 49 of file HcalMLTask.cc.

Referenced by HcalMLTask().

◆ onnx_model_path_HE

std::string HcalMLTask::onnx_model_path_HE
private

Definition at line 49 of file HcalMLTask.cc.

Referenced by HcalMLTask().

◆ tagHO

edm::InputTag HcalMLTask::tagHO
private

Definition at line 52 of file HcalMLTask.cc.

Referenced by HcalMLTask().

◆ tagQIE10

edm::InputTag HcalMLTask::tagQIE10
private

Definition at line 53 of file HcalMLTask.cc.

Referenced by HcalMLTask().

◆ tagQIE11

edm::InputTag HcalMLTask::tagQIE11
private

Definition at line 51 of file HcalMLTask.cc.

Referenced by HcalMLTask().

◆ tokHO

edm::EDGetTokenT<HODigiCollection> HcalMLTask::tokHO
private

Definition at line 55 of file HcalMLTask.cc.

Referenced by HcalMLTask().

◆ tokQIE10

edm::EDGetTokenT<QIE10DigiCollection> HcalMLTask::tokQIE10
private

Definition at line 56 of file HcalMLTask.cc.

Referenced by HcalMLTask().

◆ tokQIE11

edm::EDGetTokenT<QIE11DigiCollection> HcalMLTask::tokQIE11
private

Definition at line 54 of file HcalMLTask.cc.

Referenced by _process(), and HcalMLTask().