CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SummationSpecification.h
Go to the documentation of this file.
1 #ifndef SiPixel_SummationSpecification
2 #define SiPixel_SummationSpecification
3 // -*- C++ -*-
4 //
5 // Package: SiPixelPhase1Common
6 // Class: SummationSpecification
7 //
8 // This class represents a sequence of steps that produce histograms by summing
9 // up other histograms. This can be considered a domain-specific language for
10 // DQM. This class has no intelligence, it just manages the "program". It is
11 // not encapsulated, the structure is exposed.
12 //
13 // Original Author: Marcel Schneider
14 
15 #include <vector>
16 #include <string>
17 
19 
20 struct SummationStep {
21  // For step1, all the necessary information should be in the type and columns
22  // to allow fill() to exectute it very quickly.
23  // For step2 stuff (after the first SAVE), we can also keep strings, since
24  // step2 will only be executed once by an executor.
25  enum Type {
26  NO_TYPE = 0,
27  GROUPBY = 1,
28  EXTEND_X = 2,
29  EXTEND_Y = 3,
30  COUNT = 4,
31  REDUCE = 5,
32  SAVE = 6,
33  USE_X = 8,
34  USE_Y = 9,
35  USE_Z = 10,
36  PROFILE = 11
37  };
39  // STAGE1 is DQM step1, STAGE2 step2. STAGE1_2 is somewhere in between, it runs
40  // in the analyze()-method (step1) but does a sort of harvesting (per-event).
41  // STAGE1_2 is for ndigis-like counters.
42  // FIRST is the first group-by, which is special.
45 
46  int nbins{-1};
47  int xmin{0};
48  int xmax{0};
49 
50  std::vector<GeometryInterface::Column> columns;
51 
52  // more parameters. Not very elegant but good enough for step2.
54 };
55 
57  std::vector<SummationStep> steps;
60 
61  template <class stream, class GI>
62  void dump(stream& out, GI& gi) {
63  for (auto& s : steps) {
64  out << "Step: type " << s.type << " stage " << s.stage << " col ";
65  for (auto c : s.columns)
66  out << gi.pretty(c) << " ";
67  out << " arg " << s.arg << "\n";
68  }
69  }
70 
71 private:
73 };
74 
75 #endif
const edm::EventSetup & c
void dump(stream &out, GI &gi)
std::vector< GeometryInterface::Column > columns
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
std::vector< SummationStep > steps
GeometryInterface::Column parse_columns(std::string name, GeometryInterface &)