CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
HcalOfflineHarvesting Class Reference

#include <HcalOfflineHarvesting.h>

Inheritance diagram for HcalOfflineHarvesting:
hcaldqm::DQHarvester DQMEDHarvester hcaldqm::DQModule edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 HcalOfflineHarvesting (edm::ParameterSet const &)
 
virtual ~HcalOfflineHarvesting ()
 
- Public Member Functions inherited from hcaldqm::DQHarvester
 DQHarvester (edm::ParameterSet const &)
 
virtual void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual ~DQHarvester ()
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 & 
itemsToGetFromEvent () 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)
 

Public Attributes

tuple hcalOfflineHarvesting
 

Protected Types

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

Protected Member Functions

virtual void _dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &)
 
virtual void _dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
- 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

MonitorElement_reportSummaryMap
 
std::vector< bool > _vmarks
 
std::vector< std::string > _vnames
 
std::vector< hcaldqm::DQClient * > _vsumgen
 
MonitorElementme
 
- Protected Attributes inherited from hcaldqm::DQHarvester
HcalElectronicsMap const * _emap
 
int _totalLS
 
std::vector< uint32_t > _vcdaqEids
 
std::vector< int > _vFEDs
 
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::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

file: HcalOffineHarvesting.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.


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 39 of file HcalOfflineHarvesting.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 7 of file HcalOfflineHarvesting.cc.

References _vmarks, _vnames, _vsumgen, fDigi, fRaw, fReco, fTP, i, and nSummary.

7  :
9 {
10  _vsumgen.resize(nSummary);
11  _vmarks.resize(nSummary);
12  _vnames.resize(nSummary);
13  _vnames[fRaw]="RawTask";
14  _vnames[fDigi]="DigiTask";
15  _vnames[fReco]="RecHitTask";
16  _vnames[fTP]="TPTask";
17  for (uint32_t i=0; i<_vmarks.size(); i++)
18  _vmarks[i]=false;
19 
20  _vsumgen[fRaw]=new hcaldqm::RawRunSummary("RawRunHarvesting", _vnames[fRaw],ps);
21  _vsumgen[fDigi]=new hcaldqm::DigiRunSummary("DigiRunHarvesting", _vnames[fDigi],ps);
22  _vsumgen[fReco]=new hcaldqm::RecoRunSummary("RecoRunHarvesting", _vnames[fReco],ps);
23  _vsumgen[fTP]=new hcaldqm::TPRunSummary("TPRunHarvesting", _vnames[fTP],ps);
24 }
int i
Definition: DBlmapReader.cc:9
std::vector< bool > _vmarks
#define NULL
Definition: scimark2.h:8
MonitorElement * _reportSummaryMap
std::vector< std::string > _vnames
std::vector< hcaldqm::DQClient * > _vsumgen
DQHarvester(edm::ParameterSet const &)
Definition: DQHarvester.cc:5
virtual HcalOfflineHarvesting::~HcalOfflineHarvesting ( )
inlinevirtual

Definition at line 43 of file HcalOfflineHarvesting.h.

43 {}

Member Function Documentation

void HcalOfflineHarvesting::_dqmEndJob ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
protectedvirtual

Implements hcaldqm::DQHarvester.

Definition at line 68 of file HcalOfflineHarvesting.cc.

References hcaldqm::DQModule::_debug, hcaldqm::DQModule::_name, _reportSummaryMap, hcaldqm::DQModule::_subsystem, hcaldqm::DQHarvester::_vFEDs, _vmarks, _vnames, _vsumgen, DQMStore::IBooker::book2D(), gather_cfg::cout, fDigi, flags, fRaw, fReco, fTP, i, cuy::ii, mergeVDriftHistosByStation::name, pileupDistInMC::num, MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.

70 {
71  // OBTAIN/SET WHICH MODULES ARE PRESENT
72  int num=0; std::map<std::string, int> datatiers;
73  if (_vmarks[fRaw])
74  {
75  datatiers.insert(std::pair<std::string, int>("RAW",num));
76  num++;
77  }
78  if (_vmarks[fDigi])
79  {
80  datatiers.insert(std::pair<std::string, int>("DIGI",num));
81  num++;
82  }
83  if (_vmarks[fTP])
84  {
85  datatiers.insert(std::pair<std::string, int>("TP",num));
86  num++;
87  }
88  if (_vmarks[fReco])
89  {
90  datatiers.insert(std::pair<std::string, int>("RECO",num));
91  num++;
92  }
93 
94  // CREATE THE REPORT SUMMARY MAP
95  // num is #modules
96  // datatiers - std map [DATATIER_NAME] -> [positional value [0,num-1]]
97  // -> bin wise +1 should be
98  if (!_reportSummaryMap)
99  {
100  ib.setCurrentFolder(_subsystem+"/EventInfo");
101  _reportSummaryMap = ib.book2D("reportSummaryMap", "reportSummaryMap",
102  _vFEDs.size(), 0, _vFEDs.size(), num,0,num);
103  // x axis labels
104 
105  for (uint32_t i=0; i<_vFEDs.size(); i++)
106  {
107  char name[5];
108  sprintf(name, "%d", _vFEDs[i]);
109  _reportSummaryMap->setBinLabel(i+1, name, 1);
110  }
111  // y axis lables
112  for (std::map<std::string, int>::const_iterator
113  it=datatiers.begin(); it!=datatiers.end(); ++it)
114  {
115  std::string name = it->first;
116  int value = it->second;
117  _reportSummaryMap->setBinLabel(value+1, name, 2);
118  }
119  }
120 
121  // iterate over all summary generators and get the flags
122  int ii=0;
123  for (std::vector<DQClient*>::const_iterator it=_vsumgen.begin();
124  it!=_vsumgen.end(); ++it)
125  {
126  // IF MODULE IS NOT PRESENT IN DATA SKIP
127  if (!_vmarks[ii])
128  {ii++;continue;}
129 
130  // OBTAIN ALL THE FLAGS FOR THIS MODULE
131  // AND SET THE REPORT STATUS MAP
132  // NOTE AGAIN: datatiers map [DATATIER]->[value not bin!]+1 therefore
133  if (_debug>0)
134  std::cout << _vnames[ii] << std::endl;
135  std::vector<hcaldqm::flag::Flag> flags = (*it)->endJob(ib,ig);
136  if (_debug>0)
137  {
138  std::cout << "********************" << std::endl;
139  std::cout << "SUMMARY" << std::endl;
140  }
141  for (uint32_t ifed=0; ifed<_vFEDs.size(); ifed++)
142  {
144  datatiers[flags[ifed]._name]+1, (int)flags[ifed]._state);
145  if (_debug>0)
146  {
147  std::cout << "FED=" << _vFEDs[ifed] << std::endl;
148  std::cout << flags[ifed]._name << " " << flags[ifed]._state
149  <<std::endl;
150  }
151  }
152  ii++;
153  }
154 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
std::vector< bool > _vmarks
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)
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
int ii
Definition: cuy.py:588
MonitorElement * _reportSummaryMap
std::vector< std::string > _vnames
std::string _name
Definition: DQModule.h:57
std::vector< hcaldqm::DQClient * > _vsumgen
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::string _subsystem
Definition: DQModule.h:64
tuple cout
Definition: gather_cfg.py:145
std::vector< int > _vFEDs
Definition: DQHarvester.h:38
void HcalOfflineHarvesting::_dqmEndLuminosityBlock ( DQMStore::IBooker ib,
DQMStore::IGetter ig,
edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)
protectedvirtual

