1 |
|
2 |
#ifndef DTDPGCreateAnalyzerSummary_H
|
3 |
#define DTDPGCreateAnalyzerSummary_H
|
4 |
|
5 |
|
6 |
/** \classDTDPGCreateAnalyzerSummary
|
7 |
* *
|
8 |
* DQM Test Client
|
9 |
*
|
10 |
* $Date: 2008/12/19 14:22:34 $
|
11 |
* $Revision: 1.3 $
|
12 |
* \author G. Mila - INFN Torino
|
13 |
*
|
14 |
*/
|
15 |
|
16 |
|
17 |
#include "FWCore/Framework/interface/Frameworkfwd.h"
|
18 |
#include <FWCore/Framework/interface/EDAnalyzer.h>
|
19 |
#include "DataFormats/Common/interface/Handle.h"
|
20 |
#include <FWCore/Framework/interface/ESHandle.h>
|
21 |
#include <FWCore/Framework/interface/Event.h>
|
22 |
#include <FWCore/Framework/interface/MakerMacros.h>
|
23 |
#include "FWCore/ParameterSet/interface/ParameterSet.h"
|
24 |
#include <FWCore/Utilities/interface/Exception.h>
|
25 |
|
26 |
#include "DQMServices/Core/interface/DQMStore.h"
|
27 |
#include "FWCore/ServiceRegistry/interface/Service.h"
|
28 |
|
29 |
|
30 |
#include "TFile.h"
|
31 |
#include <iostream>
|
32 |
#include <string>
|
33 |
|
34 |
class DTGeometry;
|
35 |
class TCanvas;
|
36 |
|
37 |
class DTDPGCreateAnalyzerSummary: public edm::EDAnalyzer{
|
38 |
|
39 |
public:
|
40 |
|
41 |
/// Constructor
|
42 |
DTDPGCreateAnalyzerSummary(const edm::ParameterSet& ps);
|
43 |
|
44 |
/// Destructor
|
45 |
virtual ~DTDPGCreateAnalyzerSummary();
|
46 |
|
47 |
protected:
|
48 |
|
49 |
/// BeginJob
|
50 |
void beginJob();
|
51 |
|
52 |
/// Analyze
|
53 |
void analyze(const edm::Event& e, const edm::EventSetup& c);
|
54 |
|
55 |
/// Endjob
|
56 |
void endJob();
|
57 |
|
58 |
/// Create Summary Plots
|
59 |
void createSummaryPlots();
|
60 |
|
61 |
/// Create SummaryWheel Plots
|
62 |
void createSummaryWheelPlots();
|
63 |
|
64 |
/// Create SummaryAll Plots
|
65 |
void createSummaryAllPlots();
|
66 |
|
67 |
/// Get the histos
|
68 |
template <class T> T* getHisto(std::string name);
|
69 |
template <class T> T* force_getHisto(std::string name);
|
70 |
|
71 |
/// Create and save the gif files
|
72 |
void createGifFile(std::string fileName, int wh, int sec, std::string tag, TCanvas *canvas, bool isExtraFile = false);
|
73 |
|
74 |
/// Create and save the gif files
|
75 |
void createGifFile(std::string fileName, int wh, std::string tag, TCanvas *canvas, bool isExtraFile = false);
|
76 |
|
77 |
/// Create and save the gif files
|
78 |
void createGifFile(std::string fileName, std::string tag, TCanvas *canvas, bool isExtraFile = false);
|
79 |
|
80 |
private:
|
81 |
|
82 |
std::string myMainFolder;
|
83 |
edm::ParameterSet myParameters;
|
84 |
TFile *myFile;
|
85 |
int myRunNumber;
|
86 |
std::map<int,std::vector<int> > mySectors;
|
87 |
|
88 |
};
|
89 |
|
90 |
#endif
|
91 |
|
92 |
template <class T>
|
93 |
T* DTDPGCreateAnalyzerSummary::getHisto(std::string name) {
|
94 |
T* t = static_cast<T*>(myFile->Get((myMainFolder+name).c_str()));
|
95 |
if(!t) {
|
96 |
// throw cms::Exception("DTDPGCreateAnalyzerSummaryError")<< "[DTDPGCreateAnalyzerSummary]: Cannot get and convert histo " << name << " check for existence and correctness of the type" << std::endl;
|
97 |
std::cout << "[DTDPGCreateAnalyzerSummary]: Cannot get and convert histo " << name << " check for existence and correctness of the type" << std::endl;
|
98 |
return NULL;
|
99 |
}
|
100 |
return t;
|
101 |
}
|
102 |
|
103 |
|
104 |
template <class T>
|
105 |
T* DTDPGCreateAnalyzerSummary::force_getHisto(std::string name) {
|
106 |
T* t = static_cast<T*>(myFile->Get((myMainFolder+name).c_str()));
|
107 |
return t;
|
108 |
}
|
109 |
|