CMS 3D CMS Logo

CommissioningHistograms.h
Go to the documentation of this file.
1 #ifndef DQM_SiStripCommissioningClients_CommissioningHistograms_H
2 #define DQM_SiStripCommissioningClients_CommissioningHistograms_H
3 
12 #include "TProfile.h"
13 #include "TH1.h"
14 #include <iostream>
15 #include <sstream>
16 #include <string>
17 #include <vector>
18 #include <map>
19 #include <cstdint>
20 
22 
24 public:
25  // not used here but some uses in derived classes
28  // ---------- con(de)structors ----------
29 
30  CommissioningHistograms(const edm::ParameterSet& pset, DQMStore* const, const sistrip::RunType&);
31 
32  // MAKE PRIVATE
33  CommissioningHistograms(); // private constructor
34 
35  virtual ~CommissioningHistograms();
36 
37  virtual void configure(const edm::ParameterSet&, const edm::EventSetup&) {}
38 
39  // ---------- histogram container class ----------
40 
41  class Histo {
42  public:
43  Histo(const std::string& title, MonitorElement* const me, MonitorElement* const cme)
44  : title_(title), me_(me), cme_(cme) {
45  ;
46  }
47  Histo() : title_(""), me_(nullptr), cme_(nullptr) { ; }
48  void print(std::stringstream&) const;
50  MonitorElement* me_;
51  MonitorElement* cme_;
52  };
53 
54  // ---------- typedefs ----------
55 
56  typedef std::map<uint32_t, CommissioningAnalysis*> Analyses;
57 
58  typedef Analyses::iterator Analysis;
59 
61 
62  typedef std::vector<Histo*> Histos;
63 
64  typedef std::map<uint32_t, Histos> HistosMap;
65 
66  typedef std::map<uint32_t, uint32_t> FedToFecMap;
67 
68  // ---------- histogram "actions" ----------
69 
70  static uint32_t runNumber(DQMStore* const, const std::vector<std::string>&);
71 
72  static sistrip::RunType runType(DQMStore* const, const std::vector<std::string>&);
73 
75  static void copyCustomInformation(DQMStore* const, const std::vector<std::string>&);
76 
77  void extractHistograms(const std::vector<std::string>&);
78 
79  // DEPRECATE
80  void createCollations(const std::vector<std::string>&);
81 
82  virtual void histoAnalysis(bool debug);
83 
84  virtual void printAnalyses();
85 
86  virtual void printSummary();
87 
88  virtual void createSummaryHisto(const sistrip::Monitorable&,
89  const sistrip::Presentation&,
90  const std::string& top_level_dir,
91  const sistrip::Granularity&);
92 
93  void remove(std::string pattern = "");
94 
95  void save(std::string& filename, uint32_t run_number = 0, std::string partitionName = "");
96 
97  // ---------- protected methods ----------
98 
99 protected:
100  inline const sistrip::RunType& task() const;
101 
102  inline DQMStore* const bei() const;
103 
104  Analyses& data(bool getMaskedData = false);
105 
106  inline Factory* const factory();
107 
108  inline const HistosMap& histos() const;
109 
110  inline const FedToFecMap& mapping() const;
111 
112  inline const edm::ParameterSet& pset() const;
113 
114  TH1* histogram(const sistrip::Monitorable&,
115  const sistrip::Presentation&,
116  const sistrip::View&,
117  const std::string& directory,
118  const uint32_t& xbins,
119  const float& xlow = 1. * sistrip::invalid_,
120  const float& xhigh = 1. * sistrip::invalid_);
121 
122  void printHistosMap();
123 
124  void clearHistosMap();
125 
126  // ---------- private member data ----------
127 
128 protected:
129  std::unique_ptr<Factory> factory_;
130 
131 private:
133 
134  DQMStore* bei_;
135 
136  Analyses data_;
137 
138  HistosMap histos_;
139 
140  FedToFecMap mapping_;
141 
143 
144  bool mask_;
145  std::vector<uint32_t> fedMaskVector_;
146  std::vector<uint32_t> fecMaskVector_;
147  std::vector<uint32_t> ringVector_;
148  std::vector<uint32_t> ccuVector_;
149  std::vector<uint32_t> i2cChanVector_;
150  std::vector<uint32_t> lldChanVector_;
151 
152  Analyses dataWithMask_;
154 };
155 
156 // ---------- inline methods ----------
157 
164 
165 #endif // DQM_SiStripCommissioningClients_CommissioningHistograms_H
dqm::harvesting::MonitorElement MonitorElement
const FedToFecMap & mapping() const
void save(std::string &filename, uint32_t run_number=0, std::string partitionName="")
const sistrip::RunType & task() const
std::vector< uint32_t > lldChanVector_
TH1 * histogram(const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const uint32_t &xbins, const float &xlow=1.*sistrip::invalid_, const float &xhigh=1.*sistrip::invalid_)
const double xbins[]
Analyses & data(bool getMaskedData=false)
void print(std::stringstream &) const
Histo(const std::string &title, MonitorElement *const me, MonitorElement *const cme)
const edm::ParameterSet & pset() const
std::vector< uint32_t > fecMaskVector_
#define nullptr
std::vector< uint32_t > ccuVector_
SummaryPlotFactory< CommissioningAnalysis * > Factory
std::vector< Histo * > Histos
virtual void configure(const edm::ParameterSet &, const edm::EventSetup &)
std::vector< uint32_t > i2cChanVector_
std::vector< uint32_t > fedMaskVector_
void extractHistograms(const std::vector< std::string > &)
static sistrip::RunType runType(DQMStore *const, const std::vector< std::string > &)
DQMStore *const bei() const
static uint32_t runNumber(DQMStore *const, const std::vector< std::string > &)
std::map< uint32_t, uint32_t > FedToFecMap
std::map< uint32_t, Histos > HistosMap
#define debug
Definition: HDRShower.cc:19
std::unique_ptr< Factory > factory_
static const uint16_t invalid_
Definition: Constants.h:16
virtual void createSummaryHisto(const sistrip::Monitorable &, const sistrip::Presentation &, const std::string &top_level_dir, const sistrip::Granularity &)
static void copyCustomInformation(DQMStore *const, const std::vector< std::string > &)
std::map< uint32_t, CommissioningAnalysis * > Analyses
Abstract base for derived classes that provide analysis of commissioning histograms.
dqm::harvesting::DQMStore DQMStore
std::vector< uint32_t > ringVector_
void createCollations(const std::vector< std::string > &)
const HistosMap & histos() const
virtual void histoAnalysis(bool debug)