Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:12:38

0001 #ifndef PhotonOfflineClient_H
0002 #define PhotonOfflineClient_H
0003 
0004 #include "FWCore/ServiceRegistry/interface/Service.h"
0005 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0006 //
0007 #include "FWCore/Framework/interface/MakerMacros.h"
0008 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0009 #include "FWCore/Utilities/interface/Exception.h"
0010 
0011 // EgammaCoreTools
0012 #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"
0013 
0014 #include "TFile.h"
0015 #include "TH1.h"
0016 #include "TH2.h"
0017 #include "TTree.h"
0018 #include "TVector3.h"
0019 #include "TProfile.h"
0020 //
0021 
0022 #include "DQMServices/Core/interface/DQMEDHarvester.h"
0023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0024 #include "FWCore/Framework/interface/Event.h"
0025 #include "FWCore/Framework/interface/EventSetup.h"
0026 
0027 //DQM services
0028 #include "DQMServices/Core/interface/DQMStore.h"
0029 #include "FWCore/ServiceRegistry/interface/Service.h"
0030 
0031 //
0032 
0033 #include "RooGlobalFunc.h"
0034 #include "RooRealVar.h"
0035 #include "RooDataSet.h"
0036 #include "RooBreitWigner.h"
0037 #include "RooDataHist.h"
0038 #include "RooFitResult.h"
0039 
0040 #include <vector>
0041 #include <string>
0042 
0043 /** \class PhotonOfflineClient
0044  **  
0045  **
0046  **  $Id: PhotonOfflineClient
0047  **  authors: 
0048  **   Nancy Marinelli, U. of Notre Dame, US
0049  **   Jamie Antonelli, U. of Notre Dame, US
0050  **   
0051  ***/
0052 
0053 // forward declarations
0054 class TFile;
0055 class TH1F;
0056 class TH2F;
0057 class TProfile;
0058 class TTree;
0059 
0060 class PhotonOfflineClient : public DQMEDHarvester {
0061 public:
0062   //
0063   explicit PhotonOfflineClient(const edm::ParameterSet& pset);
0064   ~PhotonOfflineClient() override;
0065 
0066   //  virtual void analyze(const edm::Event&, const edm::EventSetup&  ) ;
0067   // virtual void beginJob() ;
0068   //virtual void endJob() ;
0069   void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&) override;
0070 
0071   //  virtual void endLuminosityBlock( const edm::LuminosityBlock& , const edm::EventSetup& ) ;
0072   //virtual void endRun(const edm::Run& , const edm::EventSetup& ) ;
0073   //virtual void runClient();
0074 
0075   virtual void runClient(DQMStore::IBooker& iBooker, DQMStore::IGetter& iGetter);
0076   MonitorElement* bookHisto(
0077       DQMStore::IBooker& iBooker, std::string histoName, std::string title, int bin, double min, double max);
0078 
0079   void book2DHistoVector(DQMStore::IBooker& iBooker,
0080                          std::vector<std::vector<MonitorElement*> >& vecOfHist,
0081                          std::string histoType,
0082                          std::string histoName,
0083                          std::string title,
0084                          int xbin,
0085                          double xmin,
0086                          double xmax,
0087                          int ybin = 1,
0088                          double ymin = 1,
0089                          double ymax = 2);
0090   void book3DHistoVector(DQMStore::IBooker& iBooker,
0091                          std::vector<std::vector<std::vector<MonitorElement*> > >& vecOfHist,
0092                          std::string histoType,
0093                          std::string histoName,
0094                          std::string title,
0095                          int xbin,
0096                          double xmin,
0097                          double xmax,
0098                          int ybin = 1,
0099                          double ymin = 1,
0100                          double ymax = 2);
0101 
0102   MonitorElement* retrieveHisto(DQMStore::IGetter& iGetter, std::string dir, std::string name);
0103 
0104 private:
0105   std::string analyzerName_;
0106   MonitorElement* p_efficiencyVsEtaLoose_;
0107   MonitorElement* p_efficiencyVsEtLoose_;
0108   MonitorElement* p_efficiencyVsEtaTight_;
0109   MonitorElement* p_efficiencyVsEtTight_;
0110   MonitorElement* p_efficiencyVsEtaHLT_;
0111   MonitorElement* p_efficiencyVsEtHLT_;
0112 
0113   MonitorElement* p_convFractionVsEtaLoose_;
0114   MonitorElement* p_convFractionVsEtLoose_;
0115   MonitorElement* p_convFractionVsEtaTight_;
0116   MonitorElement* p_convFractionVsEtTight_;
0117 
0118   std::vector<std::vector<MonitorElement*> > p_convFractionVsEta_;
0119   std::vector<std::vector<std::vector<MonitorElement*> > > p_convFractionVsPhi_;
0120   std::vector<std::vector<MonitorElement*> > p_convFractionVsEt_;
0121 
0122   std::vector<std::vector<MonitorElement*> > p_badChannelsFractionVsEta_;
0123   std::vector<std::vector<MonitorElement*> > p_badChannelsFractionVsPhi_;
0124   std::vector<std::vector<MonitorElement*> > p_badChannelsFractionVsEt_;
0125 
0126   MonitorElement* p_vertexReconstructionEfficiencyVsEta_;
0127 
0128   void dividePlots(MonitorElement* dividend, MonitorElement* numerator, MonitorElement* denominator);
0129   void dividePlots(MonitorElement* dividend, MonitorElement* numerator, double denominator);
0130 
0131   int verbosity_;
0132 
0133   edm::ParameterSet parameters_;
0134 
0135   double cutStep_;
0136   int numberOfSteps_;
0137   bool minimalSetOfHistos_;
0138   bool excludeBkgHistos_;
0139 
0140   double etMin;
0141   double etMax;
0142   int etBin;
0143   double etaMin;
0144   double etaMax;
0145   int etaBin;
0146   double phiMin;
0147   double phiMax;
0148   int phiBin;
0149 
0150   bool standAlone_;
0151   bool batch_;
0152 
0153   std::string outputFileName_;
0154   std::string inputFileName_;
0155 
0156   std::stringstream currentFolder_;
0157 
0158   int histo_index_photons_;
0159   int histo_index_conversions_;
0160   int histo_index_efficiency_;
0161   int histo_index_invMass_;
0162 
0163   std::vector<std::string> types_;
0164   std::vector<std::string> parts_;
0165 };
0166 
0167 #endif