![]() |
![]() |
00001 // -*- C++ -*- 00002 // 00003 // Package: SiStripCorrelateNoise 00004 // Class: SiStripCorrelateNoise 00005 // 00013 // 00014 // Original Author: Domenico GIORDANO 00015 // Created: Mon Aug 10 10:42:04 CEST 2009 00016 // $Id: SiStripCorrelateNoise.h,v 1.2 2009/09/23 14:20:53 kaussen Exp $ 00017 // 00018 // 00019 00020 00021 // system include files 00022 #include <memory> 00023 00024 // user include files 00025 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00026 #include "FWCore/Framework/interface/Frameworkfwd.h" 00027 #include "FWCore/Framework/interface/EDAnalyzer.h" 00028 #include "FWCore/Framework/interface/ESHandle.h" 00029 #include "CondFormats/SiStripObjects/interface/SiStripApvGain.h" 00030 #include "CondFormats/SiStripObjects/interface/SiStripNoises.h" 00031 00032 #include "FWCore/Framework/interface/Event.h" 00033 #include "FWCore/Framework/interface/MakerMacros.h" 00034 00035 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00036 00037 #include "CalibTracker/Records/interface/SiStripDependentRecords.h" 00038 #include "CalibTracker/SiStripCommon/interface/SiStripDetInfoFileReader.h" 00039 #include "CommonTools/TrackerMap/interface/TrackerMap.h" 00040 00041 #include "TH2F.h" 00042 #include "TH1F.h" 00043 #include "TFile.h" 00044 00045 00046 // 00047 // class decleration 00048 // 00049 00050 class SiStripCorrelateNoise : public edm::EDAnalyzer { 00051 public: 00052 explicit SiStripCorrelateNoise(const edm::ParameterSet&); 00053 ~SiStripCorrelateNoise(); 00054 00055 00056 private: 00057 virtual void beginRun(const edm::Run& run, const edm::EventSetup& es); 00058 virtual void analyze(const edm::Event&, const edm::EventSetup&){}; 00059 virtual void endJob(); 00060 00061 void DoPlots(); 00062 void DoAnalysis(SiStripNoises,SiStripNoises&); 00063 void getHistos(const uint32_t & detid,std::vector<TH1F*>& histos); 00064 TH1F* getHisto(const long unsigned int& index); 00065 00066 unsigned long long getNoiseCache(const edm::EventSetup & eSetup){ return eSetup.get<SiStripNoisesRcd>().cacheIdentifier();} 00067 unsigned long long getGainCache(const edm::EventSetup & eSetup){ return eSetup.get<SiStripApvGainRcd>().cacheIdentifier();} 00068 void checkGainCache(const edm::EventSetup& es); 00069 float getMeanNoise(const SiStripNoises::Range& noiseRange,const uint32_t& first, const uint32_t& range); 00070 00071 float getGainRatio(const uint32_t& detid, const uint16_t& apv); 00072 00073 // ----------member data --------------------------- 00074 00075 struct Data{ 00076 uint32_t detid; 00077 std::vector<float> values; 00078 }; 00079 00080 SiStripDetInfoFileReader * fr; 00081 edm::ESHandle<SiStripApvGain> gainHandle_; 00082 edm::ESHandle<SiStripNoises> noiseHandle_; 00083 00084 uint32_t theRun; 00085 SiStripNoises* refNoise; 00086 00087 SiStripApvGain *oldGain, *newGain; 00088 bool equalGain; 00089 00090 00091 TFile* file; 00092 std::vector<TH1F*> vTH1; 00093 00094 TrackerMap *tkmap; 00095 00096 00097 unsigned long long cacheID_noise; 00098 unsigned long long cacheID_gain; 00099 }; 00100 00101