CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
HcalOnlineHarvesting Class Reference

#include <HcalOnlineHarvesting.h>

Inheritance diagram for HcalOnlineHarvesting:
hcaldqm::DQHarvester DQMEDHarvester hcaldqm::DQModule edm::one::EDProducer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 HcalOnlineHarvesting (edm::ParameterSet const &)
 
 ~HcalOnlineHarvesting () override
 
- Public Member Functions inherited from hcaldqm::DQHarvester
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQHarvester (edm::ParameterSet const &)
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 ~DQHarvester () override
 
- Public Member Functions inherited from DQMEDHarvester
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester (void)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void produce (edm::Event &, edm::EventSetup const &) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () 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
 
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)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
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::vector< ModuleDescription const * > &modules, 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
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 
- Public Member Functions inherited from hcaldqm::DQModule
 DQModule (edm::ParameterSet const &)
 
virtual ~DQModule ()(false)
 

Protected Types

enum  Summary {
  fRaw =0, fDigi =1, fReco =2, fTP =3,
  fPedestal =4, nSummary =5
}
 

Protected Member Functions

void _dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void _dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 

Protected Attributes

hcaldqm::Container2D _cKnownBadChannels_depth
 
int _nBad
 
int _nTotal
 
MonitorElement_reportSummaryMap
 
MonitorElement_runSummary
 
double _thresh_bad_bad
 
std::vector< hcaldqm::ContainerSingle2D_vcSummaryvsLS
 
std::vector< bool > _vmarks
 
std::vector< std::string > _vnames
 
std::vector< hcaldqm::DQClient * > _vsumgen
 
- Protected Attributes inherited from hcaldqm::DQHarvester
HcalElectronicsMap const * _emap
 
int _totalLS
 
std::vector< uint32_t > _vcdaqEids
 
std::vector< int > _vCrates
 
std::vector< int > _vFEDs
 
std::vector< uint32_t > _vhashCrates
 
std::vector< uint32_t > _vhashFEDs
 
ContainerXXX< uint32_t > _xQuality
 
- 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
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
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
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

file: HcalOnlineHarvesting.h Author: VK Date: .. Description: This is DQMEDAnalyzer which is a edm::one module. edm::one enforces that only 1 run is being processed. https://twiki.cern.ch/twiki/bin/view/CMSPublic/FWMultithreadedFrameworkOneModuleInterface - for details.

HcalOnlineHarvesting is responsible for Status Evaluation and Summary Generation. In this step RAW, DIGI, RECO + TP Data Tiers are evaluated and Summary is generated.


Online: There is always a Current Summary - Summary for the Current LS being Evaluated. It might and might not include the information from previous LSs, depending on the Quantity.


Offline: For Offline only Run Summary is being generated. As it is meaningless to have current LS information being delivered. Only Total Summary makes sense

Definition at line 47 of file HcalOnlineHarvesting.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 6 of file HcalOnlineHarvesting.cc.

References _thresh_bad_bad, _vmarks, _vnames, _vsumgen, fDigi, fPedestal, fRaw, fReco, fTP, edm::ParameterSet::getUntrackedParameter(), mps_fire::i, and nSummary.

