CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/MuonAnalysis/MomentumScaleCalibration/plugins/ErrorsPropagationAnalyzer.h

Go to the documentation of this file.
00001 #ifndef ERRORSANALYZER_HH
00002 #define ERRORSANALYZER_HH
00003 
00004 // -*- C++ -*-
00005 //
00006 // Package:    ErrorsPropagationAnalyzer
00007 // Class:      ErrorsPropagationAnalyzer
00008 // 
00016 //
00017 // Original Author:  Marco De Mattia
00018 //         Created:  Thu Sep 11 12:16:00 CEST 2008
00019 // $Id: ErrorsPropagationAnalyzer.h,v 1.4 2012/12/20 16:09:21 emiglior Exp $
00020 //
00021 //
00022 
00023 // system include files
00024 #include <memory>
00025 #include <string>
00026 #include <vector>
00027 
00028 #include "FWCore/Framework/interface/Frameworkfwd.h"
00029 #include "FWCore/Framework/interface/EDAnalyzer.h"
00030 #include "FWCore/Framework/interface/Event.h"
00031 #include "FWCore/Framework/interface/MakerMacros.h"
00032 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00033 
00034 #include <TH1D.h>
00035 #include <TProfile.h>
00036 #include <TString.h>
00037 #include <TCanvas.h>
00038 #include <TGraphAsymmErrors.h>
00039 #include <TROOT.h>
00040 
00041 #include "MuonAnalysis/MomentumScaleCalibration/interface/Functions.h"
00042 #include "MuonAnalysis/MomentumScaleCalibration/interface/RootTreeHandler.h"
00043 #include "MuScleFitUtils.h"
00044 #include "MuonAnalysis/MomentumScaleCalibration/interface/SigmaPtDiff.h"
00045 
00046 //
00047 // class declaration
00048 //
00049 
00050 class ErrorsPropagationAnalyzer : public edm::EDAnalyzer
00051 {
00052 public:
00053   explicit ErrorsPropagationAnalyzer(const edm::ParameterSet&);
00054   ~ErrorsPropagationAnalyzer();
00055 
00056 private:
00057   virtual void analyze(const edm::Event&, const edm::EventSetup&);
00058   void fillHistograms();
00059   void drawHistograms(const TProfile* histo, const TProfile* histoPlusErr,
00060                       const TProfile* histoMinusErr, const TString& type, const TString& yLabel);
00061   void fillValueError();
00062   virtual void endJob() {};
00064   double massResolution( const lorentzVector& mu1,
00065                          const lorentzVector& mu2,
00066                          const std::vector<double> & parval,
00067                          const double & sigmaPt1,
00068                          const double & sigmaPt2 );
00069   double massResolution( const lorentzVector& mu1,
00070                          const lorentzVector& mu2,
00071                          double* parval,
00072                          const double & sigmaPt1,
00073                          const double & sigmaPt2);
00074 
00075   TString treeFileName_;
00076   int resolFitType_;
00077   uint32_t maxEvents_;
00078   TString outputFileName_;
00079   int ptBins_;
00080   double ptMin_;
00081   double ptMax_;
00082   int etaBins_;
00083   double etaMin_;
00084   double etaMax_;
00085   bool debug_;
00086 
00087   double ptMinCut_, ptMaxCut_, etaMinCut_, etaMaxCut_;
00088 
00089   std::vector<double> parameters_;
00090   std::vector<double> errors_;
00091   std::vector<int> errorFactors_;
00092 
00093   std::vector<double> valuePlusError_;
00094   std::vector<double> valueMinusError_;
00095 
00096   TProfile * sigmaPtVsEta_;
00097   TProfile * sigmaPtVsEtaPlusErr_;
00098   TProfile * sigmaPtVsEtaMinusErr_;
00099 
00100   TProfile * sigmaPtVsPt_;
00101   TProfile * sigmaPtVsPtPlusErr_;
00102   TProfile * sigmaPtVsPtMinusErr_;
00103 
00104   TProfile * sigmaPtVsEtaDiff_;
00105   TProfile * sigmaPtVsPtDiff_;
00106 
00107   // Mass resolution
00108   TProfile * sigmaMassVsEta_;
00109   TProfile * sigmaMassVsEtaPlusErr_;
00110   TProfile * sigmaMassVsEtaMinusErr_;
00111 
00112   TProfile * sigmaMassVsPt_;
00113   TProfile * sigmaMassVsPtPlusErr_;
00114   TProfile * sigmaMassVsPtMinusErr_;
00115 
00116   TProfile * sigmaMassOverMassVsEta_;
00117   TProfile * sigmaMassOverMassVsEtaPlusErr_;
00118   TProfile * sigmaMassOverMassVsEtaMinusErr_;
00119 
00120   TProfile * sigmaMassOverMassVsPt_;
00121   TProfile * sigmaMassOverMassVsPtPlusErr_;
00122   TProfile * sigmaMassOverMassVsPtMinusErr_;
00123 };
00124 
00125 #endif // RESOLUTIONANALYZER_HH