Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:37:58

0001 #ifndef HcalGainsCheck_h
0002 #define HcalGainsCheck_h
0003 
0004 //
0005 // R.Ofierzynski 9.12.2007
0006 //
0007 // Code to check pedestals for completeness and to compare to previous pedestals
0008 
0009 #include <string>
0010 #include <iostream>
0011 #include <fstream>
0012 #include <sstream>
0013 #include <map>
0014 #include <vector>
0015 #include <algorithm>
0016 
0017 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0018 #include "FWCore/Framework/interface/Event.h"
0019 #include "FWCore/Framework/interface/MakerMacros.h"
0020 
0021 #include "FWCore/Framework/interface/EventSetup.h"
0022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0023 
0024 #include "CondFormats/HcalObjects/interface/HcalPedestals.h"
0025 #include "CondFormats/HcalObjects/interface/HcalPedestalWidths.h"
0026 #include "CondFormats/HcalObjects/interface/HcalGains.h"
0027 #include "CondFormats/HcalObjects/interface/HcalGainWidths.h"
0028 #include "CondFormats/HcalObjects/interface/HcalElectronicsMap.h"
0029 
0030 #include "DataFormats/HcalDetId/interface/HcalGenericDetId.h"
0031 #include "DataFormats/DetId/interface/DetId.h"
0032 
0033 #include "CondFormats/DataRecord/interface/HcalPedestalsRcd.h"
0034 #include "CondFormats/DataRecord/interface/HcalPedestalWidthsRcd.h"
0035 #include "CondFormats/DataRecord/interface/HcalGainsRcd.h"
0036 #include "CondFormats/DataRecord/interface/HcalGainWidthsRcd.h"
0037 #include "CondFormats/DataRecord/interface/HcalElectronicsMapRcd.h"
0038 
0039 #include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h"
0040 #include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h"
0041 
0042 #include "TFile.h"
0043 #include "TH1.h"
0044 #include "TH2.h"
0045 
0046 class HcalGainsCheck : public edm::one::EDAnalyzer<> {
0047 public:
0048   HcalGainsCheck(edm::ParameterSet const& ps);
0049 
0050   ~HcalGainsCheck() override {}
0051 
0052   void beginJob() override;
0053   void endJob() override;
0054 
0055   void analyze(const edm::Event& ev, const edm::EventSetup& es) override;
0056 
0057 private:
0058   //  std::string front;
0059   //  vecDetId getMissingDetIds(std::vector<HcalPedestals> &);
0060   std::string dumpupdate;
0061   std::string dumprefs;
0062   std::string rootfile;
0063   std::string outfile;
0064   bool emapflag;
0065   bool validategainsflag;
0066   double epsilon;
0067   edm::ESGetToken<HcalGains, HcalGainsRcd> m_tok1;
0068   edm::ESGetToken<HcalGains, HcalGainsRcd> m_tok2;
0069   edm::ESGetToken<HcalElectronicsMap, HcalElectronicsMapRcd> m_tokmap;
0070 
0071   TFile* f;
0072   //plots:
0073   TH2F* ocMapUp;
0074   TH2F* ocMapRef;
0075   //  TH2F* valMapUp;
0076   //  TH2F* valMapRef;
0077 
0078   TH1F* diffUpRefCap0;
0079   TH1F* diffUpRefCap1;
0080   TH1F* diffUpRefCap2;
0081   TH1F* diffUpRefCap3;
0082   TH1F* ratioUpRefCap0;
0083   TH1F* ratioUpRefCap1;
0084   TH1F* ratioUpRefCap2;
0085   TH1F* ratioUpRefCap3;
0086   TH1F* gainsUpCap0;
0087   TH1F* gainsUpCap1;
0088   TH1F* gainsUpCap2;
0089   TH1F* gainsUpCap3;
0090   TH1F* gainsRefCap0;
0091   TH1F* gainsRefCap1;
0092   TH1F* gainsRefCap2;
0093   TH1F* gainsRefCap3;
0094   TH1F* gainsUpCap0vsEta;
0095   TH1F* gainsUpCap1vsEta;
0096   TH1F* gainsUpCap2vsEta;
0097   TH1F* gainsUpCap3vsEta;
0098   TH1F* gainsRefCap0vsEta;
0099   TH1F* gainsRefCap1vsEta;
0100   TH1F* gainsRefCap2vsEta;
0101   TH1F* gainsRefCap3vsEta;
0102 };
0103 #endif