6  :
7  DQHarvester(ps), _nBad(0), _nTotal(0), _reportSummaryMap(nullptr)
8 {
9 
10  // NOTE: I will leave Run Summary Generators in place
11  // just not triggering on endJob!
12  _vsumgen.resize(nSummary);
13  _vnames.resize(nSummary);
14  _vmarks.resize(nSummary);
15  for (uint32_t i=0; i<_vmarks.size(); i++)
16  _vmarks[i]=false;
17  _vnames[fRaw]="RawTask";
18  _vnames[fDigi]="DigiTask";
19  _vnames[fReco]="RecHitTask";
20  _vnames[fTP]="TPTask";
21  _vnames[fPedestal]="PedestalTask";
22 
23  _vsumgen[fRaw] = new hcaldqm::RawRunSummary("RawRunHarvesting",
24  _vnames[fRaw], ps);
25  _vsumgen[fDigi] = new hcaldqm::DigiRunSummary("DigiRunHarvesting",
26  _vnames[fDigi],ps);
27  _vsumgen[fReco] = new hcaldqm::RecoRunSummary("RecoRunHarvesting",
28  _vnames[fReco], ps);
29  _vsumgen[fTP] = new hcaldqm::TPRunSummary("TPRunHarvesting",
30  _vnames[fTP], ps);
31  _vsumgen[fPedestal] = new hcaldqm::PedestalRunSummary("PedestalRunHarvesting",
32  _vnames[fPedestal], ps);
33 
34  _thresh_bad_bad = ps.getUntrackedParameter("thresh_bad_bad", 0.05);
35 }
std::vector< bool > _vmarks
std::vector< std::string > _vnames
MonitorElement * _reportSummaryMap
std::vector< hcaldqm::DQClient * > _vsumgen
DQHarvester(edm::ParameterSet const &)
Definition: DQHarvester.cc:5
HcalOnlineHarvesting::~HcalOnlineHarvesting ( )
inlineoverride

Definition at line 51 of file HcalOnlineHarvesting.h.

References _dqmEndJob(), _dqmEndLuminosityBlock(), and beginRun().

51 {}

Member Function Documentation

void HcalOnlineHarvesting::_dqmEndJob ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
overrideprotectedvirtual

Implements hcaldqm::DQHarvester.

Definition at line 146 of file HcalOnlineHarvesting.cc.

References DEFINE_FWK_MODULE.

Referenced by ~HcalOnlineHarvesting().

