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.2 |
* $Date: 2008/11/02 20:43:11 $
|
11 |
battilan |
1.1 |
* $Revision: 1.1 $
|
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 |
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 |
|
|
void beginJob(const edm::EventSetup& c);
|
51 |
|
|
|
52 |
|
|
/// Analyze
|
53 |
|
|
void analyze(const edm::Event& e, const edm::EventSetup& c);
|
54 |
|
|
|
55 |
|
|
/// Endjob
|
56 |
|
|
void endJob();
|
57 |
|
|
|
58 |
|
|
/// Create FullWheel Plots
|
59 |
|
|
void createFullWheelPlots();
|
60 |
|
|
|
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.1 |
|
70 |
|
|
/// Create and save the gif files
|
71 |
|
|
void createGifFile(std::string fileName, int wh, int sec, std::string tag, TCanvas *canvas);
|
72 |
|
|
|
73 |
|
|
/// Create and save the gif files
|
74 |
|
|
void createGifFile(std::string fileName, int wh, std::string tag, TCanvas *canvas);
|
75 |
|
|
|
76 |
|
|
/// Create and save the gif files
|
77 |
|
|
void createGifFile(std::string fileName, std::string tag, TCanvas *canvas);
|
78 |
|
|
|
79 |
|
|
private:
|
80 |
|
|
|
81 |
|
|
std::string myMainFolder;
|
82 |
|
|
edm::ParameterSet myParameters;
|
83 |
|
|
TFile *myFile;
|
84 |
|
|
int myRunNumber;
|
85 |
|
|
|
86 |
|
|
};
|
87 |
|
|
|
88 |
|
|
#endif
|
89 |
|
|
|
90 |
|
|
template <class T>
|
91 |
battilan |
1.2 |
T* DTDPGCreateAnalyzerSummary::getHisto(std::string name) {
|
92 |
|
|
T* t = static_cast<T*>(myFile->Get((myMainFolder+name).c_str()));
|
93 |
|
|
if(!t) {
|
94 |
|
|
throw cms::Exception("DTDPGCreateAnalyzerSummaryError")<< "[DTDPGCreateAnalyzerSummary]: Cannot get and convert histo " << name << " check for existence and correctness of the type" << std::endl;
|
95 |
|
|
}
|
96 |
|
|
return t;
|
97 |
battilan |
1.1 |
}
|