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