Implements hcaldqm::DQHarvester.

Definition at line 39 of file HcalOfflineHarvesting.cc.

References hcaldqm::DQModule::_subsystem, _vmarks, _vnames, _vsumgen, fDigi, fRaw, fReco, fTP, DQMStore::IGetter::get(), cuy::ii, and NULL.

43 {
44  if (ig.get(_subsystem+"/"+_vnames[fRaw]+"/EventsTotal")!=NULL)
45  _vmarks[fRaw]=true;
46  if (ig.get(_subsystem+"/"+_vnames[fDigi]+"/EventsTotal")!=NULL)
47  _vmarks[fDigi]=true;
48  if (ig.get(_subsystem+"/"+_vnames[fTP]+"/EventsTotal")!=NULL)
49  _vmarks[fTP]=true;
50  if (ig.get(_subsystem+"/"+_vnames[fReco]+"/EventsTotal")!=NULL)
51  _vmarks[fReco]=true;
52 
53  // CALL ALL THE HARVESTERS
54  int ii=0;
55  for (std::vector<DQClient*>::const_iterator it=_vsumgen.begin();
56  it!=_vsumgen.end(); ++it)
57  {
58  // run only if have to
59  if (_vmarks[ii])
60  (*it)->endLuminosityBlock(ib,ig,lb,es);
61  ii++;
62  }
63 }
std::vector< bool > _vmarks
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
#define NULL
Definition: scimark2.h:8
int ii
Definition: cuy.py:588
std::vector< std::string > _vnames
std::vector< hcaldqm::DQClient * > _vsumgen
std::string _subsystem
Definition: DQModule.h:64
void HcalOfflineHarvesting::beginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
virtual

Reimplemented from hcaldqm::DQHarvester.

Definition at line 26 of file HcalOfflineHarvesting.cc.

References _vsumgen.

28 {
29  DQHarvester::beginRun(r,es);
30 
31  for (std::vector<DQClient*>::const_iterator it=_vsumgen.begin();
32  it!=_vsumgen.end(); ++it)
33  (*it)->beginRun(r,es);
34 }
std::vector< hcaldqm::DQClient * > _vsumgen

Member Data Documentation

MonitorElement* HcalOfflineHarvesting::_reportSummaryMap
protected

Definition at line 71 of file HcalOfflineHarvesting.h.

Referenced by _dqmEndJob().

std::vector<bool> HcalOfflineHarvesting::_vmarks
protected
std::vector<std::string> HcalOfflineHarvesting::_vnames
protected
std::vector<hcaldqm::DQClient*> HcalOfflineHarvesting::_vsumgen
protected
tuple HcalOfflineHarvesting.hcalOfflineHarvesting
Initial value:
1 = cms.EDAnalyzer(
2  "HcalOfflineHarvesting",
3 
4  name = cms.untracked.string("HcalOfflineHarvesting"),
5  debug = cms.untracked.int32(0),
6  runkeyVal = cms.untracked.int32(0),
7  runkeyName = cms.untracked.string('pp_run'),
8  ptype = cms.untracked.int32(1),
9  mtype = cms.untracked.bool(True),
10  subsystem = cms.untracked.string("Hcal"),
11 
12  thresh_EtMsmRate_high = cms.untracked.double(0.2),
13  thresh_EtMsmRate_low = cms.untracked.double(0.1),
14  thresh_FGMsmRate_high = cms.untracked.double(0.2),
15  thresh_FGMsmRate_low = cms.untracked.double(0.1),
16  thresh_unihf = cms.untracked.double(0.2),
17  thresh_tcds = cms.untracked.double(1.5)
18 )

Definition at line 3 of file HcalOfflineHarvesting.py.

MonitorElement* HcalOfflineHarvesting::me
protected

Definition at line 72 of file HcalOfflineHarvesting.h.