148 {}
void HcalOnlineHarvesting::_dqmEndLuminosityBlock ( DQMStore::IBooker ib,
DQMStore::IGetter ig,
edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements hcaldqm::DQHarvester.

Definition at line 46 of file HcalOnlineHarvesting.cc.

References _cKnownBadChannels_depth, hcaldqm::DQModule::_currentLS, hcaldqm::DQHarvester::_emap, hcaldqm::DQModule::_maxLS, _nBad, _nTotal, hcaldqm::DQModule::_ptype, _reportSummaryMap, _runSummary, hcaldqm::flag::Flag::_state, hcaldqm::DQModule::_subsystem, _thresh_bad_bad, _vcSummaryvsLS, hcaldqm::DQHarvester::_vFEDs, hcaldqm::DQHarvester::_vhashFEDs, _vmarks, _vnames, hcaldqm::DQHarvester::_xQuality, hcaldqm::ContainerXXX< STDTYPE >::begin(), hcaldqm::constants::BIT_AXIS_LS, hcaldqm::constants::BIT_OFFSET, hcaldqm::Container2D::book(), DQMStore::IBooker::book2D(), runTauDisplay::eid, hcaldqm::ContainerXXX< STDTYPE >::end(), hcaldqm::flag::fBAD, hcaldqm::hashfunctions::fdepth, fDigi, hcaldqm::flag::fGOOD, hcaldqm::quantity::fieta, hcaldqm::Container2D::fill(), hcaldqm::quantity::fiphi, RemoveAddSevLevel::flag, hcaldqm::quantity::fN, hcaldqm::flag::fNCDAQ, hcaldqm::fOffline, fPedestal, fRaw, fReco, hcaldqm::quantity::fState, fTP, DQMStore::IGetter::get(), MonitorElement::getTH1(), mps_fire::i, hcaldqm::Container2D::initialize(), dataset::name, MonitorElement::setBinContent(), MonitorElement::setBinLabel(), and DQMStore::IGetter::setCurrentFolder().

Referenced by ~HcalOnlineHarvesting().

50 {
51  // DETERMINE WHICH MODULES ARE PRESENT IN DATA
52  if (ig.get(_subsystem+"/"+_vnames[fRaw]+"/EventsTotal")!=nullptr)
53  _vmarks[fRaw]=true;
54  if (ig.get(_subsystem+"/"+_vnames[fDigi]+"/EventsTotal")!=nullptr)
55  _vmarks[fDigi]=true;
56  if (ig.get(_subsystem+"/"+_vnames[fTP]+"/EventsTotal")!=nullptr)
57  _vmarks[fTP]=true;
58  if (ig.get(_subsystem+"/"+_vnames[fReco]+"/EventsTotal")!=nullptr)
59  _vmarks[fReco]=true;
60  if (ig.get(_subsystem+"/"+_vnames[fPedestal]+"/EventsTotal")!=nullptr)
61  _vmarks[fPedestal]=true;
62 
63  // CREATE SUMMARY REPORT MAP FED vs LS and LOAD MODULE'S SUMMARIES
64  // NOTE: THIS STATEMENTS WILL BE EXECUTED ONLY ONCE!
65  if (!_reportSummaryMap)
66  {
67  ig.setCurrentFolder(_subsystem+"/EventInfo");
68  _reportSummaryMap = ib.book2D("reportSummaryMap", "reportSummaryMap",
69  _maxLS, 1, _maxLS+1, _vFEDs.size(), 0, _vFEDs.size());
70  for (uint32_t i=0; i<_vFEDs.size(); i++)
71  {
72  char name[5];
73  sprintf(name, "%d", _vFEDs[i]);
74  _reportSummaryMap->setBinLabel(i+1, name, 2);
75  }
76  // set LS bit to mark Xaxis as LS axis
78 
79  // INITIALIZE ALL THE MODULES
80  for (uint32_t i=0; i<_vnames.size(); i++)
82  "SummaryvsLS",
86 
87  // LOAD ONLY THOSE MODULES THAT ARE PRESENT IN DATA
88  for (uint32_t i=0; i<_vmarks.size(); i++)
89  {
90  if (_vmarks[i])
91  _vcSummaryvsLS[i].load(ig, _subsystem);
92  }
93 
94  // Create a map of bad channels and fill
95  _cKnownBadChannels_depth.initialize("RunInfo", "KnownBadChannels",
101  for (uintCompactMap::const_iterator it=_xQuality.begin();
102  it!=_xQuality.end(); ++it)
104 
105  ig.setCurrentFolder(_subsystem+"/EventInfo");
106  _runSummary = ib.book2D("runSummary", "runSummary",
107  1, 0, 1, 1, 0, 1);
108  }
109 
110  int ifed=0;
111  hcaldqm::flag::Flag fTotal("Status", hcaldqm::flag::fNCDAQ);
112  if (_ptype != fOffline) { // hidefed2crate
113  for (std::vector<uint32_t>::const_iterator it=_vhashFEDs.begin();
114  it!=_vhashFEDs.end(); ++it)
115  {
116  HcalElectronicsId eid(*it);
118  for (uint32_t im=0; im<_vmarks.size(); im++)
119  if (_vmarks[im])
120  {
121  int x = _vcSummaryvsLS[im].getBinContent(eid, _currentLS);
123  fSum+=flag;
124  }
125  _reportSummaryMap->setBinContent(_currentLS, ifed+1, int(fSum._state));
126  ifed++;
127  fTotal+=fSum;
128  }
129  }
130 
131  // update the Run Summary
132  // ^^^TEMPORARY AT THIS POINT!
133  if (fTotal._state==hcaldqm::flag::fBAD) _nBad++;
134  _nTotal++;
135  if (double(_nBad)/double(_nTotal)>=_thresh_bad_bad)
137  else if (fTotal._state==hcaldqm::flag::fNCDAQ)
139  else
141 }
ContainerXXX< uint32_t > _xQuality
Definition: DQHarvester.h:45
std::vector< uint32_t > _vhashFEDs
Definition: DQHarvester.h:43
void setBinContent(int binx, double content)
set content of bin (1-D)
std::vector< bool > _vmarks
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
virtual CompactMap::const_iterator begin()
Definition: ContainerXXX.h:75
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
hcaldqm::Container2D _cKnownBadChannels_depth
virtual CompactMap::const_iterator end()
Definition: ContainerXXX.h:77
std::vector< std::string > _vnames
ProcessingType _ptype
Definition: DQModule.h:59
MonitorElement * _reportSummaryMap
virtual void initialize(std::string const &folder, hashfunctions::HashType, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fN), int debug=0)
Definition: Container2D.cc:32
TH1 * getTH1(void) const
HcalElectronicsMap const * _emap
Definition: DQHarvester.h:32
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:347
MonitorElement * _runSummary
void fill(HcalDetId const &) override
Definition: Container2D.cc:59
std::string _subsystem
Definition: DQModule.h:64
int const BIT_OFFSET
Definition: Constants.h:314
int const BIT_AXIS_LS
Definition: Constants.h:318
std::vector< int > _vFEDs
Definition: DQHarvester.h:42
std::vector< hcaldqm::ContainerSingle2D > _vcSummaryvsLS
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: Container2D.cc:895
Readout chain identification for Hcal.
void HcalOnlineHarvesting::beginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
override

Definition at line 37 of file HcalOnlineHarvesting.cc.

References _vsumgen.

Referenced by ~HcalOnlineHarvesting().

39 {
40  DQHarvester::beginRun(r,es);
41  for (std::vector<DQClient*>::const_iterator it=_vsumgen.begin();
42  it!=_vsumgen.end(); ++it)
43  (*it)->beginRun(r,es);
44 }
std::vector< hcaldqm::DQClient * > _vsumgen

Member Data Documentation

hcaldqm::Container2D HcalOnlineHarvesting::_cKnownBadChannels_depth
protected

Definition at line 86 of file HcalOnlineHarvesting.h.

Referenced by _dqmEndLuminosityBlock().

int HcalOnlineHarvesting::_nBad
protected

Definition at line 80 of file HcalOnlineHarvesting.h.

Referenced by _dqmEndLuminosityBlock().

int HcalOnlineHarvesting::_nTotal
protected

Definition at line 81 of file HcalOnlineHarvesting.h.

Referenced by _dqmEndLuminosityBlock().

MonitorElement* HcalOnlineHarvesting::_reportSummaryMap
protected

Definition at line 89 of file HcalOnlineHarvesting.h.

Referenced by _dqmEndLuminosityBlock().

MonitorElement* HcalOnlineHarvesting::_runSummary
protected

Definition at line 90 of file HcalOnlineHarvesting.h.

Referenced by _dqmEndLuminosityBlock().

double HcalOnlineHarvesting::_thresh_bad_bad
protected

Definition at line 77 of file HcalOnlineHarvesting.h.

Referenced by _dqmEndLuminosityBlock(), and HcalOnlineHarvesting().

std::vector<hcaldqm::ContainerSingle2D> HcalOnlineHarvesting::_vcSummaryvsLS
protected

Definition at line 84 of file HcalOnlineHarvesting.h.

Referenced by _dqmEndLuminosityBlock().

std::vector<bool> HcalOnlineHarvesting::_vmarks
protected

Definition at line 72 of file HcalOnlineHarvesting.h.

Referenced by _dqmEndLuminosityBlock(), and HcalOnlineHarvesting().

std::vector<std::string> HcalOnlineHarvesting::_vnames
protected

Definition at line 74 of file HcalOnlineHarvesting.h.

Referenced by _dqmEndLuminosityBlock(), and HcalOnlineHarvesting().

std::vector<hcaldqm::DQClient*> HcalOnlineHarvesting::_vsumgen
protected

Definition at line 73 of file HcalOnlineHarvesting.h.

Referenced by beginRun(), and HcalOnlineHarvesting().