CMS 3D CMS Logo

HistDefinition.cc
Go to the documentation of this file.
3 #include <algorithm>
4 
5 namespace dqmoffline {
6  namespace l1t {
7 
8  typedef std::vector<double> vdouble;
9 
11  : name("name"), title("title"), nbinsX(0), nbinsY(0), xmin(0), xmax(0), ymin(0), ymax(0), binsX(), binsY() {}
12 
14  : name(ps.getUntrackedParameter<std::string>("name")),
15  title(ps.getUntrackedParameter<std::string>("title")),
16  nbinsX(ps.getUntrackedParameter<unsigned int>("nbinsX", 0)),
17  nbinsY(ps.getUntrackedParameter<unsigned int>("nbinsY", 0)),
18  xmin(ps.getUntrackedParameter<double>("xmin", 0)),
19  xmax(ps.getUntrackedParameter<double>("xmax", 0)),
20  ymin(ps.getUntrackedParameter<double>("ymin", 0)),
21  ymax(ps.getUntrackedParameter<double>("ymax", 0)),
22  binsXtmp(ps.getUntrackedParameter<vdouble>("binsX", vdouble())),
23  binsYtmp(ps.getUntrackedParameter<vdouble>("binsY", vdouble())),
24  binsX(binsXtmp.begin(), binsXtmp.end()),
25  binsY(binsYtmp.begin(), binsYtmp.end()) {}
26 
28 
30  const std::map<std::string, unsigned int> &mapping) {
32  std::vector<std::string> names = ps.getParameterNames();
33  std::vector<unsigned int> map_values;
34 
35  for (auto const &imap : mapping) {
36  map_values.push_back(imap.second);
37  }
38  unsigned int max_size = *std::max_element(map_values.begin(), map_values.end());
39  max_size = std::max(max_size, (unsigned int)mapping.size());
40  definitions.resize(max_size);
41 
42  for (auto name : names) {
43  if (mapping.find(name) != mapping.end()) {
46  } else {
47  edm::LogError("HistDefinition::readHistDefinitions")
48  << "Could not find histogram definition for '" << name << "'" << std::endl;
49  }
50  }
51  return definitions;
52  }
53  } // namespace l1t
54 } // namespace dqmoffline
dqmoffline::l1t::readHistDefinitions
HistDefinitions readHistDefinitions(const edm::ParameterSet &ps, const std::map< std::string, unsigned int > &mapping)
Definition: HistDefinition.cc:29
MessageLogger.h
L1THistDefinitions_cff.binsY
binsY
Definition: L1THistDefinitions_cff.py:21
hlt_dqm_clientPB-live_cfg.nbinsX
nbinsX
Definition: hlt_dqm_clientPB-live_cfg.py:60
HistDefinition.h
end
#define end
Definition: vmac.h:39
dqmoffline::l1t::HistDefinition::~HistDefinition
~HistDefinition()
Definition: HistDefinition.cc:27
L1TOccupancyClient_cfi.ymax
ymax
Definition: L1TOccupancyClient_cfi.py:43
names
const std::string names[nVars_]
Definition: PhotonIDValueMapProducer.cc:122
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hlt_dqm_clientPB-live_cfg.nbinsY
nbinsY
Definition: hlt_dqm_clientPB-live_cfg.py:64
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
l1t
delete x;
Definition: CaloConfig.h:22
dqmoffline
Definition: HistDefinition.h:48
edm::ParameterSet::getParameterNames
std::vector< std::string > getParameterNames() const
Definition: ParameterSet.cc:656
createfilelist.int
int
Definition: createfilelist.py:10
definitions
Definition: definitions.py:1
dqmoffline::l1t::HistDefinition::HistDefinition
HistDefinition()
Definition: HistDefinition.cc:10
dqmoffline::l1t::HistDefinition
Definition: HistDefinition.h:54
dqmoffline::l1t::HistDefinitions
std::vector< HistDefinition > HistDefinitions
Definition: HistDefinition.h:51
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
dqmoffline::l1t::vdouble
std::vector< double > vdouble
Definition: HistDefinition.cc:8
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
L1THistDefinitions_cff.binsX
binsX
Definition: L1THistDefinitions_cff.py:20
std
Definition: JetResolutionObject.h:76
L1TOccupancyClient_cfi.ymin
ymin
Definition: L1TOccupancyClient_cfi.py:43
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:28
begin
#define begin
Definition: vmac.h:32