CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/Validation/HcalDigis/interface/HcalDigisValidation.h

Go to the documentation of this file.
00001 #ifndef HCALDIGISVALIDATION_H
00002 #define HCALDIGISVALIDATION_H
00003 
00004 #include <memory>
00005 
00006 #include "FWCore/Framework/interface/Frameworkfwd.h"
00007 #include "FWCore/Framework/interface/EDAnalyzer.h"
00008 #include "FWCore/Framework/interface/ESHandle.h"
00009 
00010 #include "FWCore/Framework/interface/Event.h"
00011 
00012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00013 #include "DQMServices/Core/interface/DQMStore.h"
00014 #include "DQMServices/Core/interface/MonitorElement.h"
00015 
00016 #include "FWCore/ServiceRegistry/interface/Service.h"
00017 
00018 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00019 
00020 #include "Geometry/Records/interface/CaloGeometryRecord.h"
00021 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00022 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
00023 #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
00024 
00025 #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h"
00026 #include "CalibFormats/HcalObjects/interface/HcalCoderDb.h"
00027 #include "CalibFormats/HcalObjects/interface/HcalCalibrations.h"
00028 #include "CondFormats/HcalObjects/interface/HcalQIEShape.h"
00029 
00030 #include "DataFormats/HcalDigi/interface/HBHEDataFrame.h"
00031 
00032 
00033 #include "CalibFormats/HcalObjects/interface/HcalDbService.h"
00034 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
00035 
00036 
00037 
00038 #include <map>
00039 #include <vector>
00040 #include <utility>
00041 #include <ostream>
00042 #include <string>
00043 #include <algorithm>
00044 #include <cmath>
00045 #include <iostream>
00046 
00047 class HcalDigisValidation : public edm::EDAnalyzer {
00048 public:
00049     explicit HcalDigisValidation(const edm::ParameterSet&);
00050 
00051     ~HcalDigisValidation() {
00052     };
00053 
00054 private:
00055 
00056     struct HistLim {
00057 
00058         HistLim(int nbin, double mini, double maxi)
00059         : n(nbin), min(mini), max(maxi) {
00060         }
00061         int n;
00062         double min;
00063         double max;
00064     };
00065 
00066     virtual void analyze(const edm::Event&, const edm::EventSetup&);
00067 
00068     virtual void beginJob();
00069 
00070     virtual void endJob();
00071 
00072     void beginRun();
00073 
00074     void endRun();
00075 
00076     DQMStore* dbe_;
00077     std::map<std::string, MonitorElement*> *msm_;
00078 
00079     void book1D(std::string name, int n, double min, double max);
00080 
00081     void book1D(std::string name, HistLim limX);
00082 
00083     void fill1D(std::string name, double X, double weight = 1);
00084 
00085     void book2D(std::string name, HistLim limX, HistLim limY);
00086 
00087     void fill2D(std::string name, double X, double Y, double weight = 1);
00088 
00089     void bookPf(std::string name, HistLim limX, HistLim limY);
00090 
00091     void fillPf(std::string name, double X, double Y);
00092 
00093     MonitorElement* monitor(std::string name);
00094 
00095     void booking(std::string subdetopt, int bnoise, int bmc);
00096 
00097     std::string str(int x);
00098 
00099     template<class Digi> void reco(const edm::Event& iEvent, const edm::EventSetup& iSetup);
00100     void eval_occupancy();
00101 
00102     std::string outputFile_;
00103     std::string subdet_;
00104     std::string zside_;
00105     std::string dirName_;
00106     edm::InputTag inputTag_;
00107     std::string mode_;
00108     std::string mc_;
00109     int noise_;
00110 
00111     edm::ESHandle<CaloGeometry> geometry;
00112     edm::ESHandle<HcalDbService> conditions;
00113     int nevent1;
00114     int nevent2;
00115     int nevent3;
00116     int nevent4;
00117     int nevtot;
00118 
00119 };
00120 
00121 #endif
00122 
00123