Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-11 04:32:40

0001 // -*- C++ -*-
0002 //
0003 // Package:    SiStripCorrelateNoise
0004 // Class:      SiStripCorrelateNoise
0005 //
0006 /**\class SiStripCorrelateNoise SiStripCorrelateNoise.cc
0007  DQM/SiStripMonitorSummary/plugins/SiStripCorrelateNoise.cc
0008 
0009  Description: <one line class summary>
0010 
0011  Implementation:
0012      <Notes on implementation>
0013 */
0014 //
0015 // Original Author:  Domenico GIORDANO
0016 //         Created:  Mon Aug 10 10:42:04 CEST 2009
0017 //
0018 //
0019 
0020 // system include files
0021 #include <memory>
0022 
0023 // user include files
0024 #include "CalibTracker/Records/interface/SiStripDependentRecords.h"
0025 #include "CommonTools/TrackerMap/interface/TrackerMap.h"
0026 #include "CondFormats/SiStripObjects/interface/SiStripApvGain.h"
0027 #include "CondFormats/SiStripObjects/interface/SiStripNoises.h"
0028 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0029 #include "FWCore/Framework/interface/ESWatcher.h"
0030 #include "FWCore/Framework/interface/Event.h"
0031 #include "FWCore/Framework/interface/Frameworkfwd.h"
0032 #include "FWCore/Framework/interface/MakerMacros.h"
0033 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0034 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0035 
0036 // ROOT includes
0037 #include "TFile.h"
0038 #include "TH1F.h"
0039 #include "TH2F.h"
0040 
0041 //
0042 // class decleration
0043 //
0044 
0045 class TrackerTopology;
0046 class SiStripCorrelateNoise : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
0047 public:
0048   explicit SiStripCorrelateNoise(const edm::ParameterSet &);
0049   ~SiStripCorrelateNoise() override = default;
0050 
0051 private:
0052   void beginRun(const edm::Run &run, const edm::EventSetup &es) override;
0053   void analyze(const edm::Event &, const edm::EventSetup &) override {}
0054   void endRun(const edm::Run &run, const edm::EventSetup &es) override {}
0055   void endJob() override;
0056 
0057   void DoPlots();
0058   void DoAnalysis(const edm::EventSetup &, const SiStripNoises &, SiStripNoises &);
0059   void getHistos(const uint32_t &detid, const TrackerTopology *tTopo, std::vector<TH1F *> &histos);
0060   TH1F *getHisto(const long unsigned int &index);
0061 
0062   void checkGainCache(const edm::EventSetup &es);
0063 
0064   float getGainRatio(const uint32_t &detid, const uint16_t &apv);
0065 
0066   // ----------member data ---------------------------
0067 
0068   struct Data {
0069     uint32_t detid;
0070     std::vector<float> values;
0071   };
0072 
0073   edm::ESWatcher<SiStripNoisesRcd> noiseWatcher_;
0074   edm::ESWatcher<SiStripApvGainRcd> gainWatcher_;
0075   edm::ESGetToken<SiStripNoises, SiStripNoisesRcd> noiseToken_;
0076   edm::ESGetToken<SiStripApvGain, SiStripApvGainRcd> gainToken_;
0077   edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
0078 
0079   uint32_t theRun;
0080   std::unique_ptr<SiStripNoises> refNoise;
0081   std::unique_ptr<SiStripApvGain> oldGain, newGain;
0082   bool equalGain;
0083 
0084   TFile *file;
0085   std::vector<TH1F *> vTH1;
0086 
0087   TrackerMap *tkmap;
0088 };