1 |
battilan |
1.1 |
|
2 |
|
|
#ifndef DTDPGCreateAnalyzerSummary_H
|
3 |
|
|
#define DTDPGCreateAnalyzerSummary_H
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
/** \classDTDPGCreateAnalyzerSummary
|
7 |
|
|
* *
|
8 |
|
|
* DQM Test Client
|
9 |
|
|
*
|
10 |
battilan |
1.4 |
* $Date: 2008/12/19 14:22:34 $
|
11 |
|
|
* $Revision: 1.3 $
|
12 |
battilan |
1.1 |
* \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 |
battilan |
1.2 |
#include <FWCore/Utilities/interface/Exception.h>
|
25 |
battilan |
1.1 |
|
26 |
|
|
#include "DQMServices/Core/interface/DQMStore.h"
|
27 |
|
|
#include "FWCore/ServiceRegistry/interface/Service.h"
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
#include "TFile.h"
|
31 |
battilan |
1.2 |
#include <iostream>
|
32 |
battilan |
1.1 |
#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 |
battilan |
1.4 |
void beginJob();
|
51 |
battilan |
1.1 |
|
52 |
|
|
/// Analyze
|
53 |
|
|
void analyze(const edm::Event& e, const edm::EventSetup& c);
|
54 |
|
|
|
55 |
|
|
/// Endjob
|
56 |
|
|
void endJob();
|
57 |
|
|
|
58 |
battilan |
1.3 |
/// Create Summary Plots
|
59 |
|
|
void createSummaryPlots();
|
60 |
battilan |
1.1 |
|
61 |
|
|
/// Create SummaryWheel Plots
|
62 |
|
|
void createSummaryWheelPlots();
|
63 |
|
|
|
64 |
|
|
/// Create SummaryAll Plots
|
65 |
|
|
void createSummaryAllPlots();
|
66 |
|
|
|
67 |
|
|
/// Get the histos
|
68 |
battilan |
1.2 |
template <class T> T* getHisto(std::string name);
|
69 |
battilan |
1.4 |
template <class T> T* force_getHisto(std::string name);
|
70 |
battilan |
1.1 |
|
71 |
|
|
/// Create and save the gif files
|
72 |
battilan |
1.4 |
void createGifFile(std::string fileName, int wh, int sec, std::string tag, TCanvas *canvas, bool isExtraFile = false);
|
73 |
battilan |
1.1 |
|
74 |
|
|
/// Create and save the gif files
|
75 |
battilan |
1.4 |
void createGifFile(std::string fileName, int wh, std::string tag, TCanvas *canvas, bool isExtraFile = false);
|
76 |
battilan |
1.1 |
|
77 |
|
|
/// Create and save the gif files
|
78 |
battilan |
1.4 |
void createGifFile(std::string fileName, std::string tag, TCanvas *canvas, bool isExtraFile = false);
|
79 |
battilan |
1.1 |
|
80 |
|
|
private:
|
81 |
|
|
|
82 |
|
|
std::string myMainFolder;
|
83 |
|
|
edm::ParameterSet myParameters;
|
84 |
|
|
TFile *myFile;
|
85 |
|
|
int myRunNumber;
|
86 |
battilan |
1.3 |
std::map<int,std::vector<int> > mySectors;
|
87 |
battilan |
1.1 |
|
88 |
|
|
};
|
89 |
|
|
|
90 |
|
|
#endif
|
91 |
|
|
|
92 |
|
|
template <class T>
|
93 |
battilan |
1.2 |
T* DTDPGCreateAnalyzerSummary::getHisto(std::string name) {
|
94 |
|
|
T* t = static_cast<T*>(myFile->Get((myMainFolder+name).c_str()));
|
95 |
|
|
if(!t) {
|
96 |
battilan |
1.4 |
// 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 |
battilan |
1.2 |
}
|
100 |
|
|
return t;
|
101 |
battilan |
1.1 |
}
|
102 |
battilan |
1.4 |
|
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 |
|
|
|