Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:09:55

0001 #ifndef HLTriggerOffline_Egamma_EmDQMPosProcessor_H
0002 #define HLTriggerOffline_Egamma_EmDQMPosProcessor_H
0003 
0004 #include "DQMServices/Core/interface/DQMEDHarvester.h"
0005 #include "FWCore/Framework/interface/Frameworkfwd.h"
0006 
0007 class EmDQMPostProcessor : public DQMEDHarvester {
0008 public:
0009   EmDQMPostProcessor(const edm::ParameterSet &pset);
0010   ~EmDQMPostProcessor() override{};
0011 
0012   void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override;
0013 
0014   TProfile *dividehistos(DQMStore::IBooker &ibooker,
0015                          DQMStore::IGetter &igetter,
0016                          const std::string &num,
0017                          const std::string &denom,
0018                          const std::string &out,
0019                          const std::string &label,
0020                          const std::string &titel = "");
0021 
0022   TH2F *dividehistos2D(DQMStore::IBooker &ibooker,
0023                        DQMStore::IGetter &igetter,
0024                        const std::string &num,
0025                        const std::string &denom,
0026                        const std::string &out,
0027                        const std::string &label,
0028                        const std::string &titel = "");
0029 
0030 private:
0031   /** a replacement for the function TGraphAsymmErrors::Efficiency(..) used with
0032      earlier versions of ROOT (this functionality has been moved to a separate
0033      class TEfficiency) */
0034   static void Efficiency(int passing, int total, double level, double &mode, double &lowerBound, double &upperBound);
0035 
0036   /** read from the configuration: if set to true, efficiencies
0037       are calculated with respect to reconstructed objects (instead
0038       of generated objects). This is e.g. a useful option when
0039       running on data. */
0040   bool noPhiPlots;
0041   bool normalizeToReco;
0042   bool ignoreEmpty;
0043 
0044   /** convenience method to get a histogram but checks first
0045       whether the corresponding MonitorElement is non-null.
0046       @return null if the MonitorElement is null */
0047   TH1F *getHistogram(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &histoPath);
0048   TH2F *get2DHistogram(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &histoPath);
0049   std::string subDir_;
0050 
0051   /** dataset with which these histograms were produced.
0052       This is set by a user parameter in the configuration
0053       file.
0054 
0055       It is just used for writing it to the DQM output file.
0056       Useful to remember with which dataset a histogram file
0057       was produced. This code does not do much with this information
0058       (apart from copying it to the output file) but
0059       it can be used when generating reports.
0060   */
0061   std::string dataSet_;
0062 };
0063 
0064 #endif