File indexing completed on 2024-04-06 12:08:25
0001 #ifndef SiPixel_HistogramManager_h
0002 #define SiPixel_HistogramManager_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include "DataFormats/DetId/interface/DetId.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 #include "FWCore/Framework/interface/Event.h"
0022
0023
0024 #include "DQMServices/Core/interface/DQMStore.h"
0025
0026
0027 #include "DQM/SiPixelPhase1Common/interface/SummationSpecification.h"
0028 #include "DQM/SiPixelPhase1Common/interface/GeometryInterface.h"
0029 #include "DQM/SiPixelPhase1Common/interface/AbstractHistogram.h"
0030
0031 class HistogramManager {
0032 public:
0033 typedef dqm::legacy::DQMStore DQMStore;
0034 typedef dqm::legacy::MonitorElement MonitorElement;
0035
0036 explicit HistogramManager(const edm::ParameterSet& iConfig, GeometryInterface& geo);
0037
0038 void addSpec(SummationSpecification spec);
0039
0040
0041 void fill(DetId sourceModule, const edm::Event* sourceEvent = nullptr, int col = 0, int row = 0);
0042 void fill(double value, DetId sourceModule, const edm::Event* sourceEvent = nullptr, int col = 0, int row = 0);
0043 void fill(double x, double y, DetId sourceModule, const edm::Event* sourceEvent = nullptr, int col = 0, int row = 0);
0044
0045
0046 void executePerEventHarvesting(edm::Event const* ev);
0047
0048
0049 void book(DQMStore::IBooker& iBooker, edm::EventSetup const& iSetup);
0050
0051
0052
0053 void executePerLumiHarvesting(DQMStore::IBooker& iBooker,
0054 DQMStore::IGetter& iGetter,
0055 edm::LuminosityBlock const& lumiBlock,
0056 edm::EventSetup const& iSetup);
0057 void executeHarvesting(DQMStore::IBooker& iBooker, DQMStore::IGetter& iGetter);
0058
0059 typedef std::map<GeometryInterface::Values, AbstractHistogram> Table;
0060
0061 private:
0062 GeometryInterface& geometryInterface;
0063
0064 std::vector<SummationSpecification> specs;
0065 std::vector<Table> tables;
0066 std::vector<Table> counters;
0067
0068 std::pair<std::string, std::string> makePathName(SummationSpecification const& s,
0069 GeometryInterface::Values const&,
0070 SummationStep const* upto);
0071
0072 void fillInternal(double x,
0073 double y,
0074 int n_parameters,
0075 GeometryInterface::InterestingQuantities const& iq,
0076 std::vector<SummationStep>::iterator first,
0077 std::vector<SummationStep>::iterator last,
0078 AbstractHistogram& dest);
0079
0080 void loadFromDQMStore(SummationSpecification& s, Table& t, DQMStore::IGetter& iGetter);
0081 void executeGroupBy(SummationStep const& step, Table& t, DQMStore::IBooker& iBooker, SummationSpecification const& s);
0082 void executeExtend(SummationStep const& step,
0083 Table& t,
0084 std::string const& reduction,
0085 DQMStore::IBooker& iBooker,
0086 SummationSpecification const& s);
0087
0088 public:
0089 bool enabled;
0090 bool perLumiHarvesting;
0091 bool bookUndefined;
0092 std::string top_folder_name;
0093
0094 std::string name;
0095 std::string title;
0096 std::string xlabel;
0097 std::string ylabel;
0098 int dimensions;
0099 int range_x_nbins;
0100 double range_x_min;
0101 double range_x_max;
0102 int range_y_nbins;
0103 double range_y_min;
0104 double range_y_max;
0105 bool statsOverflows;
0106
0107
0108 edm::LuminosityBlock const* lumisection = nullptr;
0109
0110 private:
0111
0112
0113
0114
0115
0116 GeometryInterface::InterestingQuantities iq;
0117
0118 std::vector<GeometryInterface::Values> significantvalues;
0119
0120 std::vector<AbstractHistogram*> fastpath;
0121 };
0122
0123 #endif