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 
84  static void getContents( DQMStore* const,
85  std::vector<std::string>& );
86 
87  void extractHistograms( const std::vector<std::string>& );
88 
89  // DEPRECATE
90  void createCollations( const std::vector<std::string>& );
91 
92  virtual void histoAnalysis( bool debug );
93 
94  virtual void printAnalyses();
95 
96  virtual void printSummary();
97 
98  virtual void createSummaryHisto( const sistrip::Monitorable&,
99  const sistrip::Presentation&,
100  const std::string& top_level_dir,
101  const sistrip::Granularity& );
102 
103  void remove( std::string pattern = "" );
104 
105 
106  void save( std::string& filename,
107  uint32_t run_number = 0,
108  std::string partitionName = "");
109 
110  // ---------- protected methods ----------
111 
112  protected:
113 
114  inline const sistrip::RunType& task() const;
115 
116  inline DQMStore* const bei() const;
117 
118  Analyses& data(bool getMaskedData = false);
119 
120  inline Factory* const factory();
121 
122  inline const HistosMap& histos() const;
123 
124  inline const FedToFecMap& mapping() const;
125 
126  inline const edm::ParameterSet& pset() const;
127 
128  TH1* histogram( const sistrip::Monitorable&,
129  const sistrip::Presentation&,
130  const sistrip::View&,
131  const std::string& directory,
132  const uint32_t& xbins,
133  const float& xlow = 1. * sistrip::invalid_,
134  const float& xhigh = 1. * sistrip::invalid_ );
135 
136  void printHistosMap();
137 
138  void clearHistosMap();
139 
140  // ---------- private member data ----------
141 
142  protected:
143 
144  std::unique_ptr<Factory> factory_;
145 
146  private:
147 
149 
151 
152  Analyses data_;
153 
154  HistosMap histos_;
155 
156  FedToFecMap mapping_;
157 
159 
160  bool mask_;
161  std::vector<uint32_t> fedMaskVector_;
162  std::vector<uint32_t> fecMaskVector_;
163  std::vector<uint32_t> ringVector_;
164  std::vector<uint32_t> ccuVector_;
165  std::vector<uint32_t> i2cChanVector_;
166  std::vector<uint32_t> lldChanVector_;
167 
168  Analyses dataWithMask_;
170 
171 };
172 
173 // ---------- inline methods ----------
174 
176 DQMStore* const CommissioningHistograms::bei() const { return bei_; }
181 
182 #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_
static void getContents(DQMStore *const, std::vector< std::string > &)
std::vector< uint32_t > ccuVector_
SummaryPlotFactory< CommissioningAnalysis * > Factory
std::vector< Histo * > Histos
#define nullptr
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)