test
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 ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 
- Public Member Functions inherited from hcaldqm::DQModule
 DQModule (edm::ParameterSet const &)
 
virtual ~DQModule ()
 

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< 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

Definition at line 41 of file HcalOfflineHarvesting.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 3 of file HcalOfflineHarvesting.cc.

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

3  :
5 {
6  _vsumgen.resize(nSummary);
7  _vmarks.resize(nSummary);
8  _vnames.resize(nSummary);
9  _vnames[fRaw]="RawTask";
10  _vnames[fDigi]="DigiTask";
11  _vnames[fReco]="RecHitTask";
12  _vnames[fTP]="TPTask";
13  for (uint32_t i=0; i<_vmarks.size(); i++)
14  _vmarks[i]=false;
15 
16  _vsumgen[fRaw]=new RawRunSummary("RawRunHarvesting", _vnames[fRaw],ps);
17  _vsumgen[fDigi]=new DigiRunSummary("DigiRunHarvesting", _vnames[fDigi],ps);
18  _vsumgen[fReco]=new RecoRunSummary("RecoRunHarvesting", _vnames[fReco],ps);
19  _vsumgen[fTP]=new TPRunSummary("TPRunHarvesting", _vnames[fTP],ps);
20 }
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< DQClient * > _vsumgen
DQHarvester(edm::ParameterSet const &)
Definition: DQHarvester.cc:5
virtual HcalOfflineHarvesting::~HcalOfflineHarvesting ( )
inlinevirtual

Definition at line 45 of file HcalOfflineHarvesting.h.

45 {}

Member Function Documentation

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

Implements hcaldqm::DQHarvester.

Definition at line 64 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.

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

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

39 {
40  if (ig.get(_subsystem+"/"+_vnames[fRaw]+"/EventsTotal")!=NULL)
41  _vmarks[fRaw]=true;
42  if (ig.get(_subsystem+"/"+_vnames[fDigi]+"/EventsTotal")!=NULL)
43  _vmarks[fDigi]=true;
44  if (ig.get(_subsystem+"/"+_vnames[fTP]+"/EventsTotal")!=NULL)
45  _vmarks[fTP]=true;
46  if (ig.get(_subsystem+"/"+_vnames[fReco]+"/EventsTotal")!=NULL)
47  _vmarks[fReco]=true;
48 
49  // CALL ALL THE HARVESTERS
50  int ii=0;
51  for (std::vector<DQClient*>::const_iterator it=_vsumgen.begin();
52  it!=_vsumgen.end(); ++it)
53  {
54  // run only if have to
55  if (_vmarks[ii])
56  (*it)->endLuminosityBlock(ib,ig,lb,es);
57  ii++;
58  }
59 }
std::vector< bool > _vmarks
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:304
#define NULL
Definition: scimark2.h:8
int ii
Definition: cuy.py:588
std::vector< std::string > _vnames
std::vector< 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 22 of file HcalOfflineHarvesting.cc.

References _vsumgen.

24 {
25  DQHarvester::beginRun(r,es);
26 
27  for (std::vector<DQClient*>::const_iterator it=_vsumgen.begin();
28  it!=_vsumgen.end(); ++it)
29  (*it)->beginRun(r,es);
30 }
std::vector< DQClient * > _vsumgen

Member Data Documentation

MonitorElement* HcalOfflineHarvesting::_reportSummaryMap
protected

Definition at line 73 of file HcalOfflineHarvesting.h.

Referenced by _dqmEndJob().

std::vector<bool> HcalOfflineHarvesting::_vmarks
protected
std::vector<std::string> HcalOfflineHarvesting::_vnames
protected
std::vector<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_fgmsm = cms.untracked.double(0.1),
13  thresh_etmsm = cms.untracked.double(0.1),
14  thresh_unihf = cms.untracked.double(0.2),
15  thresh_tcds = cms.untracked.double(1.5)
16 )

Definition at line 3 of file HcalOfflineHarvesting.py.

MonitorElement* HcalOfflineHarvesting::me
protected

Definition at line 74 of file HcalOfflineHarvesting.h.