CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalWidthsValidation.h

Go to the documentation of this file.
00001 #ifndef HcalPedestalWidthsValidation_H
00002 #define HcalPedestalWidthsValidation_H
00003 
00004 #include "FWCore/Framework/interface/ESHandle.h"
00005 #include "FWCore/Framework/interface/Frameworkfwd.h"
00006 #include "FWCore/Framework/interface/EDAnalyzer.h"
00007 #include "FWCore/Framework/interface/Event.h"
00008 #include "FWCore/Framework/interface/MakerMacros.h"
00009 #include "FWCore/Framework/interface/EventSetup.h"
00010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00011 #include "FWCore/ServiceRegistry/interface/Service.h"
00012 
00013 #include "DataFormats/Common/interface/Handle.h"
00014 #include "DataFormats/HcalDetId/interface/HcalGenericDetId.h"
00015 #include "DataFormats/HcalDetId/interface/HcalElectronicsId.h"
00016 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00017 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
00018 #include "DataFormats/DetId/interface/DetId.h"
00019 #include "CondFormats/HcalObjects/interface/HcalPedestals.h"
00020 #include "CondFormats/HcalObjects/interface/HcalPedestalWidths.h"
00021 #include "CondFormats/HcalObjects/interface/HcalQIECoder.h"
00022 #include "CondFormats/HcalObjects/interface/HcalQIEData.h"
00023 #include "CondFormats/HcalObjects/interface/HcalQIEShape.h"
00024 #include "CondFormats/HcalObjects/interface/HcalElectronicsMap.h"
00025 #include "CondFormats/HcalObjects/interface/AllObjects.h"
00026 
00027 #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h"
00028 #include "CalibFormats/HcalObjects/interface/HcalDbService.h"
00029 #include "CalibFormats/HcalObjects/interface/HcalCalibrations.h"
00030 #include "CalibFormats/HcalObjects/interface/HcalCalibrationWidths.h"
00031 
00032 #include "CondTools/Hcal/interface/HcalDbOnline.h"
00033 
00034 #include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h"
00035 #include "TBDataFormats/HcalTBObjects/interface/HcalTBTriggerData.h"
00036 
00037 #include "TFile.h"
00038 #include "TProfile.h"
00039 #include "TH1.h"
00040 #include "TH2.h"
00041 #include <math.h>
00042 #include <iostream>
00043 #include <map>
00044 #include <iomanip>
00045 #include <fstream>
00046 #include <vector>
00047 #include <string>
00048 
00049 namespace edm {
00050   class ParameterSet;
00051   class Event;
00052   class EventSetup;
00053 }
00054 
00055    struct NewPedBunchVal
00056    {
00057       HcalDetId detid;
00058       bool usedflag;
00059       float cap[4];
00060       float capfc[4];
00061       float sig[4][4];
00062       float sigfc[4][4];
00063       float prod[4][4];
00064       float prodfc[4][4];
00065       int num[4][4];
00066       TH1F * hist[4];
00067       TH2F * covarhistADC;
00068       TH2F * covarhistfC;
00069    };
00070 
00071 class HcalPedestalWidthsValidation : public edm::EDAnalyzer
00072 {
00073    public:
00074    //Constructor
00075    HcalPedestalWidthsValidation(const edm::ParameterSet& ps);
00076    //Destructor
00077    virtual ~HcalPedestalWidthsValidation();
00078    //Analysis
00079    void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
00080 
00081    private:
00082    //Container for data, 1 per channel
00083    std::vector<NewPedBunchVal> BunchVales;
00084    int runnum;
00085    int firstTS;
00086    int lastTS;
00087    std::string ROOTfilename;
00088    std::string pedsADCfilename;
00089    std::string pedsfCfilename;
00090    std::string widthsADCfilename;
00091    std::string widthsfCfilename;
00092 
00093    TH1F *HBMeans;
00094    TH1F *HBWidths;
00095    TH1F *HEMeans;
00096    TH1F *HEWidths;
00097    TH1F *HFMeans;
00098    TH1F *HFWidths;
00099    TH1F *HOMeans;
00100    TH1F *HOWidths;
00101 
00102    TFile *theFile;
00103    bool firsttime;
00104    HcalPedestals* rawPedsItem;
00105    HcalPedestalWidths* rawWidthsItem;
00106    HcalPedestals* rawPedsItemfc;
00107    HcalPedestalWidths* rawWidthsItemfc;
00108 };
00109 #endif
00110