CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalsAnalysis.h

Go to the documentation of this file.
00001 #ifndef HcalPedestalsAnalysis_H
00002 #define HcalPedestalsAnalysis_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 "CalibCalorimetry/HcalAlgos/interface/HcalDbXml.h"
00036 #include "TBDataFormats/HcalTBObjects/interface/HcalTBTriggerData.h"
00037 
00038 #include "TFile.h"
00039 #include "TProfile.h"
00040 #include "TH1.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 NewPedBunch
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    };
00067 
00068 class HcalPedestalsAnalysis : public edm::EDAnalyzer
00069 {
00070    public:
00071    //Constructor
00072    HcalPedestalsAnalysis(const edm::ParameterSet& ps);
00073    //Destructor
00074    virtual ~HcalPedestalsAnalysis();
00075    //Analysis
00076    void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
00077 
00078    private:
00079    //Container for data, 1 per channel
00080    std::vector<NewPedBunch> Bunches;
00081    //Flag for saving histos
00082    bool hiSaveFlag;
00083    bool dumpXML;
00084    bool verboseflag;
00085    int runnum;
00086    int firstTS;
00087    int lastTS;
00088    std::string ROOTfilename;
00089    std::string pedsADCfilename;
00090    std::string pedsfCfilename;
00091    std::string widthsADCfilename;
00092    std::string widthsfCfilename;
00093    std::string XMLfilename;
00094    std::string XMLtag;
00095 
00096    TH1F *HBMeans;
00097    TH1F *HBWidths;
00098    TH1F *HEMeans;
00099    TH1F *HEWidths;
00100    TH1F *HFMeans;
00101    TH1F *HFWidths;
00102    TH1F *HOMeans;
00103    TH1F *HOWidths;
00104 
00105    TFile *theFile;
00106    bool firsttime;
00107    HcalPedestals* rawPedsItem;
00108    HcalPedestalWidths* rawWidthsItem;
00109    HcalPedestals* rawPedsItemfc;
00110    HcalPedestalWidths* rawWidthsItemfc;
00111 };
00112 #endif
00113