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  void save( std::string& filename,
106  uint32_t run_number = 0 );
107 
108  // ---------- protected methods ----------
109 
110  protected:
111 
112  inline const sistrip::RunType& task() const;
113 
114  inline DQMStore* const bei() const;
115 
116  inline Analyses& data();
117 
118  inline Factory* const factory();
119 
120  inline const HistosMap& histos() const;
121 
122  inline const FedToFecMap& mapping() const;
123 
124  inline const edm::ParameterSet& pset() const;
125 
126  TH1* histogram( const sistrip::Monitorable&,
127  const sistrip::Presentation&,
128  const sistrip::View&,
129  const std::string& directory,
130  const uint32_t& xbins,
131  const float& xlow = 1. * sistrip::invalid_,
132  const float& xhigh = 1. * sistrip::invalid_ );
133 
134  void printHistosMap();
135 
136  void clearHistosMap();
137 
138  // ---------- private member data ----------
139 
140  protected:
141 
142  std::auto_ptr<Factory> factory_;
143 
144  private:
145 
147 
149 
150  Analyses data_;
151 
152  HistosMap histos_;
153 
154  FedToFecMap mapping_;
155 
157 
158 };
159 
160 // ---------- inline methods ----------
161 
163 DQMStore* const CommissioningHistograms::bei() const { return bei_; }
169 
170 #endif // DQM_SiStripCommissioningClients_CommissioningHistograms_H
const FedToFecMap & mapping() const
const sistrip::RunType & task() const
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[]
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
static void getContents(DQMStore *const, std::vector< std::string > &)
SummaryPlotFactory< CommissioningAnalysis * > Factory
void save(std::string &filename, uint32_t run_number=0)
std::vector< Histo * > Histos
#define nullptr
virtual void configure(const edm::ParameterSet &, const edm::EventSetup &)
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
static const uint16_t invalid_
Definition: Constants.h:16
std::map< uint32_t, CommissioningAnalysis * > Analyses
std::map< uint32_t, Histos > HistosMap
std::auto_ptr< Factory > factory_
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.
void createCollations(const std::vector< std::string > &)
const HistosMap & histos() const
virtual void histoAnalysis(bool debug)