ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/DTDPGAnalysis/src/DTDPGCreateAnalyzerSummary.h
(Generate patch)

Comparing UserCode/DTDPGAnalysis/src/DTDPGCreateAnalyzerSummary.h (file contents):
Revision 1.1 by battilan, Sun Nov 2 20:43:11 2008 UTC vs.
Revision 1.2 by battilan, Mon Nov 3 11:06:39 2008 UTC

# Line 21 | Line 21
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;
# Line 63 | Line 65 | class DTDPGCreateAnalyzerSummary: public
65    void createSummaryAllPlots();
66  
67    /// Get the histos
68 <  template <class T> T getHisto(std::string name);
68 >  template <class T> T* getHisto(std::string name);
69  
70    /// Create and save the gif files
71    void createGifFile(std::string fileName, int wh, int sec, std::string tag, TCanvas *canvas);
# Line 86 | Line 88 | class DTDPGCreateAnalyzerSummary: public
88   #endif
89  
90   template <class T>
91 < T DTDPGCreateAnalyzerSummary::getHisto(std::string name) {
92 <  return static_cast<T>(myFile->Get((myMainFolder+name).c_str()));
91 > 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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines