CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/CaloOnlineTools/EcalTools/plugins/EcalMipGraphs.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:   EcalMipGraphs 
00004 // Class:     EcalMipGraphs 
00005 // 
00013 //
00014 // Original Author:  Seth COOPER
00015 //         Created:  Th Nov 22 5:46:22 CEST 2007
00016 // $Id: EcalMipGraphs.h,v 1.9 2010/01/16 14:46:16 hegner Exp $
00017 //
00018 //
00019 
00020 
00021 // system include files
00022 #include <memory>
00023 #include <vector>
00024 #include <map>
00025 #include <set>
00026 
00027 // user include files
00028 #include "FWCore/Framework/interface/Frameworkfwd.h"
00029 #include "FWCore/Framework/interface/EDAnalyzer.h"
00030 #include "FWCore/Framework/interface/Event.h"
00031 #include "FWCore/Framework/interface/EventSetup.h"
00032 #include "FWCore/Framework/interface/MakerMacros.h"
00033 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00034 #include "FWCore/Framework/interface/ESHandle.h"
00035 #include "FWCore/ServiceRegistry/interface/Service.h"
00036 #include "CommonTools/UtilAlgos/interface/TFileService.h"
00037 #include "Geometry/EcalMapping/interface/EcalMappingRcd.h"
00038 
00039 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00040 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
00041 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00042 #include "DataFormats/DetId/interface/DetId.h"
00043 #include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h"
00044 #include "DataFormats/EcalRawData/interface/EcalDCCHeaderBlock.h"
00045 
00046 #include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h"
00047 #include "Geometry/CaloTopology/interface/CaloTopology.h"
00048 #include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h"
00049 
00050 #include "CaloOnlineTools/EcalTools/interface/EcalFedMap.h"
00051 
00052 #include "TFile.h"
00053 #include "TH1F.h"
00054 #include "TGraph.h"
00055 #include "TTree.h"
00056 
00057 
00058 //
00059 // class declaration
00060 //
00061 
00062 class EcalMipGraphs : public edm::EDAnalyzer {
00063    public:
00064       explicit EcalMipGraphs(const edm::ParameterSet&);
00065       ~EcalMipGraphs();
00066 
00067 
00068    private:
00069       virtual void beginRun(edm::Run const &, edm::EventSetup const &) ;
00070       virtual void analyze(edm::Event const &, edm::EventSetup const &);
00071       virtual void endJob() ;
00072       std::string intToString(int num);
00073       std::string floatToString(float num);
00074       void writeGraphs();
00075       void initHists(int);
00076       void selectHits(edm::Handle<EcalRecHitCollection> hits,
00077           int ievt, edm::ESHandle<CaloTopology> caloTopo);
00078       TGraph* selectDigi(DetId det, int ievt);
00079       int getEEIndex(EcalElectronicsId elecId);
00080 
00081     // ----------member data ---------------------------
00082 
00083   edm::InputTag EBRecHitCollection_;
00084   edm::InputTag EERecHitCollection_;
00085   edm::InputTag EBDigis_;
00086   edm::InputTag EEDigis_;
00087   edm::InputTag headerProducer_;
00088 
00089   edm::Handle<EBDigiCollection> EBdigisHandle;
00090   edm::Handle<EEDigiCollection> EEdigisHandle;
00091 
00092   int runNum_;
00093   int side_;
00094   double threshold_;
00095   double minTimingAmp_;
00096 
00097   std::set<EBDetId> listEBChannels;
00098   std::set<EEDetId> listEEChannels;
00099     
00100   int abscissa[10];
00101   int ordinate[10];
00102 
00103   static float gainRatio[3];
00104   static edm::Service<TFileService> fileService;
00105 
00106   std::vector<std::string>* names;
00107   std::vector<int> maskedChannels_;
00108   std::vector<int> maskedFEDs_;
00109   std::vector<int> seedCrys_;
00110   std::vector<std::string> maskedEBs_;
00111   std::map<int,TH1F*> FEDsAndTimingHists_;
00112   std::map<int,float> crysAndAmplitudesMap_;
00113   std::map<int,EcalDCCHeaderBlock> FEDsAndDCCHeaders_;
00114   std::map<std::string,int> seedFrequencyMap_;
00115   
00116   TH1F* allFedsTimingHist_;
00117   
00118   TFile* file_;
00119   TTree* canvasNames_;
00120   EcalFedMap* fedMap_;
00121   const EcalElectronicsMapping* ecalElectronicsMap_;
00122  
00123   int naiveEvtNum_; 
00124 };