CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CalibCalorimetry/CastorCalib/interface/CastorPedestalsAnalysis.h

Go to the documentation of this file.
00001 #ifndef CastorPedestalsAnalysis_H
00002 #define CastorPedestalsAnalysis_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/CastorObjects/interface/CastorPedestals.h"
00020 #include "CondFormats/CastorObjects/interface/CastorPedestalWidths.h"
00021 #include "CondFormats/CastorObjects/interface/CastorQIECoder.h"
00022 #include "CondFormats/CastorObjects/interface/CastorQIEData.h"
00023 #include "CondFormats/CastorObjects/interface/CastorQIEShape.h"
00024 #include "CondFormats/CastorObjects/interface/CastorElectronicsMap.h"
00025 #include "CondFormats/CastorObjects/interface/AllObjects.h"
00026 
00027 #include "CalibFormats/CastorObjects/interface/CastorDbRecord.h"
00028 #include "CalibFormats/CastorObjects/interface/CastorDbService.h"
00029 #include "CalibFormats/CastorObjects/interface/CastorCalibrations.h"
00030 #include "CalibFormats/CastorObjects/interface/CastorCalibrationWidths.h"
00031 
00032 //  #include "CondTools/Hcal/interface/HcalDbOnline.h"
00033 
00034 #include "CalibCalorimetry/CastorCalib/interface/CastorDbASCIIIO.h"
00035 // #include "CalibCalorimetry/CastorCalib/interface/CastorCondXML.h"
00036 #include "TBDataFormats/HcalTBObjects/interface/HcalTBTriggerData.h"
00037 
00038 #include "TFile.h"
00039 #include "TProfile.h"
00040 #include "TH1.h"
00041 #include "TH2.h"
00042 #include "TCanvas.h"
00043 #include "TStyle.h"
00044 
00045 #include <math.h>
00046 #include <iostream>
00047 #include <map>
00048 #include <iomanip>
00049 #include <fstream>
00050 #include <vector>
00051 #include <string>
00052 
00053 namespace edm {
00054   class ParameterSet;
00055   class Event;
00056   class EventSetup;
00057 }
00058 
00059    struct NewPedBunch
00060    {
00061       HcalCastorDetId detid;
00062       bool usedflag;
00063       float cap[4];
00064       float capfc[4];
00065       float sig[4][4];
00066       float sigfc[4][4];
00067       float prod[4][4];
00068       float prodfc[4][4];
00069       int num[4][4];
00070    };
00071 
00072 class CastorPedestalsAnalysis : public edm::EDAnalyzer
00073 {
00074    public:
00075    //Constructor
00076    CastorPedestalsAnalysis(const edm::ParameterSet& ps);
00077    //Destructor
00078    virtual ~CastorPedestalsAnalysis();
00079    //Analysis
00080    void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
00081 
00082    private:
00083    //Container for data, 1 per channel
00084    std::vector<NewPedBunch> Bunches;
00085    //Flag for saving histos
00086    bool hiSaveFlag;
00087    bool dumpXML;
00088    bool verboseflag;
00089    int runnum;
00090    int firstTS;
00091    int lastTS;
00092    std::string ROOTfilename;
00093    std::string pedsADCfilename;
00094    std::string pedsfCfilename;
00095    std::string widthsADCfilename;
00096    std::string widthsfCfilename;
00097    std::string XMLfilename;
00098    std::string XMLtag;
00099    std::string ZSfilename;
00100 
00101    TH1F *CASTORMeans;
00102    TH1F *CASTORWidths;
00103 
00104    // TH2F *dephist[4];
00105    TH2F *dephist;
00106 
00107    TFile *theFile;
00108    bool firsttime;
00109 };
00110 #endif
00111